Electronic Projects, forums and more.

Go Back   Electronic Circuits Projects Diagrams Free > Electronics Categories > Micro Controllers


Micro Controllers Discuss all aspects of micro controllers - building them, coding them, etc. All controllers are welcome - PIC, BASIC, Z8 Encore!, etc.

Reply
 
LinkBack Thread Tools Display Modes
Old 5th January 2006, 06:46 PM   (permalink)
Default circuit for pwm fan control

I would like some help in putting together a circuit for controlling fans through pwm. Does the attached circuit makes sense? I have added the npn amplifier and mosfet as the pic (16f628a) is not capable of driving the fans (2x12V) directly. I should probably also isolate the CCP1 pin using an optocoupler.

This is first itteration, once this is working, the next step would be to add temperature sensing (Dallas DS18B20). For those interested, the aim is to produce an "automagical" way of controlling fans used to cool the primary mirror of a newtonian telescope.

Thanks for your help
Attached Images
File Type: png pwm_circuit.png (10.9 KB, 704 views)
spirosd is offline  
Old 5th January 2006, 07:09 PM   (permalink)
Default

What's T1 for?.

Also, I would suggest putting the diode across the fan, and not across the FET.
__________________
PIC programmer software, and PIC Tutorials at:
http://www.winpicprog.co.uk
Nigel Goodwin is offline  
Old 5th January 2006, 07:45 PM   (permalink)
Default

Quote:
What's T1 for?.
The fans that I need to power are 12V. I assume that Q1 needs to be driven at 12V. The CCP1 output from the pic would be 5V so, use T1 to amplify to the 12V.
spirosd is offline  
Old 5th January 2006, 07:56 PM   (permalink)
Default

Quote:
Originally Posted by spirosd
Quote:
What's T1 for?.
The fans that I need to power are 12V. I assume that Q1 needs to be driven at 12V. The CCP1 output from the pic would be 5V so, use T1 to amplify to the 12V.
T1 is an emitter follower, so will only drive the gate of Q1 to about 4.3V - LESS than the PIC on it's own will do!. The gate voltage isn't dependent on the drain supply, but on the switching characteristics of the FET - many FET's are logic level, and will work fine straight from the PIC. But in any case, as it's wired T1 is only making things WORSE.
__________________
PIC programmer software, and PIC Tutorials at:
http://www.winpicprog.co.uk
Nigel Goodwin is offline  
Old 5th January 2006, 08:33 PM   (permalink)
Default

Quote:
Originally Posted by Nigel Goodwin
Quote:
Originally Posted by spirosd
Quote:
What's T1 for?.
The fans that I need to power are 12V. I assume that Q1 needs to be driven at 12V. The CCP1 output from the pic would be 5V so, use T1 to amplify to the 12V.
T1 is an emitter follower, so will only drive the gate of Q1 to about 4.3V - LESS than the PIC on it's own will do!. The gate voltage isn't dependent on the drain supply, but on the switching characteristics of the FET - many FET's are logic level, and will work fine straight from the PIC. But in any case, as it's wired T1 is only making things WORSE.
I take it from your reply that I can remove T1 and drive Q1 directly from the pic.

I should be able to utilise the pwm output to control the voltage to
> peltier device
> step motors (in place of a chopper circuit)

Greatly appreciate your input Nigel.
spirosd is offline  
Old 5th January 2006, 09:28 PM   (permalink)
Default

Quote:
Originally Posted by spirosd
I take it from your reply that I can remove T1 and drive Q1 directly from the pic.
Yes, no matter what the FET it will be better than with it, but with a logic level FET it will switch fully (I'm not sure if that FET is logic level or not?, the datasheet should tell you).
__________________
PIC programmer software, and PIC Tutorials at:
http://www.winpicprog.co.uk
Nigel Goodwin is offline  
Old 5th January 2006, 09:46 PM   (permalink)
Default

Quote:
Originally Posted by Nigel Goodwin
Yes, no matter what the FET it will be better than with it, but with a logic level FET it will switch fully (I'm not sure if that FET is logic level or not?, the datasheet should tell you).
Looking at the datasheet for the irf510 from intersil it says
Quote:
... These types can be opearated directly from integrated circuits. ....
I think it's time to try the circuit.

Thank you for your help.
spirosd is offline  
Old 5th January 2006, 09:46 PM   (permalink)
Default

Quote:
Originally Posted by Nigel Goodwin
Quote:
Originally Posted by spirosd
I take it from your reply that I can remove T1 and drive Q1 directly from the pic.
Yes, no matter what the FET it will be better than with it, but with a logic level FET it will switch fully (I'm not sure if that FET is logic level or not?, the datasheet should tell you).
I suggest that you connect a 100 Ohm resistor between the PIC output and the gate of Q1. As I understand it, this prevents the possibility of spurious oscillation.
__________________
Len
ljcox is offline  
Old 5th January 2006, 09:54 PM   (permalink)
Default

Quote:
Originally Posted by ljcox

I suggest that you connect a 100 ohm resistor between the PIC output and the gate of Q1. As I understand it, this prevents the possibility of spurious oscillation.
Would that be in place of the 1K resistor or, in addition to?
spirosd is offline  
Old 5th January 2006, 10:32 PM   (permalink)
Default

You don't need the 1 k as the PIC switches between Vdd and gnd.
__________________
Len
ljcox is offline  
Old 5th January 2006, 10:54 PM   (permalink)
Default

Thank you Len,

I am attaching the modified circuit.

Thanks again to you and Nigel for your help.
Attached Images
File Type: png pwm_circuit_128.png (10.5 KB, 652 views)
spirosd is offline  
Old 6th January 2006, 04:17 AM   (permalink)
Default

You're welcome. Its nice to be appreciated, some don't bother.
__________________
Len
ljcox is offline  
Old 6th January 2006, 06:08 AM   (permalink)
Default

You don't need to use 7805 for the PIC. A 78L05 the size of a TO-92 transistor is suffice and it don't need a heatsink.

The value of capacitors(C1 & C2) at the input and output of the regulator is a bit low consider that you are driving a DC motor. You'll get better reliability against motor noise by using 100uF or higher for C1 and 10uF for C2.

I would also add a 100K resistor from the gate of IRF510 to Vss as the PIC would reset to open circuit(high impedance) regarding its port pins.
__________________
L.Chung
eblc1388 is offline  
Old 6th January 2006, 06:44 AM   (permalink)
Default

I dunno about the 100 ohm inline with the gate ... I guess it can't hurt, since the gate only requires microamps to switch off to on

however, I would recommend a pulldown between the gate and ground (easy way is your source pin is ground, just connect a 10k resistor between pins 1 and 3 on the fet)

the pull down prevents the mosfet from entering linear or resistive mode should something happen to the control signal from the pic (for example PIC browns out or resets or locks up or whatever)

without a pulldown to ground, the gate could be left floating, meaning the mosfet would be partily conducting, and incur massive power dissipation. this way, the pulldown forces the switch off unless the pic specificly tells it to be on

also, check the datasheet for your mosfet ... most of the IRF5xx are in the International Rectifier HEXFet series, and have internal clamping diodes, eliminating the need for D1... in fact, page two of the IRF510 datasheet clearly describes the internal protection diode

last thing... the RdsON of that fet is pretty poor, compared to what's available now ... that device is not what I'd call a "logic level" mosfet ... depending on the load being switched, it might not make a difference... but if you're trying to pwm some monster fan you probably won't see full voltage at the fan, since the 5v from your PIC won't be enough to fully switch the mosfet. this also means your mosfet will be getting pretty warm, since it's in resistive mode and not switching the full current.
justDIY is offline  
Old 6th January 2006, 06:58 AM   (permalink)
Default

Quote:
Originally Posted by justDIY
also, check the datasheet for your mosfet ... most of the IRF5xx are in the International Rectifier HEXFet series, and have internal clamping diodes, eliminating the need for D1... in fact, page two of the IRF510 datasheet clearly describes the internal protection diode.
The diode in the datasheet is the intrinsic body diode. The diode in the OP's circuit is there to prevent back emf of the load affect other part of the circuit. They serve different functions and is not one or the other. One still needs the D1 diode even using a MOSFET with an intrinsic diode.
__________________
L.Chung
eblc1388 is offline  
Reply

Bookmarks

Thread Tools
Display Modes





All times are GMT. The time now is 06:49 AM.


Electronic Circuits  |  Learning Electronics
Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.

eXTReMe Tracker