Arduino Stack Exchange is a question and answer site for developers of open-source hardware and software that is compatible with Arduino. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've an Arduino Nano to which a Micro Servo 9g is connected. The Arduino board and consequently the servo are powered by a USB powerbank connected to the board with a USB mini cable.

My question is: Is there a way to insert a power switch so I can turn on/off the board without plug/unplug the USB (that now is the way I use) ? I was thinking to cut the USB cable and work with the positive of it but if someone has an alternative or any tips I'd really appreciate it. Thanks!

EDIT: If is needed I could make a wiring diagram.

share|improve this question
up vote 1 down vote accepted

Cutting a usb wire would be the easiest. Otherwise you'd have to cut traces in the pcb and attach wires. Not recommend for beginners. You can actually buy usb cable with a switch.

Another alternative would be to put the microcontroler in sleep mode and have it use very little power.

share|improve this answer
    
Thanks for your reply. If Arduino is in sleep mode does the servo still work? – Luigi Cerone Aug 25 '16 at 18:03
    
I think that if you deattach the servo in software it doesn't use that much power. Otherwise you'd have to connect power to the servo using a transistor, so you can power it down during sleep. – Gerben Aug 25 '16 at 18:16

As Gerben said, you can buy a cable with a switch built in.

Usb cable with switch

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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