I'm currently making a simple obstacle avoidance robot and I've ran into an obstacle myself. Firstly, I prototype my robot using a breadboard which was powered by usb for the whole robot. Both servos and the parallax ping sensor were working accordingly. However, when I transferred the circuit over to a PCB the robot began spazzing out(the robot now was running on a single 9v). For example, both servos would work sometimes while the sensor would work occasionally(Servos I'm using are hs-55 micro servos) I then proceeded to try just powering the bot via usb- same issue but only worse. Finally, I plugged in both usb and a 9v and voila! everything was working! Thus, it leads me to believe that my bot was under powered. However, the fact that it was working fine on the breadboard really bugs me... why wasn't 5v enough on the PCB? Amperage perhaps? Wiring gone wrong? It should be noted that I'm also a extreme newbie in electronics.
If it is indeed under powered, perhaps I should grab a couple of these:
But what do you suppose happen with the breadboard situation? It was being powered fine with 5v.. but when transferred to the pcb it wouldnt even operate using usb/9v.
rhodium:
But what do you suppose happen with the breadboard situation? It was being powered fine with 5v.. but when transferred to the pcb it wouldnt even operate using usb/9v.
If the Vin is greater than 6.6V the USB power is disconnected. If you connect 9V the USB power won't be used.
I'd suggest using 4 AA batteries to power the servos, and a 9 volt battery to power the Arduino and sensors. This has the added bonus of keeping some of the motor noise out of the Arduino's power rail. Connect the negative of the battery pack to the Arduino's ground. The positive of the battery pack should only connect to the power lead of the servos.
You may want a battery pack with a switch on it. Better yet, use a double pole switch connected to the negative connection of both power sources.
Keep in mind that 4 regular AA batteries provide 6VDC. Typical rechargeable batteries are 1.2V for a total of 4.8VDC. Most servos can handle either voltage, but check your specs.