Remote Controlled, dimmable LED Lamp - now with source
JasonDorie
Posts: 1,930
My most recent project: A remote controlled living room lamp.
This was done using a Propeller chip to control a TLC5940 LED driver, and is one of my first "fully complete" projects.
The circuit was designed in DipTrace. The PCB was cut with my CNC machine using isolation routing paths output from DipTrace. As coded, it can be controlled using the volume and channel buttons on any Sony TV remote.
The LED driver is written in PASM using BrillDea's SPIN driver as a starting point. The driver is unique in that it's the first I've seen in PASM, and it properly handshakes between the cog running the PWM clock and the cog doing data transmission. This avoids the single frame flicker that happens if you latch in new data during the PWM cycle. I haven't timed it, but the GS cog should run roughly 1500fps & 80MHz (4096 ticks, 3 instructions each), and the data update cog about 10x faster (~10 instructions per bit, 192 bits).
The Sony Remote code is Jon McPhalen's SIRCS object.
For physical construction, the shade is made of a 4' x 2' sheet of thin HDPE, the ends are garbage cans from Target, the central column is 1" PVC from Home Depot, and the "caps" are custom routed 1/2" UHMW plastic.
The LEDs are 16 foot-long sections of a 16 foot 12v LED strip, purchased from Amazon. The LEDs are spiral-wrapped around the PVC column at even intervals, and all the channel wires are run through the tube.
Each LED strip is run at 120ma, which is the maximum rated sink current for the TLC lighting chip. The power supply is a common 2A @ 12v / 5v switching supply, usually used for external hard drives. I currently don't do anything clever like disable cogs or lower the clock rate when the lamp is "off", though I plan to. Current use is 1920ma at full power (calculated, not measured), with a small amount of additional power for the brain.
It's a little brighter than a 100 watt light bulb, but only uses 24 watts at full brightness.
I have included full source, as well as the schematic and board layout for DipTrace, as well as a simple GIF of the schematic. The code is heavily commented and should be pretty easy to follow. Comments welcome on the code and schematic - particularly the latter, as this is one of my first "real" projects.
Pictures:
http://www.facebook.com/album.php?aid=344728&id=671403972&l=4320ebfe4f
Video:
http://www.youtube.com/watch?v=J8H9-FBXlFY
This was done using a Propeller chip to control a TLC5940 LED driver, and is one of my first "fully complete" projects.
The circuit was designed in DipTrace. The PCB was cut with my CNC machine using isolation routing paths output from DipTrace. As coded, it can be controlled using the volume and channel buttons on any Sony TV remote.
The LED driver is written in PASM using BrillDea's SPIN driver as a starting point. The driver is unique in that it's the first I've seen in PASM, and it properly handshakes between the cog running the PWM clock and the cog doing data transmission. This avoids the single frame flicker that happens if you latch in new data during the PWM cycle. I haven't timed it, but the GS cog should run roughly 1500fps & 80MHz (4096 ticks, 3 instructions each), and the data update cog about 10x faster (~10 instructions per bit, 192 bits).
The Sony Remote code is Jon McPhalen's SIRCS object.
For physical construction, the shade is made of a 4' x 2' sheet of thin HDPE, the ends are garbage cans from Target, the central column is 1" PVC from Home Depot, and the "caps" are custom routed 1/2" UHMW plastic.
The LEDs are 16 foot-long sections of a 16 foot 12v LED strip, purchased from Amazon. The LEDs are spiral-wrapped around the PVC column at even intervals, and all the channel wires are run through the tube.
Each LED strip is run at 120ma, which is the maximum rated sink current for the TLC lighting chip. The power supply is a common 2A @ 12v / 5v switching supply, usually used for external hard drives. I currently don't do anything clever like disable cogs or lower the clock rate when the lamp is "off", though I plan to. Current use is 1920ma at full power (calculated, not measured), with a small amount of additional power for the brain.
It's a little brighter than a 100 watt light bulb, but only uses 24 watts at full brightness.
I have included full source, as well as the schematic and board layout for DipTrace, as well as a simple GIF of the schematic. The code is heavily commented and should be pretty easy to follow. Comments welcome on the code and schematic - particularly the latter, as this is one of my first "real" projects.
Pictures:
http://www.facebook.com/album.php?aid=344728&id=671403972&l=4320ebfe4f
Video:
http://www.youtube.com/watch?v=J8H9-FBXlFY
Comments
The TLC5940 driver is there (although I wrote mine in PASM, it didn't need to be - it was just a good exercise), as is the SIRCS (Sony Remote Code) handler. The rest of it was just the glue that made the lights change in interesting ways. The physical construction of it took me several days, but the coding only took about an hour or two.
Do you have an auto/show-off mode?
Are you using a switching supply or a linear?
(As seen on Hack-a-day, too!)
There isn't a "show off" mode, but it'd be pretty trivial to add a demo mode. I actually want to add a "sparkle" mode that keeps the overall brightness value chosen, but twinkles the lights a little, almost like a string of Christmas lights. There are lots of possibilities.
I also wrote all the code to be heavily configurable with consts, so if I decide I want to add more channels, increase/reduce the staggering between channels, add new fade modes, change the overall speed of brightness adjustment, etc, it's almost all done with just a few consts in the main file. I've amended the original post to include the board, schematic, a close up of the finished board, and all source.
I really like the remote control part of the project
Very nicely done