RGBTent retrospective

About

At EMFCamp 2012 @mikechislett and I designed and built an internet controlled colour changing tent, @rgbtent. I'm going to go over it now.

If anyone has any photos, please tweet them at @rgbtent or @User_4574.

Dioders

First we'll look at how we hacked the IKEA Dioder kits. The moment I spotted them in store I was thrilled by their potential. The LED strips are novelly basic, taking 12v R, G, B and GND. The controller supplied is similarly simple, and with a little work, will do everything for you.
 
This is the box we built outside and in. The XLR4 connector carries RGB on/off logic and GND. The three white cables connect to the breakout boxes on the ends of the transformers.
Each transformer will only drive four LED strips before it starts dropping off. We initially hoped only to have to mod one controller, but in the end we did all three as it was the easiest way to control the three transformers for the three sets we used.
 
Lets look at the control circuitry in close detail. If you look in close on the board, yep. That's no black blob ASIC, but a simple PIC. It has three outputs, one to each mosfet, which it drives the strips with using PWM. Perfect, we can just connect our own input to the mosfets and drive the lights using most of the circuitry on the board. But first, how to disable the pic?
Take another look at the connector on the left. Notice that black wire that's disconnected, and the accompanying depopulated + pad? That black wire is the 12v input from the transformer. After some tracing, we determined all it does is drive a 5v Vreg to power the PIC. Perfect again, all we have to do is cut it.
Finally, we scraped the enamel from the tracks leading to the mosfet inputs (leaving the buffer resistors in circuit) and carefully soldered wires to them. The large one at the bottom is GND. These four connections are simply connected in parallel board to board. Done.
It's really that easy. IKEA did wonders on making this product, like so many of their others, so easily hackable. One thing to note is that those logic inputs are left floating, so if you don't pull them to ground, you'll get interesting effects. In the future I might add large (100k?) pull-down resistors to GND so they turn off when not driven.

Controller

This was a Raspberry Pi using three GPIO pins to drive the mosfets. I risked connecting them directly, and had no issues. I chose this platform because a) it does networking easily, b) it's easy to code for and c) it had just arrived.
I wrote the software in Ruby using the WiringPi and TweetStream gems. It ran for the entire weekend without issue. You can find the software here, the config here, and the colour definitions file here. Install the gems and populate the oauth fields and it should just go.
You'll notice the threading used for soft-PWM, and yes, it's bad. Sometimes it flickers, but 99% of the time it's fine. The Pi only has one hard-PWM pin so to get full colour I had to code it.
There is a basic CLI for it as well as accepting the tweet commands. Mostly for debugging.
change [colour]Same as tweet. Change to [colour].
change #[r][g][b]Same as tweet. Change to #[r][g][b].
change #[rr][gg][bb]Same as tweet. Change to #[rr][gg][bb].
testRuns through a colour cycle.
set pwm period [n]Set the pwm period to [n].
set pwm frequency [f]Set the pwm period to 1/[f].
set pwm bpm [b]Set the pwm period to 1/([b]/60).
set pwm {on|off}Turn the pwm on or off.
define [colour] thisName the current colour as [colour] for use in change.
define [colour] #[r][g][b]Name the colour #[r][g][b] as [colour] for use in change.
define [colour] #[rr][gg][bb]Name the colour #[rr][gg][bb] as [colour] for use in change.
saveSave the running colour definitions to the colour definitions file.
loadLoad the colour definitions from the colour definitions file.
quitQuit.