I will remplace an old light by an arduino controlled LED tape (12V @ about 1.5 or 2A max), directly connected to the main power with a AC/DC adapter. So when I push the switch on the wall, the AC/DC adapter is alimented and the LED goes ON, when I push again the switch, the power is cut and the light goes off. No problem for this.
BUT, I want to do the following: make the light going off gradually (in about 2 secs), and close a kind of small shutter with a very small servomotor (also a 2 seconds move). Of course all this will happen AFTER I cut the power, so I have to find a way to store enough power to do so, and after that shutdown the whole system to force the arduino to shutdown completely and restart from the setup() the next time I will push the switch.
From my research, I assume that 2 super capacitors should do the trick, but I am not very familiar with this kind of stuff and I am not exactly an electronic master.
What can I do?
first you must verify that they are dimmable. absolute must.
second, it might be easier to control the power source to dim them.
also adds a neat option.
on/off/on/off/on and they run at some dim level.
or each 'on' that occurs withing 1 second of the last off, is 10% dim from the last.
anything over 1 second off and they go off or full on, depending where the switch is after that 1 second timeout.
lastly, are you saying that the only power source comes from the power switch when the lights are turned on ?
and that there is no available power when they are turned off ?
still like the simple battery pack, charger and maybe a relay to remove all power from the arudino after the timeout.
for the motor, you mean make it stall? I think it is a bit reckless no?
I prefer properly command the servos after shutdown.
and yes, only one power source, the acdc adapter, and it will completely cut off when I shut the power.
btw I drew this:
the leds need to be feeded directly by the acdc output via a transistor controlled by the upper voltage divider, but for the other parts, what do you think?