This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Write my own wind sensor code
#1
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!
Reply


Messages In This Thread
Write my own wind sensor code - by MigGat - 2022-03-05, 09:48 AM
RE: Write my own wind sensor code - by Sailoog - 2022-03-06, 10:49 PM
RE: Write my own wind sensor code - by MigGat - 2022-03-07, 05:51 PM
RE: Write my own wind sensor code - by Sailoog - 2022-03-07, 08:08 PM
RE: Write my own wind sensor code - by MigGat - 2022-03-08, 05:35 PM
RE: Write my own wind sensor code - by MigGat - 2023-06-27, 06:48 AM
RE: Write my own wind sensor code - by ddelorme - 2023-10-06, 09:20 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)