NODEMCU ESP8266 MONITOR SUHU LM35 INTERFACE LCD 20X4 I2C
b. Sensor Suhu LM35
c. LCD 20x4 I2C
d. Program Arduino IDE
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x3F, 20, 4);
void setup() {
lcd.begin();
lcd.clear();
lcd.noCursor();
Serial.begin(9600);
}
void loop() {
int dataadc = analogRead(A0);
float suhu = dataadc * (3.3/1023.0)* 100.0;
float v = dataadc * (3.3/1023.0);
lcd.setCursor(0,0);
lcd.print("Monitor ADC & SUHU");
lcd.setCursor(0,1);
lcd.print("ADC = ");
lcd.print(dataadc);
lcd.print(" ");
lcd.setCursor(0,2);
lcd.print("SUHU = ");
lcd.print(suhu);
lcd.print(" ");
lcd.setCursor(0,3);
lcd.print("Volt = ");
lcd.print(v);
lcd.print(" ");
Serial.println(suhu);
delay(200);
}
e. VIDEO HASILNYA
No comments:
Post a Comment