ElektorLabs / 191148-RemakeWeatherStation

RemakeWeatherStation
12 stars 4 forks source link

WinDir SW/W seems to be incorrect #11

Open Pakl8 opened 4 years ago

Pakl8 commented 4 years ago

The wind direction SW gives U8:8 and Enum:8, but shows direction North The wind direction W gives U8:14 and Enum:8 but shows direction North All other directions mappings looks to be correct.

Pakl8 commented 4 years ago

The resistance of the direction west is 120K (see elektor weather station mark1, page 30) which gives Dir-ADC3870, u8val 15 and enumval 8, but will not pass if(u8_dir < 15){ WindDir = obj->WindDirLUT[u8_dir]; changed it to if(u8_dir < 16){ WindDir = obj->WindDirLUT[u8_dir]; } and now it gives enum value 6, which is west }

lab-mathias-claussen commented 4 years ago

Hello Pakl8,

thanks for looking into this issue. We will incooperate the changes.

Best Regards

Mathias Claußen

t3hoe commented 4 years ago

Hello. I found some faults in the WindDirSensor.cpp After the correction the sensor provides plausible values in all 3 channels From winddir you can get only the 10s average (see line 230 and 237) the switch case instraction is wrong. The calculation of average_60s is wrong (line 178). When you add 6 values then you must divide by 6 not by 10. The calculation of average_3600s is also wrong. You have to add all 60 values (line198) and then divide by 60 (line 202). Regards Thomas