ESP32 and ARC - Arduino and PCA 9685

EzAng

USA

ESP32 and PCA 9685 -  using 3 servos for now - can add up to 16 servos on one PCA 9685 module - can connect many PCA 9685 together for100s of servos  :-)

I modified some code I found

Can display the 3 motors results on the ARC serial monitor

By — Last update

ARC Pro

Upgrade to ARC Pro

ARC Pro is your passport to a world of endless possibilities in robot programming, waiting for you to explore.

Portugal
#1  

Nice! I see you are using I2C to connect esp32 to the PCA. How do you connect to ARC? Can you control the servos from ARC?

PRO
USA
#2  

I only tried the the ARC serial monitor to see the serial output for the 3 servos

I will test

PRO
USA
#4   — Edited

proteusy,

here it is with the Arduino with the PCA9685 - to control each servo individually

Downloaded Mickeys andDJ's firmware  from here https://synthiam.com/Support/Hardware/Adafruit-16-Servo-Shield

I modified their code, added:  Adafruit_PWMServoDriver pca9685 = Adafruit_PWMServoDriver(0x40);

for one PCA9685, if you want 2 PCA9685 just change the hex to (0x41) or  3 PCA9685 (0x42) and on and on...

in setup I added:

// Initialize PCA9685 pca9685.begin();

// Set PWM Frequency to 50Hz pca9685.setPWMFreq(50);

If your Arduino does not have a SDA or SCL

use:

Analog 4 -> SDA Analog 5 -> SCL

GND to GND

VCC to 5v from Laptop computer

make sure you add a separate power supply - 5 - 7.5 V  to the PCA9685 for the servos

ARC connect Arduino at 57600 baud n settings

easy connection

works very good

EzAng

Portugal
#5  

Thanks EzAng, will need this for my next project.

#6  

Can you pls help? I'm using Arduino UNO and PCA9685, changed the code and attached the cables as you said.  I'm new to this ARC software so can you pls. tell me on which port we have to use servo like D0, D1 or any other?

User-inserted image

PRO
USA
#7   — Edited

pra_nav,

just tested it again , works well

separate 5 to 7.5 v power supply, I use into the PCA 9685

Arduino 5v - GND -  from laptop - make sure the you use 57600 (in settings) when you connect to the Arduino from ARC

try all  D0 to D15

2 pics

User-inserted image

User-inserted image

PRO
USA
#8   — Edited

Almost forgot about the PCA 9685

Used it tonight with the Arduino code and the PCA 9685 and connected to ARC com5 -

PRO
USA
#9   — Edited

I got the Arduino, PCA9685, working with ARC and voice commands, my PC answering back, right, left, up, down moving the servos,

Nothing would move until I added a separate 5 to 7.5 v power supply, I use into the PCA 9685