Work

Micro Charlieplex Display

Charlieplexing allows hundreds of LEDs to be controlled using 13 pins. This was the first personal project where I used PCB Assembly to speed up manufacturing.

A green micro charlieplex LED display PCB being held in a hand, showing its compact size.

Introduction

After learning about Charlieplexing I thought it would be really cool to try to make a small display that could display animations. This was also a perfect opportunity to learn about PCB assembly and how to use it to speed up manufacturing. To make the design simple, the top of the board was a 10x10 grid of 0402 LEDs that I got assembled using PCB assembly. To reduce the cost the bottom of the board was left empty and was designed to hold a MCP23S17 GPIO expander that would be used to control the LEDs.

Design

The design of the board was done in KiCAD. It utilized a 6 layer stackup which costs $5.00 for 5 boards through JLCPCB. Routing such a dense board was a challenge, if I was to repeat this I would have reduced the size of the traces to allow for easier routing. Using the MCP23S17 GPIO expander allowed for a simple design that could be controlled using SPI. After soldering the GPIO expander to the board, I quickly realized that one row of LEDs was not lighting up. After some debugging I realized I missed a trace on the board but that was easily fixed by soldering a small wire to connect the two pads. After fixing this issue, I was able to get the display working and was able to display some simple animations on it.

Firmware

The firmware was written in C++ using platformio. I quickly ran into problems with the MCP23S17 GPIO expander as it was not fast enough to control the LEDs at a high enough refresh rate. I ended up switching to writing a custom driver that could batch SPI writes to the GPIO expander which allowed for a much higher refresh rate. The firmware also included a simple animation engine that could be used to display animations on the display. The animations were stored in a simple format that could be easily parsed by the firmware. One part of the firmware that I was particularly proud of was the brightness control. I implemented a simple PWM algorithm that allowed for smooth brightness control of the LEDs. This was done by using a timer to control the PWM frequency and a simple algorithm to control the duty cycle of the PWM signal. The firmware stored the brightness of the grid in a 10x10 array of bytes, where each byte represented the brightness of a row of LEDs. The firmware would then use this array to control the PWM duty cycle of each row of LEDs. This allowed for smooth brightness control of the entire display.

Conclusion

Micro Charlieplex Display Animation

I managed to get the display working, in the future I would probably switch to using a RP2040 microcontroller as it could handle a faster refresh rate and then I could send commands to it over USB or SPI. This would allow for a much more flexible display that could be used for a variety of applications. I still want to take the multiple displays I currently have and combine them into a LED cube that could display 3D animations.

Comments (...)

Loading comments...

Leave a Comment