Wednesday, August 4, 2021

ESP8266 seven segment counter

ref 2018


The ESP8266 seven segment counter is a WiFi enabled device that updates one ore more 7 segment led display by loading data from a RESTful API.

The device is based on a ESP8266 chip. It uses the WiFiManager ( library to simplify the settings of the AP the board has to connect to. If the ESP8266 can not find the last network used, or no network is set, the ESP8266 enters the "forced AP mode", now the user can connect to the device WiFi and set the main WiFi AP to be used for the internet connection.
When it's connected WiFi AP the IP address given by the main AP DHCP server, or the static IP of the device is shown on the first seven segment dispaly.

The user can change the API uri used to get the data, and the interval of the data routine from the settings web page.

Whenever the interval time, which is by the way expressed in seconds, is passed by, the ESP8266 performs a GET requests on the API uri, then try to parse the results. The result must be plain text format: each line must be a numeric value that will be shown on the display. Of course it's just a matter of changing a little bit of code to customize the parsing function to fit the desidered API uri.

If errors happened, nothing is display till a threshold number is reached, then the last error is displayed.

The schematics and the board for this project is as simple as the code.

The power comes from the 5V port, a mini USB is used, then a linear regulator reduce the voltage to 3.3V used by the ESP8266 board, that is a ESP-12F pinout compatibile one.

The seven segment display driver is the MAX7219.

Even the numer of 8 bit seven segment display is pretty simple to customize by changing a few lines of code.
The one proposed here has 2 seven segment 8 digits display, one display for each driver, but with just a few changes it will be easy to add or reduce the number of digits to use.

  • read risk disclaimer
  • excuse my bad english