Hello,
I am in the process of setting up an ESP32-based weather station using the Aliexpress versions of the sparkfun weather meter sensors.
I have based my configuration largely on this project: https://gist.github.com/bassicrob/93fb0adc95261217fd4677dd7c34381c which is originally based on this, I believe.
But I am struggling with the wind sensor, specifically the calibration filters. Why multiply by 0.04973? If the sensor updates every 15 seconds, and lets say it read 15 pulses, it should output 60 pulses/min. If 1 pulse per second is 1.492 MPH, then shouldn’t the formula be: 60 / 60 = pulses/sec and pulses/sec * 1.492, so the wind speed is 1.492MPH? Why does the formula given have 60 divided by 2? Please help me understand where I am wrong. Maybe the author @bassicrob could chime in? Thank you!
sensor:
- platform: pulse_counter
pin:
# pin D5
number: GPIO14
mode: INPUT_PULLUP
unit_of_measurement: 'mph' ##change to m/s if metric
name: 'Wind sensor'
icon: 'mdi:weather-windy'
id: my_wind
count_mode:
rising_edge: DISABLE
falling_edge: INCREMENT
internal_filter: 50us
update_interval: 15s
#rotations_per_sec = pulses/2/60
#circ_m=0.09*2*3.14 = 0.5652
#mps = 1.18*circ_m*rotations_per_sec
#mps = 1.18*0.5652/2/60 =0,0055578
filters:
# - multiply: 0.0055578 #use for m/s
# - multiply: 2.237 #m/s to mph
# - sliding_window_moving_average:
# window_size: 4
# send_every: 1
- multiply: 0.04973 #1.492mph switch to close 1/sec per spec, pulse/sec (/60/2)*1.492
# - multiply: 0.0124327986 #m/s * mph conversion
EDIT: As I’ve done more research I have determined that the original formulas in the config (rotations_per_sec, circ_m) have to do with calibration of the anemometer using rotational physics, if I’m not mistaken. If the manufacturer specifies 1.492mph for the switch to close once per second, then shouldn’t the multiply filter simply be 1 / 60 * 1.492 = ~0.024867?