Mood lamp is a LED RGB lamp that changes the color of light at random. There are a lot of mood lamps projects in the Internet and usually they use relatively "big" microcontrollers. I wanted to make a lamp based on simply ATTiny13 microcontroller.
The circuit of the device is very primitive and shown in the figure below:
Power RGB_LED is connected with the microcontroller through the field effect transistors. To change the brightness of used self-made three-channel PWM. I have used RGB LED with power 3 W. A power supply I have used phone charger with output voltage about 5.5 V. The PCB is designed for SMD components.
Control program for the microcontroller works as follows:
I have used AVRStudio 5.0 for writing and building the firmware. As result the firmware compiled in Debug mode has a size 1022 bytes, but the firmware compiled in Release mode has a size 1094 bytes and this version is unusable for AtTiny13 with 1K flash. Although I used default AVRStudio settings.
I have used the USBASP programmator with avrdude software for writing the firmware with commandline:
avrdude -c usbasp -pt13 -u -Ulfuse:w:0x7A:m -Uhfuse:w:0xFF:m -Uflash:w:moodlamp.hex:a
As a radiator for the LED I used the shell of the old large aluminum electrolytic capacitor:
I put the lamp in this case:
Then you can watch a video of the device:
On the links below you can download the circuit, PCB-layout, the source code and firmware.