0

I started with hooking up the PCA9685 board to my Pi 4B and then installing the Adafruit PCA9685 library.

I followed this guide Control Servos using 16 Channel Servo Driver And Raspberry Pi except that I installed the latest adafruit library

I tried different examples I found but the servos don't move.

I get no errors but there's no movement.

When going through a loop

for i in range(180):
    servo.angle = i
    print(servo.angle)

it prints the angle from 0 to 180, but....no moving servos.

What could be wrong? It's the az-delivery PCA9685 board, could there be a problem with that..?

I'm using the AZDelivery SG90 Micro Servo Motor 9G

Also when I execute sudo i2cdetect -y 1 I get

0 1 2 3 4 5 6 7 8 9 a b c d e f
00: -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: 40 -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: 70 -- -- -- -- -- -- --

That's ok I guess.

Below are the images showing the connections.

pi4B PCA9685

Note: I’m using a 5V supply for the servo motors on the PCA9685 board.

3
  • We need more information. There are plenty of similar questions. Look at them then edit yours with the needed info.
    – joan
    Commented Aug 22, 2022 at 9:58
  • I made some edits to make my problems more clear
    – Wezy
    Commented Aug 22, 2022 at 13:54
  • Are you using a second power supply for the servos? Also, it would be very useful if you included photos of your equipment.
    – NomadMaker
    Commented Aug 22, 2022 at 15:30

2 Answers 2

1

The device appears to be wired correctly.

Try running this example code.

http://abyz.me.uk/rpi/pigpio/examples.html#Python_PCA9685_py

Unzip then

sudo pigpiod
python PCA9685.py
5
  • Thank you for your answer. I tried it, when I ran python PCA9685.py I got an importerr: ,no module pigpio so I used python3 PCA9685.py, that ran without error, but also without movement. I took some time before the cursor came back so I guess it's doing something.
    – Wezy
    Commented Aug 23, 2022 at 7:05
  • Sounds like duff servos or power supply. Try connecting a servo directly to the Pi (5V, ground, plus GPIO). If you connect to GPIO4 (pin 7) give the command pigs s 4 1000 then pigs s 4 2000. It should move if the servo is ok.
    – joan
    Commented Aug 23, 2022 at 7:30
  • when I connect the servo directly to the Pi I can get them to move with those commands, so the servo's are ok.
    – Wezy
    Commented Aug 24, 2022 at 9:09
  • 1
    I suggest you connect one of the PCA9685 PWM outputs to a Pi GPIO set in read mode. Then use piscope or monitor.py to check that a signal is being generated when you run a test. Perhaps the power supply is wrongly connected.
    – joan
    Commented Aug 24, 2022 at 9:38
  • Omg, that was it, the power supply cables where wrongly connected. Now they're moving like they should. Thanks for thinking about it.
    – Wezy
    Commented Aug 24, 2022 at 9:45
0

I guess the problem is you connected 3.3 V [Pi] -> 3.3 V/5 V PCA9685.

You can use 5 V from the Pi or connect an external power source to the V+ pin.

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.