Pi Motor HAT and Servos

Moderators: adafruit_support_bill, adafruit

Forum rules
Talk about Adafruit Raspberry Pi® accessories! Please do not ask for Linux support, this is for Adafruit products only! For Raspberry Pi help please visit: http://www.raspberrypi.org/phpBB3/
Locked
User avatar
steven_conaway
 
Posts: 41
Joined: Fri May 20, 2016 9:18 pm

Pi Motor HAT and Servos

Post by steven_conaway »

I am wondering if I can control 2 servos with the extra PWM pins on the Motor HAT.

User avatar
adafruit_support_carter
 
Posts: 29189
Joined: Tue Nov 29, 2016 2:45 pm

Re: Pi Motor HAT and Servos

Post by adafruit_support_carter »

You could, but the PCA9685 can only run at one frequency. You'd have to set that to be 50-60Hz for hobby servos.

Assuming you're asking as you already have one? Just so you know, there's a dedicated servo HAT:
https://www.adafruit.com/product/2327
and even a basic breakout:
https://www.adafruit.com/product/815

User avatar
steven_conaway
 
Posts: 41
Joined: Fri May 20, 2016 9:18 pm

Re: Pi Motor HAT and Servos

Post by steven_conaway »

I was aware of the HAT and breakout, but would have liked to use what I already have. Also, do you recommend any specific way to control servos with a Pi?

User avatar
adafruit_support_carter
 
Posts: 29189
Joined: Tue Nov 29, 2016 2:45 pm

Re: Pi Motor HAT and Servos

Post by adafruit_support_carter »

I'd try the Python library for the PCA9685 and just realize there's only two usable channels:
https://github.com/adafruit/Adafruit_Python_PCA9685

User avatar
steven_conaway
 
Posts: 41
Joined: Fri May 20, 2016 9:18 pm

Re: Pi Motor HAT and Servos

Post by steven_conaway »

Without a HAT, natively with the GPIOs?

User avatar
adafruit_support_carter
 
Posts: 29189
Joined: Tue Nov 29, 2016 2:45 pm

Re: Pi Motor HAT and Servos

Post by adafruit_support_carter »

Oh. Wouldn't suggest doing it. But if you must, you could try the software PWM provided by some of the general purpose libraries like wiringpi or RPi.GPIO. But also realize the Pi is 3.3V and most servos want to see 5V.

User avatar
steven_conaway
 
Posts: 41
Joined: Fri May 20, 2016 9:18 pm

Re: Pi Motor HAT and Servos

Post by steven_conaway »

Ok. I will try. Will a level shifter work here?

User avatar
adafruit_support_carter
 
Posts: 29189
Joined: Tue Nov 29, 2016 2:45 pm

Re: Pi Motor HAT and Servos

Post by adafruit_support_carter »

It could, but also sometimes you can get away with a 3.3V signal. You could start with that then add it in if you aren't getting the performance / reliability you're looking for.

Locked
Forum rules
Talk about Adafruit Raspberry Pi® accessories! Please do not ask for Linux support, this is for Adafruit products only! For Raspberry Pi help please visit: http://www.raspberrypi.org/phpBB3/

Return to “Adafruit Raspberry Pi® accessories”