mheidenreich / PWMLEDs

These examples demonstrate how Pulse-Width Modulation is used with Raspberry Pi and gpiozero to regulate brightness of LEDs. Both calculated and lookup table methods are shown.
https://youtu.be/1fKH5PU9eck
MIT License
3 stars 5 forks source link

How to use with PCA9685 #2

Open Linkdudu opened 2 years ago

Linkdudu commented 2 years ago

Hey, first of all, thanks for putting this in place, amazing work!

I would like to know how I can use this with PCA9685, my idea is to use the PCA9685 to control 8 relays and 8 led strings using a mosfet, so for the realys basically I need ON and OFF but for the LED the idea is to be able to have them ramp up and down on pragramable time (small reef aquarium projetc).

Thank you!

mheidenreich commented 2 years ago

I have not tried the PCA9685 module yet with Raspberry Pi. From what I see, it is designed to control LEDs. You mention using MOSFETs - that is definitely a good idea as multiple LEDs would likely draw too much power from the controller directly. Controlling relays with the same controller may work, just don't forget the flywheel diodes.

I would be interested how that project turns out if you decide to go for it.

On Sat., Nov. 27, 2021, 10:37 a.m. Carlos Eduardo Guimarães, < @.***> wrote:

Hey, first of all, thanks for putting this in place, amazing work!

I would like to know how I can use this with PCA9685, my idea is to use the PCA9685 to control 8 relays and 8 led strings using a mosfet, so for the realys basically I need ON and OFF but for the LED the idea is to be able to have them ramp up and down on pragramable time (small reef aquarium projetc).

Thank you!

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/mheidenreich/PWMLEDs/issues/2, or unsubscribe https://github.com/notifications/unsubscribe-auth/ASJ3XOKNNOOBULL4KE5Q5X3UOD3LTANCNFSM5I4JUWFQ .

Linkdudu commented 2 years ago

The electronic is already working at some level, the challenge that I was not able to overcome is that for the pca9685 python driver, you have to specify the pulse length in hex going from 0 to 0xffff and I was not able to translate your 100 values table or function to match that. As for the relays, I'm using the 8 relays model that is already protected, so is working fine so far.

mheidenreich commented 2 years ago

It's hard for me to say without trying it with the actual controller. My lookup table goes from 0 to 1 so the only thing I can suggest is to multiply these values by 0xFFFF.

On Sat., Nov. 27, 2021, 2:33 p.m. Carlos Eduardo Guimarães, < @.***> wrote:

The electronic is already working at some level, the challenge that I was not able to overcome is that for the pca9685 python driver, you have to specify the pulse length in hex going from 0 to 0xffff and I was not able to translate your 100 values table or function to match that. As for the relays, I'm using the 8 relays model that is already protected, so is working fine so far.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/mheidenreich/PWMLEDs/issues/2#issuecomment-980789847, or unsubscribe https://github.com/notifications/unsubscribe-auth/ASJ3XOIEDK4EQAPTJBRRE63UOEXCDANCNFSM5I4JUWFQ .