Hello
I am running a sample program for “Water level sensor” on Arduino, but if the sensor is submerged in water when the power is turned on, it will not measure correctly.
If the sensor is placed outside of water when the power is turned on, and then placed in water, the Hello
I am running a sample program for “Water level sensor” on Arduino, but if the sensor is submerged in water when the power is turned on, it will not measure correctly.
If the sensor is placed outside of water when the power is turned on, and then placed in water, the measurements will be accurate.
example
(a problem occured)
Under water when power is turned on
sample1
water level = 0%
low 8 sections value =
0.0.0.0.0.0.0.251.
high 12 sections value =
251.0.0.0.0.0.0.0.0.0.0.0.
sample2
water level = 0%
low 8 sections value =
0.0.0.0.0.0.0.0.
high 12 sections value =
0.0.0.0.0.0.0.0.0.0.0.0.
(works correctly)
Out of water when powering on, then in water
water level = 45%
low 8 sections value =
252.251.252.252.253.251.252.251. PASS
high 12 sections value =
250.0.0.0.0.0.0.0.0.0.0.0.
Due to the above operation,
・If there is water in it from the beginning
・If the power is turned on and off repeatedly
In these two cases, this sensor will not work properly.
This problem seems to be caused by the initialization of the sensor when the power is turned on. Is there a way to avoid this problem?
By the way, this problem occurs with Arduino, but it also occurs with Raspberry Pi PICO, which was ported with Python.