DIY Water Level Sensor (without 3D Parts)

by AgriPulse in Outside > Water

55 Views, 0 Favorites, 0 Comments

DIY Water Level Sensor (without 3D Parts)

IMG_1313.jpg

Have you ever driven 30 minutes to check a water tank, only to find out it was fine? Or worse — arrived to find it bone dry and animals thirsty, plants wilting, or a pump running against nothing?


This sensor fixes that. It clips onto any water tank or basin, measures the water level with ultrasound, and sends the reading to your phone over LTE — no Wi-Fi needed. Whether your water is in the backyard or 10 kilometres down a dirt road, you'll know the level without making the trip.


It works for cattle basins, greenhouse reservoirs, rainwater tanks, irrigation systems — anywhere water matters and you can't always be there to check.


Built to be simple and adaptable. We deliberately tried to only use materials you might already have. No complex fabrication or specialty tools. If you can follow a recipe and use a drill, you can build this.


Developed at Concordia University's Innovation Lab as part of the Regenerative Agriculture Challenge.


Let's build it!


(Have a 3D printer and want to put it to use? Check out our alternative Instructables that 3D prints the housing: https://www.instructables.com/DIY-Water-Level-Sensor-Monitor-Any-Tank-From-Your-/)

Supplies

snapedit_1777048008714.jpeg

Electronics:

  1. JSN-SR04T Ultrasonic Sensor: the "ears" of the device, sends a sound pulse and measures the distance to the water surface (~$15, Amazon)
  2. ESP32-S3 SIM7670G 4G Development Board: the "brain," reads the sensor and sends data to your phone over cell service (~$38, Amazon)
  3. Soder & Flux
  4. ~1ft (5 pieces) of coated copper wire
  5. IoT SIM Card: a cell data plan for the sensor, lets it transmit over LTE. Typically ~$2–5/month after initial prepaid bundle (~$50 prepaid)
  6. 12V-5V USB Step-Down Converter: converts battery power to the voltage the board needs (~$14, Amazon)
  7. Battery


Materials:

  1. 8" of a 2-inch PVC pipe
  2. 2-inch PVC pipe cap
  3. 2 Zipties (long enough to reach around the PVC and side of basin)
  4. Waterproof Outdoor Silicon Caulk (neutral cure)
  5. 2 thick rubber bands
  6. Weatherproof junction box
  7. OPTIONAL: Plastic Shim (if side of basin is not straight)


Tools:

  1. Drill & ~15mm bit
  2. Sodering Iron
  3. Wire cutter & strippers

Connect Mircocontroller + Ultrasonic Sensor + LTE Chip

Screenshot 2026-04-14 at 1.57.05 PM.png

Follow the schematic above to connect your components:

  1. Insert the SIM Card
  2. Place your IoT Sim Card into the SIM slot on the ESP32 board
  3. Make sure it clicks into place and is oriented correctly
  4. Wire the Ultrasonic Sensor
  5. Connect the JSN-SR04T Ultrasonic Sensor to the ESP32-S3 SIM7670G board as follows:
  6. VCC → 5V (or VIN)
  7. GND → GND
  8. Trig → GPIO pin
  9. Echo → GPIO
  10. Double-Check your Connections
  11. Ensure all wires are firmly connected
  12. Verify each pin matches the schematic exactly


Connect Microcontroller to the Computer Using Waveshare Driver and Create a Thingspeak Account

image.png
  1. Connect the Board
  2. Connect the ESP32-S3 board to your computer using a USB-C cable
  3. Open the Arduino IDE on your computer
  4. Install the Required Board Package
  5. In the Arduino IDE, go to Tools → Board → Boards Manager
  6. Search for and install the Waveshare ESP32-S3 (or relevant ESP32-S30) board package
  7. Create a ThingSpeak Account
  8. Go to the ThingSpeak website and create a free account
  9. You'll use this to store and visualize sensor data


Upload Code to Microcontroller

F3ZJ2N0MNXKI5U8.jpg
  1. Install Required libraries
  2. Open the Arduino IDE and install the following libraries:
  3. ESP32
  4. TinyGSM
  5. Select the Correct Board and Port
  6. Go to Tools → Board and select ESP32-S3 Dev Module
  7. Go to Tools → Port and choose the port that corresponds to your device
  8. Configure the Code
  9. Before uploading, update the following in your code
  10. Insert your ThingSpeak API key
  11. Enter your SIM card APN (provided by your carrier)
  12. Upload the Code
  13. Click the Upload button in the Arduino IDE
  14. Wait for the code to compile and upload to your ESP325
  15. Verify Uplaod
  16. Open the Serial Monitor to confirm the device is connecting and sending data

Assemble the Water Level Sensor

IMG_1259.jpg
IMG_1304.jpg

It's time to put together your device!

  1. Drill a hole in the middle of the PVC cap
  2. Feed the ultrasound sensor through the drilled hole, USB port first
  3. Using the silicone, secure the ultrasound sensor to the inside of the PVC cap. Then, create a conical seal on the outside to both stabilize the wire and ensure waterproofing.
  4. Once dry, place the PVC cap onto the pipe

Secure the Water Level Sensor to the Basin

IMG_1305.jpg
IMG_1310.jpg

Now that you have your device we need to mount it!

  1. First, we need to drill holes into the basin to secure the sensor. Drill two sets of holes about 2 inches apart, 2 and 2.5 inches down from the top of the basin (the measurements aren’t too important as long as the pipe feels secure and the ultrasound sensor is 23cm above the highest possible water level)
  2. Place the rubber bands around the bottom of the PVC pipe where it will be secured. The rubber bands provide grip for the zipties to hold the sensor in place.
  3. Feed the zipties through the drilled holes and around the rubber bands, and secure the water-level sensor in place

Tip: If the side of your basin is not straight, place a plastic shim between the basin and pipe to ensure the sensor is at a 90-degree angle from the water

Connect to Power

FR5EI7KMNXKI5PI.jpg

Your sensor is mounted on the basin; now it needs electricity to start working!


The step-down converter in your supplies list does one simple job: it takes 12V power from a battery and converts it to the 5V that your ESP32 board needs


What you'll need:

  1. The 12V-5V USB step-down converter from your supplies list
  2. A 12V battery
  3. Your mounted sensor device from (Step 6)

Wiring the converter:

  1. Look at the converter. It has two bare wires on one end (red and black) and a USB plug on the other end.
  2. Connect the red wire to the positive (+) terminal of your 12V power source.
  3. Connect the black wire to the negative (−) terminal of your 12V power source.
  4. Plug the USB end into the USB port on the ESP32 board.


Storage:

  1. The ESP32 board, converter, and battery all need to stay dry. Put them inside a weatherproof junction box.



Test Your Sensor

IMG_1313.jpg

Everything is connected and powered up. Before you walk away and trust it, let's make sure it's actually working.


Check for signs of life:

  1. Look at the ESP32 board. You should see a small LED light up, so that means it's getting power.
  2. Give it a minute or two. The LTE module needs about 30–60 seconds to find and connect to the cell network, just like a phone does when you turn it on.

Check ThingSpeak:

  1. Open ThingSpeak on your phone or computer. Go to your channel (the one you set up in step 3)
  2. Within 2–5 minutes, you should see a number appear on the chart. This number is the distance in centimeters from the sensor to the water surface.