Cov txheej txheem:

Nyob Covid19 Tracker Siv ESP8266 thiab OLED - Realtime Covid19 Dashboard: 4 Kauj Ruam
Nyob Covid19 Tracker Siv ESP8266 thiab OLED - Realtime Covid19 Dashboard: 4 Kauj Ruam

Video: Nyob Covid19 Tracker Siv ESP8266 thiab OLED - Realtime Covid19 Dashboard: 4 Kauj Ruam

Video: Nyob Covid19 Tracker Siv ESP8266 thiab OLED - Realtime Covid19 Dashboard: 4 Kauj Ruam
Video: What is Contact Tracing (Hmong) 2024, Hlis ntuj nqeg
Anonim
Image
Image

Mus ntsib Techtronic Harsh Website:

Txhua qhov txhia chaw muaj qhov tshwm sim loj ntawm Tus Kab Mob Tshiab Corona (COVID19). Nws tau dhau los tsim nyog los saib xyuas qhov xwm txheej tam sim no ntawm COVID-19 hauv Ntiaj Teb.

Yog li, nyob hauv tsev, qhov no yog txoj haujlwm kuv xav txog "Ntiaj Teb Nyob Covid19 Dashboard"-Lub Dashboard uas muab cov lus qhia tseeb txog lub sijhawm COVID-19 lub ntiaj teb. Tsis tas yuav tsum khaws TV hauv lossis saib hauv ntau lub vev xaib.

Qhov tsim ntawm txoj haujlwm tsis yog qhov tseem ceeb. Tab sis ua qee yam muaj txiaj ntsig, siv cov khoom siv uas yooj yim yog qhov nyuaj. Txoj haujlwm no yuav pab koj tsim qhov yooj yim dashboard interface kom koj hloov kho tshiab.

Khoom siv

  • ESP8266
  • OLED Zaub
  • Jumper Cables

Kauj Ruam 1: Schematics:

Teeb
Teeb

Kauj ruam 2: Teeb:

Teeb
Teeb
Teeb tsa
Teeb tsa
  1. Mus ntsib Realtime Covid19 Dashboard's Website. Nov Kuv Siv
  2. ID nkag mus/Sau npe mus rau https://thingspeak.com. Mus rau App thiab Tsim Tshiab ThingHttp Action.

    • Muab Lub Npe Koj Xaiv, URL (https://trackcorona.live), Txoj hauv kev tau txais thiab hauv Parse String, koj yuav tsum muab XPath los ntawm trackcorna.live lub vev xaib ntawm thaj chaw xav tau uas koj xav qhia.
    • Hauv Qhov Piv Txwv Zoo Dua (Duab), Kuv Parsing String For Confirmed Cases, txhua yam koj yuav tsum ua yog

      • Txoj Cai Nyem rau Tus Naj Npawb Ntawm Tus Kheej> Txheeb Xyuas,
      • Ib zaug ntxiv Right Click in the Code> Copy> CopyXPath
      • Muab qhov no tso rau hauv Parse String field ntawm ThinkHttp Action thiab Txuag Nws.
      • Ib yam nkaus, ua qhov no rau txhua qhov Rov Qab Los, Tuag, Tus Neeg Tuag Tuag thiab Tus Tuag Tus Nqi.
      • Mus ntsib Tus Txheej Txheem Cai thiab Hloov SSID nrog koj Lub Npe Wifi, Tus Kheej nrog Koj Tus Kheej Wifi thiab Tus lej API nrog koj li ThingHttp API.
  3. Upload Cov Cai. Qhov ntawd yog !!

Kauj ruam 3: Source Code:

/* © Techtronic Harsh

Youtube:

Qhia: https://www.instructables.com/member/… Instagram: https://instagram.com/techtronicharsh Website: https://techtronicharsh.com Telegram:

*/

#suav nrog // Siv ESP8266 ua haujlwm #suav nrog #suav nrog #suav nrog #suav nrog #suav nrog

Adafruit_SSD1306 zaub = Adafruit_SSD1306 (128, 32, & Hlau);

const char*ssid = "*******"; // Koj tus router SSID piv txwv li WiFi Lub Npe const char*password = "*******"; // Koj li WiFi Password const char* host = "api.thingspeak.com"; // Peb nyeem cov ntaub ntawv los ntawm tus tswv tsev no const int httpPortRead = 80; /* Tsuas yog hloov tus lej API nrog Koj li API ntawm ThingHttp*/const char* url1 = "/apps/thinghttp/send_request? Api_key = TGC4KNQ98REOA4JH"; // Pom zoo const char* url2 = "/apps/thinghttp/send_request? Api_key = Y0ALN1QGDTNLLNNM"; // Rov zoo li qub char* url3 = "/apps/thinghttp/send_request? Api_key = 0J24MB3W9F9Q0E7M"; // Tuag const char* url4 = "/apps/thinghttp/send_request? Api_key = R2BKR1DRVS5YT2PH"; // Rov Qab Tus Nqi const char* url5 = "/apps/thinghttp/send_request? Api_key = VYMVMGK9S8W21EXQ"; // Tus nqi tuag taus

Cov Teeb Meem, Tuag, Rov Qab, Rov Rov Los, Tuag;

WiFiClient tus thov kev pab; // Tsim WiFi tus thov thiab http tus thov kev pab

HTTPClient

void teeb tsa () {

Serial.begin (9600); // Pib kev sib txuas lus txuas nrog WiFi.disconnect (); // Txuas thiab txuas dua rau Wifi koj teeb tsa ncua (1000); WiFi.begin (ssid, password); Serial.println ("Txuas nrog WiFi network"); // Zaub tawm tswv yim ntawm tus saib xyuas Serial.println (WiFi.localIP ()); display.begin (); display.display (); ncua (1000);

display.clearDisplay ();

display.display ();

display.setTextSize (1);

display.setTextColor (WHITE);

}

void lub voj ()

{// Nyeem 1: Nyeem Ntawv Ntawm Tus Kheej

yog (http.begin (tus tswv tsev, httpPortRead, url1)) // Txuas rau tus tswv tsev thiab url

{int httpCode = http. GET (); // Txheeb xyuas cov lus tawm yog tias muaj lus teb yog (httpCode> 0) {yog (httpCode == HTTP_CODE_OK || httpCode == HTTP_CODE_MOVED_PERMANENTLY) {Cases = http.getString (); Serial.print ("Cov Ntaub Ntawv Pom Zoo:"); Serial.println (Mob); display.setCursor (0, 0); display.println ("COVID19 LIVE"); display.println (""); display.println ("Cov Ntaub Ntawv Pom Zoo:"); display.println (Rooj plaub); display.display (); ncua (4000); display.clearDisplay (); }} lwm // Yog tias peb tsis tuaj yeem tau txais cov ntaub ntawv {Serial.printf ("[HTTP] Tau txais … ua tsis tiav, yuam kev: %s / n", http.errorToString (httpCode).c_str ()); } http.end (); } lwm // Yog tias peb tsis tuaj yeem txuas rau HTTP {Serial.printf ("[HTTP} Tsis tuaj yeem txuas tau / n"); }

// Nyeem 2: Nyeem Ntawv Rov Qab

yog (http.begin (tus tswv tsev, httpPortRead, url2))

{int httpCode = http. GET (); yog (httpCode> 0) {yog (httpCode == HTTP_CODE_OK || httpCode == HTTP_CODE_MOVED_PERMANENTLY) {Rov qab = http.getString (); Serial.print ("Rov qab tau:"); Serial.println (Rov qab); display.setCursor (0, 0); display.println ("COVID19 LIVE"); display.println (""); display.println ("Rov qab tau:"); display.println (Rov qab); display.display (); ncua (4000); display.clearDisplay (); }} lwm {Serial.printf ("[HTTP] Tau … ua tsis tiav, yuam kev: %s / n", http.errorToString (httpCode).c_str ()); } http.end (); } lwm {Serial.printf ("[HTTP} Tsis tuaj yeem txuas tau / n"); }

// Nyeem 3: Nyeem Kev Tuag

yog (http.begin (tus tswv tsev, httpPortRead, url3))

{int httpCode = http. GET (); yog (httpCode> 0) {yog (httpCode == HTTP_CODE_OK || httpCode == HTTP_CODE_MOVED_PERMANENTLY) {Tuag = http.getString (); Serial.print ("Tuag:"); Serial.println (Tuag); display.setCursor (0, 0); display.println ("COVID19 LIVE"); display.println (""); display.println ("Tuag:"); display.println (Tuag); display.display (); ncua (4000); display.clearDisplay (); }} lwm {Serial.printf ("[HTTP] Tau … ua tsis tiav, yuam kev: %s / n", http.errorToString (httpCode).c_str ()); } http.end (); } lwm {Serial.printf ("[HTTP} Tsis tuaj yeem txuas tau / n"); }

// Nyeem 4: Nyeem Ntawv Tus Nqi Rov Los

yog (http.begin (tus tswv tsev, httpPortRead, url4))

{int httpCode = http. GET (); yog (httpCode> 0) {yog (httpCode == HTTP_CODE_OK || httpCode == HTTP_CODE_MOVED_PERMANENTLY) {Recoveryrate = http.getString (); Serial.print ("Tus Nqi Rov Los:"); Serial.println (Recoveryrate); display.setCursor (0, 0); display.println ("COVID19 LIVE"); display.println (""); display.println ("Tus Nqi Rov Los:"); display.print (Recoveryrate); display.println (" %"); display.display (); ncua (4000); display.clearDisplay (); }} lwm {Serial.printf ("[HTTP] Tau … ua tsis tiav, yuam kev: %s / n", http.errorToString (httpCode).c_str ()); } http.end (); } lwm {Serial.printf ("[HTTP} Tsis tuaj yeem txuas tau / n"); }

// Nyeem Ntawv 5: Nyeem Ntawv Tus Tuag

yog (http.begin (tus tswv tsev, httpPortRead, url5))

{int httpCode = http. GET (); yog (httpCode> 0) {yog (httpCode == HTTP_CODE_OK || httpCode == HTTP_CODE_MOVED_PERMANENTLY) {Deathrate = http.getString (); Serial.print ("Tus Neeg Tuag:"); Serial.println (Deathrate); display.setCursor (0, 0); display.println ("COVID19 LIVE"); display.println (""); display.println ("Tus Neeg Tuag:"); display.print (Deathrate); display.println (" %"); display.display (); ncua (4000); display.clearDisplay (); display.display (); }} lwm {Serial.printf ("[HTTP] Tau … ua tsis tiav, yuam kev: %s / n", http.errorToString (httpCode).c_str ()); } http.end (); } lwm {Serial.printf ("[HTTP} Tsis tuaj yeem txuas tau / n"); } thaum (WiFi.status ()! = WL_CONNECTED) // Yog tias Wifi txuas tsis tau {WiFi.disconnect (); ncua (1000); WiFi.begin (ssid, password); Serial.println ("Txuas rau WiFi.."); display.setCursor (0, 0); display.println ("Techtronic Harsh"); display.println (""); display.println ("Txuas …."); display.display (); ncua (10000); display.clearDisplay (); display.display (); }

}

/* © Techtronic Harsh

Youtube:

Qhia: https://www.instructables.com/member/… Instagram: https://instagram.com/techtronicharsh Website: https://techtronicharsh.com Telegram:

*/

Kauj ruam 4: Ua haujlwm:

Ua cov kev sib txuas raws li daim duab qhia chaw thiab xa cov lej tom qab xaiv lub rooj tsav xwm kom raug thiab COM Port. Yog tias nws qhia qhov ua yuam kev kom ntseeg tau tias koj tau ntxiv lub tsev qiv ntawv raws li cov lus qhia tau hais los saum no.

Yog tias nws siv sijhawm ntau los khiav ntawm OLED, Xyuas kom tseeb tias koj tau txuas nrog rau cov kev pabcuam internet piv txwv li Koj li WiFi lossis Hotspot.

Pom zoo: