This lockdown has brought almost everyone back to their home towns and people have now really adapted to this new reality. Being in the IT industry, people focus so much on the Business Requirements and their solutions that sometimes, they forget that few problems at their home are also “Business Requirements”, which can be solved by investing your software development efforts. Spending such a long time at my home, I discovered a very basic problem of every-day life and I resolved the challenge with a small investment of my time and my software development skills. Read through, to understand The Water Problem!
Identifying the Problem
Okay, so my mom told me one day that she couldn’t sleep well last night. On asking “why?” she told me that she had to “Turn ON” the water motor early morning because we had no water left in our Water Tank. I felt so bad that her sleep was actually affected because she was tensed about turning the Water Motor ON/OFF. Another thing that I noticed is that when the tank was full, water overflows from the tank into the drain. Many-times, there was a delay due to some reason in switching OFF the Water Motor resulting in an unnecessary flow of liters of freshwater into the drain.
After this, the problem was pretty much clear to me. All I had to do is to scratch my head and figure what tool and technology to use to automate the Turn ON/OFF mechanism of my Water Motor.
The Technological Solution
As I started my research on a solution to the problem, I deep dived into the “As Is” process to better understand the Water Motor process. I created a simple diagram, which describes the normal Water Motor ON/OFF process. See the diagram below.
The Water Motor requires to be run twice a day – morning around 5.30 AM and evening around 5.15 PM. That’s the time water flow from the main supply line is at its best.
After a good amount of research on how to get this done, I was clear with one thing that I need a solution that comprises both – hardware and software, and to completely automate the process I went ahead with IoT technology. The solution comprises a combination of hardware and software which has to be put into a complete electronic circuit. The TURN ON and TURN OFF are required to be automatically controlled through a WiFi-based Chip or ESP8266 WiFi Chip. I used a WiFi-based switch (or a simple Relay would work) to perform the task of Turn ON/OFF and made use of the ESP8266 WiFi chip to handle the programming part i.e. controlling the automation process.
- A WiFi-enabled smart plug (or a relay-based switch)
- ESP8266 WiFi Chip
- A float-based switch (used atop the water tank to decide water level). A common example is a switch used in Water Purifiers.
The WiFi chip triggers an API call to Turn ON the WiFi-based Smart plug as per its schedule. As the Water tank starts filling up and the water tank reaches its full capacity, the float-based switch automatically Turns ON due to water level. This switch ON of the float switch is detected by ESP8266 chip (called external interrupt) and the Chip immediately triggers an API call to Turn OFF the WiFi Smart Plug to Turn OFF water motor.
WATER MOTOR AUTOMATIC TURN ON
WATER MOTOR AUTOMATIC TURN OFF
Its been almost a month of this project working successfully in a real production environment 😁. If I think about the ROI (Return of Investment) of this automation project, I am more than happy to quote that I have saved hours of sleep and literally saved liters of fresh water from going into the drain.
Apart from the coding of the ESP8266 WiFi chip, I spent some additional effort to integrate the entire setup with a database for better tracking and set up some alerts in my Telegram Chatbot for better notifications.
A link to my GitHub repository is available below where you can find my ESP8266 WiFi chip code.
Keep Learning and Happy Automation 🤘