Switzerland
Asked
Resolved Resolved by Dave Schulpius!

ESP32 And A PCA9685 To Control 16 Servomotors With ARC

Good day, my problem is this: I want to build a robot myself. I already have the following servo control components: ESP32 and a PCA9685 to control 16 servomotors.

I have already installed the ESP32 DOIT Dev Kit v1 EZ-B and the firmware for Synthiam and a control with 1 servo via WIFI works.

how can I connect the PCA9685 to the ESP32 so that I can control all of my 16 servos? (probably via the UART connection RX / TX). How can I link and control the whole thing with ARC?

could someone please help me with the programming? Regards Plokber


Related Hardware Esp32 DevKit v1

ARC Pro

Upgrade to ARC Pro

Stay on the cutting edge of robotics with ARC Pro, guaranteeing that your robot is always ahead of the game.

PRO
USA
#1   — Edited

I used ARC with the ESP32 or Arduino and the the PCA9685

https://synthiam.com/Community/Robots/ESP32-and-ARC-Arduino-and-PCA-9685-20320

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

Downloaded Mickeys and DJ'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);

ARC connect Arduino at 57600 in settings

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

easy connection

works very good

EzAng

Switzerland
#3  

Thank you for the help, I have one more question:

how should I proceed so that I (instead of an Arduino) only have an ESP32 with a PCA9685 want to connect?

I had already installed EZ-B and the firmware for Synthiam on the ESP32 DOIT Dev Kit v1 and the control with 1 servo via WIFI worked happily:D

Now I just want to connect the PCA9685 to the ESP32 and then control my 16 servos with the ARC program.

Is there also an (Arduino code) for the ESP32 (like the Dev v1 EZ-B)? How can I use the firmware (https://synthiam.com/Firmware/EZ-ESP32-with-PCA9685-O3HKWLPWOIO ?

  1. Is it enough if I use the connections (RX / TX) on the ESP and (TX / RX) on the PCA9685?

  2. Which (settings) have to be set in the ARC for the servos? Regarts plokber

#4  

According to DJ the PCA9685 does not use UART. It only has a i2c interface. You need to connect the two boards (PCA9685 to the ESP32) through their 12c interfaces.

Here's a good article that will show you how to set up the ESP32 for I2C Communication: ESP32 using i2c

Here's your pinouts on the PCA9685: Pinouts on the PCA9685

BTW, I've never used either of these boards. I simply pulled up the info on google and the respective manufacturers websites.

Have fun!

Switzerland
#6  

Good day, Many Thanks!! Yes, the connection with ARC via the two (PCA9685 with the ESP32) has now worked perfectly:D:D I am really happy and motivated that I was able to carry out the various actions with my self-made robot.

Now I realized that I could use more than 16 servo connections for another robot project.

I also have a 32 servo controller (VER 3.2 from rtrobot) in my component box, which I have already used for another project. Now I would like to be able to control this with 32 servo controllers with the ARC. I tried to connect the connections to the ESP32 via TX / RX, but it didn't work that way. Do you have a solution for the connection of the otherwise well-functioning 32 servo controller with the ARC program? Greeting plokber

#7   — Edited

Update, I am sorry to have bothered you.  I think I have it sorted now.  D0-D5 while represented on ARC under the Auto Position as being part of the board, it looks like they represent the 0-5 positions of the motor driver.  Once I figured that out it was easy to get them functioning.

So for the record.  I am good to go. ----end update I hate to buzz by and ask a stupid question...but since when has that stopped me?!  lmao.

I am new to ARC not to iot or other software such as Blynk.   BUT I am having difficulty and cannot find a solid answer.  Downloaded the latest firmware and install/uploaded it to the esp32 dev kit.  connected my pca9685 via pins next to the RX/TX pins, on my dev kit it says 22 and 21.  To test the communication via i2c, I used the pca9685 example in ide.  BUT when I go to make something move I am not having any luck.  I added a servo via settings, set it to v0 and created a frame and action...execute it and nothing happens.  Oddly enough when I click "Stop" the servo will jitter a little.

I think I may be missing something within ARC that I just don't see.  BUT it looks like I create a servo object then add actions to it that I can exectute but that is not working.  As I understand the firmware's description digital pins are for servo use when connected to the ESP directly, so I am assuming Virtual pins are via the i2c connection?

Any ideas, or advice...much appreciated!

PRO
USA
#8  

I don't know if will help.

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