By Kevin McAleer, 5 Minutes
Page last updated November 24, 2026

Ahoy there makers! In this course we’ll build a small robot arm called Buddy Jr and teach it to move with Python. Watch Kev’s video of the build first, then come back and let’s get going.
A Raspberry Pi can talk to servos directly, but it only has a couple of hardware PWM pins and they are shared with other jobs. A PCA9685 board fixes that. It is a 16-channel, 12-bit PWM driver that you talk to over I2C, using just two wires, and it makes the pulses for up to 16 servos on its own. Once you’ve told it what to do, the Pi is free to think about other things.
We’ll use one PCA9685 to drive the four servos of Buddy Jr: a base that turns, a shoulder, an elbow and a camera holder that tilts. Every lesson adds one step, and by the end you will have an arm that moves smoothly between named poses and runs a little routine on its own.
flowchart LR
Pi["Raspberry Pi<br/>(Python)"] -- "I2C: SDA + SCL" --> PCA["PCA9685<br/>16 x 12-bit PWM"]
PSU["5 V servo supply"] -- "V+ and GND" --> PCA
PCA -- "ch 0" --> Base["Base servo"]
PCA -- "ch 1" --> Shoulder["Shoulder servo"]
PCA -- "ch 2" --> Elbow["Elbow servo"]
PCA -- "ch 3" --> Camera["Camera holder servo"]
After completing this course, you will:
New to the pieces? These courses help, and are worth a look before or alongside this one:
Every program is complete. When a lesson says “save this as a file”, you can copy the whole listing, save it on the Pi and run it with python3. Short snippets that are only part of a program say so.
Maths on a computer first. The angle and pulse maths lives in small programs that run on any computer, so you can check your understanding before a servo ever moves.
Quizzes and exercises. Each lesson ends with a short quiz, a few exercises that rise in difficulty, and a Common Issues list. Check that list before you decide something is broken.
Power safely. The servos always get their own supply. We’ll explain why in lesson 4, and you’ll see it come up again in the troubleshooting lesson.
Teachers: this course suits learners from about 11 upwards who can use a keyboard and a terminal. Allow 45 to 60 minutes per lesson, with the printing and assembly (lessons 6 and 7) needing a few extra hours, mostly waiting on the 3D printer. One Pi, one PCA9685, four servos and a 5 V supply per pair is ideal, and the servo supply must be a proper 5 V adapter or battery pack, never the Pi’s pins. Lessons 3, 6 and 11 need no hardware at all, and the angle maths in lessons 4 and 8 runs on any computer, so a class can start before the kit arrives. Check your school’s rules on soldering and on 3D printer use before lessons 6 and 7.
Ready? Let’s start by getting a Raspberry Pi set up for the job.
Comments