Table of Contents
Toggle
This ESP8266 Covid-19 Live Tracker will help you to be up to date about the coronavirus outbreak and the situation in your country. This is an IoT-based project which displays the real-time data of cases, deaths, and recovered people by the coronavirus ( COVID-19 ). It uses a Wemos D1 Mini Pro board which is based on the ESP8266 Wifi module to get data from the worldometers via ThingSpeak API. I have used an 0.96″ OLED display for making a dashboard for all the real-time data.
Note: I made this project for fun and learning. The COVID-19 data display in this project is completely based on information on www.worldometers.info/coronavirus/. Follow WHO (https://www.who.int/) for COVID19 Updates.
Supplies:
1. Wemos D1 Mini Pro ( Amazon )
2. OLED Display ( Amazon )
3. Prototype Board ( Amazon )
4. 18650 Battery ( Amazon )
5. 18650 Battery Holder ( Amazon )
6. Slide Switch ( Amazon )
7. Female Headers ( Amazon )
8. 24 AWG Wires ( Amazon )
Prepare the Board
To make the ESP8266 Covid-19 Live Tracker project compact and neat, I made it by using a perforated board.
First I measure the width of the Wemos board, then cut out a piece of the perforated board slightly greater than the width. I used a utility knife to cut out the perforated board.
Mount the Wemos Board ( ESP8266 )
To mount the Wemos board, you need a female straight header pin. When you purchase the straight headers, they’ll be too long for the Arduino Nano. You’ll need to trim them down to an appropriate length. I used a nipper to trim down it.
Then solder the female header pins to the perforated board.
Mount the OLED Display
In the ESP8266 Covid-19 Live Tracker project, I am using an 0.96″ I2C OLED Display. So you need a 4 pins header.
Just like the previous step, trim out the header pin with a nipper.
Then solder the header pins as shown in the above picture.
Mount the Switch
The switch is required to isolate the power from the battery to the Wemos board. I am using a slide switch for this.
Solder the slide switch as shown in the above picture.
Make the Circuit
The circuit diagram for this project is very simple. The OLED display is hooked up to the Wemos board in I2C communication mode.
OLED -> Wemos
VCC -> VCC
GND – > GND
SCL-> D1
SDA -> D2
I have used 24AWG colored wires to make the circuit. Solder the wire as per the circuit diagram.
The schematic is attached below.
Mount the Battery Holder
The power required to drive the Wemos board and OLED display is supplied by a 18650 Li-Ion battery.
First, mount a double-sided tape on the backside of the battery holder.
Then paste it on the bottom side of the perforated board. You can see the above image for it.
Then I applied hot glue all around the battery holder.
Complete the Circuit
At last, you have to complete the circuit by connecting the battery terminal to the Wemos board via the slide switch.
Connect the positive terminal of the battery holder to the Slide switch middle pin. Then connect one of the remaining two-pin of the switch to Wemos 5V pin.
Connect the negative terminal of the battery to the GND pin of the Wemos board.
ThingSpeak Settings
First, create an account in ThingSpeak and then log in to your account.
From the top menu click on the app and press “New ThingHTTP”.
You will notice a lot of blank fields but don’t worry, you have to enter fill up the following three:
1. Name: Name the field as per your choice
2. URL: https://www.worldometers.info/coronavirus/
3. Parse String: In the next step, I will guide you on how to get this string.
Enter the Parse String
Go to WorldOmeters website https://www.worldometers.info/coronavirus/
Search for the country name, in my case it is India. Then click on the Country name. You will find 3 counters
1. Coronavirus Cases
2. Deaths
3. Recovered
Select the counter -> Right click -> Inspect
On the right side of the screen, just hover over those elements until you select the correct data to get. You can see the above image for a better understanding.
Then press the right click on the element and Copy XPath.
Now go back to ThingHTTP field ( Cases ) and paste it in Parse String, and press “Save ThingHTTP”.
Now you are done!
Software and Libraries
Download the OLED library from GitHub.
Download the code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 |
/* This code is used to read the COVID-19 data from https://www.worldometers.info/ through ThingSpeak app ThingHTTP and displays the datas on an 0.96" I2C OLED display * Original code was written by www.SurtrTech.com modified by Debasish Dutta on 08.04.2020 * Example code here used to track the numbers in India * OLED interfacing https://thingpulse.com // Library: https://github.com/ThingPulse/esp8266-oled-ssd1306 */ #include <ESP8266WiFi.h> //Use ESP8266 functions #include <ESP8266HTTPClient.h> #include <Wire.h> // Only needed for Arduino 1.6.5 and earlier #include "SSD1306Wire.h" #include "OLEDDisplayUi.h" // Include the UI lib #include "images.h" // Include custom images SSD1306Wire display(0x3c, D2, D1); // D2 -> SDA and D1 -> SCL OLEDDisplayUi ui ( &display ); const char* ssid = "XXXXXXXX"; //Your router SSID and password const char* password = "XXXXXXXXX"; const char* host = "api.thingspeak.com"; //We read the data from this host const int httpPortRead = 80; const char* url1 = "/apps/thinghttp/send_request?api_key=POGA7PGJH4EZPKJ4"; //This URL is mine but I kept it so you can replace the key only const char* url2 = "/apps/thinghttp/send_request?api_key=XQA3PRKTRLQB1CHP"; const char* url3 = "/apps/thinghttp/send_request?api_key=163SRMV8C2TBL8UK"; int To_remove; //There are some irrelevant data on the string and here's how I keep the index //of those characters String Cases,Deaths,Recovered,Data_Raw,Data_Raw_1,Data_Raw_2,Data_Raw_3; //Here I keep the numbers that I got WiFiClient client; //Create a WiFi client and http client HTTPClient http; void drawFrame1(OLEDDisplay *display, OLEDDisplayUiState* state, int16_t x, int16_t y) { //display->drawXbm(x + 34, y + 14, WiFi_Logo_width, WiFi_Logo_height, WiFi_Logo_bits); display->clear(); display->drawXbm(0 , 0 , covid19_width, covid19_height, covid19_bits); } void drawFrame2(OLEDDisplay *display, OLEDDisplayUiState* state, int16_t x, int16_t y) { display->clear(); display->setTextAlignment(TEXT_ALIGN_LEFT); display->setFont(ArialMT_Plain_16); display->drawString(10, 15, "COVID -19 India"); } void drawFrame3(OLEDDisplay *display, OLEDDisplayUiState* state, int16_t x, int16_t y) { display->clear(); display->setFont(ArialMT_Plain_16) ; display->drawString(2,15, "Confirmed : "+String(Cases)); } void drawFrame4(OLEDDisplay *display, OLEDDisplayUiState* state, int16_t x, int16_t y) { display->clear(); display->setFont(ArialMT_Plain_16); display->drawString(2,15, "Deaths : " + String(Deaths)); } void drawFrame5(OLEDDisplay *display, OLEDDisplayUiState* state, int16_t x, int16_t y) { display->clear(); display->setFont(ArialMT_Plain_16); display->drawString(2,15, "Recovered : " + String(Recovered)); } // This array keeps function pointers to all frames // frames are the single views that slide in FrameCallback frames[] = { drawFrame1, drawFrame2, drawFrame3, drawFrame4, drawFrame5 }; // how many frames are there? int frameCount = 5; // Overlays are statically drawn on top of a frame eg. a clock //OverlayCallback overlays[] = { msOverlay }; int overlaysCount = 1; void setup() { Serial.begin(115200); WiFi.disconnect(); //Disconnect and reconnect to the Wifi you set delay(1000); WiFi.begin(ssid, password); Serial.println("Connected to the WiFi network"); //Display feedback on the serial monitor Serial.println(WiFi.localIP()); // The ESP is capable of rendering 60fps in 80Mhz mode // but that won't give you much time for anything else // run it in 160Mhz mode or just set it to 30 fps ui.setTargetFPS(60); // Customize the active and inactive symbol ui.setActiveSymbol(activeSymbol); ui.setInactiveSymbol(inactiveSymbol); // You can change this to // TOP, LEFT, BOTTOM, RIGHT ui.setIndicatorPosition(BOTTOM); // Defines where the first frame is located in the bar. ui.setIndicatorDirection(LEFT_RIGHT); // You can change the transition that is used // SLIDE_LEFT, SLIDE_RIGHT, SLIDE_UP, SLIDE_DOWN ui.setFrameAnimation(SLIDE_LEFT); // Add frames ui.setFrames(frames, frameCount); // Add overlays // ui.setOverlays(overlays, overlaysCount); // Initialising the UI will init the display too. ui.init(); display.flipScreenVertically(); } void loop() { int remainingTimeBudget = ui.update(); if (remainingTimeBudget > 0) { // You can do some work here // Don't do stuff if you are below your // time budget. delay(remainingTimeBudget); } //COVID-19 Tracking //Reading 1: Reading of cases if( http.begin(host,httpPortRead,url1)) //Connect to the host and the url { int httpCode = http.GET(); //Check feedback if there's a response if (httpCode > 0) { if (httpCode == HTTP_CODE_OK || httpCode == HTTP_CODE_MOVED_PERMANENTLY) { Data_Raw = http.getString(); //Here we store the raw data string Data_Raw_1 = Data_Raw; To_remove = Data_Raw_1.indexOf(">"); //I look for the position of this symbol ">" Data_Raw_1.remove(0,To_remove+1); //I remove it and everything that's before To_remove = Data_Raw_1.indexOf("<"); //I look for the position of this symbol ">" Data_Raw_1.remove(To_remove,Data_Raw_1.length()); //I remove it and everything that's after //Example: This is the raw data received <td style="font-weight: bold; text-align:right">63,927</td> //First we look for ">" and we remove everything before it including it //We stay with this 63,927</td> //We look for "<" symbol and we remove it + everything after //We keep only this 63,927 as string Cases=Data_Raw_1; Serial.print("Cases: "); //I choosed to display it on the serial monitor to help you debug Serial.println(Cases); Data_Raw_2=Data_Raw; To_remove = Data_Raw_2.indexOf("<span>"); Data_Raw_2.remove(0,To_remove+6); Data_Raw_3=Data_Raw_2; To_remove = Data_Raw_2.indexOf("</span>"); Data_Raw_2.remove(To_remove,Data_Raw_2.length()); Deaths=Data_Raw_2; Serial.print("Deaths: "); Serial.println(Deaths); To_remove = Data_Raw_3.indexOf("<span>"); Data_Raw_3.remove(0,To_remove+6); To_remove = Data_Raw_3.indexOf("<"); Data_Raw_3.remove(To_remove,Data_Raw_3.length()); Recovered=Data_Raw_3; Serial.print("Recovered: "); Serial.println(Recovered); } } else //If we can't get data { Serial.printf("[HTTP] GET... failed, error: %s\n", http.errorToString(httpCode).c_str()); } http.end(); } else //If we can't connect to the HTTP { Serial.printf("[HTTP} Unable to connect\n"); } delay(5000); while (WiFi.status() != WL_CONNECTED) //In case the Wifi connexion is lost { WiFi.disconnect(); delay(1000); WiFi.begin(ssid, password); Serial.println("Reconnecting to WiFi.."); delay(10000); } } |
Download the images.h file
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 |
#define covid19_width 127 #define covid19_height 64 const uint8_t covid19_bits[] PROGMEM = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xE0, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xE0, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x83, 0x83, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC0, 0xE1, 0x83, 0x83, 0x0F, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xE0, 0xE1, 0xC1, 0x87, 0x07, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF0, 0x80, 0xFF, 0xFF, 0x03, 0x1E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF8, 0x80, 0xFF, 0xFF, 0x03, 0x3E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFC, 0xC1, 0x0F, 0xE0, 0x07, 0x7F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x98, 0xF3, 0x01, 0x00, 0x9F, 0x37, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x7F, 0x00, 0x00, 0xFC, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3F, 0x80, 0x03, 0xF8, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0E, 0xC0, 0x07, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xC0, 0x07, 0xC0, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xC7, 0x87, 0x83, 0xC7, 0x23, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x9C, 0xE3, 0x07, 0xC0, 0x8F, 0x33, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xDC, 0xE1, 0x0E, 0xE0, 0x0E, 0x7F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFC, 0x61, 0x0C, 0x60, 0x0C, 0x7F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFE, 0x60, 0x0E, 0xE0, 0x0C, 0xFE, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xE0, 0xE0, 0x0F, 0xE0, 0x0F, 0x0E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0xC0, 0x07, 0xC0, 0x07, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x70, 0x00, 0xC0, 0x07, 0x00, 0x1C, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x70, 0x00, 0xE0, 0x07, 0x00, 0x1C, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x70, 0x3C, 0xE0, 0x0E, 0x78, 0x1C, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xE0, 0x7F, 0x3C, 0x60, 0x0C, 0x78, 0xFC, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xE0, 0x7F, 0x3C, 0x60, 0x0C, 0x78, 0xFC, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x70, 0x18, 0xE0, 0x0F, 0x30, 0x1C, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x70, 0x00, 0xC0, 0x07, 0x00, 0x1C, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x80, 0x03, 0x80, 0x03, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xE0, 0xC0, 0x07, 0xC0, 0x07, 0x0E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xEC, 0xE0, 0x0F, 0xE0, 0x0E, 0xEE, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFE, 0x60, 0x0C, 0x60, 0x0C, 0x7E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFC, 0x61, 0x0E, 0xE0, 0x0C, 0x7F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x9C, 0xE3, 0x0F, 0xE0, 0x8F, 0x73, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x98, 0xC3, 0x87, 0xC3, 0x87, 0x33, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xC1, 0x07, 0xC1, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0E, 0xC0, 0x07, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1E, 0x80, 0x07, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3F, 0x00, 0x00, 0xF8, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x88, 0xF7, 0x00, 0x00, 0x9E, 0x23, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xDC, 0xE1, 0x03, 0x80, 0x0F, 0x77, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF8, 0xC0, 0x7F, 0xFC, 0x03, 0x3E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF0, 0x80, 0xFF, 0xFF, 0x03, 0x1E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xE0, 0xC0, 0xF3, 0x1F, 0x0F, 0x0E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC0, 0xE1, 0x83, 0x83, 0x0F, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xC0, 0x83, 0x83, 0x07, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x83, 0x83, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xE0, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xE0, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xE0, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, }; #define WiFi_Logo_width 60 #define WiFi_Logo_height 36 const uint8_t WiFi_Logo_bits[] PROGMEM = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xFF, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0xE0, 0xFF, 0x1F, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF8, 0xFF, 0x7F, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFC, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFE, 0xFF, 0xFF, 0x01, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0x03, 0x00, 0x00, 0x00, 0xFC, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0x07, 0xC0, 0x83, 0x01, 0x80, 0xFF, 0xFF, 0xFF, 0x01, 0x00, 0x07, 0x00, 0xC0, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x0C, 0x00, 0xC0, 0xFF, 0xFF, 0x7C, 0x00, 0x60, 0x0C, 0x00, 0xC0, 0x31, 0x46, 0x7C, 0xFC, 0x77, 0x08, 0x00, 0xE0, 0x23, 0xC6, 0x3C, 0xFC, 0x67, 0x18, 0x00, 0xE0, 0x23, 0xE4, 0x3F, 0x1C, 0x00, 0x18, 0x00, 0xE0, 0x23, 0x60, 0x3C, 0x1C, 0x70, 0x18, 0x00, 0xE0, 0x03, 0x60, 0x3C, 0x1C, 0x70, 0x18, 0x00, 0xE0, 0x07, 0x60, 0x3C, 0xFC, 0x73, 0x18, 0x00, 0xE0, 0x87, 0x70, 0x3C, 0xFC, 0x73, 0x18, 0x00, 0xE0, 0x87, 0x70, 0x3C, 0x1C, 0x70, 0x18, 0x00, 0xE0, 0x87, 0x70, 0x3C, 0x1C, 0x70, 0x18, 0x00, 0xE0, 0x8F, 0x71, 0x3C, 0x1C, 0x70, 0x18, 0x00, 0xC0, 0xFF, 0xFF, 0x3F, 0x00, 0x00, 0x08, 0x00, 0xC0, 0xFF, 0xFF, 0x1F, 0x00, 0x00, 0x0C, 0x00, 0x80, 0xFF, 0xFF, 0x1F, 0x00, 0x00, 0x06, 0x00, 0x80, 0xFF, 0xFF, 0x0F, 0x00, 0x00, 0x07, 0x00, 0x00, 0xFE, 0xFF, 0xFF, 0xFF, 0xFF, 0x01, 0x00, 0x00, 0xF8, 0xFF, 0xFF, 0xFF, 0x7F, 0x00, 0x00, 0x00, 0x00, 0xFE, 0xFF, 0xFF, 0x01, 0x00, 0x00, 0x00, 0x00, 0xFC, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF8, 0xFF, 0x7F, 0x00, 0x00, 0x00, 0x00, 0x00, 0xE0, 0xFF, 0x1F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xFF, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFC, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, }; const uint8_t activeSymbol[] PROGMEM = { B00000000, B00000000, B00011000, B00100100, B01000010, B01000010, B00100100, B00011000 }; const uint8_t inactiveSymbol[] PROGMEM = { B00000000, B00000000, B00000000, B00000000, B00011000, B00011000, B00000000, B00000000 }; |
Note: The images. h file is a .txt file and Keep the above two files in a single folder
To use Wemos D1 with the Arduino library, you’ll have to use the Arduino IDE with ESP8266 board support. If you haven’t already done that yet, you can easily install ESP8266 Board support to your Arduino IDE by following this tutorial by Sparkfun.
In the code, fill up your WiFi Router SSID and Password.
Then fill up the api_key for all the 3 fields.
You can refer to the above picture to get the api_key.
Once you edited your code, compile it and then upload it into your Wemos/ ESP8266 board.
Credit: The original code was written by SurtrTech, I have modified the code to fit into my requirement.
Final Testing
After uploading the code successfully, you can go to your serial monitor. You will find the numbers as displayed on the WorldoMeters website.
Here is a short clip for testing:
https://www.instagram.com/p/B-xemNTjI2C/?utm_sourc…
Congratulations, now your ESP8266 Covid-19 Live Tracker is ready to use. Insert the 18650 battery into the battery holder.
Slide the switch to the ON position, you will notice the CORONA virus icon on the OLED display. Then one after data will be displayed.
Thank You for reading this article.