I Build Things

With Software and Electronics

Micropython Christmas Card

Micropython Christmas Card

For many years, I have wanted to make a USB christmas tree. Not just a USB powered christmas tree, but a USB controlled christmas tree.

This idea was floating around in my head for a long time, but this time, I decided to make it a reality, and as a christmas card.

The board was designed around 28 WS2812B addressable RGB LEDs arranged in the shape of a christmas tree. The brains of the board was an STM32F401RET6 microcontroller, chosen mostly because JLCPCB had them available in their assembly service for a good price that also had support for Micropython.

The entire project was a bit of a rush, so I needed something already supported by Micropython, since I didn’t have time to port to a new microcontroller - the STM32F401 was perfect for this!

I did write a custom module in C to support driving the WS2812B LEDs in an efficient way. It would have been nice to contribute that code upstream, however I think it’s a bit to specific to the board I designed - it uses a specific combination of pins, timers, and DMA hardware to very efficiently control the LEDs, presenting an easy to use Micropython interface to the user.

I also wrote some documentation on how to use the board, in Sphinx.

The code for this project can be found on Github: