Digital liquid level switch
Digital liquid level switches are devices that can detect the presence of liquid/water. GPIO can be used to communicate with the devices.
Documentation
The implementation supports any single pin output digital liquid level switch.
- LLC200D3SH sensor datasheet
Usage
Define the LLC200D3SH sensor using the LiquidLevelSwitch class.
using (LiquidLevelSwitch sensor = new LiquidLevelSwitch(23, PinValue.Low))
{
while (true)
{
// read liquid level switch
Debug.WriteLine($"Detected: {sensor.IsLiquidPresent()}");
Debug.WriteLine();
Thread.Sleep(1000);
}
}
An example on how to use the specific LLC200D3SH device binding is available in the https://github.com/nanoFramework/nanoFramework.IoT.Device/tree/develop/devices/LiquidLevel/samples folder.
LLC200D3SH Circuit
The following fritzing diagram illustrates one way to wire up the Optomax LLC200D3SH digital liquid level switch with a MCU.