Connecting and reading Water level sensor
-
Hi,
I'm trying to connect a water level sensor on the IO_5, but can't seem to get a correct reading from it. I tried to add the following in the config.g file:
M308 S0 P"io5.in" Y"linear-analog" A"Water Level" F0 B0 C1
The sensor reads values decreasing exponentially, meaning the higher the water level goes, the slower the value increases and it maxes out at 0.7.
The sensor itself is supposed to read 3.3v when there is no water and 5v at max water level.Kind Regards,
Shehryar. -
Which Duet board? Which firmware version?
Do you have a data sheet for the sensor? -
@shehryar said in Connecting and reading Water level sensor:
The sensor itself is supposed to read 3.3v when there is no water and 5v at max water level.
I expect this is the main issue. The Duet expects inputs in the range 0 to 3.3V. Please provide a link to the water level sensor specification. You may be able to use an Arduino to do the conversion, eg something like this: https://docs.duet3d.com/en/User_manual/Tuning/Triggers#water-flow-sensor-failsafe.
Ian