Evolution of the System - ECEdreamTeam/GroupProject GitHub Wiki
Brainstorming and Initial Ideas
When presented with the group project idea, we were very intrigued by what type of project we could do. We were all interested in the idea of a security system, although we were not entirely sure how we wanted to execute this idea yet. After some brainstorming we created a list of items that all security systems should have. These included the following list.
- Radar (ultrasonic)
- Motion detector
- Infrared sensor
- Potentially a remote?
- Piezo Speaker (alarm, Star Wars song)
- LEDs (blind them, flashing lights)
- Display screen?
- Hex Keypad?
- Intercom?
- Sending alert text/emails/tweet
- Signal jammer
- Wireless communication between components
- Enable/disable text?
- Automatic projectile launcher
Initial Design
After eliminating the ideas that were not feasible due to time and resource constraints, the team described the ideal security system and determined the components that were crucial to this system. The components are listed below.
- Motion Detector
- Infrared Motion Detector
- Alarm
- A way to control the system
Individual Components
The next step in the process was to get the individual components working.
UltraSonic
There are two ultrasonic sensors in our project. We originally planned for two stationary ultrasonic sensors; however, we now have one stationary and one moving. Both ultrasonic sensors will constantly be reading in data and only sending it through the RF communications when there is an abnormal object detected. For example, the data being determined is either a "1" or a "0" based on detected abnormal movements. The ultrasonic sensors are connected to their own individual micro-controller because the need to be placed at strategic locations in the room. The ultrasonic sensor that will be moving in a sweeping motion will give our security system more credibility to detect a burglary because it can scan the majority of any room. The reason behind the sweeping ultrasonic sensor is because the chips only have a 15 degree range and the sweeping motion can now cover the majority of the room.
Stationary Ultrasonic
Ultrasonic with Servo Motor
PIR
The PIR sensor in the JAAZ security system is another tool to determine if an intruder is in the home. The PIR sensor faces the door and detects if there is motion by detecting changes in heat. If motion is detected, an LED will light up indicating motion is detected. Additionally, the Arduino will output a high (in this case a 5) through RF communication to the main unit alerting that motion was detected. If motion is not detected, the system outputs a low (in this case a 4) to the unit alerting that no motion has been detected.
A Way to Control the System
The most efficient way to control the system is through a keypad. The keypad is a 4x4 set of numbers, letters, and symbols. The keypad used in the security system has 8 signal pins the connect to the micro controller. 4 pins are for the columns of the keypad and the other 4 pins are for the rows. Do to the lack of digital pins on the Arduino Uno, we eliminated a row and column to our keypad (opening up 2 more digital pins).
The keypad acts as the main unit to our home security system because it controls the data received. When the system is "unlocked", the RF communications are turned off. When the security system is alarmed, the data can be received. The way to make this work is having a password hard coded in advance.
Alarm
The alarm is based on the keypad, 2 ultrasonic sensors, and a PR sensor. The 2 ultrasonic sensors and PR sensor are put in different locations all around the room and use RF transmitters and receivers to communicate with one another. The sensors are constantly sending data to the main micro controller that holds the keypad and piezo speaker. The rule behind our security system is prioritizing the sensors. The ultrasonic sensors will act as a caution warning to the main unit (Arduino Uno). Once the caution warning is set, the PR sensor must detect abnormal activity for the alarm to turn on. The alarm will remain on while there are at least two sensors detecting motion. The buzzer will turn off and send a tweet once there is no more motion detected on more than one sensor.
LCD Display
Liquid Crystal Display The LCD screen is programmed to display one of two messages: "Door open" or "Door closed". The message that gets outputted is dependent upon data received from the ultrasonic sensor. The ultrasonic sensor is aimed at the door and has a certain threshold assigned to it to determine when the door is closed and when it is opened, in this case the threshold is 56 inches. Meaning that the distance to the door (when it is shut) from the sensor is 56 inches. So when the door is opened that distance will decrease alerting the arduino to output a high signal to the LCD screen to display the "Door open" message. Otherwise it will output a low signal to the arduino causing the "Door closed" message to be displayed on screen. Ideally we would attach an LCD to all of the sensor nodes that way the owner of the system would be able to see the state that all the nodes are in.
System Interactions
After each individual component was working, the next step was to figure out a way for each component to act like a system.
RF Communication
The system uses nRF24L01+ (RF24) radio frequency communication transceivers to relay data from individual components (PIR and Ultrasonic sensors) to a master unit. Each sensor requires an RF24 module, as does the master component. The each of the sensors communicate over unique pipes, sending a unique data pair to the master module. The master listens to all pipes and decides the threat of motion based on the values received.
Each slave component uses a pair of int values to notify the master of their current state. The stationary ultrasonic sensor uses a 0 to designate no threat and a 1 to designate a threat. The sweeping ultrasonic uses 2 and 3 for no threat and threat. The PIR sensor uses 4 and 5 for no threat and threat. The slave module is constantly listening on all three pipes. When a data value is received, the master identifies it and sets one of two flags high or low based on a bit of logic. If one of the ultrasonic sensors sends a positive reading, then a "caution" flag is raised. If the PIR sensor sends a positive reading, and the "caution" flag is high, then a "threat" flag is raised. If any of the sensors sends a negative, then the flags are lowered. The piezo buzzer sounds when the "threat" flag is high.

Constraints:
The biggest constraint that we had to work with was the number of digital I/O pins available on the arduino. This greatly limited the number of sensors that we were able to include in our system. Another challenge we faced was wanting to use an ethernet shield so that we could send out a tweet when the alarm system went off. However, this interfered with the RF communication between the arduinos so we were not able to implement it. Our last limitation was our financial resources. Seeing as we had to rely on our own budget we were not able to make the system as aesthetically appealing as we would have liked.