Hello,
I have a project where I have to use both servos and LEDs, So my question is that can I use both servos and LEDs with PCA9685 at the same time?
I am using mg90s servos and a normal 5mm LEDs lights.
Yes, I do. The PCA9685 from Adafruit has built-in 220 ohm resistors on the output pins for powering LEDs without a current limiting resistor. You can connect them direct.
yes.
If you need several LED Effects, you could use my Tool Kit for LEDs:
Noiasca Took Kit for LEDs - Arduino Effect Library for your LEDs (rothschopf.net)
There are several examples for the PCA9685 also. Backbone to the HW layer is the Adafruit Library. You can still use it for Servos also.
I would guess no. If the servos work at all, they won't work long.
I'm not sure, but I think the LEDs may flicker, and you may not be able to achieve much brightness.
Servo signals are normally around 50Hz (20ms period) and duty cycle varies between 1ms and 2ms if I remember correctly. So the LEDs will only be 5% to 10% of maximum brightness, and they will flicker in a similar way to old CRT TV sets.
Ideally for LEDs you want to use a frequency at least 10 times higher and have full 0% to 100% brightness control. I think PCA9685 can achieve that, but not also servo signals at the same time.
If you have 2x PCA9685, maybe you can use 1 for servos and 1 for LEDs.
It depends on the accuracy you expect from the servos. My requirements weren't that accurate.
The servos in my application were fine with an accuracy of 40 positions stop to stop.
Edit: As I recall, I set the PCA9685 for LEDs at 50Hz (20ms).
The LED ports took 0-4095 (off to full bright)
The servo ports took 80-160 (1-2ms)
Edit2: I think the settings for the servos was 200-400. Don't quote me. I'm old.
I have problem with my LED setup, I am using two same LEDs but one is less brighter than the other, what can be the issue.
I can't replace them so is there any other solution?
Variants:
- use different resistors (or an additional resistor on the brighter LED)
- use PWM pins and drive the LEDs with different PWM
I need the high brightness in led with lower brightness.
Is it possible or I have to low the brightness of brighter LED
either fix the root cause of your installation (there must be a reason why one LED is brighter)
or dimm down the brighter one.
I presume you have each LED on a separate channel on the PCA9685.
Maybe a bad/damaged channel on the 9685? Switch the wires to the LEDS. Does the dim LED change to the other side?
If you want the brightness to be the same and bright, then you need a constant current LED driver. Otherwise you will need to play around with the current limiting resistors for both LEDs until you get them to match and they may not be the brightness you like.
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.