The real case
The styled bus stops J.C.Decaux has put in Paris have displays that indicate how many minutes one has to wait for the next bus. I like the simple matrix display put atop a 5m pole. The size of the LED matrix and their brightness allow a good read from more than 10m for the average person.
Unfortunately, there is only one matrix and as such, it is visible only from one side. While it is good for a MVP, the design has a big flaw: people coming from the opposite direction cannot see the information. The worst case is when someone sits across the street. The bus could come from around the corner and go in just one minute. So much for the wait time display.
The idea of having a small matrix placed high enough to avoid destruction of property is quite good. The only bad thing is that I need to be near the bus stop in order to get the information. And this suggested the following project: a matrix display placed on my door, so I can see how minutes I have before the next bus arrives.
The circuit uses two components:
- a WeMos D1 R2 board with the the excellent ESP8266 chip
- a 8×8 LED display driven by the MAX7219 chip
And now to the project
The MAX7219 and the 8×8 LED display have a bright red color, easy to spot from a few meters away. Put on the front door (on the inside, of course), it is visible from a few meters away.
The excellent Arduino LedControl library is easy to use. It has only one drawback: no support for displaying figures, especially two figures, as the waiting time can go up to 60 minutes. Most of the existing stuff on the internet does not accommodate so much information in such a small space.
That is no problem. One piece of paper, a pencil and time. Not much. Ten minutes later, the display problem is solved. The design of the font for the figures is simple, yet sufficient. Enough to show one or two digits.
And just in case, I’ve added several text messages, like Err for error and WF for WiFi.
Updating the wait time display
A waiting time display must update itself on a regular basis. The precision is down to minutes, so it feels right to refresh it every minute. There is no secret recipe: one needs a network connection.
While today we have many IoT options like LoRA, ZigBee, SigFox and the likes of them, for sake of simplicity, I used a regular WiFi connection. Thus the presence of the WeMos D1 board, featuring an ESP8266 WiFi enabled chip. It is a low-cost solution to the problem.
The wait time provider
For this project, I use the excellent API from Pierre Grimaud. It is easy to use. The only caveat is the necessity to connect in https instead of http, which is not the default role of ESP8266. Fortunately, there are alternatives. The whole project is on GitHub. Feel free to use it and don’t judge too harsh the quality of the code. I did it in a rush. Don’t forget to replace the placeholder values with real stuff.
Flashing the ESP8266
I used the Arduino editor. It is the best thing to use when playing with Arduino devices.
A word of caution
The LED display draws a certain amount of current. The USB port of the computer has its limits. During the flash, I disconnected the LED matrix from the board. Maybe this step it is not necessary, but better safe than sorry.
One more thing
Be careful, the real LED matrix has a slightly different order for the pins than the image above. The order is the following: Vcc,GND,DIN,CS,CLK. Make sure you connect pin D6 to CLK, respectively pin D5 to CS.