Track COVID-19 Outbreak by ESP8266

by opengreenenergy in Circuits > Arduino

6655 Views, 20 Favorites, 0 Comments

Track COVID-19 Outbreak by ESP8266

Thumbnail_inst (1).jpg
IMG_2483.jpg
COVID-19 Realtime Status by ESP8266 || Interfacing ESP8266 With OLED Display

This little gadget 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 realtime 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

Screenshot (44).png
Screenshot (45).png
Screenshot (46).png
IMG_2383.jpg
Screenshot (48).png

To make the 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 width. I used a utility knife to cut out the perforated board.

Mount the Wemos Board ( ESP8266 )

Screenshot (43).png
Screenshot (42).png
IMG_2368.jpg
IMG_2422.jpg
IMG_2430.jpg
IMG_2431.jpg

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

Screenshot (54).png
Screenshot (52).png
Screenshot (53).png
Screenshot (55).png
IMG_2436.jpg

In this 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 by a nipper.

Then solder the header pins as shown in the above picture.

Mount the Switch

Screenshot (41).png
Screenshot (49).png
IMG_2440.jpg

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

Schematic_Real Time COVID-19 Tracker.png
Screenshot (51).png
IMG_2451.jpg
IMG_2455.jpg

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

IMG_2457.jpg
IMG_2459.jpg
IMG_2465.jpg
Screenshot (35).png

The power required to drive the Wemos board and OLED display are 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

Screenshot (38).png
Screenshot (32).png
Screenshot (39).png
Screenshot (34).png

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

Screenshot (71).png
Screenshot (72).png

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

Screenshot (73).png
Screenshot (82).png
Screenshot (74).png
Screenshot (75).png
Screenshot (76).png
Screenshot (77).png

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

Screenshot (79).png
Screenshot (80).png

First, download the code attached below. Then download the OLED library from GitHub.

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

Screenshot (40).png
IMG_2475.jpg
Thumbnail_inst.jpg

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 little gadget is ready to use. Insert the 18650 battery into the battery holder.

Slide the switch to 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.