If you want to follow the situation with regard to the distribution of COVID-19 24/7, you can use a microcontroller for this. Together with an LCD, you can compile a live COVID-19 CORONA Tracker. For example with an M5StickC, which is equipped with an ESP32 and a color LCD. If you want to do the same but with an ESP8266 microcontroller, read the blog “ESP8266 Real-time COVID-19 Data Monitor“.
First of all, we need an ESP32-compatible development board with LCD, such as the M5StickC. You can, of course, use a different ESP32, as long as you adjust the sketch. As usual, install the Arduino IDE with the ESP32 core. When you use the M5StickC, you also have to install the M5StickC libraries. For more information, you can consult the previous blog “Programming the M5StickC with the Arduino IDE“.
Finally, you still need the ArduinoJson library. You can install it with the library manager in the Arduino IDE.
Then, of course, we need the data. They can be found on the Coronavirus Disease (COVID-19) GIS Hub website, for example. That website also provides a REST API, where you can request the data in JSON format. Through the API Explorer on that website, you can easily compile the correct query URL.
In this case, you choose the following settings:
At “Where” you choose “Country_Region” and then, for example, enter “Netherlands”.
Under “From fields”, check “Last_Update”, “Confirmed”, “Deaths”, “Recovered” and the rest off.
At “Output options” you set “Request geometry” to “False”, and the rest too.
At the top right you now see the generated query URL:
The code we need to read in the JSON data can be generated automatically with the online “ArduinoJson Assistant“. Paste the JSON data that we generated above into the ArduinoJson Assistant, and the website generates the program code.
From that program code, we only copy the necessary rules, and we adjust the “deserializeJson” line. See the end result below:
You will see this fragment in the sketch at the bottom of this page.
COVID-19 CORONA Tracker sketch
With this information, you can now easily put together your own Corona tracker. The sketch at the bottom of this article does nothing but retrieve new data every 10 minutes (the red LED will light up). On the screen of the M5StickC, you can see the number of infections in the area concerned (in yellow numbers), below that the number of deaths (red numbers) and the number recovered (green numbers).
Do not forget to enter your network name and password in the sketch.
As usual on this blog, the code is only a starting point for your own project. The sketch is very basic, but you can make something cool yourself. Have you made something interesting, then let it be known in the comments section below this article!