0

I am trying to use an Adafruit PCA9685 servo driver module with an ELEGOO Mega 2560 board.

I am supplying the servo driver board with 5 V and tested all the wires to make sure. I tested the servo without the board and it works fine.

enter image description here

I2CScanner code:

#include "I2CScanner.h"

I2CScanner scanner;

void setup() 
{
    Serial.begin(9600);
    while (!Serial) {};

    scanner.Init();
}

void loop() 
{
    scanner.Scan();
    delay(5000);
}
8
  • What exact board is this? Looks like an Arduino Due, in which case you would be using the wrong pins. Try to use the pins labeled "SCL" and "SDA".
    – PMF
    Feb 10 at 16:08
  • @PMF the exact board i am using is the elegoo mega 2560 and have put the pins in the "SCL" and "SDA" near the "AREF" Feb 10 at 16:15
  • 1
    I'm not exactly sure about this board, but have you tried the other pins marked "SCL" and "SDA" (Pin 20/21 I think, near the green Led)
    – PMF
    Feb 10 at 16:17
  • @PMF It should be the exact same as the Arduino Mega 2560, I have tried those pins also the older version "A4" and "A5" pins but it still didn't detect anything. Thx for helping btw. Feb 10 at 16:20
  • what is the result when you run the code? ... please copy and paste into your post... no pictures please
    – jsotola
    Feb 10 at 19:05

1 Answer 1

0

The I2C bus needs a set of pull up resistors. When buying assembled I2C devices, the designer may include I2C pull up resistors but not connect them. This is because, according to this sparkfun.com tutorial, you only need about 4.7K Ohms of pull up resistance. Adding multiple I2C boards to the same bus all with their own pull up resistors will lower this resistance and may damage I2C drivers. So, it is up to the end-user to decide which I2C board to connect the pull up resistors on.

1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.