Shop OBEX P1 Docs P2 Docs Learn Events
Fan Speed Control — Parallax Forums

Fan Speed Control

BpaddockBpaddock Posts: 6
edited 2009-12-01 03:34 in BASIC Stamp
Hello all!

I'm trying to build a laptop cooler with a temperature controlled variable speed fan. I've ordered the main components such as a DS18B20 temperature sensor and a 12VDC pwm computer case fan. I have seen multiple projects similar to this on the internet, but I need help controlling the fan speed. The one I found uses 5V fans not 12V.

Here's my problem. I want to use the pbasic command pwm to tell the fan what speed to operate at using duty and duration. The problem is the duty is only rated for 0-5V and I need to output pulses at 12V for the fan to operate at its optimum rpm range. Is this possible? Do i need to use a transistor to switch the fan up from 5v to 12V or what? Any help we be amazing.

Thanks!

Brian

Comments

  • sam_sam_samsam_sam_sam Posts: 2,286
    edited 2009-11-17 23:52
    Take a look at this web site

    ·Click here....>>>>>· Fans

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ··Thanks for any·idea.gif·that you may have and all of your time finding them smile.gif

    ·
    ·
    ·
    ·
    Sam
  • BpaddockBpaddock Posts: 6
    edited 2009-11-18 21:11
    Sam,

    Thanks for the reply. Yeah, I've found a bunch of 5V fans, but i was just wondering if there was any other way.
  • BpaddockBpaddock Posts: 6
    edited 2009-11-19 15:55
    Will a 5V .15A fan work with the Bs2 board? Can it handle that amount of current?
  • Mike GreenMike Green Posts: 23,101
    edited 2009-11-19 17:29
    A BS2 I/O pin can handle maybe 25mA. If you want to control more, look at Nuts and Volts Column #6. Go to Parallax's main web page and click on the Resources tab. In the list that you'll get, choose the Nuts and Volts Columns link and look for column #6.
  • BpaddockBpaddock Posts: 6
    edited 2009-11-19 23:33
    Ok, so let me see if I'm understanding this right. To get the fan to be powered by the BS2 board pin, I need to use a (in my case) ZTX689AB Transistor to get the current up, pairing this with a 390 ohm Resistor will send a 5V signal from the board to the transistor, but will loose .5V, so the fan will be at 4.5V, but will have enough current (need .15A and will get 2A?). Is that right? So then I can send pwm to the fan? Do i send this signal out through the same pin (+V) or the ground?
  • Mike GreenMike Green Posts: 23,101
    edited 2009-11-19 23:45
    Again, refer to the Nuts and Volts Column I mentioned.

    Yes, you need to use a switching transistor to control the current for the fan. This switching transistor will drop a small amount of voltage across it that will "take away" from what's available for the fan (usually about 0.3V - typical for a saturated switching transistor). The fan will use as much current as it needs, in your case 150mA (not 2A!)

    If you need to control the fan's speed, you should be able to use what's called PWM (pulse width modulation). This turns the fan on and off rapidly so the average current (and average speed) is what you want. A BS2 can't do anything else when it's generating PWM signals, so that may not be practical. If you really need to control the fan's speed, there are some external circuits that can take responsibility for the actual PWM operation so the Stamp doesn't have to do it.
  • BpaddockBpaddock Posts: 6
    edited 2009-11-19 23:54
    Mike,

    Thank you so much for pointing me in the right direction. So basically, if i want to use the BS2 pbasic command PWM, I could'nt say take the temperature using a DS18B20 at the same time? If not, what external circuit will i have to build to free up the BS2 but still use PWM? What does it consist of?
  • Mike GreenMike Green Posts: 23,101
    edited 2009-11-20 00:03
    You could use an LM555 timer with digital potentiometers to set the frequency and pulse width. There are different digital potentiometers all of which can be controlled with a Stamp. Look at Maxim/Dallas' website for a large selection of potentiometers.
  • skylightskylight Posts: 1,915
    edited 2009-11-20 09:25
    Just to add you shouldnt overlook starting current for the fan
  • MichelBMichelB Posts: 154
    edited 2009-11-20 12:31
    You can also see Chapter 6 & 7 of Process Control.
  • BpaddockBpaddock Posts: 6
    edited 2009-12-01 03:34
    OK,

    So I got the fans figured out, but i have another problem. I ordered 3 DS18b20's thinking I could use them with the BS2 but in reality the commands owin and owout only work with the bs2p. Is there any way to get these to work with the BS2 I saw a code by PH Anderson, but I'm not sure exactly how everything is hooked up. Should I just forget it and use a LM34 sensor to make my life easier?
Sign In or Register to comment.