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.


21 thoughts on “Dimming AC Lights The Hard Way

    1. 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.

      1. 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.

    2. 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.

  1. “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

    1. 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

    2. 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.

  2. 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. :)

  3. “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 :)

    1. 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).

  4. 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. :)

  5. 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 :)

Leave a Reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.