How does it work?
Water Detect 2 Click is based on the OPB350L250, a tube liquid sensor from TT Electronics. It consists of an LED and a phototransistor, where the phototransistor reads the light of an LED that passes through a clear tube. Depending on the liquid that passes through, you can distinguish light from dark liquid, no liquid presence, bubbles in the liquid that passes through the tube, or even no tube presence at all. You will have to identify the typical current values for each situation, where the ratio between the different states allows the acknowledgment of different conditions. In addition, the sensor itself comes in an opaque plastic housing that enhances ambient light rejection. The housing „clicks“ around the tube, allowing a secure and tight connection.
Water Detect 2 Click uses the MCP6022, a rail-to-rail input/output operational amplifier from Microchip, to amplify the output of the liquid sensor. For a visual presentation of the fluid sensor status, this Click board™ has an RGB LED that uses all three colors to indicate water detection, no water detection, and the LED ON. The onboard VREF potentiometer is used for the calibration of the liquid sensor. This way, you can set the threshold for what you want to detect.
Water Detect 2 Click uses an interrupt DET pin (liquid detection) to communicate with the host MCU. In addition, you can turn the LED ON/OFF over the ON pin of the mikroBUS™ socket.
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 non-contact fluid sensing, IV fluid, oils, and other petroleum products sensing applications, colored fluids, toner fluids, water, and more
On-board modules
OPB350L250 – tube liquid sensor from TT Electronics
Key Features
Identify liquid presence or even no tube presence, and identify light or dark fluid, bubbles, accepts 1/4″ (6.3mm) clear tubes, operational amplifier, potentiometer for calibration, onboard status RGB LED, and more
Interface
GPIO
Feature
ClickID
Compatibility
mikroBUS™
Click board size
L (57.15 x 25.4 mm)
Input Voltage
3.3V or 5V
Pinout diagram
This table shows how the pinout on Water Detect 2 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 |
---|---|---|---|
– | PWR | – | Power LED Indicator |
LD1 | – | – | Fluid Status RGB LED Indicator |
JP1 | VCC SEL | Left | Power/Logic Level Voltage Selection 3V3/5V: Left position 3V3, Right position 5V |
P1 | VREF | – | Calibration Potentiometer |
Water Detect 2 Click electrical specifications
Description | Min | Typ | Max | Unit |
---|---|---|---|---|
Supply Voltage | 3.3 | – | 5 | V |
Tube Diameter | – | 6.3 | – | mm |
Software Support
We provide a library for the Water Detect 2 Click as well as a demo application (example), developed using MikroElektronika compilers. The demo can run on all the main MikroElektronika 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 2 Click driver.
Key functions
-
waterdetect2_get_fluid_status
Water Detect 2 get fluid status function. -
waterdetect2_enable
Water Detect 2 enable function. -
waterdetect2_disable
Water Detect 2 disable function.
Example Description
This library contains API for Water Detect 2 Click driver. Water Detect 2 Click is used for detecting water and other electroconductive liquids.
void application_task ( void )
{
static uint8_t fluid_status = waterdetect2_get_fluid_status( &waterdetect2 );
if ( fluid_status != fluid_status_old )
{
if ( WATERDETECT2_FLUID_DETECTED == fluid_status )
{
log_printf( &logger, " Fluid present! rn" );
}
else
{
log_printf( &logger, " No fluid present. rn" );
}
log_printf( &logger, "------------------- rn" );
fluid_status_old = fluid_status;
}
}
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.WaterDetect2
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 MikroElektronika compilers.
mikroSDK
This Click board™ is supported with mikroSDK – MikroElektronika 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.