Richard Caunt

Richard Caunt

Software Developer

© 2020

Programming LEDs with NodeJS

I’ve started to make progress with the LED lighting in the cinema. The plan is to use a Raspberry Pi to drive a series of APA102C LED strips (purchased from Alibaba). A NodeJS server running on the Pi serving a REST API will allow the LEDs to be interfaced to my Hubitat Elevation automation platform.

PCB Design

I had a play with a few different software suites for designing PCBs, each of varying complexity. I settled on Fritzing as the parts library and ‘simplistic’ user interface proved to be approachable for a beginner in comparison to other packages. Importantly it can also export to Gerber files which are used by manufacturers to generate PCBs.

Live action shot of Fritzing:

Fritzing Design

It took a while to place the components in useful locations with the least amount of overlaps between traces (where a double sided PCB would be needed). Once I was happy with the design I submitted the PCB to PCBWay for a quote. A few of days later the PCBs had been made. Below are the PCBs as delivered from PCBWay:

PCBWay Circuits

I started wiring up the circuit with the Raspberry Pi and a single LED strip:


After a simple test with a basic NodeJS program we had a few LEDs lit:

LED Test

I programmed a full NodeJS REST API, available on my GitHub and a driver for Hubitat, also on Github.

Here the setup can be seen placed in the soffit in the cinema:

This is an example of what the finished effect should look like:

This shows the LED lighting temporarily placed in the soffit to check the wiring works: