0% found this document useful (0 votes)
23 views2 pages

Define BLYNK

The document defines constants and includes libraries to connect a baby monitoring box to Blynk over WiFi. It initializes an ESP8266 for WiFi, MLX90614 temperature sensor, and LCD. It reads the temperature, displays it on the LCD, and sends it to Blynk.

Uploaded by

eka nugraha
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
23 views2 pages

Define BLYNK

The document defines constants and includes libraries to connect a baby monitoring box to Blynk over WiFi. It initializes an ESP8266 for WiFi, MLX90614 temperature sensor, and LCD. It reads the temperature, displays it on the LCD, and sends it to Blynk.

Uploaded by

eka nugraha
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

#define BLYNK_TEMPLATE_ID "TMPL6xy-hviQt"

#define BLYNK_TEMPLATE_NAME "BABYBOX"


#define BLYNK_AUTH_TOKEN "wXbBZpYqNhurf9_TVomUsxMOBSUTUpyu"

#define BLYNK_PRINT Serial


#include <ESP8266_Lib.h>
#include <BlynkSimpleShieldEsp8266.h>

char auth[] = BLYNK_AUTH_TOKEN;


char ssid[] = "monitoring";
char pass[] = "monitoring";

#include <SoftwareSerial.h>
SoftwareSerial EspSerial(3, 2);
#define ESP8266_BAUD 9600
ESP8266 wifi(&EspSerial);

//-------------------SUHU--------------------//
#include <Wire.h>
#include <Adafruit_MLX90614.h>
Adafruit_MLX90614 mlx = Adafruit_MLX90614();
float suhu;

//--------------LCD------------------//
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x27,16,2);

void setup() {
Serial.begin(9600);
delay(10);
EspSerial.begin(ESP8266_BAUD);
delay(10);
Blynk.begin(auth, wifi, ssid, pass, "blynk.cloud", 80);
Serial.println("SUDAH TERKONEKSI WIFI");

//-----------------SUHU---------------//
Serial.println("Adafruit MLX90614 test");
mlx.begin();
//------------------LCD--------------//
lcd.begin(16,2); // initialize the lcd for 16 chars 2 lines, turn on
backlight
lcd.backlight();

}
void loop() {

//-----------------SUHU---------------//
int suhu = mlx.readObjectTempC();
Serial.print("Ambient = ");
Serial.print(mlx.readAmbientTempC());
Serial.print("*C\tObject = ");
Serial.print(mlx.readObjectTempC());
Serial.println("*C");

lcd.setCursor(0,0);
lcd.print("T=");
lcd.setCursor(2,0);
lcd.print(suhu);
lcd.setCursor(4,0);
lcd.print(",0*C");

Blynk.run();
//Blynk.virtualWrite(V0, suhu);
//Blynk.virtualWrite(V2, humi);
//Blynk.virtualWrite(V1, temp);
}

You might also like