This post has information about an LED matrix used to show power, energy and other data from our pedal power systems. Mostly standard components have been used to implement this, along with a specifically written library to take serial data and update the LED display accordingly.
We often need to display power and energy for some of our pedal power systems.
To do this we have often used a 64 x 32 large LED matrix from Embedded Adventures, the LDP-6432-P7.62v2.
This is a large and bright dual LED display which can show 4 colours (Red, Green, Orange, Black).
This requires quite a lot of memory to update and keep the display sorted, too much for the small ATMega328 inside an Arduino.
So we use the Embedded Adventures LED Matrix Driver PLT-1001v4. This device has a special library and can take serial (or SPI and I2C) commands and use these to draw different fonts, boxes, circles etc. There is a full library of functions this controller can implement.
We use an Arduino Nano to read data sent from our pedal power meter to the display.
The unit is wired up as per the following diagram:
We use a DC-DC converter to convert the 12V into the 5V required by the display. This can take over 5A at 5V, so you need a good, high current unit here. An Arduino Nano with bespoke connector PCB is used to listen to the incoming serial data (via the DATA line). The serial connection to the LED matrix driver is using software serial lines which can be on any two pins of the Arduino Nano. In this case we use the easy to access connectors V1+ and V2+, which are actually connected to A0 and A1 of the nano.
We needed a nice control program on the Arduino Nano to take serial data and convert it into the correct display.
Initially we used the display to either show a nice graph of power and energy or to display a count down timer and winner information. But we also wanted it to be easy to add new functions and displays types on it.
The display unit responds to textual commands sent by serial on the serial wire. The serial interface is configured to run at 115200 baud. The device will ignore anything which is not a valid command, as described below.
Display devices have an two-character ID, which can be set so that the device only responds to commands intended for that unit. Multiple devices can be connected to the serial bus, and commands directed to a specific device by using this ID. By default, display units are configured with the wildcard device ID “**”, which means it will respond to commands with any ID. Other valid IDs are any combination of two upper-case alpha characters, i.e. “AA”, “AB”, … “ZZ”.
Commands are ASCII strings with the following structure:
- The character “a”
- The two-character destination ID for this command, e.g. “AA”
- A one or two-character command ID, e.g. “P” or “CD”. See “Commands” below for a full list
- Zero or more bytes which act as a parameter to the specified command
A command is processed as soon as it is complete. Completeness is determined by whichever of these conditions is true first:
- The command parsing buffer is filled
- An ASCII line feed (“\n”) or carriage return (“\r”) is received
- The selected command’s expected parameter length has been received. e.g. the “CD” command expects a single byte parameter, once this is read, the command will be triggered.
There are lots of commands that have been included within this code – these can all be found in the Github documentation. The commands all relate to displays required by our customers. These can easily be added or removed or adjusted as required.