I am in the process of creating a pcb design to control 6 x 12V 1.5A solenoids mostly using parts I already have lying around, as well some through-hole components to match my soldering ability. I am hoping to use a single 12V power input to the board, however I have found most similar topics all have separate power supplies for microcontroller and solenoids or use optocouplers to keep things separated.
I have put together a schematic and layout and am wondering if there are any clear issues, in particular around sharing the same 12V power supply to drive the solenoids and the ESP32 (through a 5V stepdown converter).
For reference I would like to have the ablility to drive all 6 solenoids simultaneously, although this would only be occasionally. I already have a 12V 150W PSU that I am planning to use, and I have made the trace width 10mm to the solenoid headers. The bottom of the pcb is a full ground plane.
I am planning to place the circuit and power supply in an enclosure with a ventilation fan and connectors for the etheret cable and 6 x 2-core cables to connect to the solenoids. I am hoping to have these 2-core cables up to 3m in length and would be using 18AWG cable.
Some more info about the components:
I have chosen IRLZ44N as a logic level tranisistor, and stepped up the gate signal to 5V. I chose a STPS2H100 flyback diode as it rated for 2A.
The ESP32 receives OSC messages over ethernet to trigger the solenoids, this is connected with a W5500 module.
I have added two DFRobot 1015 step down converters, one to supply 5V to the ESP and one to supply 3.3V to the W5500 module.
Here is the schematic and layout, I am still pretty new to designing circuits and am trying to keep things as easy as possbile, so am using modules/through hole components and am not too restricted with space. Any feedback would be greatly appreciated!
That seems unnecessary. The ESP is a 3.3V device too.
Since you need to step up the gate voltage, why not step it all the way up to 12V. Then you don't need to use logic level MOSFETs, and won't need a 5V supply in your circuit.
I think the most important piece of feed back I would give is not to make, or have made for you, any PCB yet. You need to prototype and thoroughly test the circuit first. Breadboards are the usual way.
However, the current for your solenoids is too high for breadboards. So for initial testing, replace the solenoids with LEDs (+ series resistor chosen for 12V).
But it's very important to run some tests with all your solenoids working, so for that stage of testing, move the MOSFETs and diodes off the breadboard, maybe find a way using some terminal blocks or something. This is the point where you find out if the solenoids are going to cause any problems that would affect the rest of the circuit.
I'm not sure the logic level converters you are planning to use are appropriate. They are meant for use as bi-directional converters for i2c bus. But you are not using them for that.
If you look at the internal schematic for the converters, each channel is as follows:
Notice there is a 10K pull-up to HV (=5V in your circuit).
These 2 10K resistors will create a voltage divider which will present 2.5V to the MOSFET gate, which will probably turn the MOSFET only partially on, and not achieve a low RdsOn, risking overheating and failure.
So I think you need to re-think this part of the circuit. Your logic level converters will convert 3.3V signals to 2.5V, not the 5V you wanted.
PCB looks good. As someone stated, esp32 also uses 3.3v. There is no need to use that many regulators (you can even use the one already on the esp32 module).
If possible, NEVER EVER GO FOR THE MINIMUM TRACE WITDH! That's the oposite of clever. All your esp32 lines should be as wide as possible. 0.5mm if you cant route a 0.75 mm (or the equivalent in mils).
You just placed 1 cap at the power pin. Caps should be placed where you need to deliver power. Thats the powerpin of every IC.
Add capacitors to every power pin (close to power pin for the esp, before the 3.3v/5v regulator, and any other IC. If you you place SMD caps, 1-10uF is ok. If caps are THT, also place a 10-100pF C0.
Remove that 'ground plane'. After re-routing super fat traces, placing caps everywhere, choosing 1 regulator, then go for a fill / polygon connected to ground. Your whole board sould be either tracks or ground.
Remember to set the minimum distance between tracks (0.75 or something like that).
Check if your mounting holes are connected to ground.
The W5500 module can draw quite a lot of current, so I'm not sure I would rely on the ESP module's regulator to power the ESP and the W5500 from a 12V supply. It's a small-ish linear regulator and likely to overheat and fail.
BTW, since you are not using the ESP's WiFi/BT, have your code switch them off to reduce power consumption & heat.
@dual_flow
If you use AOD424 MOSFETs, you can eliminate the level translators and your design will actually work.
The AOD424 is an SMD device but the pin spacing is actually larger than the 44ZN so it's very easy to hand solder.
Thank you for all of your feedback, it is very helpful and much appreciated.
@PaulRB Thanks for pointing out the ESP32 can be powered 3.3V, I had read that ages ago but had forgotten as I've only been using ESPs in 5V projects.
And thanks for the advice around breadboarding, I am definitely planning to do more prototyping and testing, I might have gotten a bit ahead of myself with the layout but I found it helpful to visualise things.
I had totally misunderstood the logic level converters and had swapped them in as I had used them previously on a project for digital LEDs. I see the problem with them, especially that 10K pullup!
I think I will try and test with the AOD424 mosfet that jim-p suggested, otherwise I read that I could use a transistor to switch the higher voltage to the mosfet gate?
Those adapter boards look great for testing, thanks!
@maikarg Thanks for your comments, I have so far only prototyped controlling a single 1A solenoid using a TIP20 transistor and have successfully got it all working with the ESP and W5500. Next I will order some components to begin testing with mosfets and then with more solenoids.
The W5500 module runs on 3.3V but can accept either 3.3v or 5v signals. I have read that it is not advisable to supply the 3.3v from the ESP, which is why I have the regulator.
Happy to bump up trace width once I get to the pcb stage, and will add caps across power pins to the ICs.
Reguarding the grounding, I so far have all power and signal traces on the top side of the PCB and the bottom side is a full copper fill for ground. Are you suggesting adding ground fill on the top layer as well and stitching with vias?
@jim-p Thank you for recommending the AOD424, I hadn't had the best luck finding a mosfet that can be driven by 3.3V.
I'm not an expert about pcb (since where I live is a bit expensive to order them abroad), but is always welcome to fill it with ground (its easier to make them when there is less copper to remove).
If w5500 can be powered with 5V, why are you using 3.3v?
Power the esp32 with 5V, and the w5500 with 5V. I expect both boards have their own linear regulator.
You can save space and 1 IC $$$ (then you can route wider tracks).
Even if the W5500 could run on 5V or 3.3V using an onboard or external regulator, that would probably be another linear regulator, like that on the ESP32. Those regulators would be inefficient (3.3/12=27% efficient) and so produce a lot of heat if powered from 12V. Buck converters would be more efficient at around 80~90% efficient.
Using a buck converter to produce 5V would also be 80~90% efficient, but if linear regulators were used to provide 3.3V for the ESP and W5500, these would be 3.3/5=66% efficient. The combination would be 52~59% efficient overall.