0

PCA9685 PWM Servo Driver & RPi
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/
Please be positive and constructive with your questions and comments.

PCA9685 PWM Servo Driver & RPi

by ttu_don on Fri Dec 01, 2017 6:08 pm

I am using a Raspberry Pi 2 B & the PCA9685 Servo Driver board. Unfortunately, I wasn't paying attention I guess, & it's the Servo Driver board shield for an Arduino.

No problem, I thought. I will just use jumper wires between the boards instead of stacking them.

I still can't seem to get it working. I installed the Adafruit library fine. The RPi sees the I2C device attached. I have the servos powered from a separate 5V power supply. The simpletest.py code compiles & runs ok -- I see "Moving servo on channel 0, press Ctrl-C to quit..." in the terminal window. The servo just doesn't move.

Surely their isn't a compatibility issue with a RPi board & an Arduino shield...? I grabbed the schematics & fab prints & see no major issues. The only thing I can think of is the "Vcc select" pads on the shield... it shows 5V connected to Vcc. The datasheet for the PCA9685 shows it can handle 5V...

I'm stumped!

Any suggestions?

ttu_don
 
Posts: 12
Joined: Mon Mar 17, 2014 12:36 am

Re: PCA9685 PWM Servo Driver & RPi

by adafruit_support_bill on Fri Dec 01, 2017 6:28 pm

The PCA9685 can handle 5v, but the Pi cannot. Since i2c is a bi-directional bus, if you want to connect it to the Pi you should use 3.3v for VCC.

adafruit_support_bill
 
Posts: 67409
Joined: Sat Feb 07, 2009 10:11 am

Re: PCA9685 PWM Servo Driver & RPi

by ttu_don on Wed Dec 06, 2017 5:08 pm

Got it working!

I had to cut the track on the Vcc selection jumper to stop the 5V from going to the board Vcc. Then I soldered across the selection jumper to give the board 3.3V, which is what the I2C uses.

Now the simpletest.py works as expected.

Thanks!

ttu_don
 
Posts: 12
Joined: Mon Mar 17, 2014 12:36 am

Re: PCA9685 PWM Servo Driver & RPi

by adafruit_support_bill on Wed Dec 06, 2017 5:25 pm

Excellent! Thanks for the follow-up.

adafruit_support_bill
 
Posts: 67409
Joined: Sat Feb 07, 2009 10:11 am

Re: PCA9685 PWM Servo Driver & RPi

by ttu_don on Thu Dec 14, 2017 7:45 pm

Ok. I got the I2C board working, sort of. . .

I tried changing the simpletest.py program to see how the servo_min & servo_max effect the sweep of the servo.

I'm using a Tower Pro SG92R mini servo & powering the servo & I2C board from a separate 5V power supply.

Things work good when I use the given servo_min=150, servo_max=600. The servo sweeps thru ~90 degrees rotation & back again.

When I changed the min to 100, the servo freaks out. No matter what I change the min & max values to, the servo acts crazy -- it even turns completely around (it's a standard servo, not a continuous-rotation servo).

Suggestions? Comments?

ttu_don
 
Posts: 12
Joined: Mon Mar 17, 2014 12:36 am

Re: PCA9685 PWM Servo Driver & RPi

by adafruit_support_bill on Thu Dec 14, 2017 8:16 pm

Different servos respond differently when you reach the limits of their normal operating range. I've noticed that recent versions of the SG92R appear to behave more strangely compared to most analog servos. I suspect they are using some hybrid analog/digital control board.

adafruit_support_bill
 
Posts: 67409
Joined: Sat Feb 07, 2009 10:11 am

Please be positive and constructive with your questions and comments.