Wednesday, May 1, 2013

Embedded System Part Design

  The embedded part of HomeGuard project consists of server, camera module, temperature module and dimmer module. 
  The server is responsible for receiving data such as current temperature from temperature module and sending the data to the android phone as well as receiving control message from android phone and sending the message to control relative modules such as controlling the speed of motor.


Android Part Design



Our application is called home security. I am going to introduce each screen of the application.
1.     HOME SCREEN
  In order to enter the application, the user should click on the welcome button.
  
Figure 1.1
2.     MAIN MENU SCREEN
  The main menu screen of our application consists of three modules corresponding to each embedded system module. User could click on the image button of temperature, dimmer, camera to enter each module. Once the camera has detected a motion, a notification would be sent to user as displayed in Figure 2.2. The user could click on the notification to view the latest detected picture. If the user would like to stop receiving the notification, the user could click the checkbox “Take a Rest”.

 
Figure 2.1

 
Figure 2.2
3.     TEMPERATURE MODULE SCREEN
  After entering the temperature module, the user could view the current temperature and the current hotness. The seekbar could be used to control the speed of motor so as to control the temperature in the manual mode. If the user wants to control the speed of the motor automatically according to the current temperature, the user could choose auto mode that would speed up the motor once the threshold of temperature is reached. To view the graph and statistics of history data, the user should click on the view graph and statistics image button. Then the user could see the highest temperature, lowest temperature and average temperature in history as well as the graph for history temperatures as show in Figure 3.2.
Figure 3.1
 
Figure 3.2
4.     DIMMER MODULE SCREEN
  After entering the dimmer module, user could control the lightness of bulb through controlling the seekbar. Under the seekbar, there is a image to indicate the current lightness of bulb.








 
Figure 4.1

 
Figure 4.2

 
Figure 4.3
5.     CAMERA MODULE SCREEN
  After entering the camera module, the user could view the latest detected picture as well as when it is detected. If the user wants to take a picture immediately, the user could click on the camera image button.

Figure 5.1

Thursday, April 4, 2013

How to coordinate message sending between xbees

During our project there were many times that one xbee just received part of the data that another xbee issued, leading the incomplete information communication. One effective way (at least works in our project) is to use delay to give the receiver/sender enough time to finish what they're trying to receive/send out. For example: In Picture sending, since there is a persistent data flow, which is long goes into the server, there is a large possibility that server will lose parts of them. So after each byte is sent, we will let the xbee to rest for 50 milliseconds and also the same amount of time for the server to get rest. In this way, we can coordinate the send and receive buffer of both ends and try to minimize the loss of data flow.

code in the sender (in arduino):








Wednesday, April 3, 2013

System Architecture and Project Functionality


On the embedded part, this project includes mainly three parts, and they are:
  • Temperature Module
    • monitor and adjust the home temperature
  • Dimmer Module
    • monitor and adjust the density of the lights
  • Camera Module
    • take pictures when motion is detected

The system architecture can be illustrated using this graph:


To gain a more detailed understanding, here are 10 main functionalities we aim to implement:
  • User can see the recent temperature information
  • User can see the most recent image which is detected
  • The user should be able to put the system into a "stand-by" mode
  • User can set a threshold of temperature to control the motor automatically
  • User can get notification message on the phone 
  • User can control the speed of motor to control temperature
  • User can control the intensity of lights
  • User can control the camera when to take a picture
  • User can view graphs of history
  • System can trigger the light when motion is detected

Sunday, March 31, 2013

Message Type

Since each board needs to deal with all kinds of messages, we need to distinguish them. Here is the definition of different message types we need by now:


Message Type:

  • Temperature
    • M0 = temperature readings from temperature module to server
    • M1 = temperature mode (auto or manual) from server to temperature module
      • 0: manual
      • 1: auto
    • M2 = manual control message from server to temperature module for motor
  • Security (camera & voice)
    • M3 = picture message from security module to server
    • M4 = voice message from security module to server
    • M5 = manual control message from server to security module to take a picture
    • M7 = manual control message for the control of LED
  • Dimmer
    • M6 = manual control message from server to dimmer module to control the brightness of the dimmer
  • Stand-by mode
    • M8 = use stand-by mode or not

Friday, March 29, 2013

Project Overview

Project Overview
Our group is focusing on building a Home Automation System, including the monitor for the temperature, dimmer and control for the motor. By the nature of the system, our project is made up of two major components, in the front end we are using Android to manage the system, mainly communicating with one Ethernet shield. While in the back end there are different components including temperature module, dimmer module and camera module. With both of the front end and back end components integrated together, our system has the basic functionality for the requirement of home security.