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/
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/
- steven_conaway
- Posts: 41
- Joined: Fri May 20, 2016 9:18 pm
Pi Motor HAT and Servos
I am wondering if I can control 2 servos with the extra PWM pins on the Motor HAT.
- adafruit_support_carter
- Posts: 29189
- Joined: Tue Nov 29, 2016 2:45 pm
Re: Pi Motor HAT and Servos
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
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
- steven_conaway
- Posts: 41
- Joined: Fri May 20, 2016 9:18 pm
Re: Pi Motor HAT and Servos
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?
- adafruit_support_carter
- Posts: 29189
- Joined: Tue Nov 29, 2016 2:45 pm
Re: Pi Motor HAT and Servos
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
https://github.com/adafruit/Adafruit_Python_PCA9685
- steven_conaway
- Posts: 41
- Joined: Fri May 20, 2016 9:18 pm
Re: Pi Motor HAT and Servos
Without a HAT, natively with the GPIOs?
- adafruit_support_carter
- Posts: 29189
- Joined: Tue Nov 29, 2016 2:45 pm
Re: Pi Motor HAT and Servos
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.
- steven_conaway
- Posts: 41
- Joined: Fri May 20, 2016 9:18 pm
Re: Pi Motor HAT and Servos
Ok. I will try. Will a level shifter work here?
- adafruit_support_carter
- Posts: 29189
- Joined: Tue Nov 29, 2016 2:45 pm
Re: Pi Motor HAT and Servos
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.
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/
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/