Main Content

Achieve Perfect Accuracy for Your Water Tank.

Step 1: Assemble the Circuit
Start by connecting your Arduino board to the computer using the USB cable. Then, create the circuit by following these steps:

Connect the VCC pin of the water sensor to the 5V pin on the Arduino board.

Connect the GND pin of the water sensor to the GND pin on the Arduino board.

Connect the signal pin of the water sensor to one of the analog input pins on the Arduino board (e.g., A0). Use a jumper wire for each connection and the breadboard to make the connections easier.

Step 2: Open the Arduino IDE and Set Up the Code
Launch the Arduino IDE on your computer. If you haven’t installed it yet, download it from the official Arduino website ( and follow the installation instructions.

In the Arduino IDE, Go to Examples, then Analog, then select AnalogInOut Serial Code. Select the Arduino Uno from Board and then select the COM Port.

Upload the AnalogInOutSerial code from code section.

Step 3: Upload the Code to the Arduino Board
Connect your Arduino board to the computer if you haven’t already. Then, select the appropriate board and port from the “Tools” menu in the Arduino IDE. Finally, click on the “Upload” button (right-facing arrow) to upload the code to your Arduino board.

Step 4: Monitor Serial Output and Determine Calibration Points
Once the code is uploaded successfully, open the Serial Monitor by clicking on the magnifying glass icon or navigating to “Tools” > “Serial Monitor” in the Arduino IDE. Set the baud rate to 9600 (same as in the code).

Immerse the water sensor in a container filled with water, ensuring that the sensor is completely submerged. Observe the values printed in the Serial Monitor. Note down the analog readings.

You will see that Analog Reading starts from 0 and ends till 700. As shown on Serial Monitor.”

Link to article