{"id":156996,"date":"2025-01-31T13:22:10","date_gmt":"2025-01-31T07:52:10","guid":{"rendered":"https:\/\/www.electronicsforu.com\/?p=156996"},"modified":"2025-03-07T17:30:08","modified_gmt":"2025-03-07T12:00:08","slug":"automatic-water-level-indicator-and-controller","status":"publish","type":"post","link":"https:\/\/www.electronicsforu.com\/electronics-projects\/automatic-water-level-indicator-and-controller","title":{"rendered":"Automatic Water Level Indicator And Controller"},"content":{"rendered":"<div class=\"wp-block-image\">\n<figure class=\"alignright size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"178\" height=\"163\" src=\"https:\/\/www.electronicsforu.com\/wp-contents\/uploads\/2024\/07\/efy-tested-1.jpg\" alt=\"Electronics For You Tested DIY Project\" class=\"wp-image-143513\"\/><\/figure><\/div>\n\n\n<p>Water storage often presents challenges such as monitoring tank levels, preventing overflow, and reducing manual intervention to operate the pump. Two types of devices, known as water level indicators and controllers, have been developed to address these issues.<\/p>\n\n\n\n<p>These devices have key drawbacks. Water level indicators require manual pump operation and often waste power as multiple LEDs stay unnecessarily lit. Water level controllers face frequent pump cycling from minor fluctuations, accelerating the pump\u2019s wear and tear and shortening its lifespan.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"poc-video\">POC Video Tutorial<\/h2>\n\n\n\n<figure class=\"wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio\"><div class=\"wp-block-embed__wrapper\">\n<span class=\"rgzSAGshCE7IFvYOLtdifmnPNp2xQDMqHw1bU6keJjc\"><iframe loading=\"lazy\" title=\"Automatic Water Level Indicator and Controller | Arduino Project | Electronics For You\" width=\"696\" height=\"392\" src=\"https:\/\/www.youtube.com\/embed\/iI11O1bCzX8?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen><\/iframe><\/span>\n<\/div><\/figure>\n\n\n\n<p>Also, Check the <a href=\"https:\/\/www.electronicsforu.com\/electronics-projects\/automatic-water-pump-controller\">Water Pump Controller project<\/a> that we built previously.<\/p>\n\n\n\n<p>An automatic water level indicator cum controller device can address these problems. To build this device, the components listed in Table 1 are required. Fig. 1 shows the author\u2019s prototype.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"600\" height=\"832\" src=\"https:\/\/www.electronicsforu.com\/wp-contents\/uploads\/2025\/01\/Authors-prototype.jpg\" alt=\"Automatic Water Level Indicator and Controller\" class=\"wp-image-157004\" style=\"width:450px\" srcset=\"https:\/\/www.electronicsforu.com\/wp-contents\/uploads\/2025\/01\/Authors-prototype.jpg 600w, https:\/\/www.electronicsforu.com\/wp-contents\/uploads\/2025\/01\/Authors-prototype-361x500.jpg 361w, https:\/\/www.electronicsforu.com\/wp-contents\/uploads\/2025\/01\/Authors-prototype-303x420.jpg 303w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><figcaption class=\"wp-element-caption\">Fig 1: Author\u2019s prototype of Automatic Water Level Indicator and Controller<\/figcaption><\/figure><\/div>\n\n\n<div class=\"wp-block-rank-math-toc-block\" id=\"rank-math-toc\"><h2>Table of Contents<\/h2><nav><ul><li><a href=\"#poc-video\">POC Video Tutorial<\/a><\/li><li><a href=\"#arduino-code-for-water-level-indicator-and-controller\">Arduino Code for Water Level Indicator and Controller<\/a><\/li><li><a href=\"#circuit\">Circuit<\/a><\/li><li><a href=\"#working\">Working<\/a><ul><li><a href=\"#filling-mode\">Filling Mode<\/a><\/li><li><a href=\"#draining-mode\">Draining Mode<\/a><\/li><\/ul><\/li><li><a href=\"#testing\">Testing<\/a><\/li><\/ul><\/nav><\/div>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><tbody><tr><td colspan=\"2\"><strong>Table 1: List of components<\/strong><\/td><\/tr><tr><td><strong>Item<\/strong><\/td><td><strong>Quantity<\/strong><\/td><\/tr><tr><td>Arduino Uno (MOD1)<\/td><td>1<\/td><\/tr><tr><td>Water level sensors or float switch<\/td><td>3<\/td><\/tr><tr><td>5V SPDT relay (RL1)<\/td><td>1<\/td><\/tr><tr><td>BC547 NPN transistor (T1)<\/td><td>1<\/td><\/tr><tr><td>1N4007 rectifier diode (D1)<\/td><td>1<\/td><\/tr><tr><td>330\u03a9 resistor (R1, R2, R3)<\/td><td>3<\/td><\/tr><tr><td>10k\u03a9 resistor (R4, R5, R6)<\/td><td>3<\/td><\/tr><tr><td>1k\u03a9 resistor (R7)<\/td><td>1<\/td><\/tr><tr><td>Water pump<\/td><td>1<\/td><\/tr><tr><td>5mm LED<\/td><td>3<\/td><\/tr><tr><td>Power supply for Arduino Uno<\/td><td>5V<\/td><\/tr><tr><td>Power supply for water pump motor<\/td><td>230V AC<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"arduino-code-for-water-level-indicator-and-controller\"><strong>Arduino Code for Water Level Indicator and Controller<\/strong><\/h2>\n\n\n\n<p>The code is written in Arduino IDE. First, the IDE must be installed. The code can then be downloaded and opened in Arduino IDE.<\/p>\n\n\n\n<p>In the initial part of the code, sensor wires, LEDs, and the relay pin are defined. In the setup function, the pin modes are configured as input for the sensor wires and output for the LEDs and relay.<\/p>\n\n\n\n<p>In the loop function, the levels are detected using the read function. Based on the detected level, the relay turns on or off, controlling the motor connected to it.<\/p>\n\n\n\n<p>The board and port for the Arduino Uno should be selected. The Arduino Uno should then be plugged in, and the source code uploaded. Fig. 2 shows a snippet of the source code.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"800\" height=\"847\" src=\"https:\/\/www.electronicsforu.com\/wp-contents\/uploads\/2025\/01\/Snippet-of-source-code-1.jpg\" alt=\"Code for Water Level Indicator and Controller Project\" class=\"wp-image-157006\" srcset=\"https:\/\/www.electronicsforu.com\/wp-contents\/uploads\/2025\/01\/Snippet-of-source-code-1.jpg 800w, https:\/\/www.electronicsforu.com\/wp-contents\/uploads\/2025\/01\/Snippet-of-source-code-1-472x500.jpg 472w, https:\/\/www.electronicsforu.com\/wp-contents\/uploads\/2025\/01\/Snippet-of-source-code-1-397x420.jpg 397w, https:\/\/www.electronicsforu.com\/wp-contents\/uploads\/2025\/01\/Snippet-of-source-code-1-696x737.jpg 696w\" sizes=\"auto, (max-width: 800px) 100vw, 800px\" \/><figcaption class=\"wp-element-caption\">Fig. 2: Snippet of source code<\/figcaption><\/figure><\/div>\n\n\n<h2 class=\"wp-block-heading\" id=\"circuit\"><strong>Circuit<\/strong><\/h2>\n\n\n\n<p>Fig. 3 shows the circuit diagram of the automatic water level indicator cum controller. It is built around an Arduino Uno board (MOD1), three LEDs, a 5V SPDT relay, and other components.<\/p>\n\n\n\n<p>First, all sensors should be installed in the upper tank, and the pump motor should be installed in the lower tank.<\/p>\n\n\n\n<p>The circuit can use either wires as sensors or float switches.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"800\" height=\"440\" src=\"https:\/\/www.electronicsforu.com\/wp-contents\/uploads\/2025\/01\/Circuit-diagram.jpg\" alt=\"\" class=\"wp-image-157007\" srcset=\"https:\/\/www.electronicsforu.com\/wp-contents\/uploads\/2025\/01\/Circuit-diagram.jpg 800w, https:\/\/www.electronicsforu.com\/wp-contents\/uploads\/2025\/01\/Circuit-diagram-500x275.jpg 500w, https:\/\/www.electronicsforu.com\/wp-contents\/uploads\/2025\/01\/Circuit-diagram-764x420.jpg 764w, https:\/\/www.electronicsforu.com\/wp-contents\/uploads\/2025\/01\/Circuit-diagram-696x383.jpg 696w\" sizes=\"auto, (max-width: 800px) 100vw, 800px\" \/><figcaption class=\"wp-element-caption\">Fig. 3: Circuit diagram<\/figcaption><\/figure><\/div>\n\n\n<h2 class=\"wp-block-heading\" id=\"working\"><strong>Working<\/strong><\/h2>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"filling-mode\"><strong>Filling Mode<\/strong><\/h3>\n\n\n\n<p>During water filling, the three wire sensors are positioned at different heights in the tank. The pump motor starts automatically when water is below the lowest sensor.<\/p>\n\n\n\n<p>When water touches the lowest sensor, LED1 lights up, but the pump remains on. When water touches the middle sensor, LED1 turns off, LED2 lights up, and the pump remains on.<\/p>\n\n\n\n<p>When water touches the highest sensor, LED3 lights up, LEDs 1 and 2 turn off, and the pump switches off.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><tbody><tr><td colspan=\"6\"><strong>Table 2:<\/strong> <strong>Filling mode<\/strong><\/td><\/tr><tr><td><strong>Sensor Position<\/strong><\/td><td><strong>Condition<\/strong><\/td><td><strong>LED1<\/strong><\/td><td><strong>LED2<\/strong><\/td><td><strong>LED3<\/strong><\/td><td><strong>PUMP<\/strong><\/td><\/tr><tr><td>Water touches no sensors (below lowest sensor)<\/td><td>Tank is empty<\/td><td>OFF<\/td><td>OFF<\/td><td>OFF<\/td><td>ON<\/td><\/tr><tr><td>Water touches the lowest sensor<\/td><td>Tank is not empty<\/td><td>ON<\/td><td>OFF<\/td><td>OFF<\/td><td>ON<\/td><\/tr><tr><td>Water touches the middle sensor<\/td><td>Tank is partially filled<\/td><td>OFF<\/td><td>ON<\/td><td>OFF<\/td><td>ON<\/td><\/tr><tr><td>Water touches the highest sensor<\/td><td>Tank is full<\/td><td>OFF<\/td><td>OFF<\/td><td>ON<\/td><td>OFF<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"draining-mode\"><strong>Draining Mode<\/strong><\/h3>\n\n\n\n<p>During water drainage, when the water level drops below the highest sensor, LED3 turns off, and LED2 lights up, but the pump remains off.<\/p>\n\n\n\n<p>When the water level reaches below the middle sensor, LED2 turns off, and LED1 lights up, but the pump remains off.<\/p>\n\n\n\n<p>When the water is below the lowest sensor, all LEDs turn off, and the pump starts.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><tbody><tr><td colspan=\"6\"><strong>Table 3: Draining mode<\/strong><\/td><\/tr><tr><td><strong>Sensor Position<\/strong><\/td><td><strong>Condition<\/strong><\/td><td><strong>LED1<\/strong><\/td><td><strong>LED2<\/strong><\/td><td><strong>LED3<\/strong><\/td><td><strong>PUMP<\/strong><\/td><\/tr><tr><td>Water level is at the highest sensor<\/td><td>Tank is full<\/td><td>OFF<\/td><td>OFF<\/td><td>ON<\/td><td>OFF<\/td><\/tr><tr><td>Water level is below the highest sensor<\/td><td>Tank is partially filled<\/td><td>OFF<\/td><td>ON<\/td><td>OFF<\/td><td>OFF<\/td><\/tr><tr><td>Water level is below the middle sensor<\/td><td>Tank is not empty<\/td><td>ON<\/td><td>OFF<\/td><td>OFF<\/td><td>OFF<\/td><\/tr><tr><td>Water level is below the lowest sensor<\/td><td>Tank is empty<\/td><td>OFF<\/td><td>OFF<\/td><td>OFF<\/td><td>ON<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"testing\"><strong>Testing<\/strong><\/h2>\n\n\n\n<p>The source code must first be uploaded into the Arduino Uno. The components should then be connected as per the circuit diagram shown in Fig. 3. The Arduino Uno board should be powered using a 5V adaptor or a USB cable connected to a laptop or desktop.<\/p>\n\n\n\n<p>The water pump should be connected to a 230V AC power supply through the relay contacts. After powering the device and installing the sensors in the tank, water should be filled into the tank. The LEDs will glow according to the water level, and the pump will switch on or off as described in Tables 2 and 3.<\/p>\n\n\n\n<p>Check other <a href=\"https:\/\/www.electronicsforu.com\/arduino-projects-ideas\">Arduino Projects<\/a><\/p>\n\n\n\n<div class=\"wp-block-buttons is-layout-flex wp-block-buttons-is-layout-flex\">\n<div class=\"wp-block-button\"><a class=\"wp-block-button__link wp-element-button\" href=\"https:\/\/www.electronicsforu.com\/wp-contents\/uploads\/2025\/01\/Water_Level_Controller.ino_.zip\">Download Source Code<\/a><\/div>\n<\/div>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p><em>Rakesh Jain, Assistant Professor in the <\/em>ECE Department at Geetanjali Institute of Technical Studies, Udaipur, holds a master\u2019s degree in VLSI, a BE degree in electronics and communication and a diploma in electronics. His research areas are sensors and microcontrollers, and he has 31 copyrights, 9 design patent registrations, and 3 Indian utility patents to his credit. He is the recipient of the <em>Mewar Scientist Award 2023.<\/em><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Water storage often presents challenges such as monitoring tank levels, preventing overflow, and reducing manual intervention to operate the pump. Two types of devices, known as water level indicators and controllers, have been developed to address these issues. These devices have key drawbacks. Water level indicators require manual pump operation and often waste power as [&hellip;]<\/p>\n","protected":false},"author":197757,"featured_media":157004,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[22,6070,3805,6072],"tags":[1985,11761,110,12605],"class_list":{"0":"post-156996","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-electronics-projects","8":"category-advanced-projects","9":"category-arduino-projects","10":"category-beginners-projects","11":"tag-diy-projects","12":"tag-do-it-yoursef","13":"tag-electronics-projects","14":"tag-feb-2025"},"_links":{"self":[{"href":"https:\/\/www.electronicsforu.com\/wp-json\/wp\/v2\/posts\/156996","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.electronicsforu.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.electronicsforu.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.electronicsforu.com\/wp-json\/wp\/v2\/users\/197757"}],"replies":[{"embeddable":true,"href":"https:\/\/www.electronicsforu.com\/wp-json\/wp\/v2\/comments?post=156996"}],"version-history":[{"count":2,"href":"https:\/\/www.electronicsforu.com\/wp-json\/wp\/v2\/posts\/156996\/revisions"}],"predecessor-version":[{"id":159184,"href":"https:\/\/www.electronicsforu.com\/wp-json\/wp\/v2\/posts\/156996\/revisions\/159184"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.electronicsforu.com\/wp-json\/wp\/v2\/media\/157004"}],"wp:attachment":[{"href":"https:\/\/www.electronicsforu.com\/wp-json\/wp\/v2\/media?parent=156996"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.electronicsforu.com\/wp-json\/wp\/v2\/categories?post=156996"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.electronicsforu.com\/wp-json\/wp\/v2\/tags?post=156996"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}