This guide will teach you how to control up to 992 5V Servos through the GPIO pins on your Raspberry Pi! But more practically, without stacking multiple HATS (Hardware Attached on Top), this guide will teach exactly how to control sixteen 5V servos using a single Raspberry Pi single-board computer. This is all possible via the Adafruit Servo HAT which will act as a PWM expander, taking up only 2 GPIO pins and communicating through I2C.
The setup created in this guide will be able to send out 16 unique PWM signals. PWM signals are great for servos (both standard and continuous) and can be used for a myriad of other purposes (like LED light control, motor speed, and even the heat output of a heater).
Hi Tim, I am wondering that instead of using Adafruit 16-Channel PWM / Servo HAT for Raspberry Pi - Mini Kit, can I use another servo driver which is the PCA9685 and go with the same of your code and method/process that you have made to control multiple servos?
Hey Tim, thank you heaps mate!!! And I have got one more question, can the servo run in parallel? I mean I’ve to run 4 servos at the same time to open and close my eyelid mechanism(blink or twinkle). If it can, could you please beat me a little bit about that. Sorry man, I am a beginner.
Absolutely! The PCA9685 chip that powers this HAT handles sending the PWM “target position” to the servos, and the Pi is free to go off and do something else (like tell the next servo to start moving). This all happens in the uS scale, so you’ll almost certainly be able to get things moving at the same time.
I am trying to use the servo hat but am stuck on installing python-smbus. I am getting an error that python-smbus has no installation candidate. Its a new Pi with all the latest so I am guessing python-smbus is not compatible?
A lot of things haven’t made it over to the new “Bullseye” Pi OS. I’d see if you can install the older “Buster” OS and see if you get a candidate there.
A pain I know, but it’s just the way software compatibility goes when a new version of something comes out.