Close
Free HTML5 Bootstrap Template

About Me

SARATH.SM

I am an Electronics engineer, who love to explore, experiment and learn new technologies and processes in my pursuit to give life to the Ideas I dream about..

Prev Next

IoT BASED CONTROL & MONITORING
For
WATER QUALITY MEASUREMENT PLATFORM

My Proposed Final Project


I have proposed two Ideas initially, and decided to work on the second one for the final project. The idea is to develop an IoT Based Control & Monitoring for Water Quality Measurement Platform. I have been working on developing water quality measurement products ( SWATCHPAANI PROJECT ) for real world applications based on the enquiries we ( IIITMK -- That is where I work as Technical Officer ) received. As I had very limited time to both work and attend my fab academy course, most of the time I have been strugglig to keep up with the pace the classes were going on. This made me think in the direction of combining my Commercial project with the Fab one. I have already finished most of the work in data acquistion from the sample water to be measured and monitored. The rest of the cotrol part was left to be completed. I discussed this with my Remote Tutor Mr Franciso and he agreed to my idea of clubbing the projects, thats how I started working on this projecct for FAB.

Let me walk you through the various stages of its development..

It all started from this rough drawing on my notebook, functionally how I dreamed the system should work :-)

 

It is said that "A picture is worth a thousand words".. so let me first introduce you my project with the block diagram to make things very clear to you.

 

Talking about what it does, I have integrated a Waspmote Based Water Quality Measuring System which will measure the following Basic water parameters such as pH, Temperature, Conductivity, Oxygen reduction Potential and also the Ion concentrations of Chlorine, Fluride, Calcium, Cupric, Nitrate and Silver. The requirement that I had was to make such a product that can be deployed in remote place such as a remote water distribution system or on a mobile lab. The product should keep monitoring the water quality and send the live data to a cloud. There should also be provision to control the operation of this system remotely. In addition to this it must also have a self health check and feedback mechanism. So in a nutshell I will be making this IoT Based Control Mechanism as my Fab Project.


The processes and Systems that I will use are,

1. Custom PCB Design and Milling

2. Laser Cutting & Engraving

3. The WASPMOTE Sensor Assembly

4. 3D Printing

5. Networking & Communication

6. Customised Cloud based Interface design


Let us see the development of each module in detail..

1. Custom PCB Design and Milling


As you can see in the blockdiagram representation I am using two microcontrollers for having a modular design. I tried to design a PCB in such a way that I can use it for both the microcontrollers and special care was taken to find the Microcontrollers that I can use without much difference in pin configuration and footprint. It is necessary that One microcontroller be a more powerful one and the other be a normal general purpose controller. The functions of these two controllers are,

  • Microcontroller 1 Board will take care of GSM Connectivity,Power & Health status Monitoring
  • Microcontroller 2 Board will take care of Cloud connectivity and Local Display UI

  • I have used two Micrcontrollers , PIC16F877A and PIC18F4620. I have chosen them so that they are PIN compatible and hence a single PCB design can meet the requirement of hosting these two Microcontrollers.

    I started by making my custom PCB keeping in mind of a modular design by which the PIC16F877A microcontroller used in the Board can be replaced by PIC18F4620 with out making any changes for the second PCB.

    Main features I wanted this Board to have are,

  • Compatible with PIC16F and PIC18F family of microcontrollers
  • Incircuit programming capability
  • 3.3V and 5V Power supply compatibility as per interface requirements
  • RS232 Debugging capability
  • 3.3V or 5V serial Connectivity to Interface with another microcontroller
  • Power good indicator
  • USB Powerup or external powerup options
  • ICSP Debugging option
  • Onboard Test Leds
  • Individual GPIO hardware connectivity for flexible external custom circuit interface


  • CIRCUIT & PCB DESIGN - USING EAGLE

    Schematic Design and PCB was developed using EAGLE CAD, The following shows screenshots shows the various stages of development,

     

    Starting with the Microcontroller and its GPIO..

     

    Progressing with the ICSP and power circuits..

     

    The completly finshed PCB

     

    MODELLA - PCB MILLING

    The finished milled PCB, ready to be cut and removed

     

    The finished PCB..

     

    Assemblying the components..

     

    This is a closer view of the tracks of the PCB, I was not satisfied with the tracks from Microcontroller, it doesnt seem to have got milled properly and I decided to quit trying to fix the controller directly to avoid problems that may arise later..

     

    I did not want to throw this PCB away and hence decided to use SMD To DIP adapter and solder the PINS to the corresponding tracks of the mother board..

     

    Wires fixed to the pins of DIP adapter..

     

    Adapter PCB with the microcontroller soldered to it, ready to be fixed to the motherboard..

     

    Though it felt simple, it wasnt that easy to solder all the wires.. it took a while for me to get them soldered.. well no giving up!!

     

    Finally I completed the connections and after a thorough checkup, I powered on the board using external USB connector..

     

    It was time to check one of the critical things, the ICSP connectivity.. well to my goodfortune that too got worked the very first time..My programmer could detect the PIC16F877A.. finally a great relief to the hectic soldering :)

     

    I call this SM_FAB PIC16F pcb .. :-) Now moving on to make the second PCB for hosting PIC18F4620 Microcontroller..

    Repeating the Modella Milling with few modifications as you find that the previos PCB had some problems with the thinnest tracks.

    This time I changed the track width from 12 to 16 Mills and made Mask for milling the Microcontroller Area alone where the thinnest tracks were routed as shown and milled using the 1/100th Bit.

     

    The perfectly milled PCB :-) The masking technique did work for me..

     

    About to Solder the PIC18F4620..

     

    Well in placce..

     

    Assemblying the PCB..

     

    Both the PCBs ready..

     


    2. Laser Cutting & Engraving - For ENCLOSURE


    My requirement is to make a box that has to Host my electronics and at the same time provide acess to the sensors which will be floating beneath the box on water. So I am making a platofrm for the same.

    Box Design - OpenSCAD Software


    OpenSCAD is a software for creating solid 3D CAD models. It is free software and available for Linux/UNIX, Windows and Mac OS X. Unlike most free software for creating 3D models (such as Blender) it does not focus on the artistic aspects of 3D modelling but instead on the CAD aspects. Thus it might be the application you are looking for when you are planning to create 3D models of machine parts but pretty sure is not what you are looking for when you are more interested in creating computer-animated movies.

    OpenSCAD is not an interactive modeller. Instead it is something like a 3D-compiler that reads in a script file that describes the object and renders the 3D model from this script file. This gives you (the designer) full control over the modelling process and enables you to easily change any step in the modelling process or make designs that are defined by configurable parameters.

    OpenSCAD provides two main modelling techniques: First there is constructive solid geometry (aka CSG) and second there is extrusion of 2D outlines. As data exchange format format for this 2D outlines Autocad DXF files are used. In addition to 2D paths for extrusion it is also possible to read design parameters from DXF files. Besides DXF files OpenSCAD can read and create 3D models in the STL and OFF file formats.

    The best part is that the design is parametric and any sort of scaling can be done without much difficulty..

    Design in OpenSCAD..


    Design modificaitons in Rhino to add holes and to trim the design to the laser bed size..


    Finished Cutting..


    Finished cut pieces..


    Engraving in progress..


    Fixing them together..


    The Complety Finished Enclosure


    A perfect Fit on top :-)


    3. WASPMOTE SENSOR ASSEMBLY


    I am using WASPMOTE Sensors from Libelium to measure the water parameters, I am using three waspmote boards as I have to deploy them in three different locations once the final product is made, for the time being it is all tied together for developing the fuctional proto.

    Since these are commercially available boards, I am just refereing it here as my input source. I am not explaining in detail about Waspmote and its programming as it will not be evaluated as part of the Fab project.

    If time permits I shall document them and upload it seperately for reference to help those who may be interested to know more about this wonderful platform.



    The following water Parameters will be send to the Control and Monitoring Module by the waspmote as serial data, which will be displayed locally in the LCD Module and also send to the Cloud interface, the parameters being measured are,

  • pH
  • Temperature
  • Conductivity
  • Oxygen reduction Potential
  • Chlorine
  • Fluride
  • Calcium
  • Cupric
  • Nitrate
  • Silver

  • To measure each parameter, there is a specific probe and that is immerced in the water to be tested.

    4. 3D Printing - Probe Clips


    The probes I use for measuring the various parameters has a built in BNC connector which was non removable so I had no other choice than to provide provision in the enclosure for this to pass through. After doing this the probes shoud be made to hang and float on the water used for testing so this was 3D printed

    Story behind the clips.


    The sensor Assembly with long wires to be immersed in water from top of the enclosure.


    A temporary solution, I tried to loop them with a wire to hold the probes in place.


    A closer look.


    Still not in perfect positions.


    Tried sticking them with tapes too.


    Finally gave up that as it wasnt able to fix it as I wanted and then decided to make something to hold them in place..and started to design a 3D Printed Clip..


    The clip was designed in Rhino.


    3D printing completed.


    Tried two different rolls of material as I was finding the finish with Black one was not that good.


    Fixing the probes using the clips.


    A perfect Fit to hold the my probes on top in position :-)



    4. Networking & Communication


    Now it is time to integrate my boards and make the control system.. it consists of the following..

  • SM_FAB PIC16F Board -1 with 16F877A Microcontroller
  • SM_FAB PIC16F Board -2 with 18F4620 Microcontroller
  • GSM MODEM
  • Current Measurement Module - ACS712 BASED HALL SENSOR MODULE
  • Waspmote Powercontrol Module
  • ESP8266 Wifi Module
  • POWER SUPPLY MODULE
  • Let me walk you through the different stages of integation of these modules,

    Placing the GSM Module and controller boards on the base plate.

    I am using a SIM900A Based Modem for remote control purpose.


    I didnt had much time to make another PCB for the controlling the Power of Wasmote sensors so decided to solder them on a Common PCB as shown below..


    This is the ACS712 Halleffect current sensing module I am using to monitor the Health of Waspmote sensor modules..


    To save space I placed the the current sensing module and Buck power supply module on top of the common PCB. This not only saved space but also gave good solution to fix them and minimize the wiring..


    Integrated the LCD module and finished the wiring.


    The firmware developed using PICC.


    A quick powerup test to ensure all the modules are working before..


    Checking the serial output from the microcontroller to control the ESP8266 Wifi module using USB to TTL adapter cable..


    5. CLOUD INTERFACE USING THINGSPEAK


    I chose Thingspeak as my cloud interface for the final project to display the measured water parameters.

    First step is to signup for an account and login to the same.

    On signing in you will find options to create channels, API Keys to acess the same and options for data Import and exporting as shown below..

     

    Thingspeak provides option to have as much as Eight Fields inside the same channel, we can name them as per our requirement.

    Data can be send to the corresponding fields using the API with suitable KEY and channel ID.

     

    The hardwre that sends data to this cloud is based on an ESP8266 based PIC microcontroller platform which collects the water quality parameters from WASPMOTE Sensors..

    The following shows the hardware assembly and Cloud Integration under development.

     

    My live cloud page can be reached from here.

    kidnly note you may stumble across meaning less values in the Water Board graph at times as I keep sending arbitary values for testing and not always the live sensor value :) pls bear with me for a few days until I deploy it in the field!!


    INTEGRATING THE COMPLETE HARDWARE


    placing the waspmote sensor boards and probes inside the encloure.


    The FAB FABRICATED controller Boards and display being integrated.


    The complete system after integration.



    And finally its time to show you my proto in action, here is a quick video on how this works :-)


    The design files and BOM can be downloaded from here.