Monday, May 21, 2018

Playing with light

As mentioned in my article about my first steps into soldering, I started some real projects as well. Today I would like to tell you about one of them, lightening the shelves at my office space.

When we redid our office room, we already bought this shelves to be illuminated with some LED straps. After some research on the web, I was confident, the programmable LED straps called WS2812B would fit my needs.

So I got to AliExpress and ordered some of them alongside with some other electronic accessories for my DIY projects. I chose the version with 60 LEDs per meter IP30 as this project does not the water protection of the IP67.

The hardware part

Sometime later, the LEDs finally arrived. I had also ordered a Raspberry Pi Zero W (not at Ali as this are too expensive there) which I wanted to use in that project, a 16 GB micro SD card and a level converter.

Testing the LEDs first

The first step was to set everything up to see if it's basically working. In my first setup, I was using an external power supply for the LED strip. But I switched over to power them by the 5 V output of the GPIO-Pins at the Raspberry Pi. It worked quite fine, just had to make sure to use a strong enough power supply for the Raspberry.

First setup with an external power source

Testprogramm, all 5 meter of the LEDs did lit up
The next step was to cut the LED strip in parts fitting for the shelves and create some connection between them again. In order to be able to remove the three shelves individually again, I decided not to solder the connection cables directly to the LED parts, rather than create some kind of plug system for them. I was using some pin bus strips to create male and female parts and soldered them to the cables and LED strips. To get a better grip and protect the soldered points, I also covered them with shrink tubes.

Creating the connection plugs
After everything was set up so far, I performed another test to see if my solder - plug - cable system would work, before putting them up on the shelves.

Checking the three segments for the three shelves
I was also soldering in the level shifter, adding another self-made plug for the connection to the Raspberry Pi and covering all with a shrink tube. A switch to power on and off the setup was added as well.

Soldered in the level shifter and Raspberry connection plug

Covered all the soldering points with a shrink tube

As everything was working, it's been time to put the LEDs on the shelves. I also hid the connection cables with some cable ducts.

All set up on the shelves

The software part

At the side of the software, it's not been much work. Just setting up a Raspberry Pi with the noobs image and installing Raspbien.
I also set up ssh and VNC to access the Raspberry Pi remotely as I plan to add more functionality later like to react to a movement sensor or voice commands. 
The WS281X library had to be installed as well of course as some other packages.
After everything was set, I created a script to play the rainbow animation for now. More to follow later. This script I also added to the startup, so the light animation starts automatically when the Raspberry Pi starts up.


It's been a really fun project and it's a huge improvement to the look of our home office. As my wife saw it, she wanted to get one at her desk as well so we set up another by now.

The light shelves at my wife's desk
We plan to pimp up our flat with more elements like this. Stay tuned for updates on future projects. :)