Product Introduction #
The water sensor is an instrument that can convert the water level parameters of the measured point into the corresponding electric signal in real time. Its working principle is to use the trace of its parallel wire to measure the amount of water and thus judge the water level. The analog value output by the water sensor can be directly read by the controller board, which can be used for the function of water level alarm in practical applications.
Parameter Specification #
Parameters | Value/Description |
Operating voltage | 3.3V~5V |
Operating temperature | -20°C~+80°C |
Output signal | Analog signal |
Size | 6.68cm*2.37cm |
Wiring Diagram #
Note:Expansion board is attached to esp32 controller board.
Water Sensor | ESP32 |
VCC | 5V |
GND | GND |
Sign | Pin 32 |
Sample Code #
void setup() {
pinMode(32,INPUT);//Set pin 32 to input mode
Serial.begin(115200);//Set baud rate to 115200
}
void loop() {
Serial.println(analogRead(32));//Read the state of pin 32 and print it to the serial monitor
delay(1000);
}
Note: If you are using an Arduino board, then change the pin in the program to PIN A0, set the baud rate to 9600, and then connect the hardware pin to PIN A0 and upload the program.
Test Results #
After uploading the code to the controller board, open the serial port monitor of the Arduino IDE, set the baud rate to 115200, and switch to the scroll mode.
When you plug the water sensor into the water cup, you can see the following data.
Related Resources #
Get One Now #
B2B Business: info@acebott.com