In fact, the microcontroller was now outside, connected to a sensor via cables, and powered by a USB adapter permanently. View all Summits right now in our on-demand library! While this is a cool project, as a pool owner I'm not sure you'll find it worth the effort. How to Build a DIY Home Energy Monitor Using ESP8266? To use the water tank sensor in Home Assistant I use the ESPHome integration. You signed in with another tab or window. If you are not familiar with ESPHome getting started is not complicated, especially if you already use Home Assistant and the step-by-step install guide. This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository. But what if you could build a wireless, contactless, Wi-Fi-based water level sensor that would report the water left in your tank right on your smartphone? If you are using a waterproof JSN SR04 M-2 Ultrasound Module, connect the screws as shown in the diagram. click. The Batman Credits End Scene Explained: What is a Ratalada? While this is a cool project, as a pool owner I'm not sure you'll find it worth the effort. This will create an MQTT sensor that listens on the funhouse/catbowl/state topic. After the ultrasonic sensor is connected to the MCU, reconnect the USB cable. The sensor calculates and reports the distance between the sensor and the object based on the time it takes for the sound wave or ultrasonic wave to travel and reflect. I have been using this project to measure sump (under ground) water tank water level with NodeMCU and ultrasonic sensor, implemented using Arduino, MQTT and Home Assistant. Watering your lawn and plants around the house wasn't one of my favourite things to do. In addition, they require dipped electrodes or switches in water to operate; This can contaminate the water and may spoil over time. You can do this by measuring the height of the tank from the outside or inside using a measuring tape. No further electronic components are required. He is also a solo traveler who loves to hike and explore new trails. Home Assistant uses Persistent Notifications as its main way of notifying you, which is what we'll be showing you how to add. Depending on the depth, you might be able to use a etape sensor. He explained that they are essentially just a toilet float arm attached to a valve and while they work great, in the event you have a leak you wouldn't know about it until your water bill arrives and is many hundreds of dollars.Fair enough. Similarly, you can add automation to turn on the water pump so that it automatically turns off if the tank is running low and the tank level reaches a certain level, such as 90-100%. I've thought about building an ultrasonic water level sensor, connected to an ESP32 or Pi Zero to report water levels to something TBD. But it was a fun way to learn HA and Node-RED. In order to add the Water Level Sensor to Home Assistant, you'll want to add the following code to your configuration. Utilizziamo i cookie per essere sicuri che tu possa avere la migliore esperienza sul nostro sito. Your California Privacy Rights | Do Not Sell My Personal Information This could mean I did not get an updated measurement for some days and could not be sure that the battery was still charged. Although not as intuitive as Home Assistant, it does the job and reports the initial value via a web page. Also, make sure to have good Wi-Fi signal strength when you are installing the NodeMCU or sensor. Download this repo and copy the files in to your sketches directory. Probably create a custom enclosure that I can 3d print.Whether I really use them or not, we'll see. copy and paste in file this yaml code, In the code, edit the following: To flash the waterlevelsensor.bin firmware, you can download ESPhome-Flasher Use Tools or ESPHome Web. You can follow our previous guide to install Home Assistant on a Raspberry Pi or an old laptop. I have a pressure sensor with a hose connected to the bottom of my rain barrel. Although there are many water level indicators and devices available to monitor the level in an overhead water tank, these devices often come at a heavy cost and with limited functionality. Feel free to customize the messages. This opens water level sensor File. Keep an eye on your pet's water using the FunHouse and Home Assistant, Adafruit FunHouse - WiFi Home Automation Development Board, Simple Water Detection Sensor with Digital Output, STEMMA JST PH 2mm 3-Pin to Female Socket Cable - 200mm, Servo Extension Cable - 50cm / 19.5" long, Mini Magnet Feet for RGB LED Matrices (Pack of 4), USB Type A to Type C Cable - 1ft - 0.3 meter, "Everyone you will ever meet knows something you don't", Set up Home Assistant with a Raspberry Pi, Raspberry Pi Rotary Encoder Animated Gif Player, FunHouse IoT Fume Extractor and Air Quality Sensor, No-Code WipperSnapper IoT Power Switch Outlet, Creating FunHouse Projects with CircuitPython, A Minority and Woman-owned Business Enterprise (M/WBE). You can also use this sensor to monitor the level of the salt tank. The automations I have set up to control the water tank pump & Hydrawise irrigation controller for the garden and lawn watering. Refer to the diagram below to connect the SR04 ultrasonic sensor to the MCU board. This setup had way better reliability and no wifi connection problems. click records under Water level sensor. Looks super complicated because of the extra logic for average measurement calculation, deep sleep mode and sending the values to MQTT and the particle.io cloud in parallel. Although it is not as intuitive as Home Assistant, it does the job and reports the raw price via a web page. ideally liberally sealed at openings with silastic, Home Assistant is open source home automation that puts local control and privacy first. Hero image photo by Daniel van den Berg on Unsplash, 2018 - 2022 Markus Haack | Impressum | Datenschutz, # Templates for calculated liter & percent, the sensor device got a waterproof upgrade to a JSN SR04T ultrasonic sensor, the microcontroller was changed to an ESP8266 based Wemos D1 mini pro running EPSHome. Therefore, keep the object at least 20 cm away. click Choose a fileBrowse to water level sensor firmware file, and click fix. If you haven't edited the Dashboard, it should automatically appear. Check that you have connected the ultrasonic sensor pin to the MCU correctly. The way the sensor works is very simple. The steps are as follows: After downloading the firmware, click Open the ESPHome Web site. That multiplied by 1000 results in the returned value in litres. But this time I split the hardware into two units. GND to GND. To test alerts, you may need to temporarily increase the UPDATE_INTERVAL in your sensor code so it checks more frequently.. If you could get some sort of wireless digital pressure gauge you could feed it into home assistant. There's a number of ways to measure this kind of thing. The sensor calculates the distance between the sensor and the object and reports it based on the time it takes the sound wave or ultrasound wave to travel and reflect. This will create 2 notification triggers. He spends most of his weekends working with IoT devices and playing games on Xbox. The way the sensor works it can not be super accurate and it is not really important for our use case but let's check. The two main problems of this setup were the Wifi connectivity and the battery management. You can also use this sensor to monitor the level of your salt tank. I got my float sensors in today and have it connected to an arduino uno. We end up with a mixed setup using a Hunter Hydrawise as the irrigation controller and a custom made solution to monitor and refill the water tank. Ravi is an expert tech explainer, IoT enthusiast and Linux lover with a background in Big Data and Application Development. HANGZHOU KinCony ELECTRONICS CO.,LTD - 2007-2022. Home Assistant (HA) is preferred but not required to build a smart Wi-Fi-based water level sensor or controller. - Go ahead and select it. Echo to D5/14 And where are they going in the pool? In a dedicated sump hole or something? The most crucial parts of the code config start in line 56 with the setup of the ultra sonic sensor. See here. Entity:input-1 To: off, Actions: If you made changes to the water bowl code above, you may need to update this code to reflect those changes. He spends most of his weekends working with IoT devices and playing games on Xbox. I'm splitting this into two posts. Today's ESPHome base solution is the 3rd and most stable iteration. To compile the firmware, open Home Assistant and install the ESPHome add-on if you havent already. This project wouldn't be complete without having Home Assistant notify you of when the bowl gets low or empty. Click choose filesBrowse waterlevelsensor.bin firmware file, and click install, After the firmware is flashed, disconnect the USB cable. Trig to D6/12 I read it with a KNX analog IO module but it should work with an esp too (put shunt resistor inline, measure voltage at both ends of resistor, quick maths and boom. This guide was first published on May 14, 2021. The magic factors in the formulas are multiplied out factors for volume of our cistern. It will translate the value it recives to one of the state labels. is designed for compressed gasses, so I'm not sure if it would work, but you get the idea. In our case the cistern is a round cylinder, the volume formula for that is: With h = x in the lambda function. For example, if the height of the tank is 120 cm and the distance between the sensor on the cap and the edge of the water is 10 cm, then the depth is 10 120 = 110 cm. I campi obbligatori sono contrassegnati *. , water-level-control-output4-on(turn on relay) Select your MCU, such as NodeMCU, ESP32, or D1 Mini, and click, Connect your NodeMCU, ESP32 or D1 mini to your computer using a micro USB cable and then click. Click connect And then select the USB serial COM port where your NodeMCU, D1 Mini, or ESP32 is connected. charging controller, all together in a waterproof enclosure. In the next post I will explain how the water tank data of the ESPHome sensor is used in Home Assistant. If you already have it, but it's just not showing up, be sure it is started and the option to show in the sidebar is selected. Trigger type: State If we put that into our formula (in meters) * 1 * 0,01 we get 0,03141m which is ~ 31 liter. Part 2 will cover the Home Assistant integration of Hydrawise, valves, the ESPHome water tank sensor and automations for the entire garden irrigation setup. Also ensure good Wi-Fi signal strength when installing the NodeMCU or sensor. Once that's added, go ahead and check the configuration and restart the server as you did before. This concept is still used for the current version of the water level sensor. I decided to send updated measurements every 10 minutes only. You can do this by measuring the height of the tank from the outside or from the inside with a tape measure. Unfortunately, the HC-SR04 ultrasonic sensor still caused problems. But if we consume water quickly and there is heavy rain filling the cistern the 10 minutes interval still results in a smooth graph. Refer to the diagram below to connect the SR04 ultrasonic sensor to the MCU board. To make this smart water level sensor, you will need the following: For this project, it is recommended that you use a JSON-SR04 waterproof ultrasonic sensor to prevent sensor damage due to moisture. I measured the full and empty levels of our cistern and can interpolate the intermediates. I was already familiar with Arduino microcontrollers, so programming the Photon chip was not a problem. The C sensor will be listed under ESPHome. For us, no water in the cistern means no watering of the plants or the lawn. If you see Distance measurement timed out, do the following: To add an ultrasonic water level sensor to Home Assistant for Monitoring, follow these steps: You can further customize the default card by adding the following to the code editor: Type: GaugeName: Water Level SensorUnit: %Unit: Sensor. if you need samples, you can go to KinCony's Alibaba, AliExpress or Amazon store to order ,Thank you. Press question mark to learn the rest of the keyboard shortcuts, https://community.home-assistant.io/t/esphome-water-level-sensor/126504. Once the ultrasound sensor is connected to the MCU, reconnect the USB cable. From the Configuration menu, choose Server Controls. To build this smart water level sensor, you need the following: For this project, it is recommended to use a waterproof JSN-SR04 ultrasonic sensor to prevent damage to the sensor due to moisture. To formula for me is * 1 * x which will return the volume in square meters. I'm comparing the measurements with an older flow meter I had lying around: The readings from the distance sensor are in centimetres. How to build a home energy monitor with ESP8266, ravi singh Any less than that and the echos overwhelm the good signal. You need to measure the depth of the tank. He suggest instead that I have them plumb a fill line that we can attach to our irrigation system as a new zone and use that to fill the pool without dragging a garden hose to it. I use a nodemcu board to read the sensor and control the valves of the tank. Click logs Down water level sensor. (5 articles published). Action type: Call service Perfect to run on a Raspberry Pi or a local server. An ultrasonic water level sensor works by sending sound waves at a specific frequency (also known as ultrasonic waves) and receiving the reflected wave from the target object. Aqara P1 human body movement and illuminance sensor. In this DIY guide, well use a NodeMCU board and an ultrasonic sensor to build such a water level indicator that sits on top of the water tank cover and reports the data to your smartphone via Home Assistant. home automation training -18-ZigBee motion sensor control light in home assistant, home automation training -20-extend digital output & input in home assistant, Detalji za dizajniranje hardwarea KC868-A6, smart distribution board (MCB box) case22, smart distribution board (MCB box) case21, home automation training -19-water level. updated on 2021-05-14 17:06:52 -0400. It will display the logs and data received by the sensor. Via calibrate_linear the measured distance, from the sensor to water surface, is transformed into the actual height of the water within our cistern. Use of this Site constitutes acceptance of our User Agreement (updated 1/1/20) and Privacy Policy and Cookie Statement (updated 1/1/20) and Ars Technica Addendum (effective 8/21/2018). Getting a wifi connection required usually 3-5 retries. (sensors at set heights, so you know there's at least that much water, but not more than the next one). Go ahead and configure a username and password to match your MQTT server and connect. The JSN SR04 M-2 module can measure 20-400cm. Enter a name for the firmware file, such as, Select the MCU you have, such as NodeMCU, ESP32, or D1 Mini, and click, Connect your NodeMCU, ESP32, or D1 Mini to your PC using Micro USB cable and then click. Possible to measure water level in Tank and show it in HA Dashboard? For security reasons, an e-mail has been sent to you acknowledging your subscription. The measuring and calculation of litre and percent happens in two steps. Which Sensor works with D1 Mini or any board? water level sensorGreen: 0Yellow: 45Red: 85. My water level maintenance consists of dropping a garden hose in the pool and letting it run for 30 minutes; I have to do this less than once a month.But like I said, it's a cool project. Service: Switch:Switch: Turn off