Remote Controlled, dimmable LED Lamp - now with source

JasonDorieJasonDorie Posts: 1,929
edited April 2011 in Robotics Vote Up0Vote Down
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.


1024 x 1371 - 110K
1024 x 765 - 99K
1024 x 601 - 85K
1024 x 765 - 101K
1024 x 765 - 113K


  • 8 Comments sorted by Date Added Votes
  • DynamoBenDynamoBen Posts: 366
    edited March 2011 Vote Up0Vote Down
    Nice project, well done! Any chance you will be posting code?
  • JasonDorieJasonDorie Posts: 1,929
    edited March 2011 Vote Up0Vote Down
    I'm probably going to (haven't quite decided yet), but there's really not that much in the code that isn't already in the obex.

    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.
  • DynamoBenDynamoBen Posts: 366
    edited March 2011 Vote Up0Vote Down
    I think the ASM version of the TLC5940 driver is of greatest interest to at least me.
  • PJAllenPJAllen Banned Posts: 5,065
    edited March 2011 Vote Up0Vote Down
    How does it stand up so well? Weighted base?

    Do you have an auto/show-off mode?

    Are you using a switching supply or a linear?

    (As seen on Hack-a-day, too!)
  • JasonDorieJasonDorie Posts: 1,929
    edited March 2011 Vote Up0Vote Down
    @PJ - The power supply is a switching 2A 12V/5V, commonly used to power external USB hard drives. The lower of the two trash cans is weighed down, and the lower "end cap" for the lighting tube has an indent cut in the lower edge that's a snug fit. I've added a pic to show a little more detail on the end cap and the fit with the base.

    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.
  • PublisonPublison Posts: 9,884
    edited April 2011 Vote Up0Vote Down
    Very nice Jason!
    Infernal Machine
  • sam_sam_samsam_sam_sam Posts: 2,144
    edited April 2011 Vote Up0Vote Down
    Very COOL Project

    I really like the remote control part of the project
    Very nicely done
    Now wanting to learn Spin Thanks for any idea that you may have and all of your time finding them
Sign In or Register to comment.