Hey there, I am setting up one of these:
Just wondering if you know what the km/h speed per second should be for the anemometer. Im trying to calibrate it and need this info.
Thanks,
Jeroth
Hey there, I am setting up one of these:
Just wondering if you know what the km/h speed per second should be for the anemometer. Im trying to calibrate it and need this info.
Thanks,
Jeroth
Hi Jeroth
Welcome
Not sure exactly what you mean here.
kM per second = kM per hour divided by 3600.
Why should you need to calibrate it. If you purchased this lot as a complete unit the only ācalibrationā you might need to do would be in the Arduino set up somewhere. I donāt know how this communicates with Arduino as I have not looked at it at all. I think the word ācalibrateā may be used incorrectly as you will have nothing to compare with unless you have another anemometer of known accuracy. Maybe you mean you have to do some arithmetic in Arduino to get the readings you want.
cheers Bob
Iām following the raspberry pi tutorial to create a weather station. In the guide, it says to calibrate the anemometer to 2.64 km/h for each rotation per second. Thatās for a different anemometer to the one Iāve bought, so just looking for info on what the speed reading should be for one rotation per second so I can make sure Iām getting accurate readings.
Hi Jeroth
All the documentation in that link you provided seem to refer to Arduino.
You maybe need to get the info for āthe one you boughtā.
Does not tell anybody exactly what this is so meaningful information could be a bit scarce.
Cheers Bob
Hi Jeroth, welcome back!
I took a look at the wiki page listed on the product page, and it seems the āconverter boardā in the unit you purchased handles counting pulses, so the speed output is in mph already, in what seems to be 2 peak windows (1min, 5mins):
Youāll just need a flat conversion multiplier of 1.60934
Lemme know if you have any problems
Hey James, thanks for the reply. I am using this on a raspberry pi, and following a pi guide for the project, and hence am not using the board that came with the anemometer, im connecting the wind speed, direction and rain modules directly to the pi without the board.
Hi @f0rml3ssf0rm (Jeroth)
Here is a lump of code that I found online somewhere lost in the mists of time (and will be using in my weather station soon) that is for a Holman anemometer ā¦ and from digging about seems similar to other code for these devices.
One thing I found is the Holman does 2 pulses per revolution (turn it by hand and either measure it or listen real close to hear the reed switch I need to test the code re this foibleā¦
The āmagicā is in the calculate_speed module
hw = True
import math
import threading
import time
import logging
if hw:
import RPi.GPIO as GPIO
logging.basicConfig(filename='log_weather.log', level=logging.ERROR, format='%(asctime)s %(message)s', datefmt='%d/%m/%Y %I:%M:%S %p')
#For Holman:
#1600rev/hr=1mph
#1/rotation per second = 2.25 mph = 1.953 knot
knotRevsPerSecond = 1.95313
counterStartTime = time.time()
class Anemo(threading.Thread):
def __init__(self, pinAnemometer, anemo_dia = 9.0, time_interval = 5):
threading.Thread.__init__(self)
if hw:
# Set GPIO
GPIO.setmode(GPIO.BOARD)
GPIO.setwarnings(False)
GPIO.setup(pinAnemometer, GPIO.IN, GPIO.PUD_UP)
GPIO.add_event_detect(pinAnemometer, GPIO.FALLING, callback=self.spin)
self.countAnemometer = 0
self.anemo_dia = anemo_dia
self.interval = time_interval
self.wind_speed = 0
def calculate_speed(self, r_cm = 9.0, time_sec = 5):
circ_cm = (2 * math.pi) * r_cm
rot = self.countAnemometer / 2.0 ### ;-) 2 clicks per rev ?!?
dist_km = (circ_cm * rot) / 100000.0 # convert to kilometres
km_per_sec = dist_km / time_sec
km_per_hour = km_per_sec * 3600 # convert to distance per hour
return km_per_hour
#interrupt callback
def spin(self,channel):
self.countAnemometer += 1
def run(self):
self.readAnemometer()
#Anemometer loop thread
def readAnemometer(self):
while True:
try:
self.countAnemometer = 0
self.wind_speed = self.calculate_speed(self.anemo_dia, self.interval)
logging.debug(str(self.wind_speed) + ' reading Anemometer')
time.sleep(self.interval)
except Exception as e:
logging.critical(str(e)+' error reading Anemometer')
time.sleep(self.interval)
hope this helps,
cheers
Murray
Thanks for the reply, Murray! Decided im just going to assume its accurate, ive used almost identical code, and there doesnt seem to be any calibration in that code either so il just move forward.
Jeroth
If you have a reading and you just need to compare that reading to the true wind speed then a suitable procedure is to hang it outside a car window as you drive. Remember that car speedometers are not very accurate - GPS would be best. Also do it with no breeze, and with the device held well away from the vehicle. Tthrough the sunroof on a short pole be a good choice.
Hi Jeroth
From the photo I am fairly certain you have the same weather station as mine.
The anemometer is made by the Shenzhen Fine Offset Electronics Co Ltd from Shenzhen City, China.
The manufacturerās spec has a wind speed of 2.4km/h causing the switch to close once per second.
There is Python code to support the anemometer.
Note when reporting wind speed there are two observations.
The average wind speed is over a 10 minute period.
The wind gust (which causes damage) is the maximum wind speed over a short few second period. Gusts are typically 40% higher than the average wind speed.
Hi Fractal
f0rml3ssf0rm says
And he still has not said which one he has. Apparently not the one he linked. Unless I am getting totally confused.
Cheers Bob
This is the one I have:
Thanks,
Jeroth
Apart from the rain bucket it looks very similar to the Holman one I have ā¦ I think they all use the same plastics manufacturer for the wind vane and anemometerā¦ NB The Holman one uses a set of hall effect sensors in the wind vane not the simple reed switches that appear to be in all others I have seen.
Murray
Thanks for the reply and info!
Hey Murray et al,
I appear to be in the same position of missing one or so elements.
The posted code does not help me but it also may be my wiring setup.
Do i post it here, or start a new thread.
I have some code somewhere that handles the holman anemometer with the hall effect sensors - note that it puts out a pulse train that needs to be analysed, not a switch closure or resistor chain valueā¦
I have not tested it as I am trying to find out to appropriate Vcc value for the sensor ( maybe 3v3 or 5v)ā¦
Hi Murray
Does it matter? I think the Hall sensor will output VCC/2 with no magnet present and go up or down depending on magnet orientation when one is present.
Or maybe some have schmidt trigger switching operation which may not matter either.
Cheers Bob
The Php site smarts feel my inquiry belongs here, so here goes.
I have a R-Pi 4b with a QF-FS01 (Anemometer Wind Speed Sensor w/Analog Voltage Output | Adafruit ADA1733 | Core Electronics Australia) and had it working in a badly wired manner. I have made the wiring simpler and now of course the code is broken.
the wiring now looks like
the code that gives me the most outputs I can work with does not output the wind speed
#!/usr/bin/env python #3
from gpiozero import Button
import time, math
wind_count = 0 # counts how many half-rotations
radius_cm = 9.0 # radius in cm of the anemometer
wind_interval = 5 # how often (secs) to report speed
ADJUSTMENT = 1.18 # manufacturer supplied adjustment
# every half-rotation, add 1 count
def spin():
global wind_count
wind_count = wind_count + 1
# print("spin" + str(wind_count))
# calculate the wind speed
def calculate_speed(time_sec):
global wind_count
circumference_cm = (2 * math.pi) * radius_cm
rotations = wind_count / 2.0
dist_km = (circumference_cm * rotations) / 100000.0 # divided by cm in a km
km_per_sec = dist_km / time_sec
km_per_hour = km_per_sec * 3600 # multiplied by secs in an hour
return km_per_hour * ADJUSTMENT
def reset_wind():
global wind_count
wind_count = 0
# recommended function to reset the wind_count to zero when assembling the weather station
wind_speed_sensor = Button(0)
wind_speed_sensor.when_pressed = spin
# loop to measure wind speed and report at 5 secs interval
while True:
wind_count = 0
time.sleep(wind_interval)
print( calculate_speed(wind_interval), "km/h")
it is mainly the code aspect of this I think I need the help with but as always, the whole information makes for a more accurate answer.
Cheers.
Hi Andre
The anemometer you linked supplies a voltage output depending on wind speed as stated in the text.
now I know almost nothing about Python but something here strikes me as strange.
Just how do you get a signal every half revolution to do this
Then do some math to calculate wind speed.
Seems to be unnecessary when the calc have been done for you in the anemometer as reflected in the output voltage.
You apply this output voltage to an ADC which then sends the (I would think) corresponding ADC figure to your Pi via SPI. It seems to me that you then have to massage this ADC number to get to a form you require that means something like a display etc.
Another thing. Check your wiring. You have āanalog groundā on the MCP3008 connected to +12V. I think you may have been looking at the MCP3004 pin connections when you did this. I donāt think connecting ground to +12V would work very well.
Cheers Bob