The project
The Raspberry Pi Zero has been out for quite a while now and inspiring projects with the Pi Zero pop up everywhere on maker websites. The 5 dollar Pi inspired me (Marcel Brouwers) and Chris Kuipers to start a project to control RGB ledstrips using our mobile phone. Sure, there are commercial off the shelf products with fancy Apps that let you control ledstrips, but that doesn’t give you the satisfaction achieved by making this yourself.
The solution we put together consists of a Raspberry Pi Zero and a custom PCB that takes care of the 12 volt to 5 volt power conversion for the Pi Zero and transistors for controlling the ledstrip (For more info on the hardware, see the hardware section of this post). For controlling the ledstrip via the browser we combined the pi-blaster software, a lighttpd install with php, the bootstrap framework and some php scripts. (For more info on the software, see the software section of this post)
The hardware
For this project we created a custom PCB using the Fritzing software and ordered it at a PCB manufacturing house. The 2 layer PCB is made to fit perfectly on top of the Pi Zero. The gerber files for the PCB can be downloaded here.
The parts we used:
– 3x TIP122 transistor
– 1x screw terminal with 5.0 mm pin spacing
– 2x screw terminal with 3.5 mm pin spacing
– 1x LM7805 power converter (or LM7805 drop-in alternative, which we used)
– 1x electrolytic capacitor (220 µF)
– 1x RGEF400 re-settable fuse (or bigger fuse for a longer ledstrip)
– 1x 40 pin gpio header female
– 1x 40 pin gpio header male
– 1x Raspberry pi zero
– 1x usb wifi dongle (rtl8188eu)
– 12 volt RGB ledstrip
– 12 volt power supply (amperage depending on the length of your ledstrip)
LM7805 v.s. buck converter
We could have used an ordinary LM7805 voltage regulator for powering the Pi Zero. However we chose for a buck converter as a drop-in replacement for the LM7805 mainly to limit heat buildup and improve power efficiency. There are many LM7805 drop in replacements on the market, the one we used can be found here.
The software
On the Raspberry Pi zero we installed Raspbian Jessie Lite and configured the usb wifi dongle to connect to our wireless network. Then we installed pi-blaster and tested pins 17, 27 and 22. After that we installed lighttpd and php. Then we used the bootstrap framework as basis for the webpage used to control the ledstrip. We added the code on GitHub so you can directly clone the files to the /var/www/html directory of your pi zero.
And this is the end result:
Please feel free to leave your thoughts in the comment section below.