Upload
vankhanh
View
213
Download
0
Embed Size (px)
Citation preview
Final Design Report
EEL4924-Electrical Engineering Design 2
University of Florida
24 April 2012
“Smart Safe”
Team Members: Ryan Griffin & Brie Colon
Project Abstract:
The Smart Safe is a self-monitoring safe capable of remotely alerting its user of
perceived security threats. The safe plugs directly into wall power and its contents can
be opened by entering a password on an LCD touchscreen user interface. The user
must connect the safe to a wireless network by entering the network’s name and
password, which is stored along with other pertinent data on an SD card. The code is
set by the user and can be changed if necessary when the safe door is open. Further
the user will need to enter an email address in order to obtain alerts, which can also be
changed when the safe door is open. If the user inputs a wrong code, a buzzer will
sound and an error LED will light up. After three consecutive incorrect codes are
entered, the safe will take a picture with a built-in camera and email it to the user. When
the code is recognized and accepted, the buzzer will emit a different tone. The safe
door will then be unlocked and a log of previous times when the safe was last opened
will be emailed to the user. An IR sensor will monitor when the door is opened and a
door LED will reflect where the safe door is closed or open. The lock consists of a
solenoid, which can be operated by a microcontroller.
University of Florida EEL 4924—Spring 2012 24-Apr-12 Electrical & Computer Engineering
Page 2/16 Smart Safe
Table of Contents
Project Features………………………………………………………………………………3
Components.………………………………………………………………………………..…4
Technical Objectives………………………………………………………………………....6
Division of Labor………………………………………………………………………..…...15
Projected Timeline………………….………………………………………………….……15
References…………………………………………………………………………………..16
List of Tables and Figures
1. System Block Diagram………………………………………………………………….7
2. Software Process Flow………………………………………………………………….8
3. Schematics / PCBs…………………………………………………………………….10
4. Bill of Materials…………………………………………………………………………14
5. Delegation of Tasks……………………………………………………………………15
6. Gannt Chart…………………………………………………………………………….15
University of Florida EEL 4924—Spring 2012 24-Apr-12 Electrical & Computer Engineering
Page 3/16 Smart Safe
Project Features
The purpose of this project is to create a safe that is both secure and easy to use. It will
require minimal effort on the user’s part to set up. Additionally, the safe will monitor its
state with several sensors. If any of these sensors detects a possible intrusion, the user
will be alerted through various means. Features include:
Robust menu that systematically changes when various criteria are met
Photos from an embedded camera and logs about when the safe was opened
will be emailed to the user
Backup battery power incase of power failure or safe is moved
Power LED (changes color when using battery power instead), error LED, and
door LED give user quick info about the state of the safe
Fail-secure lock will not open when supply is unavailable
Tones from the embedded speaker will aid the user in entering input and alarm
user if pass code is rejected
SD card will keep track of user information and logs
University of Florida EEL 4924—Spring 2012 24-Apr-12 Electrical & Computer Engineering
Page 4/16 Smart Safe
Technology Selection
I. Microcontroller, 2 ATMEGA1284Ps
This AVR was chosen due to its speed, cost and utility. The safe software
depends on interrupts, so a controller with quick response time is needed.
Further, this model has large amounts of SRAM, which is necessary for
managing several memory-intensive parts (i.e. camera, SD card).
II. Touch Screen, Nintendo DS Touchscreen
The touchscreen is a 4 wire resistive touch screen to aid the user in
selecting options and choosing input displayed on the LCD screen. The
touch screen was easy to integrate into the system using the AVR’s ADC
capabilities. The screen size was also a deciding factor.
III. Speaker, 8 Ohm Speaker
The low impedance speaker allows an increase in the output of the
amplifier because of low resistance to current; the speaker can draw more
power from the amplifier. A high quality sound is preferred and that is why
an 8 ohm speaker was chosen instead of a piezo buzzer.
IV. Audio Circuit, 555 timer
A voltage controlled oscillator circuit is used to emit sound to a speaker.
The input voltage comes from the microcontroller and is 5V. The timer
oscillates at a frequency set by a 20k-ohm resistor and a 0.1 micro-farad
capacitor. The voltage applied to the oscillator circuit can change based
on the input voltage. But for the use of the circuit in this system, the input
voltage is set. Also to create more volume a resistor was omitted between
one of the speaker pins and pin 8 of the 555 timer.
V. IR Sensors, IR Emitter and Detector (SEN-00241)
These sensors are used to detect if the door is open or closed. They work
at 940 nm wavelength, which is used for general IR purposes. ADC on the
microcontroller easily interfaces them with the system.
VI. Accelerometer, Triple Axis Accelerometer (MMA7361)
An accelerometer measures they dynamic acceleration of the safe in order
to detect if the safe is being moved. This serves as an anti-theft measure.
It uses 12 bits of accuracy, making it easy to detect subtle changes in
position.
University of Florida EEL 4924—Spring 2012 24-Apr-12 Electrical & Computer Engineering
Page 5/16 Smart Safe
VII. Solenoid Lock, ROB-11015
A solenoid lock is needed to act as a physical deadbolt with electronic
signals. A 6V model was salvaged from another safe. It is powered by
batteries, rather than the AC adapter.
VIII. Status LEDs, Various
Three LEDs were included in the design: error, power, and door. These
Red indicates an error. Orange shows that the door of the safe is opened
(as perceived by the IR sensors). The last LED can be turned to either
green (wall power) or yellow (battery power).
IX. Camera, LinkSprite JPEG Camera
The camera is used in the alarm process to take a picture of the culprit.
The camera is capable of capturing clear color pictures that may help
identify a suspect. The camera uses TTL serial interface (UART). The
camera also includes on-board JPEG compression.
X. SD Card, SanDisk SDSDB-004G-B35
This card was chosen due to its price. It is a high capacity SD card that
can hold 4GB, more than enough for saving logs, pictures, and user
settings. The controller uses SPI to read and write data.
XI. SD Card Adapter Board, SD/MMC Card Adapter
To easily interface the SD card with the PCB board, an SD breakout board
is used. This makes it possible for the user to remove the SD card from
the safe.
XII. Wi-Fi Module, WiFly RN-XV
A Wi-Fi module was incorporated to email logs and pictures to the user in
the event of an emergency. This module includes a wire antenna and only
requires input from a controller. The module uses TTL serial (UART)
communication, making it easy to use.
XIII. Batteries, AA batteries
Four AA batteries supplying 6V are used for backup and to drive the
solenoid and the LCD. For optimal safe working conditions, the batteries
should be changed every 3 weeks.
University of Florida EEL 4924—Spring 2012 24-Apr-12 Electrical & Computer Engineering
Page 6/16 Smart Safe
Technical Objectives
1. The system depends on interrupts from the IR sensors, and the backup batteries via
ADC (see Fig. 1). The controllers are programmed in such a way that they can
resolve interrupt calls quickly or temporarily disable global interrupts to prevent
interrupts in the middle of other subroutines. Interrupts are temporarily halted when
reading or writing to the SD card to prevent data corruption.
2. A particular menu is available to the user based on the state of the safe. When the
safe is powered up, it will detect if any previous settings are saved in memory. If
settings are found, it enters the normal routine (see Fig. 2). If no settings are found,
the user must complete a first time setup of the safe. The user will be able to enter
their password, an email address, and choose a wireless network. After the initial
setup of the safe, the safe will enter the aforementioned process flow. When the
door is closed, the only option open for the user will be to input the code. If correct,
then door of the safe will open. Once open, options to change the code or email
address will be made available.
Safe menus:
o First time setup: Wi-Fi network, password, email, new key code,
confirm key code
o Normal operation: Enter key code
o Door open: Change email, change key code
3. Most components are integrated onto two PCB boards that sit behind the door of the
safe.
4. To avoid interference, the IR sensors are shielded from outside disruptions. At the
same time, the Wi-Fi module maintains a strong connection to the Wi-Fi network. In
order to accomplish these contrary criteria, a wooden safe was used to house all
electronic components.
University of Florida EEL 4924—Spring 2012 24-Apr-12 Electrical & Computer Engineering
Page 7/16 Smart Safe
Block Diagram
Figure 1: System Block Diagram
University of Florida EEL 4924—Spring 2012 24-Apr-12 Electrical & Computer Engineering
Page 8/16 Smart Safe
Software Flowchart
Figure 2: Software Process Flow (Pt. I)
University of Florida EEL 4924—Spring 2012 24-Apr-12 Electrical & Computer Engineering
Page 9/16 Smart Safe
Figure 3: Software Process Flowchart (Pt. II)
University of Florida EEL 4924—Spring 2012 24-Apr-12 Electrical & Computer Engineering
Page 10/16 Smart Safe
Schematics / PCBs
Figure 4: Board 1 Schematic
University of Florida EEL 4924—Spring 2012 24-Apr-12 Electrical & Computer Engineering
Page 11/16 Smart Safe
Figure 5: Board 1 PCB
University of Florida EEL 4924—Spring 2012 24-Apr-12 Electrical & Computer Engineering
Page 12/16 Smart Safe
Figure 6: Board 2 Schematic
University of Florida EEL 4924—Spring 2012 24-Apr-12 Electrical & Computer Engineering
Page 13/16 Smart Safe
Figure 7: Board 2 PCB
University of Florida EEL 4924—Spring 2012 24-Apr-12 Electrical & Computer Engineering
Page 14/16 Smart Safe
Bill of Materials
Table 1: Bill of Materials
University of Florida EEL 4924—Spring 2012 24-Apr-12 Electrical & Computer Engineering
Page 15/16 Smart Safe
Delegation of Tasks
Table 1 shows how tasks were divided on this project.
Ryan Griffin Brie Colon
Preliminary Research 50% 50%
Camera, Memory, Wi-Fi
design
100% 0%
Solenoid, IR sensor, LEDs,
Speaker, Accelerometer
design
0% 100%
LCD, touch screen, power
management design
50% 50%
Board design 50% 50%
Test and Debug 50% 50%
Physical Assembly 50% 50%
Table 2: Division of Labor by approximate percentage
Gantt Chart
Figure 8 displays a timeline for the project.
Figure 8: Project Timeline
University of Florida EEL 4924—Spring 2012 24-Apr-12 Electrical & Computer Engineering
Page 16/16 Smart Safe
References
[1] R. Desai, R. Ramesh. “Designing an Electronic Safe.“ <http://www.eetimes.com/design/embedded/4205822/Designing-an-electronic-safe>.
[2] DharmaniTech. “SD/SDHC Card Interfacing with ATmega8 /32 (FAT32 implementation).“ <http://www.dharmanitech.com/2009/01/sd-card-interfacing-with-atmega8-fat32.html>. [3] K. Maxwell. “Writing drivers for common touch-screen interface hardware.” <http://eetimes.com/design/embedded/4006455/Writing-drivers-for-common-touch-screen- interface-hardware>. [4] “How to use MMC/SDC.” <http://elm-chan.org/docs/mmc/mmc_e.html>. [5] “Interfacing Touch Screen with microcontroller.” <http://mehtadhaval.blogspot.com/2011/04/touch-screen-interfacing-with.html>.