I need some help with basic maths !!!
I have made a 3 cup anemometer, with a reed switch every 45 deg around the circle.
The COUNT command gives me excellent results when the unit rotates. I thus get 8
pulses per rev.
I need to "calibrate" this. I accept the limitations that any calculations are
theoretical and no allowanace is made for losses in the mechanical design. I also
wish to use MPH, not Km per sec / hour.
The radius of the circle 7.25 inches, hence circumference is 45.5 inches.
( Not bad for half a century out of school! )
So, 1 pulse = 45.5 divided by 8 = 5.7 inches
If I count for 1 sec, I think my speed is number of pulses, N, times distance ( 5.7 ), all
divided by time ( 1 sec )
Thus speed = ( N*5.7 )/ 1, inches per sec
There are 63,360 inches to mile, 3600 secs in hour
How do I :-
1. Convert this to MPH
2. Change calculation if I change COUNT time to less than 1 sec
Honestly, this IS a Picaxe question.
The code so far is:-
Thanks to forum members for getting me thus far.
Russ
I have made a 3 cup anemometer, with a reed switch every 45 deg around the circle.
The COUNT command gives me excellent results when the unit rotates. I thus get 8
pulses per rev.
I need to "calibrate" this. I accept the limitations that any calculations are
theoretical and no allowanace is made for losses in the mechanical design. I also
wish to use MPH, not Km per sec / hour.
The radius of the circle 7.25 inches, hence circumference is 45.5 inches.
( Not bad for half a century out of school! )
So, 1 pulse = 45.5 divided by 8 = 5.7 inches
If I count for 1 sec, I think my speed is number of pulses, N, times distance ( 5.7 ), all
divided by time ( 1 sec )
Thus speed = ( N*5.7 )/ 1, inches per sec
There are 63,360 inches to mile, 3600 secs in hour
How do I :-
1. Convert this to MPH
2. Change calculation if I change COUNT time to less than 1 sec
Honestly, this IS a Picaxe question.
The code so far is:-
Code:
' Picaxe 18A
init:
high 7
serout 7,T2400,(254,1,254,1) 'clear screen
main:
posn:
readadc 1,b5 ‘ read value into b1
'Returned values 25 48 70 94 120 152 193 253
pause 50
If b5<30 then
let b12=$4e:b13=$20 'N_
ElseIf b5 < 55 then
let b12=$4e:b13=$45 'NE
ElseIf b5 < 80 then
let b12=$45:b13=$20 'E_
ElseIf b5 < 99 then
let b12=$53:b13=$45 'SE
ElseIf b5 <130 then
let b12=$53:b13=$20 'S_
ElseIf b5<160 then
let b12=$53:b13=$57 'SW
ElseIf b5<200 then
let b12=$57:b13=$20 'W_
Else
let b12=$4e:b13=$57 'NW
EndIf
'end of position select
speed:
let w1=0
count 2, 1000, w1 ‘ count pulses in 1 seconds on i/p 2
'end of speed count
temp:
readtemp 0,b8 'read value into b8 from i/p 0
let b8=40 'NOTE dummy value for b8
'end of temp read
display:
serout 7,T2400,(254,128,"Wind ",#w1," MPH ")
serout 7,T2400,(254,192,"Direction ",b12,b13)
serout 7,T2400,(254,148,"Temp ",#b8,$df,"F")
'end of display
goto main
Russ