Open Green Energy

Open Source DIY Projects on Green energy

DIY ESP8266 Covid-19 Live Tracker

 

 

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:

 

Download the images.h file

 

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.

Related Posts

Fig-12.2: Wire Gauge Systems Fig-12.4: Cable Sizing Example       Fig-12.5: DC Cable Size Chart   Fig-13.1: Battery and

Read More