Industrial manufacturing
Industrial Internet of Things | Industrial materials | Equipment Maintenance and Repair | Industrial programming |
home  MfgRobots >> Industrial manufacturing >  >> Manufacturing Technology >> Manufacturing process

Real‑Time Water Quality Monitoring System with Arduino & GPRS/GPS

Components and supplies

Real‑Time Water Quality Monitoring System with Arduino & GPRS/GPS
Arduino UNO
×1
A7 GPRS/GPS module
×1
Water Quality sensors
×1

Necessary tools and machines

Real‑Time Water Quality Monitoring System with Arduino & GPRS/GPS
Soldering iron (generic)

Apps and online services

Real‑Time Water Quality Monitoring System with Arduino & GPRS/GPS
Microsoft Azure
Real‑Time Water Quality Monitoring System with Arduino & GPRS/GPS
Arduino IDE

About this project

Introduction

In September 2016, a water treatment plant has to be shut down because polluted water flowed into the plant. The water supply company was unable to pin point the contamination source and this caused a serious water service disruption.

My university course requires the students to build a system to solve community problems. An automated water quality monitoring system would ease the job of finding the pollution source!

System Overview

Real‑Time Water Quality Monitoring System with Arduino & GPRS/GPS

4 sensors are interfaced to Arduino Genuino 101. All of them requires some interfacing circuit because they are current-output sensors. Arduino Genuino 101 collects the measurements data periodically, gets the GPS coordinates, and uploads the data bundle into a database using GPRS data link. Users can go to the website to view the result as shown below.

Real‑Time Water Quality Monitoring System with Arduino & GPRS/GPS

Sensor probes

Real‑Time Water Quality Monitoring System with Arduino & GPRS/GPS

Real‑Time Water Quality Monitoring System with Arduino & GPRS/GPS

The three current output sensors are from Global Water, provided by the supervising lecturer. I use temperature, pH and dissolved oxygen level sensors in this project. Unfortunately, the dissolved oxygen level sensor is faulty.

The other sensor is a turbidity sensor, which output a voltage level proportional to the amount of suspended solid particles in the water.

Real‑Time Water Quality Monitoring System with Arduino & GPRS/GPS

Interfacing Sensors and Arduino

Real‑Time Water Quality Monitoring System with Arduino & GPRS/GPS

A resistor converts the current output into measureable voltage level.

A7 GPRS and GPS module

Real‑Time Water Quality Monitoring System with Arduino & GPRS/GPS

I chose this A7 module because it is relatively cheaper than SIM900 variant, and it combines both GPRS and GPS in a single package!

However, the cheaper price does come with a price. First, the GPS antenna that comes with the module is not really a GPS antenna, you will have to buy one yourself. Second, it only supports 115200 bps UART communication by default, and even if you change it using software, it will return to the default baud rate after a power cycle, and Software Serial at 115200 bps is very very unreliable. I pulled my hairs for 2 days for this problem. After that I implemented a baud rate change function in the Arduino code.

And, since this is a new module, I need to create my own library for this module. The source codes are collected from various places, like SIM900, and Adafruit GPS module. It is messy, but it works, please don't condemn me.

Real‑Time Water Quality Monitoring System with Arduino & GPRS/GPS

A circuit has to be designed to switch on the module. It has two pins, RESET pin and PWR_KEY pin to be controlled. A voltage is applied to the PWR_KEY for at least 2s to boot up the module. To reset, pull the RESET pin to GND. Otherwise, the RESET pin should be pulled up to 5V. I first reset the module, and then proceed to power up the module to make sure it starts up okay.

Power Source

Power source deserves a special mention here (I think?) because of the current output sensors. They require a minimum of 10V to operate, higher than our beloved 5V. Since I wanted to demonstrate the capability of this system to work remotely, I opted for Li-Ion battery.

Real‑Time Water Quality Monitoring System with Arduino & GPRS/GPS

2 Li-Ion batteries in series will give 7.4-8.4V, one buck converter to bring it down to 5V for our Arduino and A7 module, another boost converter to provide a 11V power rail for those water sensors. With this setup, the system will not run for a long time, but that is not a main concern for this prototype.

The board

The system is build on a prototype board. The board and Arduino Genuino 101 fit nicely into the enclosure.

Real‑Time Water Quality Monitoring System with Arduino & GPRS/GPS

Enclosure

The lecturer also gave an old enclosure, with holes drilled by previous students for projects related to the water sensors. Wonderful!

Real‑Time Water Quality Monitoring System with Arduino & GPRS/GPS

Notice the connectors to the sensors. I found them attached to the sensors, thus I searched around for connectors that would mate with them. I found them with the code GX16. They are very versatile and would surely come in handy in future projects!

Webpage

Finally, the part that took me weeks to build from scratch. I have zero knowledge in server, website and throughout this project I learnt PHP, SQL queries, JavaScript, CSS and HTML.

I hosted the website on Microsoft Azure because they provide a free sservice for students. It comes with limitations, but is sufficient for this application.

The databse is provided by ClearDB, in partnership with Azure as well. Again, memory limitations, but enough for this project.

The codes are provided in the repo, but remember to add in your credentials into username_password.php file.

The log.php dumps all the data received from Arduino into a database.

Then the webpage presents a Google Map, with markers shown in locations which have measurements data. The other php files are all "tools" to access the database to retrieve the data in database.

The response of the website is quite slow, and since I just hacked all these together, I wish to improve it. Suggestions are very much welcomed. :)

Code

Water Quality Monitoring System
Website codes in /Website, Arduino sketches and A7 module library in /Arduinohttps://github.com/JohnHJ01/Water-Quality-Monitoring-System

Schematics

Schematics for the whole system

Manufacturing process

  1. Raspberry Pi–Controlled Aquaponics System: Build Guide & Code
  2. Smart Indoor Air Quality & Waste Monitoring System
  3. Real‑Time Forest Fire Monitoring System with SMS Alerts
  4. Bolt IoT: Advanced Humidity & Temperature Monitoring with DHT11 and Arduino
  5. Real‑Time Swimming Pool Monitoring with Arduino MKR1000 & Samsung ARTIK Cloud
  6. WaterPi: Intelligent Remote Watering & Monitoring for Houseplants
  7. Real‑Time Environmental Monitoring with Arduino MKR1000 & Environment Click Sensors
  8. Advanced Smart Waste Monitoring with Arduino 101: BLE & WiFi Integration
  9. Advanced Indoor Air Quality Monitoring System with Arduino & IoT
  10. IoT-Enabled Ambient Air Quality Monitoring: Boosting Safety, Productivity, and Sustainability