Sulabh Sethi · Blog ← Main Site

ESP8266 + P4 LED Matrix: A Web-API COVID Counter

An IoT build that pulls live COVID-19 figures for India from a web API on an ESP8266 and scrolls them across a 64x32 P4 LED matrix using the PxMatrix library.

Embedded Systems · 9 August 2023 · 1 min read · Updated 11 August 2023

ESP8266 P4 LED matrix COVID counter

This IoT project pairs an ESP8266 microcontroller with a P4 LED matrix to make a real-time COVID-19 case tracker for India. The system fetches live data from worldometers.info over Wi-Fi and displays the statistics on a 64x32 pixel LED matrix.

Technical implementation

The code uses the PxMatrix library to drive the display, with configuration for both ESP32 and ESP8266 and separate pin definitions for each.

ESP8266 pin configuration:

Features

The display supports multiple colours, including red, green, blue, white, yellow, cyan, magenta, and lime. I configured a 64x32 matrix with adjustable refresh timing and a scrolling-text function for showing information. The code exposes three data endpoints, tracking confirmed cases, deaths, and recovered patients in India through the API.

Display

The setup initializes the text rendering with “India” and “Covid19 Tracker” messages. A scroll_text() function scrolls text horizontally across the matrix with customizable colours and speeds, so the live figures move smoothly across the panel.

Originally published on sslabs.in.