Wled with ESP32 and Mosfet

Hello All,

I need some help if possible please. Let me explain you briefly what I am trying to create:

I would like to control an LED bulb which is 3.7v and current of up to 3Amps with an ESP32 and WLED. I figured I can not connect the LED straight to the 3.3V of the ESP32 as it doesn’t provide enough current and so I need to use Mosfet module in order to make this work. I tried with 2 different types, but both didn’t work properly. https://www.aliexpress.com/item/1005004893350627.html and this https://www.aliexpress.com/item/1005005954937751.html

Do you have any solution on this please? I Will highly appreciate your help! Thank you in advance!

1 Like

Can you provide a diagram of exactly how you wired the modules to the ESP32 and the LED string? Also, a photo of your setup, and a description of what you expected to happen with the setup, and what actually happened.

1005004893350627 is not rated for 3A without a heatsink but would probably be OK for a short test. 1005005954937751 seems a much more capable device. However in both cases quality is an issue and I always recommend buying a pack of multiple units so you can compare them to identify the faulty ones.

4 Likes

Hi Toma,

Welcome to the forum!!

Jeff is on the money with getting multiple and testing.

I’ve had success with this module from Core: MOSFET Power Switch Module | Core Electronics Australia and a 3.3V logic level.
However the load required 5V.

Liam

3 Likes

Hello Liam, thank you for getting back to me. I had success with the same module, but when using a 12V led chip which I guess is because the module is rated 5-36V. Basically it is working fine even with the 3.7V Led chip, but when I dim it it starts flickering (Switching off/on) I guess because when dimmed it goes below 5V. I tried exactly the same set up with a 12V Led chip and it was working fine even when I dim it down to 1%. My problem is I can not find good enough 12V led chip that is approx 10-15Watt and I have very good 3.7V one which is great. Another problem is I don’t understand electronics much :)))

1 Like

Hello Jeff, thank you so much for getting back to me. Traveling at the moment, but I will send you photo of the set up when I get back home.

Basically I have the ESP32 powered through its usb port (5V power bank). One of the GPIO port’s is going to the signal port of the MOSFET. Ground of the ESP32 to the ground of the MOSFET. On another side 5V power supply (another power bank) going to “+” and “-” of the DC IN of the MOSFET and DC Out “+” of the MOSFET is going to 1 Ohm 10 Watt resistor and from there to the 3.7V LED Chip. DC Out “-” of MOSFET is going to the “-” of the LED Chip.

With 1005005954937751 it’s working, but when I start dimming it starts flickering which I guess is because the module is rated 5V minimum and when I start dimming the voltage drops below the rated one (Not sure if I am right). It works fine with a 12V LED chip, but I don’t have a good and powerful enough for my needs 12V LED chip.

When trying with 1005004893350627 the gate of the MOSFET doesn’t even open as the voltage there is only 3.3V and as I understand I need to have minimum of 4V. I was thinking to try adding a logic level shifter and try again. Do you think this might work?

Thank you once again for your time!

Hi Toma
Here we go again. Using “Power Bank” as a “Power supply”. Not on in my book but I suppose I could be considered as fussy.

I suppose you are aware that most of these “Power Banks” will shut down when the current drawn gets down a bit. That is how they detect “end of charge” of a phone etc which is what they are designed to do, charge up another battery.
Will say no more.
Cheers Bob

2 Likes

That wiring sounds correct to me. A 10K resistor from gate to ground is usually included in order to ensure full turn-off, and the ESP32 output pin should have 1K resistor to the gate.

Both the D4184 (1005005954937751) and the IRF520 (1005004893350627) have a gate threshold minimum in the logic range, but they are both marginal at 3.3V. The threshold is the point at which they just turn on, and the RDS is still very high at that point. They may work with light loads, but at heavier loads there will be a significant voltage drop and heat dissipation. That probably explains your results. A logic level shifter for the ESP32 would work, as would a simple transistor buffer powered from the LED supply. Or a optoisolator could serve two purposes - isolation and voltage boost.

1 Like

Thanks Jeff! Appreciate your help!

Thinking to try now with this and see if it will work.

https://www.aliexpress.com/item/32812682321.html?spm=a2g0o.productlist.main.1.79406fe1SMfTLu&algo_pvid=c1374185-8d3f-4f41-95d1-482226d8c29f&algo_exp_id=c1374185-8d3f-4f41-95d1-482226d8c29f-0&pdp_npi=4%40dis!AED!6.42!4.38!!!1.70!1.16!%40211b8f9b17232051974678605e7142!64552655211!sea!AE!119565998!X&curPageLogUid=P8tJbLnsIwJh&utparam-url=scene%3Asearch|query_from%3A

Those devices are for driving a LED strip that uses a 5V PWM signal to control the LEDs. I don’t think they do any level shifting for that control input - just for the power side of the strip. But that’s not relevant anyway. Your problem is that you need to use the 3.3V logic signal to control the power supply to the LED bulb. Your LED does not have a logic-level control signal - it’s simply driven from the power feed, and that’s what you need to control from the ESP GPIO.

3 Likes