Is this a good breakdown of the difference?(chatgpt)
btw chatgpt validated your approach, and said both are valid. That resolves my confusion and worry a bit.
Conclusion
Both approaches will work for your fan:
The MOSFET approach is simpler, cheaper, and supports higher switching speeds.
The optocoupler approach adds isolation, which is useful for protecting your ESP32.
Since the fan provides its own 10V source (terminal 4), the MOSFET approach is likely optimal for your case.
Apparently, the input of the fan takes a potmeter or PWM, user's choice.
For a proper control you’ll need to switch the high side, which can't be done with 1 mosfet. You’ll need either 2 mosfets or 1 mosfet and a optocoupler. But the optocoupler is quite capable of handling such a low current, you can skip the mosfet.
Wow the first wiring diagram, thank you very much.
In actuality I have 10x the IRLB8721 and only 1x 4N35 Optocoupler.
As understood, the solution with the one mosfet by ledsin, is switching the low side.
Which works, but is NOT optimum?
What does that mean? Why two mosfet solution better?
I saw that the converter boards pwm to 0-10V also have two mosfets on them if not mistaken.
Ordering more parts, will take til lafter the weekend, and I would like it running before that.
I can make it optimum later, also need to understand your approach better first.
For now I was planning on testing ledsyns solution first.
I got it confirmed by two AIs, and we agreed to test with the 10k resistor first Gate->GPIO.
And to be extra safe, I can NOT connect the Mosfets source to control of the fan yet, but check with multimeter if voltage corresponds to the duty cycles. And let the poti connected, at 50%, so my fan does not run on 100% when control is not connected, and also to be super safe, by having a control signal at all.
A flyback diode to protect the fan is not needed, as the fan internally prob has one, and currents are two low for any risk.
Is this so far correct to test?? or will it create nuclear fusion?
From there one I could tackle the more optimal setup, you described.
Well it said, that both works.
"and likely is the best solution" is better than "IS the best solution"(since it never has all variables to make that call)
but anyway, can I test it like in my last post, and initially proposed by ledsyn, with only the added 10k resistor part by me. 10k to be safe for the esp32, when the mosfets gets to warm I can still go lower.
Since I read a lot from you, I would totally trust your solution.
For a simple, first setup, my last post was correct so far?
stitech suggested a "better" approach,...that I do NOT understand yet, or the advantages.
Well we both know you already know the answer.
But here for completness:
Drive Voltage (Max Rds On, Min Rds On)
4.5V, 10V
Rds On (Max) @ Id, Vgs
8.7mOhm @ 31A, 10V
Vgs(th) (Max) @ Id
2.35V @ 25µA
Gate Charge (Qg) (Max) @ Vgs
13 nC @ 4.5 V
Vgs (Max)
±20V
Input Capacitance (Ciss) (Max) @ Vds
1077 pF @ 15 V
This one and the IRLZ44N were mentioned most in all the topics I read. They are NOT really 3.3V, but close. And people said they work most of the time, but some mosfets(rare) can not work.
I did research the whole day, but did not found a better solution.
Not even sure, why. Shouldn't there be a commonly used mosfet for the esp32 3.3V logic?
But when searching for that, the IRLZ44N gets recommended, weird.
Oh right I remember. That's why I decided against them. Still havn't slept, have searched the half day yesterday, and the whole night for a connection.
I just confirmed the average Voltage my esp32 gives out as pwm. 1.6x V for 50% and 100% @ 3.29V.
Connections are all ready.
Still not connected yet.
Waiting for a final go from you.
Maybe that already was it, but just to make sure...lol.
Also I will NOT connect the controlcable to the fan yet, only ground and 10V, and check with multimeter first, if mosfet gives correct voltages @corresponding duty cycles.
I leave the potentiometer board connected for now, so the fan doesn't run @100 when testing, and fan has a control at all.(Probably defaults to 100% when no signal)
This is all I got.
I think I test it when waking up, and having a clear head.
That was serious. If you can't draw a simple schematic, then I'm not sure if you know the difference between gate, source, drain.
Also still don't know what MOSFET you are using.
haha, it was reason one ... I knew it.
Ok Mr P. I will attempt my FIRST wiring diagram, thank you for the lesson.
I am obviously NOT tired enough...lol
The chopped up 3.3V Signal comes from my esp32. Average Voltages confirmed corresponding to the duty cycles.
It goes through a 1k resistor to reduce any backpropagating energy. Some say 330ohm would be enough, but 1k is more on the safe side. the higher the resistance, the slower the MOSFET switches, but gets hotter. So when working, and getting to hot, I can step down.
It ends at the gate, which opens drain->source, when threshold is reached.(In this case 3.3V)
When the drain-source opens, energy flows from the source to the drain. In this case the 10V from the fan output, to the control line of the fan.
So my chopped up(Pulse modulated) 3.3V , gets transformed to a choppped up 10V signal.