3W RGB mood lamp, a “mylonit” lamp from ikea. Powered from TNY245 based AC-DC converter. Next is Attiny13 based RGB driver, it not only can change colors, but has 3 modes and an automatic color and mode saving to eeprom memory – so after power up you always will see last seen mode and color.
1 – rgb smooth color changing
2 – constant color from stopped mode 1
3 – white color, max power
So, how the control is done, there is no button or enything… To change mode, simply turn it off for a short time, and the turn in back on. Mode changed. In other words, device is powered trough 1N1448 diode and a 220uF capacitor, so after power is off, it can work for about 2 seconds. On one of the pins there is a power-off circuit detection, 1N1448 diode and a 1K ohm resistor allow to rapidly detect power-off. And when it is detected, program starts to count 1 second, after that it check if power is back – if so, it change mode and save it to eeprom memory – if not… well, it drains rest of current from capacitor and program dies. RGB controlling is done by software PWM (attiny13 have only two hardware PWM’s). With 4.8MHz clock, 18.750 interrupts per second from Timer0 gives refreshing at 73.24 per second with 256 bit PWM resolution. I have used the 3W RGB POWER LED, current of each emitter is about 700mA, so in 3rd mode it drains up to 2.2A. Remember to choose proper current limiting resistors, and note that red emitters have the same current with lower voltage. Transistors are standard NPN’s, each one should have at least 1A current output. On how made converter , and choose transformer, see application note of TNY245 – transformer that i have used is from some charger, don’t know anything about it. You can try to use little 5V transformer from ATX power supply. Note that this 3W power led needs some cooling, so you must attach a small radiator and make sure is sufficient. Program written in bascom. Fusebits are: 4.8MHz clock NOT divided by 8, startup time 64ms, brown-out detector 1.8V.
DOWNLOAD – eagle 4.16r2 project files, schematic and pcb PDF’s, BAS source, HEX firmware.