IoT Beginner Project #2: How to Monitor Temperature Data with LED Alert using BLYNK App

 

IoT Beginner Project #2: How to Monitor Temperature Data with LED Alert using BLYNK App

 

About Project: 

The temperature data and graph can be monitored by using Blynk App through Wi-Fi. The LED will light up if the temperature is equal or higher than 35 degrees celsius.

Components:

  • Smart phone with BLYNK App
  • Computer 
  • Breadboard 
  • ESP32 
  • Sensor LM35
  • Red LED 
  • Resistor 220 Ohm  
  • Jumper Male-to-Female  
  • Micro USB-B 
  • Internet needed

 

Schematic Diagram:

 

 

  Coding using Arduino IDE:


#define BLYNK_PRINT Serial
#include <WiFi.h>
#include <WiFiClient.h>
#include <BlynkSimpleEsp32.h>
BlynkTimer timer;
char auth[] = "__YlX-ijzaSbHG0zdCennMY1SYXoH26A"; // Auth Token in Blynk Application or by email.
char ssid[] = "mywifi"; //wifi name
char pass[] = "mypassword"; //wifi password
int Raw= 0;
double Volt = 0;
double Celcius = 0;
const int ledPin = 22; // Led di pin 22
const int lmPin = 35; // LM35 di pin 35
void setup()
{
Serial.begin(115200);
// Blynk configuration system
Blynk.begin(auth, ssid, pass);
pinMode (lmPin, INPUT); // LM35 as input
pinMode (ledPin, OUTPUT); // LED as output
timer.setInterval(1000L, sendUptime); // Data will be send to Blynk for every 1 second
}
void sendUptime()
{
Blynk.virtualWrite(V1, Celcius); // Virtual Pin
}
void loop()
{
Blynk.run();
timer.run();
Raw = analogRead(lmPin); // Original data reading from LM35 sensor
Volt = (Raw / 2048.0) * 3300; // Convert original data according to the voltage used (3.3v)
Celcius = Volt * 0.1; // Find the temperature value in Celsius
if (Celcius >= 35){
digitalWrite (ledPin, HIGH); // The LED will turn on if the temperature is more than 35 Celcius
}
else{
digitalWrite (ledPin, LOW); // The LED will turn off if the temperature is less than 35 Celcius
}
delay(2000); // Slow down the reading of the data for 2 seconds
}


Watch this project tutorial on Youtube:



 
 
 
Thank you.

Comments

  1. I need your help. I am facing some problem with this code. can I get you email for sharing the problem.

    ReplyDelete

Post a Comment

Popular posts from this blog

IoT Beginner Project #1: How to Blink LED using BLYNK App Button with Internet of Things (IoT) via ESP32 Wifi

Arduino Beginner Project #2: How to Blink RGB (Red Green Blue) LED using Arduino Uno