I am working on a controller based around the PIC16F18877 which will need to control a 4-wire 12V DC Fan, as well as read the signal from the sensor wire. The PWM signal needs to be somewhere between 18kHz and (I think) 30kHz, so I am planning on using a 20kHz. Since the MCU runs on 5V and the fan needs a 12V signal, I will obviously need some kind of level switching. Also, the signal will need to travel about 6-10 feet from the control unit to the fan.
I was doing some research online and found some conflicting information. Some sources said I should be able to run the fan directly from a MOSET, something like this:
(NOTE: I forgot to add the pull-down resistor on the PWM_Out line for when the MOSFET is off)
However, other sources said about using a circuit similar to this:
Can only suggest which one would be better and meet all my needs, specifically:
- 20kHz signal
- PWM_Out wire will be approximately 6-10 feet long
- PWM signal being generated from a PIC16F18877
Also, along the same lines, since I need to read the speed back, and convert the 12V signal from the fan back to 5V as an input to the MCU, whichever circuit I use to send the PWM signal to the fan, I am assuming I can just flip it around and use it in reverse, correct?
Any suggestions/guidance would be appreciated. TIA.