Turn arduino on and off with switch

hi, how can I turn an arduino UNO on and off without using the USB cable? Using an on / off switch with a 9V battery can I?

Plug and unplug the cable? What kind of 9 volt battery? Not a PP3 I hope....
An On/Off switch between the power source and the Arduino would be the easiest and safest, most predictable way.

@facuaaa Is this the same question as https://forum.arduino.cc/t/on-off-switch/919597 ?

I believe so.

That's what on/off switches are for.

Don't make multiple threads about the same thing.

Hello, could you tell me how to use (connection and others) an on off switch with arduino? One like the switch on the image image|409x468

Connect the common (C) terminal to ground. Connect the normally open (NO) terminal to a digital input. Set the input's pinMode to INPUT_PULLUP. That enables the internal resistor so that the pin will not "float" when the switch is open. The pin will read HIGH when the switch is open and LOW when the switch is closed.

If you need more information a search for "arduino switch" will yield around 115 million hits.

Are you trying to read a switch input or toggle the Arduino on and off?

I am trying to turn the arduino on and off. I forgot to put that, sorry

I am trying to turn the arduino on and off. I forgot to put that, sorry...

What are you powering the Arduino with? USB? VIN?


Topics merged

Please do NOT cross post / duplicate as it wastes peoples time and efforts to have more than one post for a single topic.

Continued cross posting could result in a time out from the forum.

Could you also take a few moments to Learn How To Use The Forum.

Other general help and troubleshooting advice can be found here.
It will help you get the best out of the forum in the future.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.