Electronics > Microcontrollers

Fan controller with PWM using STM32 chip

<< < (11/14) > >>

DavidAlfa:
Yes. For single on/off applications you can put a 100K resistor to the gate and it will work.
But, as I said before, when it comes to fast switching, PWM, you need a strong drive for the mosfet to fully turn it on/off, to overcome the gate capacitance.
And to do that you need a low value resistor. But that gives another issue: if the mosfet blows, you'll have a low impedance path to the mcu pin and burn it and mayber more things connected to it.
You can't use a 10K resistor to drive a mosfet with PWM, the current is very limited and it will make the switching speeds very slow, to the point where you might set the mosfet half turned on.
A bipolar transistor doesn't have a gate to charge, negligible RC constant. Thus, as long as it has enough HFE(gain), you can drive it with high resistor values.

psysc0rpi0n:

--- Quote from: ealex on May 30, 2021, 09:09:55 am ---Hello

How do you plan to program the MCU ?
I don't see any connector for either SWD or UART0

--- End quote ---

It's quite different now.



Well, I did my best. It might get better over time, I hope!



--- Quote from: DavidAlfa on May 30, 2021, 04:47:48 pm ---What a strange thing you made! Sorry I couldn't resist... :-DD.


Restore the transistor driver circuit as before. Just invert the PWM signal in the MCU registers!

With that circuit you're making a voltage divider. Not only that, a bipolar transistor needs current to turn on.
If you put a resistor in the emitter, the max voltage you can get there is Vbase-0.7.
So yes, luckly you will set the Mosfet gate to 2.4V. If it works at all.
Once the emitter voltage reaches that voltage, no more current can flow from base to emitter since the MCU sends 3.3V.

It seems you're using the one of these computer-like fans, they take little currents, maybe 300mA.... Consider replacing the whole thing with a Darlington transistor, it will be easier:



These have huge current gains, easily >1000. So with 5mA you can drive 5Amps.

--- End quote ---

I didn't come to this thread for a while. In the meantime I made some changes. Check above.

DavidAlfa:
Are you afraid of the thick traces? ;D

- Vdd comes out of the regulator, goes to C6, mcu, back to C8. Why? Put them in parallel in the same trace.
- Mcu Vdd pin goes to L1, L1 goes to C9 and C10 goes nowhere?
- VDDA goes to C11, but not connected to VDD through L1.

Ahh but you appplied via stitching to reinforce the ground, avoiding capacitance and current loops. Was you, or did the program make it automatically?  :-DD

I'm not a professional designer, but I like it... Check this one-boring-raining-day board design I did few months ago. I think it wasn't complete but I don't remember right know.
Perhabs you could get some tips by checking it (Or also might I, nobody knows everything!)
For the analog, since the current was only 2-3mA, I used a TL431 circuit designed for 7mA. For each analog device (op-amp, mcu vdda) I put a 10Ohm resistor and a 10uF cap after it.
10ohm, 2mA=20mV drop, so no problem... Use Proteus, the demo version will allow to see everything  :-+




psysc0rpi0n:

--- Quote from: DavidAlfa on June 26, 2021, 03:20:03 am ---Are you afraid of the thick traces? ;D

- Vdd comes out of the regulator, goes to C6, mcu, back to C8. Why? Put them in parallel in the same trace. <-- Noob here. Inexperience, I guess
- Mcu Vdd pin goes to L1, L1 goes to C9 and C10 goes nowhere? <-- Check images below
- VDDA goes to C11, but not connected to VDD through L1. <-- Check images below

Ahh but you appplied via stitching to reinforce the ground, avoiding capacitance and current loops. Was you, or did the program make it automatically?  :-DD

I'm not a professional designer, but I like it... Check this one-boring-raining-day board design I did few months ago. I think it wasn't complete but I don't remember right know.
Perhabs you could get some tips by checking it (Or also might I, nobody knows everyt!)
For the analog, since the current was only 2-3mA, I used a TL431 circuit designed for 7mA. For each analog device (op-amp, mcu vdda) I put a 10Ohm resistor and a 10uF cap after it.
10ohm, 2mA=20mV drop, so no problem... Use Proteus, the demo version will allow to see everything  :-+






--- End quote ---

You gotta be kidding... You're not a pro? ahahah. ok
You're a pro to me.

Anyways, replying to your post:

About the C9, C10 an C11, it's strange because the connection is present on the schematics. C9, C10 and C11 should all be connected to each other and to VDDA. I have no idea why Kicad is not complaining about a missing connection.




About the Via stitching, it was me by hand, but there are plugins to do it I think. But someone told me to do it. I didn't know this improves ground and etc.

DavidAlfa:
I don't know that software... is it kicad? I've wanting to learn it for a long time but I never started!
Can you send the file? Or is it a FBI top-secret fan controller? :-DD

Navigation

[0] Message Index

[#] Next page

[*] Previous page

There was an error while thanking
Thanking...
Go to full version