Earlier this week my Raspberry Pi and Adafruit 16 Channel Servo Controller arrived and here's how I wired them up:
First you need to figure out your power sources. The RasPi, the servo controller and the servos can all run off of 5vdc. However servos can be very power hungry. I've measured standard servos pulling upwards of 300ma under load. That means if you had the full complement of 16 servos connected to a single controller you could be pulling upwards of (16x.300 =) 4.8 AMPS from the servo power supply. Also because they are motors, servos can induce interference into the power supply they are connected to. It is strongly suggested that you use a separate 5vdc power supply just for your servos. This is why the servo controller has a separate power connector (the blue one with two screw terminals) to power the servos. This connector doesn't power the servo controller, only the servos themselves.
You may be able to get by with running one servo off the RasPi's 5v line just for testing, but anything more than that and you could pop the fuse on the RasPi. I strongly suggest using a separate 5vdc power supply for the servos.
For this robot project we are going to have at least three servo controllers connected to one Raspberry Pi. In Adafruit's instructions they use the RasPi's 3.3v connection to power the servo controller. This is fine for connecting one servo controller, however multiple controllers could draw too much current from the RasPi. The datasheet for the PCA9685 chip shows the current draw for the controller itself is 10ma max. The RaspPi's 3.3vdc power supply only has about 50ma available, however the RasPi's 5vdc output has over 200ma available so I connected my controllers to the 5vdc connection on the RasPi's GPIO connector.
Here's the link for Adafruit's instructions for hooking up he servo controller:
- VCC is the supply voltage for the Controller (you can use the 3.3v or 5v line from the RasPi)
- V+ is the supply voltage for the Servos (you should NOT connect the RasPi to V+)
- GND is common between all three components (RasPi, Controller, Servo(s))
- Be VERY CAREFUL to plug your servo into the controller correctly with the BLACK wire to GND.
NEXT UP... Making the Raspberry Pi talk to the Servo Controller using i2C