I have 10 individual 3V 4wire rgb hooked to 38 pin esp32 wroom board through IRLZ44N Mosfets. When i set up on breadboard it worked, but now that i have everything permanetly wired up the blue will not turn off. Measuring gpio 27 which is blue i am getting 0.003V at mosfet output i am getting 0.007V when turned off but the blue light is bright. the blue is inverted which i have turned enabled disabled. i dont know allot about yaml and such but i have tried allot of different configs. switching to digi output no dimming, turn on off coding, i switched to another mosfet i switched gpio’s twice. Nothing is working. i have no continuity between pins on leds so no shorts there. this is my code as of now.
i gave you zoomed in vew just to see resistors not like that matters. there are enough lights & resistors to make a load. i understand IRL is a grounding switch. i was geting low voltage on gate & drain nothing on source. when it was off
I really don’t know what to think about your circuit.
What’s the purpose of the mosfet in the first place?
And if there is a purpose, your circuit has mosfet gate connected to GND…
Also, why you have resistors on all legs (anode and cathode) of RGB?
I agree with @Karosm. I don’t understand what you are doing with mosfet. Most people use a resistor to limit gate current and hook up the output from the microcontroller to the gate on the mosfet. That is not what your picture shows.
Also use the right size resistors on the individual cathodes and do not put one on the anodes. You can do it the way you did, but it likely gives you less good control of the brightness/color.
Gate is the middle lead of the mosfet, so even if you had it drawn backwards it isn’t correct.
I have done what i have done because im new to the IOT. and lstned to people and ai on what to do. i was told the relays wouldnt function as good with PWM as they are not a fast acting switch, which makes complete sense to me. The resistors where put there to limit current to keep the brightness down and i was told on each led as it would keep variances down. As per pinout this is what i saw along with most mosfets. They did all work properly on setup breadboard. I would love to learn what i am doing wrong though, So let me hear it. I am wondering if might have 2 bad mosfets that i maybe burnt up learning to solder tiny stuff.
Ok, I can see your point for mosfet if you need to drive 10x RGB LEDs with 3 Esp pins at high brightness. But you have source and gate inverted on your circuit. Also the resistor setup needs corrections.
okay, I read the datasheet too quickly. But you do appear to have it hooked up incorrectly (just differently than I first thought), also it is normal to use a resistor on the gate.
It is possible that your blue mosfet is shorted and that is what is causing the problem.
It is possible that your esp32 output pin is no longer working correctly, so always low.
Remove the blue wire from (of the esp32 that is connected to) the gate of the blue mosfet and connect it (the side that was connected to the esp32) to ground. That should turn the mosfet off so the light is off. If it doesn’t your mosfet is likely blown.
Ok i figured out that mosfet was bad, and learned some stuff. The IRLZ44N looking at the front is Gate-Drain-Source. Now i have a different issue. I have another working and tested open close with multimeter mosfet. The blue turns off now but when i turn it on it will sometimes power full power then slowly filcker off then back to on-off-on . its not always a flicker but never hold a brightness the same other than full power. full power will be for maybe 10 seconds. The red is mostly good but is getting a bit of a flicker. its pretty steady but sometimes gives a flick or three. Green is rock solid exactly like its supposed to be. I havent touched the red mosfet at all it just startd its bit of pulsing light today. I have all efffects deleted from esphome and no automations on.
You should post some information about your RGB-LED. Resistor setup needs corrections based on that information.
Blue led has high forward voltage, it’s on the borderline if it can work at 3.3V.
3.3v is comming from LM2596 to 220ohm resistor to Anode of each led in parallel. So every Anode has a 220ohm resistor in front of it. Then for green & blue colors each has a 20ohm resistor directly after pin of each led. Red has a 50ohm resistor after pin of each led. Each of those output of color are tied together in parallel to the IRLZ44N Drain.Tthe Gate gets power from esp32. The Source is GND. The Red Is flickering and the Blue won’t turn on now. AAAGGGHHHH never had issues like this before. I saw some stuff about adding resistors between gate & esp32, From gate to source but also saw how it might load up controller over time. I dont understand how all this worked but now nothing is. I see how u say Your a greenhorn your gonna mess it up. but GRRR. this one is driving me.
That doesn’t make sense at all. Remove the 220ohm resistor from anode. Replace the red LED 50ohm resistor with the 220ohm.
So 3 resistors: red220, green20, blue20, nothing on anode.
To protect your Esp pin add a ~120ohm resistor to between pin and gate.
To ensure mosfet turns off when 3.3V is not applied to gate, add a 10000ohm pulldown resistor.
Edit:
The whole setup would be easier if you use 5V supply, so at least you have voltage above blue LEDs forward voltage.
You could set your buck converter to output 5V, power Esp through VIN pin and use 470ohm for red and 220ohm for blue and green. (I don’t have specks of your RGB, so the values might need to be adjusted little bit).
I have completed the first 3.3v steps of resistors as well as esphome pulldaow assembly, with no change. I dont think i need 5v as u can see blue max volts is 3.2, I was trying to test mosfets again semi wired up with mixed results on/off but i think that was because it was wired up. I took the drain wires off mosfets and put them to ground and what do you know all LEDS worked perfect. Seeing as green works perfect and they all did function properly at 1 point i am pretty sure i am burning up these mosfets soldering to protoboard. even if it is turning off on by multimeter i could be getting leak through or pulsing behavior of almost toast, but still passing simple testing. Am i wrong thinking these mosfets are a good choice for controlling colors of rgb. Im out of solder so im not ripping into tearing the board apart right now for further testing. ESP is sending power when asked. How would you set up the rgb or should i get some more, or should i get a rgb controller. I do like doing the DIY as i always learn way more about the components. Thanks for all your help by the way.
I asked 3 days ago about your RGBs, now you post specs. I also wrote 3 days ago that you don’t need mosfets if you don’t need to drive them at high brightness.
I don’t see anything wrong using them if you want/need but treat them carefully. Opposite polarity, heating them to 400’C while soldering etc. should not happen if you are careful. Your resistor setup was no-sense anyway, so whatever route you take you need to review that.
Sorry about the RGB info. I didnt have it or know it was there before. They are aliexpress from 5 years ago, I looked them up and way down bottom found those specs. I do want to be able to use fairly full brightness, dimming, color change with some effects for notificatons. Are you saying i should use relays? instead of mosfets cus esp wont handle that current at 40MA per pin thats a dimm bulb if i have 1 led at 20MA. i was using dirty flux which i use to clean tip. messed up the solder i now realize (another thing i learn is dont play with dirty flux) so it was contaminated. I didnt wire them backwards but does reverse polarity kill the mosfet? Resistor setup was AI, i am understanding how it can be wrong but it was saying the cathode resistor was to limit power to the rgb for some reason. AI can be very usefull but can also steer in the wrong direction. I dont know anything about RGB and very little about esp32. i do know leds to a point but not driving them like this, so i didnt know when to see a falsity. I dont mean to offend you in anyway i am just saying what i know at the time.
While it is easy to get started with electronics and stumble around and make some progress (just like a blind squirrel sometimes finds a nut) if you want to get good, you have to put in the time and effort to really learn things.
Mosfets we’re not generally available and certainly not cheap when I first learned electronics as a teenager, nor when I was in college. They are great things and make some things easy, but like any tool you do have to learn how to use them properly. You must also be careful who/what you use to learn from. Some of the stuff on the Internet is less than useless, but might look plausible. Do your research. Read the datasheet and app notes from the manufacturer and buy from a reputable supplier and you will likely do okay.
Don’t worry I’m not “offended” anyhow, but you should answer the questions if you have information available.
Relays can’t be used for dimming.
And if you want to have full brightness you can’t drive 10 of them directly from Esp pins.
But with the resistors you have been using, you don’t get anywhere near full brightness, only few milliamps instead of 20. For that brightness you could use Esp pins.
And because you use resistor on anode, the current draw of one depends of another. If you only have blue on it gets 4ma, if you turn also green on they both get 2mA. But if you turn red on, blue and green get almost nothing and don’t light up.
That’s why you don’t put resistors on common anode side!
And you should never trust what AI is telling you.
Got it all working. I changed esp32 & mosfets. I have 20ohm on each blue & green led, 220ohm on red led. 120 & 10k ohm on esp32 output for protecton. Soldering & desoldering is definetly a skill. U need some decent tools to do it prperly & flux is key. Also being sure to always have a dab of solder on iron or your not getting proper conduction of heat.
Thanks for all the help! Cheers.
I gave you 20/20/220 just because you had those resistors on board at that moment.
If you want the whole potential from your LEDs this would be more close to it.