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 270ohm 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...