As I had luckily a MSP430 Launchpad and a custom MSP430 Breakout board laying around i thought I should give this one a Try. With the help of the Internet I created a really simple program.
- Initialize all GPIOs as INPUT_PULLUP to conserve energy
- Initialize 3 GPIOs as Outputs to control LEDs (I added additional 2 for Debug Purposes
- Attach Interrupt to One Input if the Voltage is pulled down.
- Start Loop
- Got to Sleep Mode 4 "LPM4;" (Further Reading: https://www.google.com/url?sa=t&rct=j&q=&esrc=s&source=web&cd=1&ved=2ahUKEwjn_NWFhbzgAhUMK1AKHT7rBsgQFjAAegQICRAC&url=http%3A%2F%2Fwww.ti.com%2Flit%2Fml%2Fslap124%2Fslap124.pdf&usg=AOvVaw021zLcgHdu-w02dCyaSlAe)
- If a falling etch is detected, wake up and continue main loop.
- If the Output is High, set it Low, if it is Low, set it High. (Toggle 3 Outputs with delays)
- Continue Loop
Its a really small programm. I added it to the project.
Here is a quick schematic (I added some circles on the attachement points to the lamp):
This circuit has a sleep current of ~ 4.5µA. (So i get hypothetically >60 years of Battery life. Since it is really likely, that the lamp might be on > 60h in the next 60 Years, it is a ok tradeoff (don't take the self discharge in account). The µC is capable of sleeping at ~ 0,5µA but the voltage regulator has a 3,3µA Quiscent Supply Current.
Here you can find a proof of concept (150x Speed):