2022-03-07, 05:51 PM
Thanks both for your comments!
@seandepagnier The deadband is aligned forward, so that part is ok. Also i won't definetly be saling at less than 20º AWA, so that's ok too. It's just annoying to see the wind indicator showing random number when hoisting a the sail, for example. But indeed not a bit deal. The whole question was more about understanding the "whys" and learning the "hows" of this issue, as it must be something frequent.
@sailoog. My first test was with the ESP32 builtin ADC. Indeed the noise was so heavy that even with a fixed windvane I could get readings oscillating a 10% of the whole range. That's why I went for the ADS1115, where readings are very stable.
I've tried the 20KΩ resistor. It did a good job, i didn't know that! I tried to add a second 20KΩ resistor, the readings were even better. So i put a 100KΩ. Is this too much? Can I break anything?
The current algorithm does this:
1) Read ADC every 10ms -> something between 0-17500
2) Divide the reading by 32 (I don't think I need that much precision, so this already smooth the readings). -> something between 0-822
3) Filter out anything above 812 (360º corresponds to that reading) -> something between 0-812
4) Compare the value with the last reading and discard it if it's too far from previous reading
5) Get the average of the last 10 readings -> something between 0-822
6) Store the value
-- The rest happens somewhere else when using SensESP
I still have to test a couple of things, but I think the 100k resistor did the trick.
Thanks again!
@seandepagnier The deadband is aligned forward, so that part is ok. Also i won't definetly be saling at less than 20º AWA, so that's ok too. It's just annoying to see the wind indicator showing random number when hoisting a the sail, for example. But indeed not a bit deal. The whole question was more about understanding the "whys" and learning the "hows" of this issue, as it must be something frequent.
@sailoog. My first test was with the ESP32 builtin ADC. Indeed the noise was so heavy that even with a fixed windvane I could get readings oscillating a 10% of the whole range. That's why I went for the ADS1115, where readings are very stable.
I've tried the 20KΩ resistor. It did a good job, i didn't know that! I tried to add a second 20KΩ resistor, the readings were even better. So i put a 100KΩ. Is this too much? Can I break anything?
The current algorithm does this:
1) Read ADC every 10ms -> something between 0-17500
2) Divide the reading by 32 (I don't think I need that much precision, so this already smooth the readings). -> something between 0-822
3) Filter out anything above 812 (360º corresponds to that reading) -> something between 0-812
4) Compare the value with the last reading and discard it if it's too far from previous reading
5) Get the average of the last 10 readings -> something between 0-822
6) Store the value
-- The rest happens somewhere else when using SensESP
I still have to test a couple of things, but I think the 100k resistor did the trick.
Thanks again!