Aug252009

Dimlet

This is a project I built July 2009 for a friend's party. I'd been interested in 1) how to build a cheapish light dimmer circuit 2) controlling things from my iPod Touch 3) interactive engineering-art. So I set myself on this project. Two weeks and about 80 hours of work later, I had a solid working prototype (shown in the video).

How

I started by learning how to build a light dimming circuit. I knew triacs and solid state relays could be used to dim lights. Solid state relays are expensive so I took a look at a couple of existing light-dimmer designs that use triacs. This article by Andrew Kilpatrick was particularly helpful and will explain the theory of light dimming using triacs. Triacs, as well as most (maybe all) other AC light dimming methods, dim the lights by turning them on and off rapidly and in sync with the ac sine wave. I ordered the parts and set about making the AVR software that would control the TRIAC's timing.

The software on the microcontroller works like this: commands containing a light id and an intensity are received through the UART. Every time the AC voltage goes to zero (a zero-crossing), the light items are sorted by intensity, all lights that don't have an intensity of 100% are turned off, then an output compare interrupt is set for the time the next light needs to be turned on. When the output compare interrupt happens, the light specified in the top item in the array of lights is turned on, then another output compare interrupt is set up for the next light that needs to be turned on. A couple designs I saw used an interrupt that happened 256 times every AC cycle; while this certainly works, I wanted only to use output compare interrupts so that, the handler code only runs when a light is about to be turned off.

The router is a Fonera 2100 that has been updated to run a more plain version of OpenWRT Linux instead of the original FON firmware. I used the serial interface to do update the Fonera's firmware. The software on the Fonera was fairly simple: it receives commands light intensity commands via UDP and then forwards those out the UART to the AVR. To compile programs for the Fonera, I set up the OpenWRT buildroot in a VirtualBox virtual machine as per these instructions.

I learned some legit ObjectiveC iPhone/iPod programming using the Apple SDK for this project. ObjectiveC is a superset of C/C++ so it is still possible to program in C/C++ for the iPhone/iPod. For the UDP code, I used standard Unix function calls in C and the rest I wrote in ObjectiveC.

Resources Download (.zip):

  • AVR Source Code
  • Light Dimmer Schematic
  • Fonera Source Code
  • iPhone Source Code

Thanks / Acknowledgements:

Write a comment


Showing comments 1 to 10 of 31 | Next | Last
Comment Wikipedia YouTube on : Wed July 21, 2010, 07:00:03
That Txy can be awe inspiring.

http://en.wikipedia.org/wiki/Youtube - Wikipedia YouTube

<a href="http://en.wikipedia.org/wiki/Youtube">Wikipedia YouTube</a>
Comment xa53d25 on : Tue July 20, 2010, 21:27:42
<a href="http://160b87.com">77d7ea</a> | [url=http://82b5fc.com]256b39[/url] | [link=http://920d9f.com]0d2bf7[/link] | http://d892f9.com | 448f05 | [http://03ab18.com 8fba03]
Comment xa53d25 on : Tue July 20, 2010, 21:27:35
<a href="http://160b87.com">77d7ea</a> | [url=http://82b5fc.com]256b39[/url] | [link=http://920d9f.com]0d2bf7[/link] | http://d892f9.com | 448f05 | [http://03ab18.com 8fba03]
Comment authentic louis vuitton on : Sun July 18, 2010, 04:43:48
Hi, I love your blog. This is a cool site and I wanted to post a note to let you know, good job!
Thanks,
Meme

<a href=http://www.luxurygiftsbags.com>louis vitton bag</a>
<a href="http://www.luxurygiftsbags.com">louie vuitton</a>
Comment you tube on : Mon July 12, 2010, 04:31:11
Super interesting article. Honestly!

<a href="http://youtubeabbreviation.blogspot.com" title="You Tube Movies">You Tube Movies</a>
Comment Ciali13yti on : Sun July 04, 2010, 20:47:41
http://www.livescribe.com/forums/member.php?u=8058&ul23=4 [url=http://www.livescribe.com/forums/member.php?u=8053&ul23=4]buy hydrocodone[/url] <a href="http://www.livescribe.com/forums/member.php?u=8054&ul23=4">fioricet</a> <a href=http://www.livescribe.com/forums/member.php?u=8056&ul23=4>tramadol</a> [url="http://www.livescribe.com/forums/member.php?u=8055&ul23=4"]diazepam online[/url] [LINK http://www.livescribe.com/forums/member.php?u=8060&ul23=4]generic cialis[/LINK] lgib
Comment Ciagra35wsj on : Sun July 04, 2010, 11:48:26
http://www.livescribe.com/forums/member.php?u=8059&ul23=3 [url=http://www.livescribe.com/forums/member.php?u=8060&ul23=3]buy cialis online[/url] <a href="http://www.livescribe.com/forums/member.php?u=8054&ul23=3">fioricet</a> <a href=http://www.livescribe.com/forums/member.php?u=8055&ul23=3>buy diazepam</a> [url="http://www.livescribe.com/forums/member.php?u=8057&ul23=3"]viagra[/url] [LINK http://www.livescribe.com/forums/member.php?u=8056&ul23=3]buy tramadol[/LINK] tmov
Comment louis vuitton on : Fri July 02, 2010, 23:28:39
Greetings, I like your website. This is a great site and I wanted to post a comment to let you know, good job! Thanks Meia

<a href=http://www.luxurygiftsbags.com>Louis Vuitton</a>

<a href="http://www.luxurygiftsbags.com">louis vuitton outlet</a>
Comment louis vuitton on : Fri June 25, 2010, 04:17:39
Hello, I like your article. This is a good site and I wanted to post a note to let you know, great job! Thanks Meme

<a href=http://www.luxurygiftsbags.com>Louis Vuitton</a>

<a href="http://www.luxurygiftsbags.com">vuitton</a>
Comment xatxegxbkma on : Wed June 23, 2010, 07:51:09
sKbDzG <a href="http://dckbhznfkzuv.com/">dckbhznfkzuv</a>, [url=http://zjsnspwwcabe.com/]zjsnspwwcabe[/url], [link=http://ynzkhadqmcvq.com/]ynzkhadqmcvq[/link], http://ghkoiyhjusnz.com/
Showing comments 1 to 10 of 31 | Next | Last