Using DC Servo Motors with ESP32 & Arduino—This guide covers everything you need to know to work with servo motors and includes the PCA9685 16-Channel PWM driver.
We’re back with an in-depth look at DC Servo Motors. While we have worked with servo motors many times, there are still many aspects that we haven’t covered. Up until today, that is!
We’ll see how a servo motor works and understand the difference between analog and digital servo motors. We’ll see how to select a servo motor and interpret its spec sheets. And, of course, we’ll control some servo motors using an Arduino Uno and an ESP32 board.
Then, we will look at the PCA9685, a 12-bit PWM (Pulse Width Modulation) controller that can drive up to 16 servo motors from a single I2C interface. You can even cascade these boards for additional servos if 16 isn't enough. This popular module is a great way to drive servo motors, but you need to understand a few of its idiosyncracies before you can use it correctly.
Finally, we will cover troubleshooting—what to do when your servo motor project doesn’t work. I’ll show you how to deal with several common servo motor problems.
Here is the Table of Contents for today's video:
00:00 - Introduction
01:55 - Understanding Servo Motors
14:22 - Servo Motors & Accessories
20:15 - Servo Motors with Microcontrollers - Arduino
26:50 - Servo Motors with Microcontrollers - ESP32
31:41 - ESP32 Libraries
34:20 - PCA9685 16-Channel PWM Driver
49:56 - Servo Motor Troubleshooting
55:31 - Conclusion
Working with servo motors can be fun and rewarding. It’s great to bring to life something that moves. Use this video and the guide at https://dronebotworkshop.com/servoguide, and you’ll be a servo wizard in no time!
I’m currently building a dual robot arm using servo motors for a unique robot project. I’ll be showing it to you soon, so be sure to subscribe so you get notified when it’s ready.
Until then, have fun with servo motors!
Bill
"Never trust a computer you can’t throw out a window." — Steve Wozniak
When I started robotics, I had no particular skills and I knew nothing about Arduino or what PWM meant. And it's thanks to video channels like yours that I acquired some skills. I can't thank you enough.
But thanks to my ignorance, I didn't ask myself some questions. For example, when I connected my first servo to an Arduino Nano, I used pin 2. It worked very well. Then I connected a second servo to pin 3, then 4, then 5, and so on. This continued up to pin 13. That made a total of 12 servos. I didn't worry about whether the pins were PWM, since I didn't know what was PWM.
Then I noticed that the servos weren't positioning themselves exactly at the right position for 0°, 90°, or 180°. So, I entered all the parameters for the servo.attach() function.
As I gained experience, I made quadrupeds with 8 DOF and 12 DOF. This was done with a simple Arduino Nano mounted on a shield. I used pins 2 to 13, which makes 12 pins. Exactly what is needed for a quadruped with 12 degrees of freedom.
When I realized what PWM was, I naturally asked myself questions, but without finding any answers. So, I figured that if my quadrupeds worked with 8 or 12 servos with a simple Nano, it's because the Servo library didn't use the PWM function on pins 3, 5, 6, 9, 10, and 11, but generated its own PWM on all the pins. I could be wrong, but then how to explain that it works?
You can see my videos with my quadrupeds on my channel.
Thanks to you again.