Reader small image

You're reading from  Practical Python Programming for IoT

Product typeBook
Published inNov 2020
Reading LevelIntermediate
PublisherPackt
ISBN-139781838982461
Edition1st Edition
Languages
Right arrow

Connecting a servo to your Raspberry Pi

Our first task for our servo example is to wire it up to a power source and our Raspberry Pi. A schematic representing this wiring is shown here:

Figure 10.2 – Servo wiring schematic

Let's get started wiring our servo using a breadboard, as shown:

Figure 10.3 – Servo breadboard layout

Before we step through the wiring procedure, first I want to briefly discuss the wire colors coming out of a servo. While servo wire colors are somewhat standard, they can vary between different manufacturers and servos. Use the following pointers when connecting your servo at steps 4, 5, and 6. If your servo has colored wires that I do not list in the following list, you will need to consult the datasheet for your servo. 

Common servo wire colors are as follows:

  • The brown or black wire connects to GND
  • The red wire connects to +5-volts
  • The orange, yellow, white, or blue wire is the signal/PWM input wire that connects to a GPIO pin...
lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
Practical Python Programming for IoT
Published in: Nov 2020Publisher: PacktISBN-13: 9781838982461