I hate asking advice somewhere that I can contribute little so trust when I say that I have logged many, many hours researching this.. have watched every relevant video on YouTube I can find, every Reddit page and thread here I can find on the topic, and spent many hours prototyping in circuit simulators.. I will not list what all I have tried so far up to my current design because it's a lot. I am going CRAZY with this.. but GOOD NEWS, EVERYONE, I am getting close to figuring it out. It seems the common anode RGB LEDs are tougher than 6 pin or common cathode. I have been trying to figure out how to light up and control the color of a single 3W RGB LED for nearly a MONTH now. I just need a few pointers. I am very new to DIY electronics projects but eager to learn, and I'm hoping this thread may help someone else out in the future.
- Control the power, color and brightness of the LEDs using a Raspberry Pi Pico W and constant current supply
COST and simplicity. I cannot find a premade circuit board for driving a common anode 3 W RGB LED via PWM anywhere, and any time I find something that seems like it might work, it's way too much $$$
Later I will figure out controlling it via Google Assistant, but that's not what I'm posting for.
I know there are IC's I can order for this purpose off DigiKey and the like, BUT I have already purchased a pack of logic level NPN FETs and LM317's hoping they would suffice and spent weeks trying to make them work. SO without ordering additional components I am hoping I can get at least one of these LEDs working as intended.
The current plan:
I've been testing using a 5 V source, an LM317 in CC configuration with a 3.6 Ω current limiting resistor between ADJ and OUT. I plan to use IRLZ34N "logic level" MOSFETs placed between the Pi Pico and LEDs, after the cathodes.
- IRLZ34N FET
- LM317T as current regulator
- The LEDs are Chanzon 10DGL-DZ-3W-RGB4 from Amazon
Here is the current design schematic. I apologize, I'm on mobile so I used the Proto app, which isn't great so I have to explain some of it since it's missing components I used:
(Please ignore the overabundance of ammeters and unnecessary stuff I forgot to delete, and the weird grounding.)
The PROTO app does not have a common anode LED, the LM317 nor the IRLZ34N so I simply connected the anodes into one and drew three cathodes on the LED, and drew in names and values where pertinent. I did the best I could, let me know if there is anything confusing about it.
The problem currently:
I have only gotten so far in my testing as to set the current output of the LM317T with the 3.6 Ω resistor and connect the LED after it, so the above circuit without the mosfets.. and when I do, with a 5 V supply, THE LEDs WON'T ALL COME ON AT ONCE. For some reason, it will be red, or orange, but not white. It SHOULD be white if all 3 LEDs are getting power, right? If I connect each cathode one at a time separately, the correct color lights up, and when I connect red and green it will light up an orangish color, but connecting the blue in combination with either of the other cathodes does nothing to change the color. It seems that the red LED is the "preferred" path, and the blue LED is the last priority. I have tested continuity and resistance across all LED pins while disconnected from power and it seems the LED is not faulty.. I am at a loss. Am I missing something obvious, do I need resistors of different values placed after the individual cathode leads so that the current prefers all three paths equally? I was under the impression that with a constant current supply, the LEDs would pass however much forward voltage they "like" to pass and resistors are not necessary.. I also read in another thread that a 5 volt supply may not be enough in a circuit like this due to the total voltage drops of each component, so is it an issue of supply voltage? If anyone can solve this for me I will be eternally grateful.
I am literally just trying to light up a 3D printed Moon lamp I made for my daughter, and maybe add a single LED to my 3D printer for better visibility w/ webcam monitoring. In the future I will just order the best LED driver ICs I can find on DigiKey, even SMD components, idc. Anything to make this seemingly simple task ACTUALLY simple and affordable.. 🥲 also, it would just be good to actually be able to understand how this works and what the problem is. I would love to be able to DIY other "high power" LED lighting in the future, but this endeavor has been extremely frustrating.
Thank you SO MUCH in advance for your advice and for taking the time to read.