Anda di halaman 1dari 20

01/10/2019

Pengantar IOT

Abdul Muis

2019

Revolusi Industry 4.0

Revolusi Industry 4.0

01/10/2019

01/10/2019 2
01/10/2019 2

01/10/2019

01/10/2019 3
01/10/2019 3

01/10/2019

01/10/2019 4
01/10/2019 4

01/10/2019

01/10/2019 5
01/10/2019 5

01/10/2019

01/10/2019 6
01/10/2019 6

01/10/2019

01/10/2019 7
01/10/2019 7

01/10/2019

Our IOT Project ESP32
Our IOT Project ESP32

Our IOT Project

ESP32

ESP 32

Voltage 3.3Volt

ESP 32 • Voltage 3.3Volt
ESP 32 • Voltage 3.3Volt

01/10/2019

Asisten response project

Bidang

Nama Asisten

Kontak

Available

time

Elektronika

Ahli Irfan

081398255958

 

Telkomunikasi

Fathul MuinJurusan

082194404280

 

Tenaga Listrik

Iqbaal Fadlli Besstian (tema PLTS)

085720007969

 
 

Debby Ramadhani (tema selain PLTS)

085882037306

 

Kendali

Fikih Muhammad

085692811659

 

Tema : Tenaga Listrik & Elektronika

Tenaga Listrik

Bermain dg Pengukuran Arus dan Tegangan

Bermain dg Pengukuran Frekuensi Listrik AC

Bermain dg Pengukuran Energi (bisa dari PLTS di MRPQ)

Bermain dg Sistem monitoring PLTS

Elektronika

Bermain IoT untuk Pengukuran SoC baterai LTO

Bermain IoT untuk sistem lampu otomatis

IoT untuk bermain Kombinasi warna LED

Bermain IoT untuk UV sensor dan OLED display

01/10/2019

Tema : Telekomunikasi & Kendali

Telekomunikasi

Bermain dg Pengiriman kuantitas Data

Bermain melihat Pengaruh Pengiriman data terhadap jenis antenna dan kecepatan

Bermain melihat Pengaruh pengiriman data terhadap jarak dan kondisi lingkungan

Bermain dengan Error Detection

Kendali

Bermain dengan PWM utk servo motor

Bermain dengan PWM utk motor DC + L298

Bermain dengan PWM utk motor stepper + A4988+variety stepsize

Bermain dengan PWM utk motor stopper + A4988+variety current

Caution ! voltage of digital logic

Digital input output deal with voltage range

Non usable area logic depends on last state

ESP32 pins are not 5V tolerant

Akan terbakar/rusak jika pin diberi tegangan lebih dari 3.3V

Gunakan converter logic 5V -> 3.3V

lebih dari 3.3V • Gunakan converter logic 5V -> 3.3V External ESP32 ESP32 External Tidak perlu
lebih dari 3.3V • Gunakan converter logic 5V -> 3.3V External ESP32 ESP32 External Tidak perlu
External ESP32
External
ESP32
ESP32
ESP32

External

Tidak perlu Jika bisa terbaca

01/10/2019

Caution ! Interfacing with LED

LED max 20mA for bright light

LED consume 1.2Volt

Resistance (provided) 180 Ohm :

(3.3V – 1.2V) / 180 = 11.6mA

Resistance max = (3.3V-1.2V)/20mA

= 105 ohm

Two way connection

Direct logic (1 : ON, 0 : OFF)

Current drain from microcontroller

Microcontroller has maximum 200mA load

Inverted logic (0 : ON, 1 : OFF)

Current drain from voltage source

• Microcontroller has maximum 200mA load • Inverted logic (0 : ON, 1 : OFF) •

Komponen for Gatrik Project

Komponen for Gatrik Project Voltage Sensor DC 25V PLTS Current Sensor DC 20A AC Voltage &
Voltage Sensor DC 25V PLTS
Voltage Sensor DC 25V
PLTS

Current Sensor

DC 20A

Project Voltage Sensor DC 25V PLTS Current Sensor DC 20A AC Voltage & Current Sensor Arus

AC Voltage & Current Sensor

Arus & Tegangan

Sensor DC 25V PLTS Current Sensor DC 20A AC Voltage & Current Sensor Arus & Tegangan

Voltage Sensor

Frekuensi

01/10/2019

Komponen for Kendali Project

Komponen for Kendali Project Motor DC 5V 12V Motor Servo Motor Stepper

Motor DC

5V 12V
5V
12V
Motor Servo
Motor
Servo

Motor Stepper

12V 5V
12V
5V

Komponen for Electronic Project

12V 5V Komponen for Electronic Project UV & OLED Kombinasi RGB LED Lampu otomatis SOC Battery
12V 5V Komponen for Electronic Project UV & OLED Kombinasi RGB LED Lampu otomatis SOC Battery

UV & OLED

12V 5V Komponen for Electronic Project UV & OLED Kombinasi RGB LED Lampu otomatis SOC Battery
12V 5V Komponen for Electronic Project UV & OLED Kombinasi RGB LED Lampu otomatis SOC Battery

Kombinasi RGB LED

12V 5V Komponen for Electronic Project UV & OLED Kombinasi RGB LED Lampu otomatis SOC Battery

Lampu otomatis

12V 5V Komponen for Electronic Project UV & OLED Kombinasi RGB LED Lampu otomatis SOC Battery
SOC Battery
SOC Battery

Voltage Sensor DC 25V

01/10/2019

Komponen for Telkom Project

Komponen for Telkom Project
Komponen for Telkom Project
Komponen for Telkom Project

Instalasi ESP32 & Arduino

1. Install Arduino

2. Install ESP32 Addon

01/10/2019

Cara Instalasi untuk Arduino IDE

Cara 1: Install melalui library

https://randomnerdtutorials.com/installing-the-esp32-board-in-arduino-ide-

windows-instructions/

Cara 2: Install git ke folder hardware document Arduino

https://learn.sparkfun.com/tutorials/esp32-thing-hookup-guide/installing-

the-esp32-arduino-core

Cara Upload Program

Upload code + Tekan tombol boot

Upload
Upload

01/10/2019

Contoh Input Output Digital

Contoh Input Output Digital

Contoh Input Output Analog

Contoh Input Output Analog

01/10/2019

Contoh PWM output

Contoh PWM output
Mengirim Json Data ke server dengan http POST void loop() { #include <WiFi.h> #include <HTTPClient.h>
Mengirim Json Data ke server dengan http POST
void loop()
{
#include <WiFi.h>
#include <HTTPClient.h>
#include <ArduinoJson.h>
const char* ssid
= "muibee";
if(WiFi.status()== WL_CONNECTED){
HTTPClient http;
http.begin(nodeServer);
http.addHeader("Content-Type", "application/json");
StaticJsonDocument<200> jsonBuffer;
JsonObject payload = jsonBuffer.to<JsonObject>();
const char* password
= "********";
payload["id"]=1;
payload["data"]=5;
const char* nodeServer = "http://192.168.43.192:7000/iot";
void setup()
{
String payloadData;
serializeJson(payload, Serial);
serializeJson(payload, payloadData);
/* Boot Time */
Serial.begin(115200);
Serial.printf("connecting to %s ", ssid);
WiFi.begin(ssid, password);
while (WiFi.status() != WL_CONNECTED) {
delay(500);
Serial.print(".");
}
Serial.print("Connected to ");
int httpResponseCode = http.POST(payloadData);
if (httpResponseCode > 0){
String response = http.getString();
Serial.println(httpResponseCode);
Serial.println(response);
} else {
Serial.print("Error on sending POST: ");
Serial.println(httpResponseCode);
Serial.println(ssid);
}
Serial.print("IP address: ");
Serial.println(WiFi.localIP());
}
http.end();
} else {
Serial.println("Error in WiFi connection");
}
delay(100);
}

01/10/2019

Test send JSON data to server dengan POSTMAN

Test send JSON data to server dengan POSTMAN

IOT server service

Thinger.io

Free up 2 device & 4 dashboard

Thingspeak.com

Advanced data analisis with matlab

thingsboard.io

01/10/2019

01/10/2019 Buat Channel 18
Buat Channel

Buat Channel

Buat Channel

01/10/2019

Mengirim Data ke server dengan http GET

#include <WiFi.h> #include <HTTPClient.h> #include <ArduinoJson.h> const char* ssid =
#include <WiFi.h>
#include <HTTPClient.h>
#include <ArduinoJson.h>
const char* ssid
= "muibee";
const char* password
= "********";

void setup()

{ /* Boot Time */

Serial.begin(115200);

Serial.printf("connecting to %s ", ssid); WiFi.begin(ssid, password); while (WiFi.status() != WL_CONNECTED) {

delay(500);

Serial.print(".");

}

Serial.print("Connected to ");

Serial.println(ssid); Serial.print("IP address: ");

Serial.println(WiFi.localIP());

}

void loop()

{

if(WiFi.status()== WL_CONNECTED){ HTTPClient http; char* address = "https://api.thingspeak.com/update?api_key=************"; char data[300]; k++;

char data[300]; k++;
char data[300]; k++;

sprintf(data,"%s&field3=%d&field4=%.2f",address,k,k*0.2);

http.begin(data); int httpCode = http.GET(); if (httpCode > 0) { //Check for the returning code String payload = http.getString(); Serial.println(httpCode); Serial.println(payload); } else { Serial.println("Error on HTTP request");

}

}

delay(100);

}

Thingspeak view

Thingspeak view
Thingspeak view

01/10/2019

Matlab Visualization

TODO - Replace the [] with channel ID to read data from:

%

readChannelID = [*******];

%

fieldID1 = [3,4];

data from: % readChannelID = [*******]; % fieldID1 = [3,4]; TODO - Replace the [] with

TODO - Replace the [] with the Field ID to read data from:

%

readAPIKey = ‘*****************';

Channel Read API Key

= ‘*****************' ; Channel Read API Key %% Read Data %% [data, time] =

%% Read Data %% [data, time] = thingSpeakRead(readChannelID, 'Field', fieldID1, 'NumPoints', 30, 'ReadKey', readAPIKey);

%% Visualize Data %%

plot(data(:,1),data(:,2));

title('pulsa vs sudut') xlabel('pulsa') ylabel('sudut')

Data %% plot(data(:,1),data(:,2)); title( 'pulsa vs sudut' ) xlabel( 'pulsa' ) ylabel( 'sudut' )