COVID-19 Live Monitoring WIith ESP8266 and 16*2 LCD AmazingMj
Now in this project, we are going to display live data of corona virus cases and death all over the world with the help of Thing speak and ESP8266. You can also monitor other data with this method.
Idea:- nowadays the world phasing great trouble with this corona virus and I just think about monitoring the cases and death of COVID-19 virus for live update.
The component you need:-
-node MCU (ESP8266)
-16*2 LCD
data fetching process is given in the below image:-
Amazing_Mj |
Connection of LCD to node MCU like this:-
Amazing_Mj |
(I suggest to not use pin D0 and D8 of node MCU because of this pins get pull low when you upload a code)
Code:-
//start code
/*this project fetch the data from the internet
make the changes in this code shown in the video of AMAZING_MJ */
#include <ESP8266WiFi.h>
#include <ESP8266WiFiMulti.h>
#include <ESP8266HTTPClient.h>
#include <LiquidCrystal.h>
LiquidCrystal lcd(D6, D5, D4, D3, D2, D1); //PINS OF LCD(16*2) do not use D0 or D8
ESP8266WiFiMulti WiFiMulti;
void setup() {
lcd.begin(16, 2);
Serial.begin(115200);
for (uint8_t t = 4; t > 0; t--) {
Serial.flush();
delay(1000);
}
WiFi.mode(WIFI_STA);
WiFiMulti.addAP("YOUR_SSID", "YOUR_PASSWORD"); //your SSID and PASSWORD
lcd.setCursor(0, 0);
lcd.print(" COVID-19 LIVE MONITORING");
for (int i = 0; i < 24; i++) {
lcd.scrollDisplayLeft();
delay(500);
}
lcd.clear();
delay(100);
lcd.setCursor(0, 1);
lcd.print("BY- AMAZING_MJ");
delay(2000);
lcd.clear();
}
void loop() {
if ((WiFiMulti.run() == WL_CONNECTED)) {
HTTPClient http;
http.begin("http://api.thingspeak.com/apps/thinghttp/send_request?api_key=5RGM17DP11R5IXGF"); //paste your thingspeak link here
//don't forgot to remove 's' from https:
int httpCode = http.GET();
if (httpCode > 0) {
if (httpCode == HTTP_CODE_OK) {
String payload = http.getString();
Serial.println(payload);
String death = payload.substring(15, 21);
Serial.println(death);
lcd.setCursor(0, 0);
lcd.print("CASES:-");
lcd.setCursor(8, 0);
lcd.print(payload);
lcd.setCursor(0, 1);
lcd.print("DEATH:-");
lcd.setCursor(8, 1);
lcd.print(death);
}
}
else {
Serial.printf("[HTTP] GET... failed, error: %s\n", http.errorToString(httpCode).c_str());
}
http.end();
}
delay(1000);
}
//end here
Thanks for being here :)
watch out the video tutorial on YouTube here.
if you have any doubts or suggestions kindly comment below or on YouTube also.
Share this video is you like it.
Think Amazing
Be Amazing
Think Amazing
Be Amazing
Comments
Post a Comment