Soft Latch Power Circuit with data control for arduino

Thread Starter


Joined Sep 10, 2022
I am making a battery powered LED light and it has buttons on it to change the colors. Right now I just remove the battery to turn it off but what I want to do is use the tactile buttons that I use for data input to the Arduino to also toggle power using a soft latch circuit. I can find many examples of how to make this circuit using a dedicated button. But what I want to do is click the button multiple times or hold a button down to turn on the device, then once its on I can use this very same button to control the color of the lights, then click multiple times or hold a button to turn off the device. I know this is possible because lots of electronic cigarettes/vapes work exactly like this. My vape runs on an 18650 battery, and you click the button 5 times and the device powers on, I then use the same button to use the device, then at any time if i quickly click 5 times it will turn back off. How do I accomplish this using an Arduino? I ordered these latching circuit boards but as far as I can tell Ill have to have a separate button dedicated to toggling power to use them. Any Ideas appreciated! Thanks.