Use the following diagram to connect a Servo Motor.
A couple of notes before you get started:
The provided diagram is just an example of how to connect the sensor. There are many ways to connect sensors and extensions, so try what works best for you! In this case we’ll be using a PCA9685 PWM controller to connect our Servo to the Pi. We’ll also be using an external 5v power supply to provide power to the Servo.
To add a PWM Output you will need a PWM controller. For this example we will use a PCA9685 PWM I/O Controller. This tutorial assumes you already have the PCA9685 connected. Refer to the PCA9685 Tutorial if you need assistance with that part.
Make sure Raspberry Pi is powered off when connecting wires.
When using a GPIO ribbon cable, make sure the power wire (it’s a different color than the others) is connected to the corner of your Raspberry Pi and the top of your Pi cobbler.
Some full-size breadboards (used in diagrams below) have a powerline that is separated in the middle. If this is the case, be sure your sensors are connected on the same half of the breadboard as your Pi Cobbler.
Step 1
Connect power from the external power source to the PCA9685. Also connect power from one of the output channels (V+) on the PCA9685 to the servo motor (red).
Step 2
Connect ground from the external power to the PCA9685. Also connect ground (GND) from the PCA9685 (GND) to the relay (black).
Step 3
Connect the control channel (PWM) from the PCA9685 to the relay (yellow).
Step 4
You’re done! You can now add the Servo Motor to your dashboard, controlling it through the PCA9685 (Channel 15 in our example).
You must be logged in to post a comment
About the Author