Dimming AC lights the hard way

It’s that time of year again where the thermometer drops, the sun sets earlier, and we try to warm our hearts with the solstice festival that is common in our own respective cultures. Of course we all need a few strings of lights, but wouldn’t it be great if we had PWM controlled dimmable lights?

When he started out on his PWM-controlled, AC-powered light box, [Waterbury] immediately realized that relays were not going to be an optimal solution. The best way out of the mess he dug himself into would be via zero crossing. After getting a transformer wired up to a transistor for the detection circuit, a short bit of code was written in the wee hours of the morning and a proof of concept was had.

With the control box complete, [Waterbury] hacked up a quick VB app and piped the output of a WinAmp visualizer into the lights via serial. The Inception demo was great, but finer-grain control was needed. After seeing a Hack a Day post on a nice equalizer chip, the seven band output on IC were converted to UART.

[Waterbury] took his seven-band AC-controlled light box to a Halloween party with his synth and the results looked awesome. You can check that out after the break, but we’re really waiting to see his Christmas decorations this year.

Comments

  1. bearmos says:

    generally, decent AC SSR’s have zero cross detectors built in. . .what did i miss? I looked for a reference to the p\n of relay being used, but couldn’t find one from a quick skim of the pages. . .

    • compukidmike says:

      The zero cross detectors in those SSRs are so that they turn on the lights ONLY at a zero crossing, because turning on at other points in the AC cycle causes electrical noise. For dimming, you have to turn on the lights at different points in the AC cycle, which those SSRs prevent.

      • bearmos says:

        Thinking about this a little more. . . The problem with zero crossing relays is they turn on and off at zero crossings, so you’ll wind up with a potentially really long delay – distorting the duty cycle of your PWM signal.

        Turn on at the zero crossing is still desirable in all cases – to limit inrush, noise etc- but by implementing your own zero-cross, you’ll be able to have fine-grain control over the actual duty cycle – like this project requires.

        The problem with not using zero crossing is that you might not be getting the power you intend delivered to the lights…think about a 1mS ON signal centered around the zero crossing, now think about it starting at the zero crossing…big difference.

    • compukidmike says:

      Nice project. I still need to document my light controller setup, but I use a FOD814AS for zero crossing detection. It’s an optocoupler with AC input. For 120V, I use a 100K and 47K resistor in series with the optocoupler.

  2. Slurm McKenzie says:

    “inception demo” ? did i miss something. that’s the tron legacy soundtrack.

    also, i was wondering about reduced lifetime of the lights if he’s using non-led light bulbs. can’t be good for them

    • tedsmods says:

      Yeah, it is from Tron Legacy. It was my first music sync test, and I GUESS he could have been referring to the inception of the music sync, but I’m guessing he was just confused. :)

      Dimming of straight incandescent bulbs actually look and work quite well, and I don’t think it affects the life too much. CFLs are quite a different story though. The LED strings I’ve tested don’t look nearly as nice.

      I grabbed a halogen bulb at our lab the other night, and dimmed that. I don’t think the halogen liked my box, and I probably shortened the life in half, but it looked nice. :p

    • Taylor Alexander says:

      I was going to point that out too. Why did the author think it was Inception? Random guess?

      The TRON soundtrack is awesome and I’ve been listening to it a lot, so it was easy for me to pick out.

      Someone not familiar could use an app like Soundhound to pick out the song though, probably.

      • cyrozap says:

        At the end of the video the computer screen shows the track to be playing to be from the Tron Legacy soundtrack so there’s no ambiguity here. It looks like the author didn’t watch the video to the end ;)

  3. FridgeFreezer says:

    My car’s ECU plus 4 SSR’s = party

  4. HAD says:

    Not all SSRs are zero crossing, Some are instantaneous.

    Could the OP used DC lights instead? Or some kinda modified VFDs?

  5. abyssknight says:

    Waterbury set up this rig on the Christmas tree over at FamiLAB. Seriously, it is a sight to see. We’ll try to get a video of it after we flog him into watering the tree again. :)

  6. Whatnot says:

    “warm our hearts with the solstice festival that is common in our own respective cultures”

    Hey now, I’m atheist and so are a large part of the population, RESPECT US and our lack of festivals.

    (just teasing about brian’s attempt to be neutral :)

    • sneakypoo says:

      Since when does atheists have a problem with the winter/summer solstice? It’s not a religious celebration (well, it CAN be, but more often it’s celebrated as the coming of brighter days and such).

  7. DrAltaica says:

    Isn’t current 90degrees behind voltage?

  8. Waterbury says:

    Woot, I mad HaD! :)

    Before the trolls come in, I do know I re-invented the wheel. There is a huge computer-controlled Christmas light community on the web, and I could have copied another design, but at the time I found problems in all of them. i.e., While one did dimming, it did not support this software, etc..and I wanted to learn how to build a system from the ground up.

    As far as I know, there are hardware based chips for light dimming, but obviously I did not go with them. I could have used a different Micro, but I knew PICs at the time and wanted precision control, and assembly wasn’t TOO daunting for the scope of this project. I could have used DMX512, but it was overkill at the time.

    What’s cool is I could reproduce the box for about $40, all parts including case and wiring included, and I have a platform I could improve from the ground up. :)

  9. Waterbury says:

    BTW, hackerspace plug. If you are in Central Florida, and are a builder, stop by our space! We’re 10x bigger, and we are looking for new members to help our growth, and help make us more awesome. :)

  10. Ian says:

    The creator, Waterbury, is a member at Orlando’s Hackerspace – FamiLAB (www.familab.org)

    I shot some video of the setup one night while he was working on it – http://www.youtube.com/watch?v=qfAumHTWa6Q – while others were playing with DJ equipment. I was trying out my cineskates, so the video is about motion, not documenting his system…

    Yes, dimming lights can be been done with DC parts like LEDs, but with his setup, you can to take it into a room and have it control existing lamps along with someone’s normal holiday lights… with the ability to control it via your phone, it works really well for taking to (geeky) parties :)

  11. deathventure says:

    Snubberless triac with optoisolated triggering works well too.

  12. Vext says:

    Here is a well done AC controller generally used for Christmas lights using similar methods.

    http://www.doityourselfchristmas.com/wiki/index.php?title=Renard

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 96,434 other followers