ElektorLabs / 191148-RemakeWeatherStation

RemakeWeatherStation
12 stars 4 forks source link

Spikes in BME280 Readings #21

Open tom1422 opened 3 years ago

tom1422 commented 3 years ago

Hello, I have noticed some spikes in my BME280 readings over MQTT. I know its not MQTT because wind speed and particles arent affected. I at first thought it may be the adafruit library but the sparkfun library has the same issue. I will do my best to look through the code and find the issue but would also like to know if anyone else can think of the cause to the problem. Thanks, Tom.

lab-mathias-claussen commented 3 years ago

Hi Tom,

the Spikes may can be a conversation problem inside the code from int to foat if it is software related. There may be also an issue where the I²C Bus gets "wrong" bits du to noise. Currently the I²C Speed is set to 50kHz. What could be done is to read the data twice and compare the values and delta they produce to track the problem a bit more down.

Best Regards

Mathias Claußen

DhanushkaPeiris commented 3 years ago

Hi,

According to my opinion, the issue may have in one of these fields: sensor, firmware and communication. Therefore, it is better to isolating each section is the best way to find the a solution.

To test the sensor, check that with more control environment like indoor room and compare the values with another well functioning same sensor or other suitable sensor with same accuracy. Then, you can conclude that whether your sensor is working or not.

Some times, if you are using an algorithm to filter the values may affect to the final results. To test this, use dummy data with the algorithm on a mathematical software like matlab. Then, you can find the issues related to the algorithm.

Communication issues can be divided into two: from sensor to microcontroller and microcontroller to end point. Issues related to sensor-microcontroller communication are mostly happening due to the bad connection like bread board jumper wires. These may often cause for the I2C communication. Personally, I recommend solid connections like soldered wires is the best. Sometimes, the power supply noises may cause the I2C. Test your power supply for ripples.

Use dummy data to find the problems related to the microcontroller to end point communication.

I think this guide will help you.