#My Final Year Project
Tags: octograd2020
Published: 2020-05-23 17:25:16

[Comment]: # (All of this is placeholder text. Use this format or any other format of your choosing to best describe your project and experience.)

[Note]: # (If you used the GitHub Student Developer Pack on your project, add the "#githubsdp" tag above. We’d also love to know which services you used and how you used it!)

## My Final Project

Every student in his final year of graduation is tasked with submitting a final year project, this project is a measure of knowledge attained and how well we can put it to use. Before we start making a project we have to think what purpose does it serve, what problems does it solve.

To understand my project we must first understand the situation for which the project was developed:

What better way to utilize my knowledge than to make a project which solves an existing problem in my College. With that in mind, after some surveying around I came upon a problem faced by the Water Maintenance personnel in my college.
My college has a vast campus area with buildings spread throughout the campus, there are overhead tanks on each of these buildings. These tanks are supplied water from one main sump and there is only one motor to supply water to all these tanks. Now one might wonder how does water go to all the tanks if there's only one motor? Well, there is a network of pipes with valves to channel water to the desired tank. So the problem was the monitoring of these tanks, each time a personnel had to go to each blocks/buildings climb all the floors and check the status of these tanks and relay the information to the Water Maintenance Cell. So to automate the process of monitoring and filling up of tanks would have required major changes made to the Water Supply system which could result in inconvenience to the people using it.

So the project I made addressed the following issues:
* Monitoring Overhead Water Tanks
* Relaying the information of Tank's statuses to the Water Maintenance Cell

This project monitors the tanks and when there is a change in status of the tanks say the tank is empty or is full it notifies this change to the Maintenance cell on a display panel. 

My project has two units:
* Tank Unit: This unit is deployed in individual tanks. It monitors the tank and relays the information to the Central Unit.
* Central Unit: This Unit is setup in the Water Maintenance Cell. It collectively displays the information on a display panel and also sounds a buzzer to alert the personnel of the change in tanks statuses.

The Display panel has two columns of LEDs one column for Red LEDs which signify the tanks as being "Empty" and the other for Green LEDs which signify the tanks as being "Full". Rows on this panel signify the tanks.

Here is an image for a better understanding of the proposed model and situation(situation is oversimplified in the image):
![Proposed Model](https://dev-to-uploads.s3.amazonaws.com/i/8db4381y4zsortqwiqgm.png)
Display Panel Prototype:
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/bx02d6f8angz7srg52sk.jpeg)
Block Diagram for Tank Unit:
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/mkfvtujsjq13td62kpcm.png)
## Demo Link [here](https://drive.google.com/open?id=1FBkwt90udUY51aoznhnOivtQRZVpmil_)
## Link to [Central Unit code gist](https://gist.github.com/Blank1611/531ef665546a138589a6e2ff5970be32) & [Tank Unit code gist](https://gist.github.com/Blank1611/23e6d414cbbd100db08ba4fb71c08ab4)

[Note]: # (Our markdown editor supports pretty embeds. If you're sharing a GitHub repo, try this syntax: `{% github link_to_your_repo %}`)

## How I built it (what's the stack? did I run into issues or discover something new along the way?)
###The stack or components used in this project:
* Arduino nano (Tank Unit)
* Arduino Mega (Central Unit)
* GSM SIM800A
* Float Switch Sensor
* Buzzer
* 12VDC to 5VDC MB102 convertor
* Power Adapter
* LEDs (Display Panel)
* Jumper Cables

In softwares:
* Arduino IDE (To program Arduino)
* Embedded C as programming language
* SoftwareSerial Library (To communicate with GSM module)
* Usage of AT commands to control GSM module

###Issues I ran into:
####Choosing a technology for relaying information:
* My college does not have a wifi facility so I could not have implemented IoT in this project.
* ZigBees, bluetooth have very low range.

So I ended up using GSM module.
####Reading the messages recieved on GSM:
GSM module needs a SIM card to send and receive messages, using the AT commands * I was able to display this messages on the Serial Monitor but was unable to store the message body in a variable to take action/process further.
* Also GSM has different modes to operate in for reading the text messages. The easiest mode is a like pipeline of sort where everytime a new message is received the message is not stored but forwarded to the device communicating with it, in our case Arduino. So our program has to continuously monitor this stream coming from this pipeline and store it in a variable.

To manage this problem I used codes like "@T1F#", "@T1E" where "@" signifies the start of the message and "#" signifies the end.

But this mode had a disadvantage which was, if two messages were to arrive simultaneously then there is a possibility that one message is dropped.

So I thought of using another mode, a bit complex but it solves the problem. In this mode the messages are stored in the specified storage location, on the SIM card by default. This mode sends a notification of the newly arrived message, this notification  contains the location of where the message is stored. Reading the message at this location gives the body of the message. 
###New things I learnt from this project:
I discovered and learn't a lot of new things that go into deploying a real time project. I learn't how to use GSM module to send and receive information also how to use AT commands to control GSM module's behaviour.
Also I learnt how proper selection of components is crucial to a project's performance.  

## Additional Thoughts / Feelings / Stories
This project was made in a way which was less costly and simple for the given situation. I know its not something new, but it is something new in the college and it makes the life of the workers there a little easier.

[Final Note]: # (CONGRATULATIONS!!! You are amazing!)