General

Can we use the Dfrobot AI-Cam module to control pca9685 via i2c

userHead Binu.Ud 2025-10-17 23:49:52 30 Views1 Replies

The dfrobot aicam module https://www.dfrobot.com/product-2899.html?srsltid=AfmBOooDp_-eTpKXEJ89L4PKmSyZhwFAy1Ex6oBx8jGX2QzB2xhCT98E, has a Gravity port. 

 

The numbers are given as 43,44 GPIO. Can we configure same as i2c, so that we can control pca9685.

 

I was using the below code to connect to pca9685, on a normal esp32 devkit, the code works, for any GPIO pins, provided we specify same in wire.begin(gpionum1, gpionum2).

 

I am getting nack error with the AICam module. Any help in this regard is appreciated. Basically I want to use the module to drive 2 servo and also stream camera. Streaming of camera is working fine. But I am not able to repurpose the UART to i2c.

 

void setup() {

 

// Serial monitor setup

Serial.begin(115200);

 

// Print to monitor

Serial.println("PCA9685 Servo Test");

 

 

//DFROBOT

// // 49 TX = sda, 50

// RX = scl Green SCL-Tx-43-(49), Blue SDA-RX-44-(50)

digitalWrite(45, HIGH);

Wire.begin(44, 43);// SDA, SCL

 

pca9685.begin();

 

// Set PWM Frequency to 50Hz

pca9685.setPWMFreq(50);

 

}

2025-10-24 16:15:56

On the DFRobot AICam module, the Gravity port pins (GPIO 43 = TX, 44 = RX) are designed for UART use and do not support I²C open-drain mode reliably — that’s why you’re getting NACKs when trying Wire.begin(44, 43).

 

To make your PCA9685 PWM driver work alongside the camera stream, pick two other free GPIO pins on the ESP32-S3 (for example GPIO 10 & 11 or 8 & 9) that fully support I²C, then call Wire.begin(SDA_pin, SCL_pin) with those. That will give you a working I²C bus while the camera continues to run on its dedicated pins.

 

For reference, here’s a project using the PCA9685 over I²C: Simple Electronics to Escape Room Owners – Using a bunch of voltmeters with PCA9685.

 

https://www.pcbway.com/project/shareproject/Simple_Electronics_to_Escape_Room_Owners_Using_a_bunch_of_voltmeters_with_PCA9_32be3f8a.html

userHeadPic ahsrab.rifat