Natalie Wilkie
New Member
Hi All,
I was hoping I could get some hints from the experts.
I’m fairly new to the picaxe and programming and was hoping I could get some hints on my program (be gentle please).
What I have is a cabinet I would like to place a fan that will turn on when it reaches a certain temperature and increases in speed as the temp rises. I am using an 8M picaxe, a small 12v brushless fan and controlling its speed with the pwmout command. I am also using the ds18b20 temperature sensor.
My program does work and changes speed as the temp increases as it should, but when it is running at any speed other than flat out (fullon) it makes a small high pitched noise. Is this normal??
I have used the pwmout wizard and used 5000hz as the frequency, and input 25%, 50%, 75% and 100% to get my values. Excuse me for sounding blonde, but how do I know what frequency to use?
Any hints or suggestions would be most appreciated.
Cheers
Nat
Initialise:
high 2
pause 5000
low 2
Main:
readtemp 1, b1
debug b1
if b1 <28 then offf
if b1 >34 then fullon
If b1 >=29 and b1 <=31 then gosub Temp_25
If b1 >=32 and b1 <=34 then gosub Temp_50
If b1 >=35 and b1 <=37 then gosub Temp_75
Temp_25:
pwmout 2 , 199, 200
wait 5
goto main
Temp_50:
pwmout 2 , 199, 400
wait 5
goto main
Temp_75:
pwmout 2 , 199, 600
wait 5
goto main
Fullon:
'high 2
pwmout 2 , 199, 800
wait 5
goto main
Offf:
pwmout 2 , 0, 0
goto main
I was hoping I could get some hints from the experts.
I’m fairly new to the picaxe and programming and was hoping I could get some hints on my program (be gentle please).
What I have is a cabinet I would like to place a fan that will turn on when it reaches a certain temperature and increases in speed as the temp rises. I am using an 8M picaxe, a small 12v brushless fan and controlling its speed with the pwmout command. I am also using the ds18b20 temperature sensor.
My program does work and changes speed as the temp increases as it should, but when it is running at any speed other than flat out (fullon) it makes a small high pitched noise. Is this normal??
I have used the pwmout wizard and used 5000hz as the frequency, and input 25%, 50%, 75% and 100% to get my values. Excuse me for sounding blonde, but how do I know what frequency to use?
Any hints or suggestions would be most appreciated.
Cheers
Nat
Initialise:
high 2
pause 5000
low 2
Main:
readtemp 1, b1
debug b1
if b1 <28 then offf
if b1 >34 then fullon
If b1 >=29 and b1 <=31 then gosub Temp_25
If b1 >=32 and b1 <=34 then gosub Temp_50
If b1 >=35 and b1 <=37 then gosub Temp_75
Temp_25:
pwmout 2 , 199, 200
wait 5
goto main
Temp_50:
pwmout 2 , 199, 400
wait 5
goto main
Temp_75:
pwmout 2 , 199, 600
wait 5
goto main
Fullon:
'high 2
pwmout 2 , 199, 800
wait 5
goto main
Offf:
pwmout 2 , 0, 0
goto main