Hello,
I am struggling with a issue regarding the Ultra Sonic Sensor HC-SR04.
In my project humidity governor for a cigar Humidor I am using the SR04 for checking water level in tank using the NewPing Library. During development time I found that the measured distance value is sometimes changing.
Here you can see a measurement over 9 hours.
To be shure, that it ist not an side effect off my software, I made a seperate test:
Using a different Arduino, another sensor (but same shippment), an as software just the example code of the newping library. The Sensor is mounted in a wooden box with a fixed distance, an garanteed no optical disturbance, like external light, side walls in range and so on.
And, surprising, I found the same effect!
Here you can see a 3 days measurement. The Sensor îs read every 10 seconds. The data are collected via Serial Monitor.
You can see, the measured Value is change between two levels.
A better impression can be seen in a stastical frequency distribution diagramm:
Distance Sensor - Arduino approx. 40cm. I tried both: normal wire an shielded wire: no difference. Temperature was quite constant (indoor room temperature), I could not find any correlations to time of the day.
Next guess was an effect of the library
To check this, I created a software with reading the Sensor by PulseIn().
Same effect!
Here you can see a 24 hour plot where I measured the pingtime also with PulseIn(), and, to get ore date also with the pingMedian() method.
Looking at the frequency distribution, you can see that the pingMedian method ist more sharp, but at the end all have the same result.
So, this is my story.
Did anybody ever see this effekt?
Does anybody have an idea about the root cause?