Thursday, April 28, 2016

Parts of Project Report

Smart Blinds- A Home Automation Project - Specifications-II

In my previous post, https://myiotblog.blogspot.com/2016/04/fundemental-parts-of-project.html
I have discussed the first four specifications of my 'Smart Blinds' IoT project.
In this post, I would like to discuss the remaining specifications of my IoT project.

5.Service Specification:

The fifth step in the IoT design methodology is to define the service specifications. Service Specifications define the services in the IoT system, service type, it's input/output, endpoint,schedules, preconditions and finally service effects.

There are two services in my project:
1.The Blynk service, which is used for change of modes of the blinds between open and close
2. A weather API service, for getting information about the temperature, luminosity etc., based on which the automation of the blinds controlled.

Blynk Service:

 In this service, the Blynk Application installed on the mobile phone from which the user is able to control the blinds operation. It is used to interact and communicate with the Arduino to perform control actions so that user can remotely operate the blinds. It provides an interface as a mobile application where the user can give the inputs and can provide commands for the actions to be done. This one is secure as it provides a secure Auth Key for each and every project we created and with this access key only we can communicate securely.

1. We can track the position of the blinds using the display widget- 'Labeled Value'
2. Also, can continuously view the room temperature and the heat sink values which are displayed on the 'LCD display'.
3. Used the 'Menu' Widget to select the actions to either open or close of the blinds.
4. Provided the user with the option to preset the control of blinds at a particular time using the 'Timer' widget.

The below diagram is the pictographic representation of the Blynk Service:



Weather API service:

 In this service, from the openweather API we can get information about the wind, humidity, and the temperature at our place using the python programming from Raspberry pi.
Based on which the operation of the blinds is automated. If the temperature is beyond the threshold then the blinds will be closed or else opened.

The below diagram is the pictographic representation of the Weather API Service:




Functional View Specification:

Goals:
1. To remotely access the control of blinds when we are away from home.
2. To automate the position of blinds based on the external climatic factors
3. To automate the position of blinds based on the internal room conditions.

Targeted Area:
Home and work area where it's needed to control the process remotely and automate the process to avoid any sort of risk to the kids, pets, and plants.

Modules:

The overall project is divided into three modules:
1. Remote control of the blinds by the user on his wish.
2. Automatic control of the blinds based on the information of the external climate from the openweather API.
3. Automatic control of the blinds based on the room temperature extracted from DHT11 sensor.






Device: The devices that are used for this project include the raspberry pi2, NodeMCU with ESP8266, Rotational servo motor, a Photo Resistor, DHT11 sensor.

Communication: The communications used in this project include the serial communication, restful web services, MQTT communication to transfer information about the blinds position to Raspberry pi where this streams data to the InitialState cloud server through the HTTP communication which is secured with the Authentication keys. Also used the HTTP protocol for extracting information from the open weather API.

Services: The different services in this project are the monitor, control services which are explained in the above  Service Specification section.

Management: The different managemental things include the installations, configuration of all the different software's that are needed which includes the BLYNK app, the blynk libraries that are needed for the communication to and from NodeMCU. The different python packages to communicate with the weather API and InitialState Cloud server.

Security: The security for the project is minimal as it operates under the secured home network, but still should have the basic user authentication for the BLYNK application, access to the OpenWeather API, and the InitialState Cloud server. All these require the authentication key in order to have access to them in my project which results in a secured environment.

Application: In my project, the application deployed locally on the NodeMCU, python programs on Raspberry Pi2 device and can be accessible remotely from BLYNK app and also can set timers to control the blinds.


Operational View Specification:

From this specification, we can have a clear view of project how it is realized based on various factors like the service hosting, storage, devices etc.,

Services:


  1. Blynk Service: Service used to control the blinds position from Blynk, a Mobile application
  2. Weather API service: Service which is used to extract the data (temperature, humidity, wind speed) from Open Weather API based on which the blinds position is automated.


Storage: All the data is stored in the InitialState cloud and there only dashboards are created to analyze the different factors which are extracted from weather API and data valuesfrom the sensors.

Devices: 

  1.  Raspberry pi2
  2.  NodeMCU with ESP8266
  3.  Rotational servo motor
  4.  Photo Resistor
  5.  DHT11 sensor


Application:


  1. Mobile Application - Blynk app
  2. Web API - OpenWeather API
  3. Web Dashboard - InitialState
  4. MQTT Server - Mosquiito Interface 


Communications Protocols:


  1. Link Layer:  Wireless LAN(802.11)
  2. Network Layer: IPv4 
  3. Transport: TCP
  4. Application: HTTP, HTTPS,MQTT


Security: 

Authentication and Access keys for:

  1. BLYNK app
  2. InitialState Dashboards
  3. OpenWeather API.

Management:


  1. Mobile Application Management : Blynk App
  2. Web Application Management : Initial State Dashboard
  3. Device Management: Raspberry Pi2, NodeMCU with ESP8266, Servo motor
  4. Server Management: MQTT server, Mosquitto for MQTT UI.
  5. DataBase Management: Initial State Cloud
Device and Component Integration:

Blynk Integration:
Blynk Basic operation

Rotational Servo Motor:

Rotational Servo Motor

DHT11 Sensor
DHT11 sensor connection with the raspberrypi2 


Blynk Service Integration:



In this service operation, the user controls the operation of blinds using the Blynk App. Based on the commands from the Blynk application the NodeMCU controls the direction,speed and rotation of the servo motor which will either open or close the blinds. Once done, then this change in the blinds position is recorded and published to the topic 'BlindsPosition' through MQTT protocol to the MQTT server where the Pi acts as the MQTT broker. Simultaneously, a python program is running on Pi which subscribes to the 'BlindsPosition' topic and continuously checks for messages. If any message published to the topic it subscribes and streamed the data to the 'InitialState' Cloud Storage.
There in dashboards are created to constantly monitor the blinds position.

Blinds Dashboard
Blinds Positon Data




Weather API Service Integration: 



In this service operation, the controls of the operation of blinds made automatic which was based on the external climatic conditions. It's based on two factors. one the time of the day and other the temperature. The use case diagram for this as below.

First checks whether its day or night and then checks if the temperature is greater than the threshold.
Based on these conditions the operation of blinds made automatic. The external data is extracted from the open weather API which is secured as it required the authentication key. A python program is coded which is running on Raspberry Pi extracts data from weather API for every 1 minute. It streamed the data to the 'InitialState' Cloud Storage. Also, continuously checks the conditions and if the temperature exceeds the threshold then published to the topic the command 'close' to the topic through MQTT protocol to the MQTT server where the Pi acts as the MQTT broker. Simultaneously, a program is running on NodeMCU which subscribes to the topic and continuously checks for messages. Based on the message it sends the control signals to the motor and then publishes to topic 'BlindsPosition' through MQTT protocol the position of blinds.
There are dashboards also created to constantly monitor the external conditions.
External Climatic Conditions Dashboard

External Conditions Data 


This Concludes the Specifications of my project. In my next post I would report a complete report of my project which also includes my further enhancements and anticipation of this project extension to the 'Green House'.

Code:
My entire project code is present at this link:
https://github.com/jyothi-lanka/IoT/tree/master/SmartBlindsProject


References:

TextBook: 

  •  Internet of Things: A Hands-On Approach By Arshdeep Bahga, Vijay Madisetti
  • Enabling Things to Talk- Designing IoT solutions with the IoT Architectural Reference Model Editors: Alessandro Bassi, Martin Bauer, Martin Fiedler, Thorsten Kramp, Rob van Kranenburg, Sebastian Lange, Stefan Meissner
Links:

Fundemental parts of project

Smart Blinds - A Home Automation Project


Here comes the final phase of my course. The final project which comes with the inspiration of the concept of 'Green House' which helps the plants to have a safe environment. Likewise, I would like to build my own Home Automation Project for the safety of the kids and pets at home when we are away from home. For this, I chose to automate the blind operations based on various factors like the time of the day, temperature and intensity of the light.


1.Purpose and Requirements Specification

Purpose: A home automation project for automatic controlling the operation of blinds based on the intensity of light, temperature, and time of the day. This can be based on the information from the weather API. Also, provides an option for the user to control the operation of blinds from his phone and can set the timer for the same.

Behaviour: The information about the light intensity, temperature, and time of day is collected from the weather API based on which the operation of the blinds is controlled. Later, the data about the blinds position is tracked, stored in local and cloud database and can be used for further analysis.

System Management Requirement: The system should provide remote control functionality to operate the blinds between open and close modes or should provide timer functionality to automate the process.

Data Analysis Requirement: The system should report data to the cloud database where the data will be analysed.

Application Deployment Requirement: The application should be deployed locally on the device, but can be accessible remotely or set timers to control the blinds.

Security Requirement: The security requirements for the project are minimal as it operates under the secured home network, but still should have some basic user authentication.


2.Process Specification:

The automation system can be performed in three different ways.

1. Using mobile application for remote control of blinds and can even specify the time frame to automate the control.




2. Using the temperature sensor reading at home and make the process automate by closing the blinds if the temperature is beyond the specified temperature threshold.







3. Based on the information about light intensity, temperature, and time of the day from the weather API can automate the blind control.






3. Domain Model Specification:

Physical Entity: The physical entity of my project is the blinds, which is my focus object that is controlled based on various factors like the time of the day, temperature, light intensity.

Virtual Entity:  The virtual entity of my project includes the various parameters I'm tracking for the control of the blinds. They are the time of the day, temperature, light intensity.

Device: The devices being used in my project are Raspberry pi 2, Arduino esp2866, servo motor, DHT11 sensor.

Resource: Raspberry pi 2, NODE-RED, mosquitto MQTT server on the device, Arduino IDE on the laptop.

Service: The service in my application includes the blynk cloud service, which is used for change of modes of the blinds between open and close and a weather API for getting information about the temperature, luminosity etc., based on which the automation of the blinds controlled.



IoT Level Specification:


My project was based on the Iot Level-2 with the following details.

Single device/node
Sensing or actuation
Remote/cloud datastore
Local analysis
Control via Rest
Central/cloud rest services for
Monitoring
Control

IoT Level -2