Bicolor LED driver
DynamoBen
Posts: 366
I'm working on a project where I need to independently control 8 bicolor LEDs via I2C (LEDs are in some switches). I'd like to be able to dim them via PWM and not lose amber (Red and Green together). Normally I would use a PCA9685 but I'm not using discrete red and green LEDs this time around. Any thoughts on something similar that might get the job done or a way to pull this off with the PCA9685?
Comments
I would be more inclined in new designs to just use WS2812 NeoPixel LEDs as they are cheap (perhaps cheaper than bicolor+I2C) and you can run them from the one I/O.
These are LEDs in existing switches so neopixels are out. Sorry. I2C is a requirement because I'm pairing it with a port expander to read the switches.
Hello!
DB, who makes these switches? Not too long ago NKK released a series of switches that contain an RGB LED set and an appropriate switch. One enterprising pair of chaps built a Simon style game using one switch and an Arduino type controller. The resulting game was, they think, rather pleasing and even interesting.
Depending on the switch brand, the controller chip for RGB LED items is available as a separate entity, but I forget where, and there is Propeller code available for the driver chip. Although it might be bundled with the pixel function configured one.......... (The LED set that is.)
[Spins Peter's prop.] I have several of those NKK switches here, but I'll be kesseled if I can come up with a working application for them.
While I appreciate all the flashiness of RGB its overkill for this project. I just need three colors (Green, Red, Amber) and the ability to dim them...super simple. Normally I would just run the switches directly to the Prop but I have far too many (multiple sets of 8), hence the I/O expander plus LED driver on an I2C bus.
If there isn't a good alternative to the PCA9685 for what I'm doing then I will need to continue to hunt for a switch that works for this application. If I can't find one I will either need to use the more costly switch or look into a PIC as the interface.
It's worse than not having discrete leds since the red and green leds are connected with the red + to the green - and vice-versa. Very difficult if not impossible to control with a standard led driver chip. It could be done with TPIC's or similar S-P registers for each set of 8 leds but dimming them via pwm would be tricky. A propeller chip to control them (24 switches per chip) would probably be a better choice.
I was considering this to see what I would get but frankly didn't know where to start. I knew if the timing got off I wouldn't get amber but rather off. Going this route would be ideal if it works, so I may mock something up.
You are correct I did consider this as an option over a PIC, its been a few years since I've done PIC work so I'm more comfortable with a Prop. My hesitation was the $12 cost versus other options, but my quick research indicates that a PIC might not be up to the task, most only have 1-2 PWM outputs so I would need to do it in software.