I've solved the battery power supply issue for my Arduino project by simply connecting a USB powerbank. However, I just realised that I can't come up with a good way to add an on/off button! There doesn't seem to be a way to turn the Arduino off using software. My second solution would be to cut up the USB cable (or an extension chord) and solder a switch onto the 5V wire.

Is there a more convenient solution that I'm missing?

closed as off-topic by gre_gor, VE7JRO, Greenonline, sempaiscuba, per1234 Aug 15 '18 at 0:46

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "This question does not appear to be about Arduino, within the scope defined in the help center." – gre_gor, VE7JRO, Greenonline, sempaiscuba, per1234
If this question can be reworded to fit the rules in the help center, please edit the question.


You could put the microcontroller into sleep-mode. Then use a button (connected to one of the interrupt pins) to wake it up.

But depending on what Arduino board you are using, and what other sensors etc you've connected to the board, this might not save that much current. For example on the UNO board the usb-to-serial converter is always on, so while your MCU is sleeping and trying to save power, the usb-to-serial continues to draw current.

But adding a switch to a usb-cable would be a lot simpler.

PS doesn't the powerbank have an on-off switch?

Not the answer you're looking for? Browse other questions tagged or ask your own question.