What FET?
MosFet?
Need to see the circuit anyway.
What FET?
MosFet?
Need to see the circuit anyway.
"If the Earth were a single state, Istanbul would be its capital." Napoleon Bonaparte
Ok forget about the FET and talk to me about the PWM signal. Should it be 5V pulses or 2.2V pulses? If 5V, what do I need to set to make it be that level?
Using Sayzer's code, attached, I've been able to control an LED as desired.
Coupling that to a larger current drawing device is a problem. Of the schematic page provided, the top drawing has pulses at GP2 to the MOSFET of about 2.3 volts and won't power on the fan. I thought once I figured out how to get the pulses up to around 5 volts the FET would turn on and I'd be golden.
The lower schematic adds R1 and R2 so I get around 4.8 volt peaks with varying RMS values but even with the larger pulse size it still won't turn on the fan. I felt really stupid after I figured that one out.
I can connect the gate to +5V and it will turn the FET on and drive the fan. Although I don't think it's bringing the fan up to full speed.
So what in hell am I missing? Why won't the chip drive the FET to turn on the fan?
Check PWM freq,
If too high, the inductance of the motor affects operation, add diode across motor pointing up, returns energy to motor when MOS FET switches off. Hardware PWM freq only goes so low. May need INT to PWM or do it in basic.
The ckt shows P-channel MOS but your N-channel setup is ok.
Don
I didn't have a coil so I tried the cap across the motor and voila!
Thanks.
I still can't get the fan to do three speed steps it's either on or off. Any ideas?
Not all fans can be controlled by PWM.
Try your fan directly with 5V power supply, and see if it runs.
Most likely, it won't run at 5V.
Increase the voltage and see at what voltage it will start running.
If it starts running at around say 10V ~ 11V, then you will have to change your fan, which most probably is controlled by an internal electronic controller.
Try your circuit with a simple traditional DC brushed motor and see if your PWM works.
"If the Earth were a single state, Istanbul would be its capital." Napoleon Bonaparte
You are so smrt. I mean smart.
I assumed a DC fan would run slower at half of rated voltage and slower still at quarter of rated voltage. When I tried your test on my test fan, sure enough it wouldn't run on 8 volts and labored significantly on 10.
I've yet to try the PWM on a real DC fan without a speed controller but I'm sure it will work just fine.
Thanks.
Bookmarks