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.
2 Answers 2
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.
-
Thanks for your reply. If Arduino is in sleep mode does the servo still work?Luigi Cerone– Luigi Cerone2016年08月25日 18:03:24 +00:00Commented Aug 25, 2016 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– Gerben2016年08月25日 18:16:45 +00:00Commented Aug 25, 2016 at 18:16
As Gerben said, you can buy a cable with a switch built in.