Process control has a discussion how to maintain a fan running at a variable speed without tying up the BS2. Surprise! Though depending on the fan your results may vary. If you use PWM to the fan, and only read the temperature every few seconds, the fans inertia should keep it going while you read.
If i were to read the temp every 10 seconds. And sent a pulse to the fan every 5 seconds if the pulse was 1ms on 1 ms off then the fan would run at half speed.
Will the fan keep it's speed over a 5 second gap.
Could I connect a capacitor just before the fan and use it to keep the fan running for the 5 second gap between pulses.
If so what capacitor would you recomend for that job.
Please see picture.
Thanks
Post Edited (computer guy) : 1/28/2007 5:19:28 AM GMT
I’d suggest simplifying this design.· Since you mentioned that this is part of a robot and the BS2 is a single-task processor, but you need the fan to run continuously and the BS2 can’t do that and run your robot too, I’d suggest trying some other ideas for the fan speed control. ·
Please forgive my crude Paint diagram, but I wanted to show you what I was talking about.· PLEASE breadboard, research and test extensively before you build. ·
My first idea is to forget the PWM stuff.· Just switch the fan between high and low speed as needed using a SPDT relay.· Most 12V fans when fed 5V power, spin slowly, about 1/3 to 1/2 as fast.· When needed, energize the relay, giving the fan full power and full speed.· ·
The fan constantly runs at low speed.· A sensor reads the temp and when it exceeds your set point, activates the transistor, which energizes the relay.· The relay now sends full power to the fan, allowing it to spin at full speed.· The BS2 is supervising the process, with the other temp sensor.· At the point marked “BS2 Override Input”, you can output a “high” from the Stamp to make the fan run at full speed.· Or make this pin an “input” and you can sense when the fan has been commanded to full power (relay energized).· If an emergency occurs, i.e. fan is at full power, but the temp is too high for an extended period, you can take action.· You need to decide and design that action. ·
In my diagram, I’m using two temp sensors on the heat sink.· One is the LMXXX part you’re already planning on using, the other is a Dallas ·DS1821.· The DS1821 is connected to the relay, the LMXXX is the one at the top.· The DS1821 is a one-wire programmable chip.· BEFORE using it, you need to create and load a program into the BS2 to program the set points and change it’s mode to “thermostat.”· Also, the settings CAN’T be changed on the fly, to change the switch points; you would need to repeat the initial programming procedure.· Here, I’m simply using it as a temp switch to control the low/high speed transition point.· This is a VERY crude sketch; you need to add resistors as needed, such as between the BS2 and the point marked “override input” and at the base of the NPN transistor.· You may not need the diode between the DS and the relay.· I added it because I’m not sure if the DS can take a reverse input (it may also be backwards).· Check the data sheet. ·
Use an SPDT relay with a 5V coil and 12V contacts.· Connect the fan’s positive lead to the COMMON of the relay.· Connect +5V to the NC (normally closed) connection of the relay.· Connect +12V to the NO (normally open) connection of the relay.· Use a diode across the coil to protect the transistor.· ·
My last idea is to off-load the PWM task onto a co-processor, such as the PWM Pal.· The co-processor would generate continuous PWM at whatever level you specify until told to change or stop.· The PWM co-processor can’t drive the fan directly, so you would still need to use a transistor, FET or H-bridge chip.· The BS2 would initialize the PWM co-processor, starting the fan.· BS2 could then read the temp sensor every X seconds or minutes, convert and process, decide, then as needed, send a new setting to the PWM co-processor.· An advantage is that most of these have two or more channels, allowing you to PWM another fan, motor, LED, etc.· ·
One last note, as I have stated, this is just a concept.· It should work, but research and test, especially your fan.· Some fans may not start at a low voltage, you may need to give it full power at first and then bring it down to where you want it.· Verify that the fan will run at 5V for my first idea; otherwise, you’ll need to figure out the lowest PWM value that the fan will spin at.· There are a lot of example programs to use the DS1821, this should get you started. ·
I hope this helped and good luck!
Could i have a relay that when off would give the fan 5V and if the temperature sensor which will be read every 30 seconds or so reported that the temperature was high the BS2 would set an output High turning on a transistor that would switch the relay giving the fan 12V.
The diode is in there for protection from the switching relay.
Yes,·that's why I specified a Single Pole Double Throw (SPDT) relay.·· When the relay is off, the NC contacts have continuity, allowing the 5V to the fan.· When energized, the NO contacts send 12V to the fan.· Please test to see if the fan will start at 5V.· One last note, as long as there is 5V, the fan will try to spin.· There is no "off" position in the design!
In your diagram, flip the voltages on the relay.·The 5V must be on the NC (Normally Closed).· Or you could leave it this way, and use the relay to put the fan in low speed mode.· This would use a little more power, but might work out better, becuase the fan would run full tilt until you told it to do otherwise.· As you have it, the fan will run at full speed until the relay closes.· You also need a resistor for the base of the transistor.· Follow the diagram previously posted for the BS2/relay wiring.·
It looks like you've combined the two ideas.· Overall, your concept looks good to me.· Remember, breadboard and test!· Divide and conquer, get one part working, then move on and later combine the pieces.· You can use a pushbutton instead of the BS2 to check the relay's operation.· And use·the debug screen and an LED to test the programming.· Then combine the two.
Just out of curiosty, what program are you using for your diagrams?· Trying to use Paint sucks!
Post Edited (Desy2820) : 1/28/2007 11:14:18 AM GMT
Looks like it should "work": with regard to the relay contacts, you will have the fan connected to either +12 or +5 -- I don't know if that's desired or not.· Maybe that's how you're affecting "speed control" (+5 = Low speed, +12 = High speed)?
Update -- I don't know what your fan's current rating is, so I don't know if the/that transistor is appropriate (100mA.)
0.20A 12V Ball bearing I don't think 5V will be enough to power the fan but was hoping that 6V will.
If not i thought if i powered the fan on full (12V) for 5 seconds and then droped it to Low (6V) It should keep low speed momentum.
edit: I might also add another diode between the fan + and -.
P.S will a 1N4004 diode work instead of a 1N4001.
What is the difference?
The 1N4001 has a lower Peak Inverse Voltage (the lowest of that series).· The PIV is the most voltage the diode can hold off when backward-biased.· The 1N4004, etc. will work fine, in that regard.
I think that you may find you will need to incorporate a power transistor, that guy will get pretty hot at 200mA, but give it a go (I don't want to be figured a Prophet of Doom.)
When you say a power transistor what do you mean.... Replacing the original transistor with a different type or adding another one somewhere in the circuit.
I say,·"run her up the flag-pole and see if anyone salutes."· Either way, it won't be the end of the world.
A good learning lesson here.· Keep the Stamp "out of the picture" and just touch the transistor's base resistor, using a jumper wire,·to +5V.· See how that works out.
Just to clarify, the transistor DOES NOT conduct the current from the fan.· The relay's contacts conduct that current.· All the transistor has to worry about is the current thru the relay's 5 volt COIL, which shouldn't be that much.
I'm glad the fan works at·5 volts.· Step one complete!
I have tested the circuit and all seams all right except one thing the 2n2222 transistor seams to be limiting the current to the relay therefore there is not enough current to switch it on.
Everything seems all right, but it's not working, apparently.
I don't know what your relay coil resistance is (this is what collector current is all about.)· I don't know what value you're using for the base resistor either.· Hazarding a guess, I think that you may need to increase the base current (so try a lower value resistor.)
I looked at your drawing.· Is it really a 5V relay coil?· You're using a 1K base resistor.· If it is a 5V relay, then try a 470-ohm base resistor (you can use two 1K resistors in parallel.)
My relays coil resistance is 25Ω i am using a 6v relay that switches with 5 volts without the 2n2222 transistor but as soon as i add the transistor it won't work.
Thank you
P.S i managed to fry my transistor the other day playing around with my base resistor, guess i went to low.
Coil resistance = 24-ohms?· Odd that [noparse][[/noparse]super-atypical.]· The resistance should be (much) higher than 24-ohms.· Most unusual.· Relays are usually 100-300 ohms.· 5V / 24ohms = 210mA.· Where did you get this relay?
I pulled apart an old line following robot of mine the other day and found the exact same circuit. So i salvaged the parts.
Can someone tell me if it is alright to share a negative (-) terminal on 2 devices.
More specifically the power source to the relay (5v) and the propeller (i am using a Proto Board now).
Only the negative (-) terminal.
5v (+)
(+)
(-)
prop (-)
Relay (-)
Thank you
edit:
please look at the pic and tell me your thoughts on if this can be done.
Post Edited (computer guy) : 4/10/2007 2:43:00 AM GMT
computer guy said...
<snip>my parts tend to overheat and the fans are really noisy</snip>
Just an idea but, could it be that maybe the design of the circuit producing the heat should be reviewed with an eye towards reducing the current dissipation that is causing the heat?
Quote:
Can someone tell me if it is alright to share a negative (-) terminal on 2 devices.
More specifically the power source to the relay (5v) and the propeller (i am using a Proto Board now).
Only the negative (-) terminal.
End-Quote
Yes, connect the negative of the 5V power supply to the one of the propeller board
Check-out the "more sophisticated" responses in the Sandbox thread.
Post Edited (Skywalker49) : 4/10/2007 12:05:44 PM GMT
Comments
-Martin
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Martin Hebel
StampPlot - Graphical Data Acquisition and Control
AppBee -·2.4GHz Wireless Adapters & transceivers·for the BASIC Stamp & Other controllers·
Will the fan keep it's speed over a 5 second gap.
Thanks
If so what capacitor would you recomend for that job.
Please see picture.
Thanks
Post Edited (computer guy) : 1/28/2007 5:19:28 AM GMT
·
Please forgive my crude Paint diagram, but I wanted to show you what I was talking about.· PLEASE breadboard, research and test extensively before you build.
·
My first idea is to forget the PWM stuff.· Just switch the fan between high and low speed as needed using a SPDT relay.· Most 12V fans when fed 5V power, spin slowly, about 1/3 to 1/2 as fast.· When needed, energize the relay, giving the fan full power and full speed.·
·
The fan constantly runs at low speed.· A sensor reads the temp and when it exceeds your set point, activates the transistor, which energizes the relay.· The relay now sends full power to the fan, allowing it to spin at full speed.· The BS2 is supervising the process, with the other temp sensor.· At the point marked “BS2 Override Input”, you can output a “high” from the Stamp to make the fan run at full speed.· Or make this pin an “input” and you can sense when the fan has been commanded to full power (relay energized).· If an emergency occurs, i.e. fan is at full power, but the temp is too high for an extended period, you can take action.· You need to decide and design that action.
·
In my diagram, I’m using two temp sensors on the heat sink.· One is the LMXXX part you’re already planning on using, the other is a Dallas ·DS1821.· The DS1821 is connected to the relay, the LMXXX is the one at the top.· The DS1821 is a one-wire programmable chip.· BEFORE using it, you need to create and load a program into the BS2 to program the set points and change it’s mode to “thermostat.”· Also, the settings CAN’T be changed on the fly, to change the switch points; you would need to repeat the initial programming procedure.· Here, I’m simply using it as a temp switch to control the low/high speed transition point.· This is a VERY crude sketch; you need to add resistors as needed, such as between the BS2 and the point marked “override input” and at the base of the NPN transistor.· You may not need the diode between the DS and the relay.· I added it because I’m not sure if the DS can take a reverse input (it may also be backwards).· Check the data sheet.
·
Use an SPDT relay with a 5V coil and 12V contacts.· Connect the fan’s positive lead to the COMMON of the relay.· Connect +5V to the NC (normally closed) connection of the relay.· Connect +12V to the NO (normally open) connection of the relay.· Use a diode across the coil to protect the transistor.·
·
My last idea is to off-load the PWM task onto a co-processor, such as the PWM Pal.· The co-processor would generate continuous PWM at whatever level you specify until told to change or stop.· The PWM co-processor can’t drive the fan directly, so you would still need to use a transistor, FET or H-bridge chip.· The BS2 would initialize the PWM co-processor, starting the fan.· BS2 could then read the temp sensor every X seconds or minutes, convert and process, decide, then as needed, send a new setting to the PWM co-processor.· An advantage is that most of these have two or more channels, allowing you to PWM another fan, motor, LED, etc.·
·
One last note, as I have stated, this is just a concept.· It should work, but research and test, especially your fan.· Some fans may not start at a low voltage, you may need to give it full power at first and then bring it down to where you want it.· Verify that the fan will run at 5V for my first idea; otherwise, you’ll need to figure out the lowest PWM value that the fan will spin at.· There are a lot of example programs to use the DS1821, this should get you started.
·
I hope this helped and good luck!
Post Edited (Desy2820) : 1/28/2007 8:51:15 AM GMT
Could i have a relay that when off would give the fan 5V and if the temperature sensor which will be read every 30 seconds or so reported that the temperature was high the BS2 would set an output High turning on a transistor that would switch the relay giving the fan 12V.
The diode is in there for protection from the switching relay.
In your diagram, flip the voltages on the relay.·The 5V must be on the NC (Normally Closed).· Or you could leave it this way, and use the relay to put the fan in low speed mode.· This would use a little more power, but might work out better, becuase the fan would run full tilt until you told it to do otherwise.· As you have it, the fan will run at full speed until the relay closes.· You also need a resistor for the base of the transistor.· Follow the diagram previously posted for the BS2/relay wiring.·
It looks like you've combined the two ideas.· Overall, your concept looks good to me.· Remember, breadboard and test!· Divide and conquer, get one part working, then move on and later combine the pieces.· You can use a pushbutton instead of the BS2 to check the relay's operation.· And use·the debug screen and an LED to test the programming.· Then combine the two.
Just out of curiosty, what program are you using for your diagrams?· Trying to use Paint sucks!
Post Edited (Desy2820) : 1/28/2007 11:14:18 AM GMT
Site: www.cadsoft.de
(www.cadsoft.de)
Download: tp.cadsoft.de/eagle/program/4.16r2/eagle-win-eng-4.16r2.exe
(ftp.cadsoft.de/eagle/program/4.16r2/eagle-win-eng-4.16r2.exe)
Thanks for your help
Post Edited (computer guy) : 1/28/2007 11:24:15 AM GMT
Thank you all for your help.
Am jumping for joy at the fact that this project is going somewhere.
Update -- I don't know what your fan's current rating is, so I don't know if the/that transistor is appropriate (100mA.)
Post Edited (PJ Allen) : 2/1/2007 11:11:13 PM GMT
If not i thought if i powered the fan on full (12V) for 5 seconds and then droped it to Low (6V) It should keep low speed momentum.
edit: I might also add another diode between the fan + and -.
P.S will a 1N4004 diode work instead of a 1N4001.
What is the difference?
Thanks
I think that you may find you will need to incorporate a power transistor, that guy will get pretty hot at 200mA, but give it a go (I don't want to be figured a Prophet of Doom.)
What transistor would you recomend?
Thank you
A good learning lesson here.· Keep the Stamp "out of the picture" and just touch the transistor's base resistor, using a jumper wire,·to +5V.· See how that works out.
I just tested my fan and it runs from 5V so that looks good.
Now just have to get the components and test the transistor and relay switching circuit.
Thank you
Post Edited (computer guy) : 2/2/2007 3:21:40 AM GMT
I'm glad the fan works at·5 volts.· Step one complete!
I have tested the circuit and all seams all right except one thing the 2n2222 transistor seams to be limiting the current to the relay therefore there is not enough current to switch it on.
Thank you
Computer guy
I don't know what your relay coil resistance is (this is what collector current is all about.)· I don't know what value you're using for the base resistor either.· Hazarding a guess, I think that you may need to increase the base current (so try a lower value resistor.)
I looked at your drawing.· Is it really a 5V relay coil?· You're using a 1K base resistor.· If it is a 5V relay, then try a 470-ohm base resistor (you can use two 1K resistors in parallel.)
Thank you
P.S i managed to fry my transistor the other day playing around with my base resistor, guess i went to low.
Computer guy
It is a small relay (1cm X 1.5cm X 1cm) - W X L X H
Thank you
Can someone tell me if it is alright to share a negative (-) terminal on 2 devices.
More specifically the power source to the relay (5v) and the propeller (i am using a Proto Board now).
Only the negative (-) terminal.
5v (+)
(+)
(-)
prop (-)
Relay (-)
Thank you
edit:
please look at the pic and tell me your thoughts on if this can be done.
Post Edited (computer guy) : 4/10/2007 2:43:00 AM GMT
Bump
Just an idea...
Vern
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Any thoughts on the sharing of negative (-) terminal?
Thank you
Quote:
Can someone tell me if it is alright to share a negative (-) terminal on 2 devices.
More specifically the power source to the relay (5v) and the propeller (i am using a Proto Board now).
Only the negative (-) terminal.
End-Quote
Yes, connect the negative of the 5V power supply to the one of the propeller board
Check-out the "more sophisticated" responses in the Sandbox thread.
Post Edited (Skywalker49) : 4/10/2007 12:05:44 PM GMT