One of the first things I wanted to do with the Raspberry Pi was to turn one into an "extreme feedback device"1 because due to its size, the fact that it runs a fully-fledged Linux and the versatility of its connections it would be easy to interface both the server and some lights.
Because I wanted to start on the software early, I built a little mock-up device at first that did nothing more than connect three different color LEDs to GPIO pins on the Raspberry Pi:
I went with the "traffic light" color scheme because it matches the three different states used by Jenkins.
After wrapping up the code, I found the right hardware for this on Amazon:
I bought this since a life-size or real traffic light (yes, they are available on ebay every once in a while) would have been a little over the top price- and sizewise. It comes with two "car" sides (showing red, yellow and green) and two "pedestrian" sides (with only red and green). It has a switch with three positions on the bottom, and a pushbutton on the top. It originally runs off three AA batteries.
After opening it up I didn't really bother much with the original functionality and pretty much instantly ripped out the original board. What was unexpected though was the small tungsten light bulbs I found on the inside since I was really expecting LEDs. The good news at this point was that the removal of the original board freed enough space for a bare Raspberry Pi + WiFi to be fit inside.
After drilling up the holes and installing 5mm ultra-bright LEDs I hooked up another ULN2064 to amplify the GPIO outputs since the 30mA current necessary to drive the LEDs appeared a little bit too much for Raspberry Pi to me. I also drilled holes into the bottom and ran a power supply cable through the foot.
Here's a few pictures of it in action:
First experiments with regular LEDs that turned out to be too dark
1 An extreme feedback device is a tool often used in agile programming. Its purpose is to show the integrity of a software project. The idea is to detect software errors as soon as possible and to make them visible and obvious to everyone involved. It usually involves a continuous integration server like Jenkins.↩
Fast forward to 2012, the year the first Raspberry Pi Model B computers hit the market. I got one pre-ordered very early, but still had to wait a couple of months for it to arrive. I can't remember exactly when it arrived, but I found first pictures in my collection to be dating back to October.
It must have been around that time that I found a 5 meter package of LED strips on sale at a local grocery store. It was one of those typical packages... 5m of RGB LED strip, cuttable, with connectors to go around corners, a power supply and a small but colorful infrared remote. I got one of these with the explicit intention to play around with it, so I was not that disappointed to find that the capabilities of the original package were kind of limited. I really wanted to hook this up to a computer, and what would be better suited for this than a Raspberry Pi?
And so I started fiddling again. This time I was not bound to DMX, so I figured my best choice would be one of Adafruit's PWM servo boards. I didn't intend to run servos from it, but since it was capable of outputting PWM at 5V i figured this would be enough to drive one of those ULN2064B chips I had already used before. The LED strips themselves turned out to be running at 12 volts once more, so this was all kind of a déjà-vu to me. The board also had a total of 16 output channels - enough to cut the strip into five pieces and control the red, green and blue values for each one individually.
First experiments looked promising:
Rasbperry Pi with PWM board driving four regular LEDs
So I hooked up a ULN2064 I still had from earlier work to the PWM board, used the power supply from the original package and things literally got brighter:
The video shows the complete setup: Raspberry Pi, PWM board, ULN2064 and LED strip.
After that, all I had to do was get a few more ULN2064s and a case to store the circuitry in.
Fitting the circuitry into a box
For connections to the outside, I used 4-pin Mini-DIN connectors, as they allowed me to bundle the necessary lines (one for red, green, blue and a V+ pin) into a single connector without using too much space.
Fitting the connectors
How it will once look when finished (lower case is still open)
Insides almost finished
One more inside shot
I ended up cutting the original strip into four pieces, because I found that a 4-pack of LED sticks I once purchased at IKEA also ran off 12V and worked perfectly with this new dimmer device, and so I used one output to power these.
Skip to today: After finally aquiring the materials needed to etch my own PCB boards, I am currently in the process of redesigning this dimmer. Click here for the follow-up post.
The first really notable LED-related project I did started back in the year 2009, when two friends came up to me and asked whether I could help them out with the sound & light of a local club they wanted to start. The venue was already known to me (as it has been a club location before), and for monetary reasons of course as much of the equipment still in place should be re-used.
One of the previous owners most notably had made a huge investment and had installed lots of led tubes into the club furniture, groups of red, green and blue, hidden behind acrylic glass. I had seen them in action (and even worked the old lighting system) before, but at that point had no idea how they were actually wired or controlled. Nevertheless, I agreed, and this picture best shows what I found:
Many projects start off with a certain level of messiness.
That's about 80 pieces of Halogen Transformers, 12V AC. The bunch of cables coming in at the top, that's the multicores going to the actual LEDs, and the lot of cables hanging out at the bottom... well, that's the remainder of the previous owner ripping out the 220V regular lighting dimmers that were previously used to power the whole system.
Now i won't go into all of the problems that this posed (the most important problem I'm gonna skip here is: which transformer powers which LED? Just let me say: we eventually figured it out...) but would like to focus onto the electronic problems that this setup posed:
Those transformers were AC units, meaning: no recifiers and no filters. That led to a constant flickering of the connected LEDs at 50Hz.
Lighting dimmers usually are designed for ohmic loads (which fits most regular lamps). Transformers are inductive loads and most available dimmers are only able to drive a fraction of their announced power for such types of loads.
LEDs cannot be dimmed by varying the applied voltage. The effect that regular voltage dimming has to LEDs is that they will be far too bright at lower dimming levels.
An 80-channel dimmer bank would have been pretty expensive. (We worked out that the original system obviously grouped the LEDs and only consisted of four dimmers with 6 channels each)
So, besides the fact that we set out to reconstruct the original system, I started lots and lots of research in order to improve upon what would initially work.
One of the very first things I learned was that the key to LED dimming is Pulse Width Modulation, or short: PWM. So whatever I was about to build needed to integrate into a club lighting environment (that means: would require a DMX input) and had to output a PWM signal at the required 12 Volts and would need to output enough power for some meters of LED tubing (measurements indicated up to 1.2 Gigawatts, err, I mean Ampere).
At that point I was lucky enough to find Hendrik Hoelscher's DMX board. It's a basic board driven by an Atmel ATmega8515 microcontroller that can be used for various lighting purposes, including LED dimming. The sample schematics showed an ULN2803 chip used for driving high-power LEDs, but the spec sheet showed that the maximum load of that chip was 500mA, which was not enough. After a bit of searching however i found the "big brother", the ULN2064, which (despite the limitation to four instead of 8 channels) was able to drive up to 1.5A. Awesome!
So I ordered a batch of the DMX boards, the necessary components, a few ULN2064 chips, grabbed a few leftover LED tubes, and put it all together.
Assembled DMX Transceiver board with virgin inputs & outputs
After programming the mictrocontroller initial testing was performed with regular LEDs and the internal standalone demo modes:
DMX Transceiver with regular LEDs connected directly
Next, the testing circuit was hooked up to an old DMX lighting controller (left over from one of the previous owners... we had no intentions using it again initally, but still it turned out quite useful later on):
DMX Transceiver connected to DMX lighting console
Since everything worked smoothly at that point, the next step was to hook up a sample ULN2064 to the transceiver, and attach a sample strip of LEDs. An old computer power supply was the only one that would provide enough power, so I hooked that up as a power source. I don't have pictures of that stage, only a short video:
This video also shows the software that we used to control it all, DMXControl, and a first sample effect I clicked together for a quick demonstration.
Now that the whole proof of concept stuff was successful, all I had to do was wrap it up into some kind of form we could really use. The DMX Board was able to drive nine individual outputs, and one ULN2064 could amplify four channels each. That lead to the final channel count of 36. The fact that we would be able to cover 72 channels with two these devices also was pretty convenient, since that pretty much matched the amount of LED tubes in place.
In addition to the 4 DMX boards I also soldered a long row of 72 terminals onto a strip of perfboard, which would hold the ULN2064s and a row of fuses, too.
Also, a PC power supply was not suitable for the final installation, so it was swapped out for a professional Mean Well 320W switching power supply that was able to drive a whopping 25 amps in total. This was the most expensive part of the installation.
Here's a few more pictures of the process:
Laying out the components: DMX boards on the left, terminal perfboard with ULN2064s still in packaging on the right, power supply on the bottom. Also shown: 9V AC transformer used to power the DMX boards
Putting things together for another test run
First completed dimmer in place with the first LEDs attached
Final installation: 2x36 channels, still some terminals available. I also started applying heat sinks to the amplifier chips for heat dissipation.
And to round it all up, here's another short video of the final LED dimmer in action:
Skipping to today, I don't work at that place any more. But as far as I know and was told my work is still in place and functioning.