I have purchased a PCA9685 16-Channel Servo Driver and have not been able to get it to work, when I run the Servo example the servo motors do nothing. Tested with 2 versions of Arduino Uno, using 2 different computers with different operating systems (MacOS & Ubuntu).
In the video of the following link I show the connections of the pins, the power supply (PC power supply), the voltage measurement, everything. I have checked everything numerous times and wonder if I am doing something wrong or if the module is faulty.
Note: the video is not "searchable" on YouTube, it is possible to access it only if the link is known, I have posted it only so that the pin connections can be seen, etc., and I will remove it when I have confirmed if I am doing something wrong or if the module is faulty.
Nice video but it did not help me. Your best chance is to post a schematic, not a frizzy thing with links to technical information on each hardware device. Along with that post the code.
What is the brand/model of the servo? Make sure that you have the correct wiring for the servo connector, not all servos have the power/ground/signal pins arranged the same way.
You seem to be running power to everything including the servos through tiny thin wires and a breadboard. Both are bad ideas particularly with those fairly large servos. The servos at least should be more directly connected to the power supply using thicker wire and decent connectors.
Thanks all for your answers and your advice. Following your suggestions I did 3 tests with 3 servo motors (one for each test) of different sizes, including a micro servo. The result does not change, please look in this link a second video...
@slipstick following your suggestion I did a scan to determine I2C addresses. Without connecting the PCA9685 board, the result was the following:
I2C Scanner
Scanning...
No I2C devices found
So I connected the PCA9685 board, restarted the scan and the result was this:
Scanning...
I2C device found at address 0x40 !
I2C device found at address 0x70 !
done
See below the code used for the I2C scan.
I thank you for the opportunity to learn how to do I2C scanning, even though the last test of the first video showed that there is communication between Arduino Uno and the PCA9685 board. In that test the PCA9685 board activates only the sixteenth channel, exactly as it was programmed, and the voltage between PWM and GND varies in correspondence with the times set in the loop for the movements of the servo motor. Considering the measurements, the problem does not seem to be the communication between Arduino Uno and the PCA9685 board, it seems instead that there is not enough voltage in the outputs of the PCA9685 board.
The code used to scan was this:
#include <Wire.h>
void setup()
{
Wire.begin();
Serial.begin(9600);
while (!Serial); // Leonardo: wait for serial monitor
Serial.println("\nI2C Scanner");
}
void loop()
{
byte error, address;
int nDevices;
Serial.println("Scanning...");
nDevices = 0;
for(address = 1; address < 127; address++ )
{
// The i2c_scanner uses the return value of
// the Write.endTransmisstion to see if
// a device did acknowledge to the address.
Wire.beginTransmission(address);
error = Wire.endTransmission();
if (error == 0)
{
Serial.print("I2C device found at address 0x");
if (address<16)
Serial.print("0");
Serial.print(address,HEX);
Serial.println(" !");
nDevices++;
}
else if (error==4)
{
Serial.print("Unknown error at address 0x");
if (address<16)
Serial.print("0");
Serial.println(address,HEX);
}
}
if (nDevices == 0)
Serial.println("No I2C devices found\n");
else
Serial.println("done\n");
delay(5000); // wait 5 seconds for next scan
}
I did a test with a new PCA9685 16-Channel Servo Driver, so i confirmed that the previous driver was indeed faulty. This is the link to the video where I compare the two drivers...
Thank you very much everyone for the help you have given me, it was instructive.