I will first say that im not good at this stuff, ill try my best to understand and im happy to learn, but please do might i might not know what you mean.
I'm trying to create a single push button to power on the arduino with a 5v input.
I would like it to work like so:
- Push the button once and it turns on the arduino, and stays on when you let go.
- Puch and hold the button for (3-5 seconds) and the arduino shuts off.
Now i did something like this with 5v relays but sadly they are to weak to hold the connection when you drop it or hit it softly, so im thinking i need to replace it with a transistor.
The idea here is that once you press the button it will apply voltage to the transistor and make a GND connection.
Once the arduino is powered on it will apply power to the D8 pin, allowing you to let go of the button while it remains on.
So at this point it powers itself, now hold the button for a few seconds and with the help of a bit of code i can detect that on D10, and that will stop power on D8.
Then when you let got of the button is shuts off.
The issue here is that last part, where it will only turn off when you let go of the button, i would like it to turn off recardless of you still holding the button.
Also i tried to build this and it spontaneously combusted, so im doing something wrong.
I appreciate every bit of help at this point because i don't really understand all this, and that makes googling it a bit hard, Thank you.