My Contribution was developing and designing the backend server, web app, and embedded system programming using arduino to connect with server.
Project Decription
Weather conditions and climate changes must be logged and analyzed by relevant authorities like meteorological department each day. They take relevant actions observing those records obtained allover the island. But in the current manual system they collect information only from main cities and taking responses manually takes much time and effort.
So in this unified project we develop a system that can be used to collect information from much many places allover Sri Lanka using an embedded system kept in those locations. The locations may be places in each district close to sea, rivers, reservoirs, tanks and other areas. The data are wind speed, wind direction, rainfall, humidity, temperature etc.
All those data taken from those sensors, are sent to a central server and processed there. If there are extreme weather cases that public must be warned, sirens will be activated near reservoir dams,around flooding areas near rivers automatically. The process is very quicker than manual method. So the damages due to extreme weather is reduced as well as meteorological department will have newest data from allover the country.
Introduction
Project Phase 1 – Project Design
The combined embedded system will have 5 main sub parts.
- Wind Speed Sensing System
- This is a wind Vane that rotates with wind. We are making a mechanism using IR sensor to get the time taken to complete a full cycle by vane. The wind speed is calculated using that data.
- The model wind vane expected to be build is given below.
- Infrared barrier module is the IR sensor we are planning to use. It emits infra red waves and monitor the reflected rays. It can identify black and white screens.
- Rainfall measuring System
- This has a cylindrical vessel with fixed cross section that collects rain water and measure the water level using an ultrasound sensor kept few cm below top of the vessel. Sensor not having at top most is to avoid water drops to go away hitting the sensor.
- Also this has a automatic valve to remove water daily after reporting to server, based on the sonar sensor reading.
- Also this has a rain sensor to identify whether it is raining or not.
- Below is the model of the system.
- This is the ultrasonic sensor we are planning to use (HC-SR04)
- This is the automatic valve we are using. It is a plastic solenoid valve
- Temperature and Humidity measuring System
- This is a single sensor that sense temperature and humidity.
- For that we use Humidity and Temperature DHT11 Module in below picture.
- Microcontroller
- We use Atmega328p microcontroller for each node connecting all the above mentioned sub parts.
- We will use ARDUINO UNO board which has Atmega328p microcontroller.
- Network Module
- As we need the embedded unit at places normally we can’t expect WIFI access, we decided to use a GSM module to send data collected to the central server.
- So the GSM module we are using is sim808 module.
WEB APPLICATION
We are sending the data collected in each time to the central database. we have implemented the database in 000webhost.com. So we are implementing a web application for users to view the data log using a user interface.
We are sending data using protocol HTTP. HTTP GET request is used to send data. The microcontroler will send requests to the SIM808 as AT commands using serial port. Software Serial is used for that as digital pins are used for serial data sending.
Front end will run HTML5 and back end will run PHP maintaining the connection with the database. MYSQL is used for database managing.
User interface will allow users to view parameters rainfall, wind direction, wind speed, temperature, humidity based on map(current situation/latest) also based on time(history).
So the total image of the final system will be like this
NETWORK SECURITY
As the very important data are sent to the central server from systems in rural places, the security of data is a fact to consider much. As stated by the examiners of Project Milestone 1 in comments, data encryption is not required in this case because we not need to hide data from anyone. Only thing we need is to protect data from being changed externally. So we are going to use MAC -Message authentication code for the requirement.
“A message authentication code (often called MAC) is a block of a few bytes that is used to authenticate a message. The receiver can check this block and be sure that the message hasn’t been modified by the third party.” – http://www.crypto-it.net/eng/theory/mac.html
Timeline Of the Project
Project Phase 2 – Implementation Initiation
Designs
Circuit Diagram
Embedded Software Design – To be coded using Arduino
Web Back End Design – PHP, AJAX, JAVASCRIPT
Database Design – ER Diagram
Front End Design
Security Design
The server must be able to detect if any modification attacks have taken place on the data.
MAC – Message Authentication Code is used.
MAC Algorithm we used is as follows
MAC = [ (h + s – t)*w + r ] mod ( k )- Temperature = t
- Humidity = h
- Rain Status = s
- Wind Speed = w
- ainfall = r
- Key = k
MAC is sent with weather data and in server it is rechecked and if it is correct only data is accepted.
Project Phase 3 – Implementation and Testing
Video Demonstration of the Project
Web Application
Web Application is a live application that automatically update graphs on weather and give automatic notifications on extreme cases.