I’m learning how to use relays. I understand their basic function and have managed to build a few projects. But I came across an example that uses a relay or MOSFET to Auto Shutdown Arduino and I’m not sure if I’ve understood the circuit correctly.
When I built this project, the Arduino powers off as soon as I release the button!
THIS IS HOW I SEE IT: The relay (which is using NO) is initially LOW, meaning COM and NO are not connected and therefore the Vcc into Arduino’s 5V pin is not going to ground, so the circuit is open. When the button is pressed COM and NO are connected, which closes the circuit, so the Arduino powers up. Code in the Arduino immediately sets the relay signal HIGH which keeps COM and NO connected. After 5 seconds the relay signal is set LOW which opens the circuit again.
AUTO SHUTDOWN USING MOSFET OR RELAY
Arduino Auto Shutdown
- Have I understood the circuit correctly?
- Why would one use a relay instead of a MOSFET?
- I thought it was not advised to power Arduino via the 5V pin. Would this example work using the Vin pin instead?