How does it work?
Water Detect 3 Click is based on the MCP606, a micropower CMOS operational amplifier from Microchip. The way it works is very simple. If the electroconductive water detection area (additional board that comes in the same package as this Click board™) gets wet, it feeds the inverting input of the MCP606 operational amplifier. The MCP606 then compares this voltage to the reference voltage made as a voltage divider, of which one part is a 10K trimmer potentiometer, and the other is MCP1501, a high-precision buffered voltage reference from Microchip. By trimming this potentiometer, you can set the threshold for an MCP606, thus alarming the host MCU when there is enough water conductivity in an electroconductive water detection area.
The MCP606 on this Click board™ functions as a comparator. When the sensory area is dry, its resistance is near infinite, and the voltage applied to the inverting terminal of the comparator equals VCC. The water detection area is actually made of exposed conducting wires – simple but effective technology.
Water Detect 3 Click uses an interrupt INT pin to alarm the host MCU of the water presence. Besides the interrupt, Water Detect 3 Click will also notify you with a DETECT red LED, as it is connected to the INT pin.
This Click board™ can operate with either 3.3V or 5V logic voltage levels selected via the VCC SEL jumper. This way, both 3.3V and 5V capable MCUs can use the communication lines properly. Also, this Click board™ comes equipped with a library containing easy-to-use functions and an example code that can be used as a reference for further development.
Specifications
Type
Miscellaneous
Applications
Can be used for the development of a household flood alarm sensor, rain detector for smart buildings, or water tanks that act as a limit switch for a pump
On-board modules
MCP606 – micropower CMOS operational amplifier from Microchip
Key Features
Separate board for water detection in the same package, detection area made of exposed conducting wires, calibration potentiometer, interrupt output, LED for visual presentation, and more
Interface
GPIO
Feature
ClickID
Compatibility
mikroBUS™
Click board size
M (42.9 x 25.4 mm)
Input Voltage
3.3V or 5V
Pinout diagram
This table shows how the pinout on Water Detect 3 Click corresponds to the pinout on the mikroBUS™ socket (the latter shown in the two middle columns).
Onboard settings and indicators
Label | Name | Default | Description |
---|---|---|---|
LD1 | PWR | – | Power LED Indicator |
JP1 | VCC SEL | Left | Power/Logic Voltage Level Selection 3V3/5V: Left position 3V3, Right position 5V |
VR1 | – | – | Calibration Potentiometer |
Water Detect 3 Click electrical specifications
Description | Min | Typ | Max | Unit |
---|---|---|---|---|
Supply Voltage | 3.3 | 5 | V |
Software Support
We provide a library for the Water Detect 3 Click as well as a demo application (example), developed using MIKROE compilers. The demo can run on all the main MIKROE development boards.
Package can be downloaded/installed directly from NECTO Studio Package Manager (recommended), downloaded from our LibStock™ or found on Mikroe github account.
Library Description
This library contains API for Water Detect 3 Click driver.
Key functions
waterdetect3_get_int
Water Detect 3 interrupt pin reading function.
Example Description
This example demonstrates the use of the Water Detect 3 Click board™ by detecting if water is present on the sensor part of the click.
void application_task ( void )
{
if ( WATERDETECT3_PIN_STATE_HIGH == waterdetect3_get_int( &waterdetect3 ) )
{
log_printf( &logger, " Water detected.rn" );
Delay_ms( 1000 );
}
}
The full application code, and ready to use projects can be installed directly from NECTO Studio Package Manager (recommended), downloaded from our LibStock™ or found on Mikroe github account.
Other Mikroe Libraries used in the example:
- MikroSDK.Board
- MikroSDK.Log
- Click.WaterDetect3
Additional notes and informations
Depending on the development board you are using, you may need USB UART click, USB UART 2 Click or RS232 Click to connect to your PC, for development systems with no UART to USB interface available on the board. UART terminal is available in all MIKROE compilers.
mikroSDK
This Click board™ is supported with mikroSDK – MIKROE Software Development Kit. To ensure proper operation of mikroSDK compliant Click board™ demo applications, mikroSDK should be downloaded from the LibStock and installed for the compiler you are using.
For more information about mikroSDK, visit the official page.