The “not-ordinary bulb”, as title say, typical glass and metal bulb with electronic inside. Powered from miniature AC-DC converter – i have used that one from 230-5V USB chargers – it has enough power (about 500mA) for few RGB leds. Next is Attiny13 (SOIC8 package) 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, this is closed bulb with no button… 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 RGB SuperFlux LED’s, current of each one emitter is about 20mA, so in 3rd mode (with 5 leds) it drains up to 300mA. 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 100mA current output. DO NOT suggest AC-DC converter part of schematic, as it can be wrong – simply adapt your own 5V charger. Program written in bascom, pcb dimensions are 20mm x 45mm, it barely fits into the bulb thread, so take a look at converter transformer if it’s not too big.
DOWNLOAD – eagle 5.4.0 project files, schematic and pcb PDF’s, BAS source, HEX firmware.
[flashvideo file=”http://www.mm.pl/~kisiel-ket/diy.elektroda.eu.video.server/bulb.mp4″ image=”http://mdiy.pl/wp-content/uploads/video_images/bulb.jpg” /]