Wednesday, May 4, 2016

Complete Final Project Report- Smart Blinds

Smart Blinds - A Home Automation Project

Here comes the final documentation of my IoT Project, 'Smart Blinds' - a home automation project.

Introduction:

Internet of Things has been labeled as “the next Industrial Revolution” because of the way it changes the way people live, work, and businesses interact with the world. With the advancement in Technology, we can build our own secure and safe environment. This project ‘Smart Blinds’ that comes with the inspiration of the concept of ‘Green House’ which helps the plants to have a safe environment.


Abstract:
                 The project is about 'Smart Blinds'. The key point here is the opening and closing of the blinds made automatic and which depends on the intensity of the outside light. Also, can analyse the duration of opening and closing of blinds.In this project, I have built my own Home Automation Project for the safety of kids and pets at home when we are away from home. For this, I chose to automate the blinds operation based on the time of the day, temperature and intensity of light.

1.Project Report:

For my project 'Smart Blinds' which is like any other IoT project, I would like to provide a complete detail of the project with explaining all the specifications starting from the high-level overview which gives a picture of what's the project is all about and then down to low-level overview which gives all the minute details of the project so that anyone who will come across the post can do the project all on their own from the data and references I'm going to share about this project.

HighLevel Project Flow Representation


The above diagram shows a High-level idea of the project which is generic to all the 3 modules I have done in this project. Here, the user can manually control the blinds based on the temperature displayed on the Blynk application and then sends the message to the control Signal Processor, in my application Arduino acts as controller which sends signals to the servo motor to rotate the blinds either to open or close them based on the instructions it received and then the position of the blinds is again passed back to the control circuitry for future reference. This is a complete high-level design of the basic functionality in my project.

Project Requirements:

Hardware:

  1. Arduino esp8266
  2. Raspberry Pi 2
  3. BreadBoard
  4. Jumper wired
  5. Photo Resistor
  6. DHT11 sensor
  7. Servo motor
Software:
  1. Blynk app( auth token)
  2. Arduino IDE 
  3. Mosquitto installed in Pi
  4. Mosquitto configuration 
  5. NOde-Red
  6. External URL to connect to Wearther API
  7. Python working on platform 
Arduino Libraries:
  • SPI.h
  • BlynkSimpleEsp8266.h
  • Servo.h
  • ESP8266WiFi.h
  • PubSubClient.h
  • DHT.h
Python Libraries:
All code of my project will be available at this link:

IoT design methodology:

The complete design methodology is defined in a total of eight Specifications.
  1. Purpose and Requirements Specification
  2. Process Specification
  3. Domain Model Specification
  4. IoT Level Specification
Please follow the below link for these specifications of the project:
http://myiotblog.blogspot.com/2016/04/fundemental-parts-of-project.html

       5. Service Specification
       6. Functional View Specification
       7. Operational View Specification
       8. Device and Component Integration

Please follow the below link for these specifications of the project:
http://myiotblog.blogspot.com/2016/04/project-report.html

NOTE : Updated the links with more data than the one previously submitted as part of Assignments.

Architecture:

Blynk Service Integration:
Blynk Service

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.



 Weather API Service Integration:
Weather API Service 

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 Climate Parameters Storage Data

2. Project Poster:


Smart Blinds - Final Poster

Results:

Output Results in the InitialState Streaming DashBoard for all the information

This dashboard above will show the line graph details of each of the measurements stored in the cloud. Also, it adds new tiles with the information of the last value of the blind(like 'Open' or 'Close') , Histogram results of blinds position and lastly the pie chart results of the blinds position.
Line Graphs for all the measurements saved in the cloud


Blinds Position data Saved in the cloud and can be extracted as CSV file format

External and Internal Temperature, Humidity readings stored in cloud



The above diagram depicts the UI in the BLYNK app from which the user is able to control the blinds operation. It has new features like a big closet. A User can even set the timer based on which the particular operation is performed. The user will have an option to view the current position, temperature and heatsink of device.

3. Demonstration:







4.Link to Software:

Blynk Software: 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.


  1. Blynk Docs : http://docs.blynk.cc/
  2. Blynk Start Guide : http://docs.blynk.cc/#getting-started-getting-started-with-the-blynk-app
  3. Blynk Hardware Setup: http://docs.blynk.cc/#hardware-set-ups
  4. Labeled Value Display: http://docs.blynk.cc/#widgets-displays-labeled-value
  5. LCD Display Widget: http://docs.blynk.cc/#widgets-displays-lcd
  6. Menu Widget: http://docs.blynk.cc/#widgets-other-menu
  7. Timer Widget: http://docs.blynk.cc/#widgets-controllers-timer
Initial State:
http://blog.initialstate.com/category/arduino-2/


Raspberry Pi2:

NodeRed:


Arduino:

ServoMotor:

DHT11 Sensor:

Weather API:

5. Project Sites used in creating the project:
http://www.instructables.com/id/Arduino-controlled-automated-blinds-with-Web-UI/
https://www.hackster.io/cyborg-gibson-11/automated-blinds-by-cortana-7bfaff

6. Future Work and Project Enhancements:
  1. I would like to extend this further by providing SMS or EMAIL notification to the user which would be more helpful for continuous update and notification.
  2. I would like to further extend this work to the predict persons wish of blinds position based on the various factors (temperature, time of day).  
  3. Need to apply linear regression, decision tree using R programming for the predictions.
  4. Also, I would like to the monitor and analyze the health of the crops based on the different climate conditions like the wind, humidity, temperature and varied parameters which affect the plants growth.
  5. I would like to further extend it by handling all the blinds in the home by Integration.
  6. Monitoring the health of plants based on different climate conditions.

3 comments:

  1. Remember to create shade for your exterior window or enclose a covered deck or patio. Power screens and automated outdoor shades, perfect solution for your home if you want to enjoy exterior shades but also provides privacy, protection from harmful UV rays. It is energy saving too and reduce glare inside your home.

    Smart blinds

    ReplyDelete
  2. Hi, Thanks for this blog post. Homeowners need to evaluate how well their home is utilizing energy to light and heat itself. A home that is comfortable even without active heating or cooling systems might seem impossible. But there are simple ways on how you can take to ensure the temperature remains comfortable, use motorized window blinds or sensors for smart blinds.

    ReplyDelete