Electronics

  • Measure water well depth with ultrasonic sensor

    Floods are becoming a bigger threat to our world!

    A friend of mine recently experienced significant flood damage to the basement of his home. Upon investigating the cause, we discovered an old, concealed well hidden under his lawn that only became visible after removing the grass and soil.

    This well is connected to pipes from the downspouts, which direct rainwater from the roof away from the house. Additionally, there are gravel beds and drainage pipes in the ground to help channel water away from the foundation and prevent accumulation around the house.

    Through our tests and inspections, we found that the drain leading to the well was functioning properly. However, it seems that the main well, which collects water from multiple neighboring houses, may not have been designed to handle such a large volume of water. This could be the root of the problem.

    So to help monitor the current condition of the well without opening a hole in the garden i started working on a solution to monitor the depth of the well and send the information and store it through wifi.

    Choice of microcontroller and ultrasonic sensor

    Microcontroller – ESP32

    Microcontroller, i’m quite familiar with arduino, raspberry pi and ESP8266.
    They all come with their own strength and weaknesses, since it wanted to a cheap and low powered solution that have built in wifi connectivity i decided to go with ESP32.
    The low power/sleep mode looked very promising since i wasn’t sure i would be able to get solar power or wired power the solution.

    Ultrasonic Sensor – AJ-SR04M

    Ultrasonic Sensor was tricky, i have used the cheap sensor “HY-SRF05” in previous projects, but these sensors are not built for a enviroment with high moisture and risk of water.
    After some further research if decided i would test with the “AJ-SR04M” sensor that have a water proof sensor and the controller board can be protected next to the ESP32 board.

    Power Supply – 18650 Cells

    Next thing to solve was the power supply, after discussions with my friend i knew i had to find a solution without wired power or solar, atleast for starters.
    I have built my own DIY 18650 batteries before, with old reused cells and a BMS to protect the cells from discharge, overcharge when used.

    BMS – Battery management system – TP4056
    I have used these modules before to protect one cell batteries for smaller projects with low power consumption, in this case i will put 4x cells in paralell to increase the mAh from 3000 to 12 000 mAh.

    Waterproof enclosure – IP65

    Since the electronics and the batteries would be outside in the rain and snow the entire year i needed a enclosure big enough for everything bit still could keep the enviroment out.
    Found a black box with rubber gasket made for camera gear that i think will do the work without blocking the wifi signal of the module.

    3D Printing

    For all the modules i wanted to print a case so i could attach everything without directly attaching it to the case so it would be easy to remove things if needed.
    For the ESP32 module, i found this 3D print from printables that works with my breakout board.
    https://www.printables.com/model/856471-esp32-30-pin-breakout-board-case-snap-fit-lid?lang=en

    For the AJ-SR04M if found a similar case that i could 3D print
    https://www.printables.com/model/359672-jsn-sr04t-case-with-lid?lang=en

    For the actual sensor of the AJ-SR04M found a print that could be both bolted and zip tied in two directions which would suit my needs well.
    https://www.thingiverse.com/thing:5873919

    Read distance using ultrasonic sensor

    tbd

    Links to products

    Amazon Affiliate Links for all products used if you want to sponsor the channel!
    ESP32
    https://amzn.to/3NXmfVJ
    ESP32 Breakout board
    https://amzn.to/4ehaMel
    AJ-SR04M
    https://amzn.to/3YuGor6
    BMS
    https://amzn.to/3UF7tXE
    Spotwelder
    https://amzn.to/3NXx7TC
    Nickel Strips
    https://amzn.to/48KZVbC
    USB Multimeter
    https://amzn.to/4eiHzzF
    Battery tape
    https://amzn.to/4fezkWM
    Cable Screwing
    https://amzn.to/3V3mCCj
    Box Enclosure
    https://amzn.to/4fzlOg9