Shop OBEX P1 Docs P2 Docs Learn Events
Remote Controlled, dimmable LED Lamp - now with source — Parallax Forums

Remote Controlled, dimmable LED Lamp - now with source

JasonDorieJasonDorie Posts: 1,930
edited 2011-04-17 10:49 in Robotics
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
1024 x 1371 - 110K
1024 x 765 - 99K
1024 x 601 - 85K
1024 x 765 - 101K
1024 x 765 - 113K

Comments

  • DynamoBenDynamoBen Posts: 366
    edited 2011-03-30 20:35
    Nice project, well done! Any chance you will be posting code?
  • JasonDorieJasonDorie Posts: 1,930
    edited 2011-03-31 13:09
    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 2011-03-31 14:09
    I think the ASM version of the TLC5940 driver is of greatest interest to at least me.
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2011-03-31 16:52
    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,930
    edited 2011-03-31 22:36
    @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: 12,366
    edited 2011-04-01 11:23
    Very nice Jason!
  • sam_sam_samsam_sam_sam Posts: 2,286
    edited 2011-04-17 10:49
    Very COOL Project

    I really like the remote control part of the project
    Very nicely done
Sign In or Register to comment.