Swimming Pool Monitoring System using Arduino and LoRa, Save a child from drowning

(Last Updated On: June 5, 2022)

Swimming Pool Monitoring System, Description:

swimming pool monitoring system

Swimming Pool Monitoring System using Arduino and LoRa, Save a child from drowning- In this article, you will learn how to make a smart swimming pool monitoring system using Arduino boards, a pair of SX1278 LoRa Transceiver modules, MPU6050 accelerometer and Gyroscope Module, and a 5V buzzer.

The objective behind designing this swimming pool monitoring system is actually based on my commitment that during the ongoing summer and during the summers coming ahead, we do not have to let any child drown. So, you are requested guys to share this article as much as possible, so that more and more people come to know about this useful system.

According to the US Consumer Product Safety Commission, 390 deaths a year on average are attributed to drowning in a swimming pool. The majority of the deaths occur during the months of June, July, and August, mostly in the backyard pools. If this is the situation in a country like the US, where everything is so systematic, just imagine for yourself what will be the kid’s death rates due to drowning incidents throughout the world.  

As an engineer, I consider it my duty to devise a kind of a system, which may prove helpful in the protection of any precious life, so, I will go ahead and definitely work on the accomplishment of this cherished obligation.

A lot of people, mostly the parents, usually enquire about how to save a child from drowning and how to keep their kids safe at the pool? Well, you have two options for this.

1). As a precaution, you can build a sort of barricade around the swimming pool to keep the kids away, and

2). You can make a smart swimming pool monitoring system to alert the parents when there is any kind of activity in the water.

swimming pool monitoring system

If you select option 1, then believe me kids are very sharp and clever these days, they will definitely find out some sort of a mechanism to reach out to the pool, however; 

If you select option number 2 (My designed swimming pool monitoring system), then rest assured even the slightest activity in the water will trigger the system, and parents will abruptly come to know that somebody is venturing in the water, and then they can go around and check the scenario by themselves.

Now, let me tell you a bit about this swimming pool monitoring system. At the time of designing this system, I studied water ripples, my goal was that from whichever direction ripples or waves come, my designed system should be so sensitive that it can detect these ripples. I kept thinking about different types of sensors for a significant period of time, and then all of a sudden, the MPU6050 module came into my mind.

swimming pool monitoring system

The MPU6050 module is best for the project because, with the help of the MPU6050 module, we can monitor three axes (x-axis, y-axis, and z-axis) simultaneously.

swimming pool monitoring system

So, I made this prototype model. You can clearly see that I have connected MPU6050 and LoRa SX1278 modules with Arduino. This particular side is the transmitter and it will be placed on the swimming poolside.

swimming pool monitoring system

And this side is the receiver, which will be installed somewhere inside the house. A buzzer is attached to it. As soon as ripples are generated in water, this buzzer will automatically turn ON.  

Let us kick off our practical demonstration so that you can see how beneficial this swimming pool monitoring system can be;

Altium Designer, Altium 365, & Octopart:

swimming pool monitoring system

Altium 365 lets you hold the fastest design reviews ever. Share your designs from anywhere and with anyone with a single click. it’s easy, leave a comment tagging your teammate and they’ll instantly receive an email with a link to the design. Anyone you invite can open the design using a web browser. Using the browser interface, you’re able to comment, markup, cross probe, inspect, and more. Comments are attached directly to the project, making them viewable within Altium designer as well as through the browser interface. Design, share, and manufacture, all in the same space with nothing extra to install or configure. Connect to the platform directly from Altium Designer without changing how you already design electronics. Altium 365 requires no additional licenses and comes included with your subscription plan.

Get real-time component insights as you design with Octopart built into Altium 365. Octopart is the fastest search engine for electronic parts and gives you the most up-to-date part data like specs, datasheets, cad models, and how much the part costs at different amounts etc. Right in the design environment so you can focus on your designs. Start with Altium Designer and Activate Altium 365. Search for electronic parts on Octopart.

Practical Demonstration:

swimming pool monitoring system

First, I am going to do some basic testing, and thereafter I will practically test it in water. So, you can see that I have powered up both the transmitter as well as receiver’s side. I have done its programming in such a way that when MPU6050 is on an absolutely flat-water surface, it does not send any trigger message to the receiver side, however, if the slightest change occurs in any of its axis, its system triggers, and buzzer on the receiver’s side turns ON.

In the above image, you can’t see how this system activates when I touch the transmitter side. For visual demonstration, you can watch the video, given at the end of this article.

It has the capacity to detect even the smallest of vibrations. My designed system is so sensitive that even when I hit the table the buzzer on the receiver side is activated. So, if you observe during the testing that this system is very sensitive, then you can modify its threshold values in the programming, which later I will explain.

I didn’t face any issues while performing the basic tests, the only thing I did, I changed the threshold values to make it less sensitive.

Now we move on and practically test this project in water.

swimming pool monitoring system

For the practical demonstration, I placed the Transmitter side circuit in a plastic container. While you can design your own 3D printed waterproof plastic enclosure.

swimming pool monitoring system

You can see that there is no ripple on the water surface, and that’s why the buzzer on the receiver side remains OFF. So, let us move forward and produce some ripples in the water, and then we see whether the system detects these ripples or not.

swimming pool monitoring system

I generated some ripples by slowly throwing a Doll in the water, and my system quickly detected the ripples and the buzzer on the receiver side turned ON. For practical demonstration, watch the video given at the end of this article.

It has been working amazingly, even better than my imagination. So, the prototype model has turned out to be a success. 

swimming pool monitoring system

If you want to implement this swimming pool monitoring system, in reality, you can reduce the transmitter size by designing a small PCB. You can see my development board is big, the unnecessary female headers can be removed. You can also use Arduino Pro Mini, which will render it into a significantly small size, and as such you will be able to power up this system even though a small 3.7V Lipo battery.

I am sure by now, you might have got an idea of how does this system work. So, without any further delay, let’s get started!!!

Amazon Links:

Arduino Nano

LoRa SX1278 Module

MPU6050 Module

5V buzzer

Other Tools and Components:

Top Arduino Sensors:

Super Starter kit for Beginners

Digital Oscilloscopes

Variable Supply

Digital Multimeter

Soldering iron kits

PCB small portable drill machines

*Please Note: These are affiliate links. I may make a commission if you buy the components through these links. I would appreciate your support in this way!

Swimming Pool Monitoring System, Circuit Diagram:

swimming pool monitoring system

This is the circuit diagram of the transmitter side.  The VCC of the SX1278 LoRa module is connected with 3.3V of the Arduino. The MISO Pin of the LoRa module is connected with the Arduino pin 12. The MOSI pin is connected with pin 11. The SCK pin of the LoRa module is connected with pin 13. The NSS pin is connected with the Arduino’s pin 10 and the ground pin of the LoRa module is connected with the Arduino’s GND.

The VCC and GND pins of the MPU6050 Module are connected with the Arduino 3.3V and GND pins. While the SCL and SDA pins of the MPU6050 module are connected with the A5 and A4 pins of the Arduino. A5 is the SCL and A4 is the SDA.

On the left side is the regulated 5V power supply based on the LM7805 voltage regulator.

Receiver Side, Circuit Diagram:

swimming pool monitoring system

On the receiver side, the connections of the 5v regulated power supply and SX1278 LoRa transceiver module remain exactly the same. A 5V buzzer is connected with the Arduino Pin 3. A 2n2222 NPN transistor is used to control the buzzer. The 10K resistor and 2n2222 NPN transistor make the driver circuit. Now, let’s take a look at the transmitter and receiver side programming.

Swimming Pool Monitoring system, Arduino Programming:

I have written two programs, one for the transmitter side and the other one for the receiver side. Anyway, before you start the programming, first of all, make sure you download all the necessary libraries.

Download: LoRa.h

Download hartway_digital Library: hartway_digital

The hartway_digial consists of the MPU6050.h and I2Cdev.h header files.

Let’s first start with the transmitter side programming.

Arduino, LoRa, and MPU6050, Programming:

Maximum of the code I have already explained in my previous tutorials. The purpose of this code is to read the X-axis, Y-axis, and Z-axis values and then compare these values with the pre-defined values. So, if the value on any Axis is less than or greater than the pre-defined value, then a value of 1 is sent to the receiver side. Otherwise, a value of 0 is sent which means there is no activity in the water. Now, let’s take a look at the receiver-side programming.

Arduino, LoRa, and Buzzer, Programming:

The purpose of this program is to check if a value of 1 or 0 is received. If a value of 1 is received then turn ON and Turn OFF the buzzer a few times. And then finally we make the TriggerSignal = 0.

getValue() function is a user-defined function that I have been using in all those projects where I needed to split a string message. So, the purpose of this function is to split any string message using any character as the delimiter. In my case, I am using a comma as the delimiter. So, that’s all about the programming.

Watch Video Tutorial:

Recommended For You

About the Author: Engr Fahad

My name is Shahzada Fahad and I am an Electrical Engineer. I have been doing Job in UAE as a site engineer in an Electrical Construction Company. Currently, I am running my own YouTube channel "Electronic Clinic", and managing this Website. My Hobbies are * Watching Movies * Music * Martial Arts * Photography * Travelling * Make Sketches and so on...

Leave a Reply

%d bloggers like this: