Moodlight

Posted on December 8th, 2010

This is the mood light I made a couple of years ago and have been meaning to document. It’s one of my first electronics projects but I still think it came out nicely. It’s the big ball next to the Christmas lights.

The project is based on a 3W power RGB led which is controlled through the PWM channels on an AVR ATTiny2313.

The board was designed to be as small as possible to make sure that is would fit in any light I may want to fit it in. Most of the space is taken by an R2R network which is used to readout the value of a potentiometer. The potentiometer is part of the remote which is connected to the left side of the board. The right side of the board is connected to the power LED.

On the first picture the remote is located on the cabinet in between the Christmas lights and the moodlight. In this picture the remote is located on the left side of the desk. It features two switches and a potentiometer.

The first switch turns the light on or off. The second switch controls the mode of the moodlight which can either be automatic or manual. In the manual mode the potentiometer controls the current color where the color of the moodlight can be rotated around the hue spectrum. In the automatic mode the mood light will automatically rotate around the spectrum and it’s rotation speed is controlled by the potentiometer setting.
The pinout for SV1:

1. Power
2. RxD
3. TxD
4. Potentiometer
5. Mode switch
6. Ground

The pinout for SV2.

1. Power
2. Red
3. Green
4. Blue

For the resistors in the R2R network I used 100KOhm. For the RGB LED I used 80R for red and 50R for blue and green. The pot meter I used in the remote was 10K.

Since this was one of my first projects, the code was written entirely in ASM. My first couple of project where done in ASM since it is an easy way to get to know the controller and get comfortable with the development environment.

The debug interface present on SV1.2, SV1.3 is a UART command interface on 2400,8,1,N which was used to debug the process.

Here’s a picture of the bottom of the device.

The firmware is written in assembler since I wasn’t very familiar with the C / C++ tools jet. But it should still be pretty straight forward.

Moodlight Source