For a new piece I'm working on (redAlert) I wanted hundreds of red leds attached to special 'blobs' or lamps spread out on stage (designed by Jenny Michel). Each led should be able to be freely placed and controlled individually and they had to be fairly bright. And because of the custom led placement I couldn't have used led strips - strips have a fixed distance between the leds.
So I built three circuits that could drive 32 PWM channels each and thereby got 96 PWM channels in total. Each channel connects three leds in series (in a single package) and a resistor. That makes in total 288 leds.
The led I selected was the LED 5252 uh rt/1700mcd. It has 120 degrees spread angle and comes in a 5x5mm 6pin SMD package that's possible to solder by hand. I bought it from Segor where it costs 0.42 Euro if you buy +100.
Here a picture of it from the back side. The 270 Ohm resistor is chosen to match 12V and the three leds are connected in series using thin copper wire.
The three boards are controlled wirelessly and I send OSC commands from SuperCollider to control all the leds. There's a class for SuperCollider attached below that helps with addressing and packaging of the network data. One can build and connect as many of these 32ch boards as one likes.
For actually generating the 12V PWM I used on each board two TLC5490 in combination with four ULN2803a. and I also added a barebone Arduino to get a stable SPI communication with the TLC5490.
For receiving wireless OSC data I added a Raspberry Pi (model a) with an USB wlan stick. On the RPi there's just a small Python program that receives OSC and sends out serial commands to the Arduino.
Last I have a TP-link TL-WR703N with Open WRT installed acting as a router. when the boards start up they try to connect to this router and gets an IP assigned dynamically. This IP I use in SuperCollider to differentiate between the three boards.
* put 2013-09-25-wheezy-raspbian.img on a sd-card with Pi Filler
* put the card in a Raspberry Pi MODEL B, connect ethernet and 5V
* find the IP with LanScan.app
(* ssh-keygen -R 192.168.1.51)
* ssh firstname.lastname@example.org
* default password: raspberry
* sudo raspi-config
* select 'Expand Filesystem', change password, reboot and log in with SSH again
* sudo apt-get update
* sudo apt-get upgrade
* sudo pico /etc/inittab
* comment out the line 'T0:23:respawn:/sbin/getty -L ttyAMA0 115200 vt100' near the bottom and save
* sudo pico /boot/cmdline.txt
* remove 'console=ttyAMA0,115200 kgdboc=ttyAMA0,115200' and save
* sudo reboot
* sudo apt-get install python-serial
* git clone git://gitorious.org/pyosc/devel.git
* cd devel
* sudo ./setup.py install
* cd ~
//--set up wlan on the RPi
* sudo nano /etc/network/interfaces
* edit to say...
iface wlan0 inet dhcp
* sudo ifdown wlan0
* sudo ifup wlan0
//--copy file from laptop to RPi
* scp redAlertLight.py email@example.com:/home/pi/
//--automatically start the Python program at startup
* sudo pico /etc/rc.local
* add the following before the exit line: (sleep 1; python /home/pi/redAlertLight.py) & # autostart
//now move the SD card over to model A, connect the circuit and try
//--useful if you log in via SSH and want to stop the Python program
* sudo pkill python
Here is the Python code...
addy= '0.0.0.0', 15000 #from sc
port= serial.Serial('/dev/ttyAMA0', 115200) #to atmega168
def osc_led(addr, tags, data, source):
#print "incoming osc data: %s" % data
for val in data: #data has size 16 (24bit ints)
#here can be optimized later to send fewer bytes (48 instead of 64)
def osc_stop(addr, tags, data, source):
#print "shutting down"
thread= threading.Thread(target= osc_server.serve_forever)
osc_led(None, None, [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], None)
if __name__ == "__main__":
Attached is schematics, arduino firmware, partslist...