Understood. Is the BC557 the correct choice for the PNP transistor?
Something like this:
Bc557 is only ok if your fan current is below 100mA
Anyway, if you donât have any pnp on hands and need to order, I would go with BC327 (current max 800mA).
Your circuit for pnp is not correct, remove the connection on the right side.
Also why you have 5v pullup for tach? Esp doesnât like it.
Edit: And your diode is in short againâŚ
Not sure if I can follow you now. But is this what you mean? Or is the grounding of the fan still incorrect?
Fixed the diode⌠my badâŚ
On the tach:
If I connect that directly to the ESP, Iâm getting weird results. Fan at 60% results in 4500 RPM. While according to spec the fan cannot run faster than 1350 rpm.
I found I wasnât the only one and followed @MrFusion 1st suggestion in this thread
In your circuit there is no ground at the moment! Or maybe there is, but not visible. So fan gnd directly to gnd, not through transistor.
For tach, you obviously pull it up to 3.3V, not 5V. Makes sense?
Yes, starting to make sense. But I am still struggling the understand how the NPN and PNP transistors are working. As I understand, the ESP switches the NPN. When the NPN is on, it switches the PNP. Is it correct that this is necessary because the ESP canât directly switch 12v?
Hereâs another overview with colored lines:
I rerouted the 3.3v pull-up to the 3.3v pin of the ESP. But at the same time, I am wondering why I am powering the ESP and DS18B20 over 5v. There is no reason, is there? But at the same time, this is not âwrongâ either?
Edit: fixed typo on the tach-line. Is indeed pullup
If you want, I can make a circuit simulation for you on falstad.com, you donât need to create any account.
That way itâs easier to understand.
Yes, very much! Alway happy to learn!
Pullup, right?
Exactly.
If you have good 3.3V supply, you can use that. But be aware that then you donât have 5V pin anywhere in your setup.
5V supply is little bit safer because of voltage regulator between supply and MCU.
But DS18B20 you should power at 3.3V
You need to flip BC327 on your circuit image.
Also, it looks confusing that you route bc337 gnd to Esp.
I just inserted a dumb 2W load instead of fan (I donât know specs).
Many thanks @Karosm! Youâve been incredibly helpful and above all super patient.
I will fix the last issues you mentioned and order parts. That will take some 2 weeks. Of course will get back after that.
Thanks!
Youâre welcome, did that circuit simulation make transistor circuit more understandable?
Change also transistor base resistors to 1k, itâs better for your current setup.
Be aware, that you have been abusing your Esp with 5V pullup, 5V temp sensors and especially with unknown current sinking to pwm pin. I wouldât trust that board âeyes closedâ anymore.
Finally an update here! I got a working PCB (took some iterations), but running into an issue.
I just tested the setup with 15 fans (all 12v) and this will break the setup. After a short period of the the board started to smell and the BC327-25 got very hot. It will burn. The setup is not prepared for so many fans.
@Karosm can you help me once again and suggest a better switch? The current power adapter I use can go up to 5A. The fans are Artic F9 which do 0.16A each according to spec (ARCTIC | Cooling, Mounts, Equipment | The Cooler Way | Cooler than ever). I need about 2.5A, so with a little overhead that makes 3A
Edit: Something like this maybe? TIP125 STMicroelectronics - Transistor: PNP | bipolaire; Darlington; 60V; 5A; 65W; TO220AB | TME - Elektronische Componenten Nederland
You forgot to tell that? I donât remember anymoreâŚ
Anyway I wouldnât drive more than 2 fans with that tiny transistor.
Canât you use multiple of them? I donât remember all details of your setup. High side switch and thatâs it? Small pcb relay?
Iâm afraid I didnât tell you that. Sorry, forgive my ignorance.
I use the board to drive fans on my radiators (housewarming). So hard to split it all up. 15 fans is the biggest setup I have, and the most important oneâŚ
Hereâs the switching part againâŚ
No problem!
Whatâs wrong with relay? Easiest way to take care of it.
Transistors are not ideal for big loads, they are not energy efficient and thatâs the reason we use mosfets for higher loads.
If you have bag of BC327 in drawer, you can use 8 of them and wire 2 fans/each.
Thatâs an option, but would introduce some practical challenges (mostly wiring). As I probably will need to update/redesign the board anyway (think that will be version 10+ ), I would prefer to switch to a MOSFET. Would that be a simple replacement of the BC327? Or is there more involved?
If I had to choose between relay and PNP logic level mosfet, I would pick relay. Mainly for simplicity and availability (you donât find those mosfets like you find NPN).
Fourth option would be NPN mosfet, and try to drive PWM trough diode preventing sinking 12V to pwm pin. Not that I prefer that though.
I need about 7 boards with various amounts of fans connected (between 15 and 3 fans per board). With the relay option (2 fans per BC327) that would require quite some BC327âs, fan connectors, etc. And thatâs a lot of soldering, etc⌠I prefer a generic board that just accepts enough fans in a serial setup
What MOSFET would I need if I would go for that option (Quick Google; IRF4905BPF)? I mean, Ali has a lot these days
Or should I go for a completely different approach?