Maker.io main logo

COVID-19 Real-Time Data Monitor

2020-04-07 | By M5Stack

License: General Public License

* Thanks for the source code and project information provided by @Niyas Thalappil

This simple tracker will help you to the current situation of different countries due to COVID-19 outbreaks. Also, it will show alternating the current data of different countries of your choice.

The data is collected by the website: www.worldometers.info/coronavirus/

 

Hardware

M5StickC is a mini M5Stack, powered by ESP32. It is a portable, easy-to-use, open-source, IoT development board. This tiny block is able to create and prototyping any project as your idea.

 

WiFi Connection

Copy Code
/*____Wifi _____________________*/
#define WIFI_SSID "JioFi" // Enter your SSID here
#define WIFI_PASS "Niyast90" // Enter your WiFi password here

In this, I just added on a few countries. If you can change/add/delete the countries in the main loop of the program according to your interests.

Copy Code
void loop() {
check_country("India");
delay(2000);
check_country("Kuwait");
delay(2000);
check_country("Saudi-Arabia");
delay(2000);
check_country("Qatar");
delay(2000);
check_country("US");
delay(2000);
check_country("Italy");
delay(2000);
check_country("China");
delay(2000);
check_country("Spain");
delay(2000);
}

Note:

Please check the correct names of the needed countries on www.worldometers.info/coronavirus/

 

Battery Status

The M5StickC has a built-in battery. So I just added to a battery status monitor to understand the battery charge.

Battery%20Status

Copy Code
void battery_status()
{
vbat = M5.Axp.GetVbatData() * 1.1 / 1000;
discharge = M5.Axp.GetIdischargeData() / 2;
if (vbat >= 4)
{
M5.Lcd.pushImage(145, 1, 14, 8, bat_3);
}
else if (vbat >= 3.7)
{
M5.Lcd.pushImage(145, 1, 14, 8, bat_2);
}
else if (vbat < 3.7)
{
M5.Lcd.pushImage(145, 1, 14, 8, bat_1);
}
else
{}
// M5.Lcd.setTextColor(TFT_YELLOW);
// M5.Lcd.setCursor(140, 12);
// M5.Lcd.setTextSize(1);
// M5.Lcd.println(discharge);
}
Mfr Part # K016-C
M5STICKC ESP32-PICO IOT DEV KIT
M5Stack Technology Co., Ltd.
More Info
View More Details
Mfr Part # K016-D
M5STICKC WITH WATCH ACCESSORIES
M5Stack Technology Co., Ltd.
More Info
View More Details
Mfr Part # K016-F
M5STICKC DEV KIT WITH HAT
M5Stack Technology Co., Ltd.
More Info
View More Details
Add all DigiKey Parts to Cart
Have questions or comments? Continue the conversation on TechForum, DigiKey's online community and technical resource.