PCA9685 Servo Controller

PCA9685 Servo Controller by Adafruit

Connection Type
USB
Number of servos
16
Audio Support
No
Camera Support
No

Do you want to make a cool Arduino robot with ARC? Maybe a hexapod walker or a piece of art with many moving parts. The PCA9685 servo breakout (also found in Adafruit's popular PWM/Servo pcb) that works with any Arduino that uses shields: Uno, Leo, Mega, or ADK. We recommend using the Uno because it is compact and, combined with this shield, provides a ton of I/O. However, there are several EZB firmwares on this page that you can use for your desired configuration.

The Arduino can be programmed with the EZB firmware for various capabilities when connected to ARC. The tutorial to program the EZB firmware can be found HERE.

Download Firmware Sourcecode


Tutorial

Now that you have the firmware, you can follow the tutorial to install it by clicking here.


ARC Pro

Upgrade to ARC Pro

Take control of your robot's destiny by subscribing to Synthiam ARC Pro, and watch it evolve into a versatile and responsive machine.

#1   — Edited

Hi just wanted to know if there was any support for using this servo controller with raspberry pi and an Arduino

PRO
Synthiam
#2  

Install ARC on a windows pc. Install the ezb firmware on this servo controller and connect to it. The instructions are above

PRO
USA
#3   — Edited

I don't have a Adafruit's popular PWM/Servo Breakout, sorry

I use the PCA9685 for many servos

2 for 14.79 https://www.amazon.com/pca9685/s?k=pca9685

#4   — Edited

Ive been trying to use this with uno and adafruit break out board. Will not work at all in ARC, no issues with running all ports in arduino.ide and IC2... I have done the above suggestions with no avail. I must be overlooking something? But with almost 9 hours into it, cannot find a solution.

Trying to bring an old Manoi PF01 back to life, cannot use the KRS skill as the uno reports as not compatible. While I'm here, anyone been able to use ARC to talk with the Kondo RCB-3HV controller?

May have to wait and nab one of ez-robot controllers and hope for the best. Thanks in advance for any help offered. - Tom

  • I'll pick up some and try again, thank you EzAng :), along with a sub to ARC. - Edit, the adafruit breakout is the same chip, and pin out.
PRO
USA
#5  

I am using an Arduino uno with a PCA9685 for 8 servos in this video.

Make sure you use a separate power (5 V to 7.4 V) for the PCA9685

I am also using the Auto position, speech recognition, some scripts and the audio toolbox plug-in for the Mark voice you hear.

I Works best with a IOTiny, Wi-Fi https://youtu.be/CFk0pAUx_gw

PRO
Synthiam
#6  

I don't think you need an ezrobot controller for this. From what I understand how it works, you need an Arduino.

What stage are you stuck at?

  1. Program the arduino with the source above (Mickeys firmware)

  2. Connect ARC to the arduino

  3. Move servos (I'm guessing they're going to be D0-D15?)

#7   — Edited

Hey DJ,

I've programmed my UNO with Mickeys firmware, and a PCS9685 (adafruit). Connecting to ARC is no issue, it see's my board, I can do other functions with it, just not operate any servos. Yes, I've addressed them as D0-D15, then just focused on getting only one port to communicate, addressing differently, trying other hobby servos, others codes and suggestions, nada.

Tried with the KONDO skill, errors for "Hardware UART TX/RX with DMA buffer and adjustable baud rate - not supported on EZB device"

So scratched using that skill and tried many obvious things to troubleshoot why I cant control, or possibly better explain, why I cant access the breakout board over I2C with ARC on 2 different boards using PWM. When I reflash the UNO's with stock firmware and run the adafruit lib in IDE, all servos (KRC-4024) function with all boards.

I'm left to believe the problem is between ARC/ UNO and breakout, (even though ARC sees it too), getting nothing on the scope on the I2C ports while using ARC... I've tried assigning ports to the board which work, then to the breakout, tried another UNO and still can't get them to talk. 2 Different UNO's and 2 adafruit breakouts. Totally could be something I've missed...

The reason for shifting towards EZRobot controller was size and built in modes of communication, AI Etc. Really wanting to use auto gait, etc instead of coding movements for weeks. I will say I've used ARC with UNO's before but with wheel/tracked/arm builds without issue, using no expansion/breakout boards.

Sorry for the delay, work has been keeping me busy. And do appreciate you reaching out, love what you are doing and bring the live hacks back, pro subscription coming. -Tom

PRO
USA
#8   — Edited

Hi Tom,

With my Arduino I also had no servo movements action UNTIL I added a separate power supply to the PCA9685 - 5v to 7.4v will do

Maybe you are doing this, but you did not state this above.

#9  

Hey EzAng,

Yes they are on their dedicated power supply. When flashed with stock Arduino firmware and adafruit lib, all servos work 100%. Not changing anything but to the ARC firmware, etc. Zero functionality with any servo functions...

PRO
USA
#10   — Edited

You downloaded https://synthiam.com/Support/Hardware/16-Servo-Shield

and

Quote:

Zero functionality with any servo functions?

did you connect on a com port?

the BAUD_RATE. - 57600

in ARC baud rate is 57600

User-inserted image

User-inserted image

#11  

Yup, tested too many times to count. Precisely modified as you posted. No servo Control W/ ARC/No I2C activity... Works 100% of the time manually in arduino.ide! May shelf this project until I can source a different controller. Appreciate all the ideas though! - Tom

#12  

I am having the same issues servos not working in ARC

PRO
USA
#13   — Edited

Hi Tom,

I went through the steps that used to stop ARC for me:

1 - the wrong baud rate, need 57600 in ARC for the Arduino 2- missing a separate 5v or 6v power supply for the PCA9685

The last thing that usually stops ARC for me was my Anti-Virus program I was using.  You can add it to your Anti-Virus program or just shut it off and check to see if that is the problem.

That is all I can come up with at this time, sorry.

#14   — Edited

Comment removed

PRO
USA
#16   — Edited

I just tried DJ code above, using the PCA9685 with 8 servos, a Arduino uno for this test, also works well

#17   — Edited

DJ that was the code EzAng said was needed in Post #10 of his. That is why I said what I said in my post.  Anyway I loaded your new firmware and the above video shows you how well it works.  Note I did test that all this hardware works using the Adafruit PWM servo script and it worked great.

Also ARC is the latest version and is connected to the UNO at 57600 baud as stated above.

#19  

A4-5 are SCL and SDA on the Arduino

#20  

DJ, tried the .zip you posted earlier, still no servo control. All is wired and assigned correctly. Hardware is 100% functional outside of ARC. Inside of ARC, nothing.

Smiller29, Also tried your way with no results. I have mine connected to the dedicated pins, R3 has them closest to the reset button, and labeled on the bottom of the board, with SCL closest to switch and SDA the next one over, beside AREF. I get the same as your video regardless which boards or breakouts used.

As I've said before, used ARC for other projects that DID NOT require an expansion board and all work, so still focusing on ARC-UNO-Breakout communication failure, as my exact set up works outside of ARC... Hours looking through code, etc and can't find the smoking gun here. Good luck, and I'll be following updates.

PRO
USA
#21   — Edited

comment removed.

#22  

Using the other pins has no impact on making it work.  This is a code issue.

PRO
USA
#23   — Edited

Like I said:

I tried DJ's, Micky's code - it works

I modified their code, it all compiles and uploads it also works,

#24  

It maybe working for you but it is not working for Tom and I.   I know the hardware works when you take ARC and this code out of the picture.  I am using the latest 16 port board lib versions. Also the current IDE and the current ARC.  This is not a connection problem or Hardware problem.  This is a code issue somewhere.

PRO
USA
#25   — Edited

comment removed now

#26   — Edited

OK Guys I was able to get this to work for me after making changes to the firmware please try the attached file. I have put comments in the code around my changes.  DJ please review and test so you can update the package above..

EZ-Genuino_Uno_Adafruit_16_Servo_Shield-SMM.zip

PRO
USA
#27   — Edited

comment removed

#28  

What did not work?  was there and issue with the zip?

PRO
USA
#29   — Edited

That's ok,

Micky's and DJ,s code work, and my modified file works well also

#30   — Edited

Comment removed as I don't like post large code scripts.

#31  

@ smiller29 - Solid work my friend, I am a amateur extra VE out of middle TN, will shoot you an email. Everything works on both breakouts. A++/ Knew I wasn't crazy!

@DJ - Thanks for posting the code up top. Proves the community based center this program has. Look forward to contributing as well. Have several projects to share soon, time allowing.

@EzAng - Thankful for your input too, seems its a specific issue, the more the community knows the better!

#32  

Question for the group how many PCA9685 can be chained together using this firmware and ARC?  The below is how you would do it writing code without ARC.

Chaining Drivers Multiple Drivers (up to 62) can be chained to control still more servos. With headers at both ends of the board, the wiring is as simple as connecting a 6-pin parallel cable from one board to the next. User-inserted image

Addressing the Boards Each board in the chain must be assigned a unique address. This is done with the address jumpers on the upper right edge of the board. The I2C base address for each board is 0x40. The binary address that you program with the address jumpers is added to the base I2C address.

User-inserted image

To program the address offset, use a drop of solder to bridge the corresponding address jumper for each binary '1' in the address. adafruit_products_2012_10_13_IMG_0692-1024.jpg Board 0: Address = 0x40 Offset = binary 00000 (no jumpers required) Board 1: Address = 0x41 Offset = binary 00001 (bridge A0 as in the photo above) Board 2: Address = 0x42 Offset = binary 00010 (bridge A1) Board 3: Address = 0x43 Offset = binary 00011 (bridge A0 & A1) Board 4: Address = 0x44 Offset = binary 00100 (bridge A2)

etc.

In your sketch, you'll need to declare a separate pobject for each board. Call begin on each object, and control each servo through the object it's attached to. For example:

#include <Wire.h>
#include <Adfruit_PWMSerrvoDriver.h>

Adafruit_PWMServoDriver pwm1 = Adafruit_PWMServoDriver(0x40);
Adafruit_PWMServoDriver pwm2 = Adafruit_PWMServoDriver(0x41);

void setup() {
  Serial.begin(9600);
  Serial.println("16 channel PWM test!");

  pwm1.begin();
  pwm1.setPWMFreq(1600);  // This is the maximum PWM frequency

  pwm2.begin();
  pwm2.setPWMFreq(1600);  // This is the maximum PWM frequency
}


PRO
USA
#33   — Edited

Great info on th this site https://learn.adafruit.com/16-channel-pwm-servo-driver?view=all

I read the connections on the PCA9685 module are duplicated on each end, making it easy to use multiple modules. By using right-angled DuPont male and female connectors you could daisy chain the modules. Just make sure to select a unique I2C address for each module.

Wow, 992 servo motors, like to see that project, lol

#34   — Edited

Thanks for your reply.  I just want to be clear if I I connect three of these boards together that ARC can address each boards ports.  Also what are the changes needed to the firmware to support more than one board?  Because looking at the firmware I don't see how this would work.

PRO
USA
#35   — Edited

on ARC, not sure, was using an Arduino.

I can test when I get back However, I would think it is one board on ARC

correct the firmware needs to be updated with each PCA 9685 you add

// Creat object to represent PCA9685 at default I2C address Adafruit_PWMServoDriver pca9685 = Adafruit_PWMServoDriver(0x40);

**(adding another PCA 9685 ) Adafruit_PWMServoDriver pca9685 = Adafruit_PWMServoDriver(0x41);

**(adding another PCA 9685 ) Adafruit_PWMServoDriver pca9685 = Adafruit_PWMServoDriver(0x42);

now you have 48 servos

and so on

PRO
Synthiam
#36   — Edited

I don't think you'd be able to do that very easily. You'd have to create a custom robot skill and extend the existing ezb protocol. The ezb protocol supports 25 servos - a legacy from the ezrobot days. There are two alternatives...

  1. Hard way. Have a robot skill servo driver, similar to Dynamixel, which uses a custom protocol that extends the servo count. Or use the servo Script: https://synthiam.com/Support/Skills/Scripting/Servo-Script?id=19068

  2. Easy way. Have 3 arduinos and 3 pca's. Connect each Arduino to a different physical port

If you decide to go the hard way, the servo Script can send a custom serial command for each servo and position. It isn't super difficult, but you'd have to make your own firmware.

#37  

DJ thank you for confirming the limitation. I thought this could not be done with this skill without a lot of changes.

PRO
Synthiam
#38  

the servo Script skill doesn't require any changes. Just send the servo id and position for each servo. Your arduino code merely has to listen on a loop to get the servo id and position

PRO
USA
#39  

Smiller29,

Here is a video for Linking Multiple PCA9685 servo Driver Boards

https://youtu.be/v1f_EDHV390

#40  

EzAng,   Thanks for posting this but I wanted a solution that works in ARC.