esp-32 LED driver ESPhome

Thread Starter

Absak

Joined May 9, 2024
5
Hey everyone,

I'm really excited to be part of this community!

I've recently started using EDA software with EasyEDA, and I'm currently designing some PCBs for my home assistant project.

For now, I'll be using a breadboard for the computing side of things since my skills aren't quite there yet. If I happen to damage an ESP32, I can easily replace it.

I'm planning to integrate an LED strip into my home assistant setup using ESP-Home. I'll be using 12V LEDs, not exceeding 3A. That's why I chose the HT7333A and the IRFZ444NS. Previously, I was using the IRF520, but it seemed a bit overkill. The breadboard I made to test the design works well, although i noticed that the PSU I'm using gets warm even when the LEDs are off. Any idea as of why? It's probably because it's a cheap one.

Here's the schematic of the PCB I want to make. I'd really appreciate any comments or errors you may find in my design. While I'm not new to electronics, this is the first time I'm designing something more complex, so i'd be a bummer for me to order a design and waste time and money for something that won't work.

ESP32-IRF520.png


PCB_ESP32-IRF520_2024-05-09 (5).png
 

Thread Starter

Absak

Joined May 9, 2024
5
Schematic_New-Project_2024-05-10.png

hey all after some thinking i have made some adjustement to my design. let me know if you think it is better.
 

Irving

Joined Jan 30, 2016
5,120
Welcome to AAC.

When drawing a schematic, try to keep inputs to the left and outputs to the right, power up, grounds down and avoid looping back or around; this makes it much easier to follow.

Your power tracks are far too thin and you need to put a ground plane on the back oft the PCB to remove the spaghetti of thin ground tracks. Try to avoid putting components on the back of a board. Keep power tracks as short as possible.

Capacitors should be designated as Cx not Ux.
Connectors should be Jx not Ux.
MOSFETs are more commonly Mx or Qx not Ux.

On your later schematic, you've moved the gate of the MOSFET from GPIO3 to GPIO39. GPIO39 on an ESP32 is an input only pin. You're sure this works? Ideally, you shouldn't use IO3 either as its the default UART Rx pin for serial comms. IO4 is a better option, or IO15 or 16 if you want the RH side of the module.

The 3v3 pin on the WEMOS ESP32-S2-Mini is an output from the onboard regulator; I don't understand why you're connecting another regulator to it. If you mean to power everything from a 12v VCC then you should be using a 5v regulator to VBUS via a diode.

Why is C1 from VCC to drain of MOSFET? Surely this should be to ground else your PWM to the LEDs is compromised. If C1 is a 12v power reservoir/decoupling then it should be on the input connector U6.

Did you not mean the junction of R3 & R1 to be connected to IO17 and the bottom of R1 to ground? Otherwise what's the point of this?

If U5 is an output to drive the LED strip as suggest by the 'OUT' marking, then D2 is the wrong way round. As shown it will block current from VCC out to U5 pin 1. In fact D2 has no obvious purpose here.

I'm not sure your diode ratings are correct, or why you've chosen two different products, normally you try to rationalise to the smallest number of common parts. As you've shown it, D1 will have a very short life...
 
Last edited:

Irving

Joined Jan 30, 2016
5,120
Further thoughts...

Your IRFZ44n is marginal here. The output of the ESP32 isn't high enough voltage to turn it fully on, it really needs about 4v minimum - see the chart from the datasheet below with your operating point marked - you'll be lucky to get 3A through it without it overheating. You might be lucky and it may work on your breadboard, but long term reliability is suspect.

1715357294639.png

An IRF520 would never have worked...
 

Thread Starter

Absak

Joined May 9, 2024
5
Further thoughts...

Your IRFZ44n is marginal here. The output of the ESP32 isn't high enough voltage to turn it fully on, it really needs about 4v minimum - see the chart from the datasheet below with your operating point marked - you'll be lucky to get 3A through it without it overheating. You might be lucky and it may work on your breadboard, but long term reliability is suspect.

View attachment 322026

An IRF520 would never have worked...
I haven't had the time to work in the comments you made, but already, thank you !

Oddly enough I have a breadboard working with an IRF520 connected to an esp32 with 12v psu and it is working, so that's odd...
 

Irving

Joined Jan 30, 2016
5,120
Oddly enough I have a breadboard working with an IRF520 connected to an esp32 with 12v psu and it is working, so that's odd...
There's a big difference between working for a few hours on a breadboard, and operating reliably over time. The datasheet for the IRF520 shows your operating point is well outside its specification. Yes it might be working, but for how long. And across how many ESP32/MOSFET combos? For it to guarantee working it needs at least 5.5v gate drive. Are you actually getting 3A through it? And are the LEDs actually getting 12v - what is the voltage drop across the MOSFET?

1715358016290.png
 
Top