I didn’t
I thought that was the best way to go with the BC337, and probably found an example where they did that. Don’t remember exactly.
But from my point of view, there is no preference for cutting ground instead of Line
I didn’t
I thought that was the best way to go with the BC337, and probably found an example where they did that. Don’t remember exactly.
But from my point of view, there is no preference for cutting ground instead of Line
Anyway, I wouldn’t try to switch off that pwm pin with transistor because there is possibility that tach pin is becoming ground path.
So PNP is the way to go. In addition to NPN that you already have you just need another 500ohm resistor and PNP transistor.
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?