2022-03-05, 09:48 AM
Hello everyone, i know some of you helped choosing a wind sensor here, and helped me configuring it with @seandepagnier's "weather sensor" here. But i wanted to go one step forward (just for fun a because learning new stuff is cool), and designed the simplest posible pcb with an ESP32, installed SensESP libraries and write some code to read wind speed and direction. I don't think details at this point are relevant, but just know that i'm using an ADS1115 to read wind speed, and that the working voltage is 3.3V. Of course let me know if i should provide further information. Oh, i'm using the same Davis wind sensor
My issue is reading the wind direction. When the windvane is at ~3º, i get 0V, when the windvane is at 360º, i get 3.3V. Ok, so far so good, is what I expected. The problem comes when the vane is between 360º and 3º, because the voltage drop is obviously continous, and you can get ANY reading between 3.3V and 0V in that ~3º range. i.e: if the vane is at 2º, i get the same reading of 314º.
I assume this is known problem, and I assume too this is related to the fact that those wind sensors have a deadband, but how do you people usually deals with this? Should be a hardware or software solution? I can't just ignore values, because i could get ANY value.
I've tried solutions like storing the quadrant of the last X readings, and discard readings that would imply an unusual change of wind direction, but that's not a good solution, at least in a test environment, because if you keep the vane in the dead angle, you'll eventually get false readings after X samples.
Also tried averaging the readings after that, and maybe I should do it before, or maybe I should oversample more, but I'm kinda lost here.
I already know i would have a +-5º deadband, and that's perfectly fine, i just don't know hot to achieve that
So.. how do you usually solve this kind of problems?
Thanks a lot!
My issue is reading the wind direction. When the windvane is at ~3º, i get 0V, when the windvane is at 360º, i get 3.3V. Ok, so far so good, is what I expected. The problem comes when the vane is between 360º and 3º, because the voltage drop is obviously continous, and you can get ANY reading between 3.3V and 0V in that ~3º range. i.e: if the vane is at 2º, i get the same reading of 314º.
I assume this is known problem, and I assume too this is related to the fact that those wind sensors have a deadband, but how do you people usually deals with this? Should be a hardware or software solution? I can't just ignore values, because i could get ANY value.
I've tried solutions like storing the quadrant of the last X readings, and discard readings that would imply an unusual change of wind direction, but that's not a good solution, at least in a test environment, because if you keep the vane in the dead angle, you'll eventually get false readings after X samples.
Also tried averaging the readings after that, and maybe I should do it before, or maybe I should oversample more, but I'm kinda lost here.
I already know i would have a +-5º deadband, and that's perfectly fine, i just don't know hot to achieve that
So.. how do you usually solve this kind of problems?
Thanks a lot!