1. CHAPTER-1
INTRODUCTION
In this project there will be usage of the biometric material ―FINGER PRINT
MODULE‖ , ―GSM MODULE‖ and ―KEYPAD‖ and there will be XMEGA 256A3BU
microcontroller with the AVR dragon for this dragon is used for the dumping of the code and
here we are using ATMEL STUDIO 6.2 software and for the finger print module software
used is ―DOCKLIGHT‖.
1.1 AIM:
Our main aim our project is to give very high security to the important
materials because conventional locks are broken by the seasoned thieves and
they were stealing important materials.
1.2 MOTIVATION:
Since, so many robberies happening in and around world and so many important
things or materials are stolen and in a room if there is computer files are corrupted trough the
entering of that particular door. hence, we get motivated to design this particular project ,so
that unauthorized person can enter into that room without the permission of the authorized
person.
1.3 OBJECTIVE:
The main objective of our project is to design an intelligent and programmable system
by using FINGER PRINT MODULE and KEYPAD MODULE and also GSM MODE for
high security area, by using XMEGA 256A3BU microcontroller. Only authorized person can
enter into the room. In this project we are having three modules, Fingerprint module and GSM
mode with two level security. The main objective of this project is that it provides very high
security. The main documents will not be corrupted and also there will be protection to our
important things which are placed in the room.
1
2. Hence, we can allow only the authorized person to enter into the room and there will
be three modes in our project they are :
1.) Finger print mode.
2.) Keypad mode.
3.) GSM activated keypad mode.
And hence with these three modes person(i.e.Authorized person) can enter into the
room and if the person cannot enter into the room then the control goes to ―selection of the
mode‖ which will be displaying on screen.
This is the main objective of our project and it is mainly used for the very high
security purpose in which important things will not lost.
2
3. CHAPTER-2
INTRODUCTION TO THE EMBEDDED SYSTEMS
2.1 Embedded system:
An embedded system is a special-purpose system in which the computer is completely
encapsulated by or dedicated to the device or system it controls. Unlike a general-purpose
computer, such as a personal computer, an embedded system performs one or a few
predefined tasks, usually with very specific requirements. Since the system is dedicated to
specific tasks, design engineers can optimize it, reducing the size and cost of the product.
Embedded systems are often mass-produced, benefiting from economies of scale. Personal
digital assistants (PDAs) or handheld computers are generally considered embedded devices
because of the nature of their hardware design, even though they are more expandable in
software terms. This line of definition continues to blur as devices expand. With the
introduction of the OQO Model 2 with the Windows XP operating system and ports such as a
USB port — both features usually belong to "general purpose computers", — the line of
nomenclature blurs even more Physically, embedded systems ranges from portable devices
such as digital watches and MP3 players, to large stationary installations like traffic lights,
factory controllers, or the systems controlling nuclear power plants. In terms of complexity
embedded systems can range from very simple with a single microcontroller chip, to very
complex with multiple units, peripherals and networks mounted inside a large chassis or
enclosure.
Fig 2.1. Embedded kit
3
4. 2.2 Applications of Embedded System:
Embedded Systems has witnessed tremendous growth in the last one decade. Almost
all the fast developing sectors like automobile, aeronautics, space, rail, mobile
communications, and electronic payment solutions have witnessed increased use of Embedded
technologies. Greater value to mobility is one of the prominent reasons for the rise and
development of embedded technologies.
Initially, Embedded Systems were used for large, safety-critical and business-critical
applications that included
Rocket & satellite control
Energy production control
Telephone switches
Air Traffic Control Embedded Systems research and development is now concerned
with a very large proportion of the advanced products designed in the world. In one way,
Embedded technologies run global transport industry that includes avionics, space,
automotive, and trains. But, it is the electrical and electronic appliances like cameras, toys,
televisions, home appliances, audio systems, and cellular phones that really are the visual
interface of Embedded Systems for the common consumer.
Advanced Embedded Technologies are deployed in developing
Process Controls (energy production and distribution, factory automation and
optimization) Telecommunications (satellites, mobile phones and telecom networks),
Energy management (production, distribution, and optimized use)
Security (e-commerce, smart cards)
Health (hospital equipment and mobile monitoring) In the last few years the emphasis
of Embedded technologies was on achieving feasibility, but now the trend is towards
achieving optimality. Optimality or optimal design of embedded systems means
Targeting a given market segment at the lowest cost and delivery time possible
Seamless integration with the physical and electronic environment.
Understanding the real-world constraints such as hard deadlines, reliability,
availability, robustness, power consumption, and cost.
4
5. 2.3 Automobile sector
Automobile sector has been in the forefront of acquiring and utilizing
Embedded technology to produce highly efficient electric motors. These electric motors
include brushless DC motors, induction motors and DC motors, that use electric/electronic
motor controllers. European automotive industry enjoys a prominent place in utilizing
Embedded technology to achieve better engine control. They have been utilizing the recent
Embedded innovations such as brake-by-wire and drive-by-wire. Embedded technology finds
immediate importance in electric vehicles, and hybrid vehicles. Here Embedded applications
bring about greater efficiency and ensure reduced pollution. Embedded technology has also
helped in developing automotive safety systems such as the
Anti-lock braking system (ABS)
Electronic Stability Control (ESC/ESP)
Traction control (TCS)
Automatic four-wheel drive
2.4 Aerospace & Avionics
Aerospace and Avionics demand a complex mixture of hardware, electronics, and
embedded software. For efficient working, hardware, electronics and embedded software must
interact with many other entities and systems. Embedded engineers confront major challenges,
Creating Embedded systems on time
Taking the budgetary constraints into consideration
Ensuring that the complex software and hardware interactions are right
Assembling components that meet specifications and perform effectively together
Understanding the larger context of the embedded software
Adopting the latest in Embedded technology like the fly-by-wire
2.5 Telecommunications
If ever there is an industry that has reaped the benefits to Embedded Technology, for
sure, it is only Telecommunications. The Telecom industry utilizes numerous embedded
systems from telephone switches for the network to mobile phones at the end-user. The
Telecom computer network also uses dedicated routers and network bridges to route data.
5
6. Embedded engineers help in ensuring high-speed networking. This is the most critical part of
embedded applications. The Ethernet switches and network interfaces are designed to provide
the necessary bandwidth. These will allow in rapidly incorporating Ethernet connections into
advanced Embedded applications.
2.6 Consumer Electronics
Consumer electronics has also benefited a lot from Embedded technologies. Consumer
electronics includes
Personal Digital Assistants (PDAs)
MP3 players
Mobile phones
Videogame consoles
Digital cameras
DVD players
GPS receivers
Printers
Even the household appliances, that include microwave ovens, washing machines and
dishwashers, are including embedded systems to provide flexibility, efficiency and features.
The latest in Embedded applications are seen as advanced HVAC systems that uses networked
thermostats to more accurately and efficiently control temperature. In the present times, home
automation solutions are being increasingly built on Embedded technologies. Home
automation includes wired and wireless-networking to control lights, climate, security,
audio/visual, surveillance, etc., all of which use embedded devices for sensing and controlling.
2.7 Railroad
Railroad signalling in Europe relies heavily on embedded systems that allows for
faster, safer and heavier traffic. Embedded technology has brought a sea of change in the way
Railroad Signals are managed and Rail traffic in large volumes is streamlined. The Embedded
technology enabled Railroad Safety Equipment is increasingly being adopted by Railway
networks across the globe, with an assurance of far lesser Rail disasters to report.
6
7. 2.8 Electronic payment solutions sector
In the present times there is stiff competition amongst Embedded solutions providers
to deliver innovative, and high-performance electronic payment solutions that are easy to use
and highly secure. Embedded engineers knowledge able in trusted proprietary technology
develops the secure, encrypted transactions between payment systems and major financial
institutions. The market for mobile payments systems is growing rapidly. It is driven by
retailers, restaurants, and other businesses that want to service customers anywhere, anytime.
With the use of mobile devices, mostly mobile phones becoming very popular, Embedded
technologies compatible with mobile are being developed to promote payment systems.
7
8. CHAPTER-3
HARDWARE REQUIREMENTS
3.1 BLOCK DIAGRAM:
Power
supply
Finger print
module
XMEGA
256A3BUKeypad 4x3
Digital
lock
GSM
module
Fig .3.1. Block diagram of our project
This is the block diagram of ―programmable intelligent door locking system with two
level using biometrics‖ .In this block diagram there will be ATMEL ―XMEGA 256A3BU‖
microcontroller, ―POWER SUPPLY‖, ―FINGER PRINT MODULE‖, ―KEYPAD 4*3, ―GSM
MODULE‖ and ―DIGITAL LOCK‖.
Now let‘s see the brief explanation of each block and we will see its features in detail.
8
9. 3.2 MICRO-CONTROLLER (XMEGA 256A3BU):
Fig 3.2. XMEGA 256A3BU Microcontroller
The Atmel AVR Xplained kits are great platforms for early evaluation of the
capabilities offered by the Atmel AVR microcontrollers. The XMEGA-A3BU Xplained
contain one QTouch button sensor, three mechanical buttons, two LEDs, 3 analog sensors, a
USB port, battery backup system and a 128x32 pixel FSTN LCD display.
The AVR Xplained expansion headers provide easy access to analog and digital I/O pins. The
board is powered by the USB cable and equipped with the standard 10-pin JTAG header that
connects to the full range of AVR debuggers.
Key features:
Keep RTC running in the backup system while main power is absent
Display data on the 128x32 pixels of the FSTN LCD display
Read temperature sensor with the ADC
9
10. Read light sensor with the ADC
Use the Atmel QTouch library to detect touches on the touch button
Read/write data to the 64Mbit Atmel Data Flash
3 push buttons to interact with the microcontroller
4 LEDs to show status information
Program the kit via USB boot loader or an Atmel programmer
Expand the board with Xplained top modules.
3.2.1 Operation of the microcontroller:
To be able to run the preprogrammed code, you need to connect the Atmel AVR
XMEGA-A3BU Xplained evaluation kit with a USB cable (standard A to mini-B or mini
AB) to a PC or USB hub. Once the kit is powered it is possible to browse the menu
system with the on-board mechanical buttons and the touch button. The functions for
the buttons are:
• Top left mechanical button (SW0): Enter a menu
• Bottom left touch button (QTB0): Return from a menu
• Top right mechanical button (SW1): Browse the menu up
• Bottom right mechanical button (SW2): Browse the menu down
The demo application allows also the XMEGA-A3BU Xplained board to communicate
with a computer using USB with a CDC (Communications Device Class) setup,
allowing the keyboard to be used to navigate in the demo application. When the
XMEGA-A3BU Xplained board is connected for the first time, Windows will try to
install a driver for ―Virtual CDC Com‖. A driver file, XPLAINED_Virtual_Com_Port.inf,
is located in the demo application directory or can be downloaded from the Atmel
If the driver is successfully installed, the board will show up in the Device Manager under
Ports (XPLAINED Virtual Com Port (COM**)). This COM port can now be interfaced
with your favorite terminal software. The connection parameters are as follows:
• Baud rate: 115200 baud
• Data bits: 8
• Parity: None
• Stop bits: 1
• Flow control: None
10
11. If the connection has been successfully established, you should be greeted by this
text on the screen of your terminal:
Welcome to the XMEGA-A3BU Xplained Demo CDC
interface! Key bindings for LCD menu control:
Enter : Enter
Backspace : Back
Arrow Up : Up Arrow
Arrow Down : Down Arrow
The demo application for the XMEGA-A3BU Xplained is available through the Atmel
AVR Software Framework (ASF), version 2.6.0 or later. The demo application is available as
an example project in AVR Studio® 5 and can be accessed by clicking:
File -> New -> Example Project, and selecting ―Demo application for XMEGA-A3BU
Xplained‖. In-depth documentation for the demo application is available in
the XMEGA-A3BU Xplained Software User Guide.
To modify the example code or write new code and compile it, you need a toolchain
for the Atmel AVR microcontrollers and an IDE to edit and debug code.
3.2.2 Connecting a kit:
Connect a USB cable between the board and a PC or a USB power supply to
power the kit. This is all that is needed. When power is applied the power/status LED will
light up in green.
Do not power the board without having the jumper next to the USB connector or
an Ampere meter mounted. Otherwise, the device may be damaged.
When connecting the Atmel XMEGA-A3BU Xplained to a PC, the operating system
will request a driver file for installing the serial communication driver. This driver file is
available in the zip-file associated with this document. The driver file supports both
32-bit and 64-bit versions of Windows® XP and Windows 7. Driver installs are not
necessary on Linux® operating systems.
11
12. 3.3 FINGER PRINT MODULE R305:
In fingerprint we will be considering mainly two parts. They are
1) Ridges
2) Valleys
Ridges are the lines which are present on our fingers and the gaps between two ridges
are Valleys. Fingerprint ridges are formed during the third to fourth month of fatal
development. The ridges begin to develop on the skin of the thumbs and fingers.
The purpose of these ridges is to give the fingers a firmer grasp and to avoid slippage.
These ridges allow the fingers to grasp and pick up objects.
The friction ridges on the fingers arrange themselves in more or less regular patterns
with ridge characteristics. All fingerprints have a unique combination and arrangement of
patterns and ridge characteristics. These patterns of friction ridges contain rows of sweat pores
that allow sweat and or oil to exit from glands. Sweat mixed with other body oils and dirt
produces fingerprints on smooth surfaces.
Fingerprints are left by the transfer of oils or amino acids to a surface, from the
transfer of substances on the fingers like paint or blood or by leaving an impression print in a
soft substance.
No two prints have ever been found to be exactly alike. Even those of identical twins
are different. Fingerprints are not inherited. The general pattern may be the same in families
but the level 2 and 3 details will differ. After formation, the growing fingerprint ridges expand
uniformly in all directions while growth is occurring so the pattern never changes.
Finger prints cannot be altered without creating a new unique fingerprint. Even when
the skin tissue is injured, the skin that grows back will have the same print.
Prints remain the same throughout life. The prints that someone is born with won‘t change
until decomposition after death.
And this is the best biometric material in which we can use in the security system and
there will be different finger prints for each individual and no two finger prints will be same in
12
13. the world and this is this biometric material (finger print module) is used for the security
system.
Fig 3.3. Finger print module
Features:
Complete embedded platform for robust products
Optical fingerprint sensors for reliability
Multiple module to select from as per your application needs
Full development support and reference designs
Low cost
Quick development and product launches
13
14. 3.4 KEYPAD 4x3:
Keypad used is 4x3 keypad, this is mainly used to type the password so that door
opens and the authorized person can enter into the room and in this keypad there will be four
rows and three columns .
Through this keypad the authorized person will be entering the password and if he/she
enters the correct password then the door will be opened and if authorized person enters
wrong password then the door will be not opened and the control enters into the ―selection of
the mode‖ which will be displayed on the screen.
Fig 3.4. Keypad 4x3
3.5 GSM MODULE:
GSM (Global System for Mobile) / GPRS (General Packet Radio Service) TTL –
Modem is SIM900 Quad-band GSM / GPRS device, works on frequencies 850 MHZ, 900
MHZ, 1800MHZ and 1900 MHZ. It is very compact in size and easy to use as plug in GSM
Modem. The Modem is designed with 3V3 and 5V DC TTL interfacing circuitry, which
allows User to directly interface with 5V Microcontrollers (PIC, AVR, Arduino, 8051, etc.) as
well as 3V 3Microcontrollers (ARM, ARM Cortex XX, etc.). The baud rate can be
14
15. configurable from 9600-115200 bps through AT (Attention) commands. This GSM/GPRS
TTL Modem has internal TCP/IP stack to enable User to connect with internet through GPRS
feature. It is suitable for SMSas well as DATA transfer application in mobile phone to mobile
phone interface.
The modem can be interfaced with a Microcontroller using USART (Universal
Synchronous Asynchronous Receiver and Transmitter) feature (serial communication).
The main operation of the GSM Module is that it is used to sending and receiving the
number of messages and even it is used for calling and for deactivate the call from any region
and there will be some of the AT(attention) commands for sending and receiving the messages
and for calling and deactivating the call and even there will be commands for holding the
current call .
This is about the GSM module.
Fig .3.5. GSM module
15
16. Features:
Quad Band GSM/GPRS : 850 / 900 / 1800 / 1900 MHz
Built in RS232 to TTL or vice versa Logic Converter (MAX232)
Configurable Baud Rate
SMA (Sub Miniature version A) connector with GSM L Type Antenna
Built in SIM (Subscriber Identity Module) Card holder
Built in Network Status LED Inbuilt Powerful TCP / IP (Transfer Control Protocol
/ Internet Protocol) stack for internet data transfer through GPRS (General Packet
Radio Service)
Audio Interface Connectors (Audio in and Audio out)
Most Status and Controlling pins are available
Normal Operation Temperature : -20 °C to +55 °C
Input Voltage : 5V to 12V DC
LDB9 connector (Serial Port) provided for easy interface
16
17. CHAPTER-4
SOFTWARE REQUIREMENTS
4.1 ATMEL STUDIO 6.2:
Starting Atmel Studio
Atmel Studio is started by clicking on the Atmel Studio 6.2 shortcut in the Start-Up menu.
Once started, the start page is displayed. From within this page you can create new projects
and reopen recently used projects, as well as browse through articles providing tutorials,
help and news.
The Start page can also be accessed from View→Start Page, or Alt+V+G.
Fig.4.1 The Project related section of the Start Page
17
18. The left section of the start page contains project-related items:
New project - Use this to create a new project. If you are very new to the concept of
software development with Atmel Studio, refer to the step-by-step guides. The
project settings and available options are described in detail in Project Management
New example project - To take a step-by-step tour of the available Atmel platforms'
functionalities using the AVR Software Framework, click this button.
Open project - Load an existing project, not mentioned on the Recent projects pane
The Recent projects lists the most recently opened projects. Clicking on any of the links
will open the project, restoring it and the GUI to its last saved settings. You can select the
number of projects you would like to be shown in the Menus and settings.
The Get Started section
The Get Started tab contains the Welcome page,
The Welcome page contains an overview, new features and some of the common Q&A
about the current Atmel Studio release.
Getting started: New project contains information about the AVR Software Framework
and the tutorials to get you proficient with the new and existing tools quickly.
Extending the Atmel studio allows you to browse and install extensions from an online
gallery of third-party extensions to the Atmel Studio IDE and from the updates catalog for the
IDE.
The Tutorials page lists a set of basic tutorials.
The Links and resources page leads to online resources for prototyping and product
ordering and information.The AVR Tools Help section
18
19. Fig.4.2. The AVR Tools Help section
The AVR Tools Help section contains help on AVR software and hardware platforms.
The following information‘s is found here:
Starter kits tab contains information on starter kits.
Debuggers contains information on compatible debuggers.
Programmers contains information on AVR ISP mkII, the universal in-
system programmer for all AVR tools.
Touch kits contains information on touch sensor platforms.
Wireless kits contains information on platforms with RF transceivers.
Evaluation kits contains information on a large set of evaluation kits..
Software contains help on Atmel Studio and other ATMEL installed
software components.
19
20. 4.2 Prerequisites
The following software and hardware are required for this training. Atmel
Studio 6.2 IDE Atmel Studio Terminal Extension XMEGA-A3BU Xplained
evaluation kit AVR Dragon Programmer/Debugger
One mini-B USB cable to connect XMEGA-A3BU Xplained kit and one USB
type B cable to connect AVR Dragon
4.3 Hardware Setup
This section explains about the hardware setup to be followed to accomplish
the training. This section assumes that the Atmel Studio 6.2 IDE has been installed on
the PC already.
TODO Unpack the AVR Dragon kit and connect the kit to PC using USB type
B cable as shown below.
Fig 4.3. AVR Dragon
20
21. Once connected, the required drivers for the AVR Dragon will be automatically installed.
Proper driver installation can be verified in the ‗Device Manager‘ window which should show
‗AVR Dragon‘ under ‗Jungo‘ as shown below.
Fig.4.4. Selecting AVR Dragon
The next step is to verify the firmware of the AVR Dragon tool to make
sure that it is up to date.
TODO Open Atmel Studio IDE and select the option ‗View‘ -> ‗Available
Atmel Tools‘ as shown below.
Fig.4.5. Connecting AVR Dragon
21
22. TODO Right click on the AVR Dragon tool in ‗Available Atmel Tools‘ and select
the option ‗Upgrade‘ as shown below.
Fig4.6. Upgrading AVR Dragon
This is done to ensure that the firmware on the AVR Dragon is up-to-date with the Atmel
Studio IDE. If the firmware is not up-to-date, Atmel Studio will prompt for upgrade as
shown below. Click on the ‗Upgrade‘ button to upgrade the firmware.
TODO Unpack the XMEGA-A3BU Xplained kit and connect it to computer
using mini-B USB cable as shown below.
Fig.4.7. USB Connection
22
23. The kit comes with a preprogrammed demo application and it also enumerates as USB
CDC device in computer. So when the kit is connected, CDC driver will be installed.
Fig.4.8. JTAG Connection
Open ‗Device Programming‘ window from ‗Tools‘ -> ‗Device Programming‘ as shown below.
Fig.4.9. Device programming
23
24. 4.4 Opening Atmel Studio Project
This section explains how to open a simple Atmel Studio project and how to
configure the device selection.
TODO Open Atmel Studio 6.2 from start menu and select the option
‗File -> New Project‘ as shown below.
Fig.4.10. Opening Atmel project.
TODO Now select the option ‗AVRGCC C Executable Project‘. You may select a
project name and directory as needed. For this case let us use the project name
‗XMEGA_Training‘ and let the directory be the
Documents atmel studio6.2‘ as shown below.
Fig.4.11. Selecting executable project.
24
25. Now the device selection window will appear.
TODO In the search box, search for ‗xmega256a3bu‘ and select the device
‗ATxmega256A3BU‘ and click OK as shown below.
Fig.4.12. Selecting microcontroller.
This opens an Atmel Studio project with name ‗XMEGA_Training‘ and with a main C file
‗XMEGA_Training.c‘ which can be viewed from the ‗Solution Explorer‘ as shown below.
25
26. Fig.4.13. Solution explorer.
Double click on the ‗XMEGA_Training.c‘ file in the solution explorer which
opens the C file in the workspace. This file has a basic code snippet which
Includes a header file ‗avr/io.h‘ and has a main() function with an empty while(1) loop.
We will add code to this file in the upcoming sections.
This section explains how the XMEGA PORT should be configured as general purpose
input/output and how to read/write values to GPIO pins.
More specifically, in this handson, we will use one push button and one LED available on
the XMEGA-A3BU Xplained board.
Navigate to the path ‗Training_PackageDay_1XMEGA_A3BU_XPLD_Docs‘ and open
the ‗XMEGA_A3BU_XPLD_Schematics.zip‘ file. This file contains the PDF document of
theXMEGA-A3BU Xplained board schematics.
TODO Modify the ‗XMEGA_Training.c‘ file so that it looks as below.
26
27. #include <avr/io.h>
int main(void)
{
PORTE.DIRCLR = PIN5_bm;
PORTR.D
IRSET =
PIN0_bm;
while(1)
{
PORTR.OUT = (PORTE.IN >> 5);
}
}
Fig.4.14. Building solution.
Above figure shows how to bulid a solution.
TODO Select ‗Project‘ -> ‗XMEGA_Training Properties‘. Now select the
‗Tool‘ tab and configure the AVR Dragon tool as shown below.
27
28. Fig.4.15. Configuring AVR Dragon.
4.5. Handson II – Monochrome GFX on XMEGA
This section explains how to setup the Atmel Studio project and
configure the XMEGA device to make use of the on-board LCD display.
The on-board LCD display has a resolution of 128x32 pixels with X-Y co-
ordinate (0,0) starting at the top left position. This display is controlled through
SPI interface and is connected to USARTD0 peripheral configured as SPI master
in ATxmega256A3BU device.
TODO Clear all the port related code in ‗XMEGA_Training.c‘ file
and keep the main() function with while(1) loop as below.
#include <avr/io.h>
int main(void)
{
28
29. while(1)
{
}
}
TODO Copy the folder ‗gfx_library‘ and paste it in the project
directory where ‗XMEGA_Training.c‘ file exists.
This folder contains all the source code for the low level LCD driver, the
monochrome graphics library and the monochrome system font library.
This folder and the associated code should now be included in the project in
‗Solution Explorer‘.
TODO Click the ‗Show Files‘ icon in the solution explorer as shown below
which will list all the files/folders in the project directory. The files/folders
that are not included in the project will be shown as empty icons.
TODO Right click on folder ‗gfx_library‘ and click the option
‗Include in project‘ as shown below.
Fig.4.16. Selecting GFX library.
TODO The gfx library path should also be added in the project directories. Open
29
30. ‗Project -> XMEGA Training properties ->Toolchain -> AVR/GNU C Compiler ->
Directories‘. Click the ‗Add item‘ button and type the
following ‗../gfx_library‘ (without codes) and click OK as shown below.
Fig.4.17. Directories.
Now common macro definitions for the graphics library has to be added in the project settings.
TODO Open ‗Project -> XMEGA Training properties ->Toolchain -> AVR/GNU C
Compiler -> Symbols‘. Click the ‗Add item‘ button and add the following macro definitions
one by one.
F_CPU=32000000UL
GFX_MONO_C12832_A1Z=1
The first macro is used by the delay routines to determine the number of CPU cycles per
microsecond used by the LCD driver and the second macro defines the LCD type used by
the graphics library.
TODO Now open ‗XMEGA_Training.c‘ file and include the following header files
next to io.h file include.
30
31. #include
"gfx_mono.h"
#include
"gfx_mono_text.h"
#include "sysfont.h"
These header files includes all the necessary graphics and system font library files.
The next step is to make the device running at 32MHz frequency (max speed). By default,
when the device is powered up, the device will start running at 2MHz frequency generated by
the internal 2MHz RC oscillator. Since the graphics library needs more CPU performance we
will make the CPU running at its full speed of 32MHz using the on-chip dedicated 32MHz ring
oscillator.
TODO Add the following code before while(1) loop in main() function.
OSC.CTRL |=
OSC_RC32MEN_bm;
while(!(OSC.STATUS &
OSC_RC32MRDY_bm)); CCP =
CCP_IOREG_gc;
CLK.CTRL = CLK_SCLKSEL_RC32M_gc;
The above code first enables the internal 32MHz oscillator through the oscillator control
register and then waits in a while loop until the corresponding ready bit in STATUS register
is set.
It then switches the main clock to 32MHz oscillator after writing the CCP register
(Configuration Change Protection register). Write to CCP register is mandatory when switching
the main clock otherwise the clock switch will not happen for security reason.
TODO Add the following code before while(1) loop and after clock switching
31
32. snippet.
gfx_mono_init();
PORTE.OUTSET
= PIN4_bm;
gfx_mono_draw_string("Hello World!", 0, 0, &sysfont);
The function ‗gfx_mono_init()‘ will initialize the graphics library as well as the low level
LCD drivers and the USART SPI module.
From the schematic document the backlight for LCD module is connected to PORTE pin 4 of
the ATxmega256A3BU device. Setting this pin to logic high state will enable the LCD
backlight and vice versa. The second line in the above snippet sets a logic high state on the
backlight pin.
The function ‗gfx_mono_draw_string()‘ is used to print a string on the LCD display. The
first argument is the actual string, the second and third arguments represent the X and Y co-
ordinates respectively and the fourth argument is the pointer to the system font structure.
The final code should look as below.
#include <avr/io.h>
#include "gfx_mono.h"
#include
"gfx_mono_text.h"
#include "sysfont.h"
int main(void)
32
33. {
OSC.CTRL |= OSC_RC32MEN_bm;
while(!(OSC.STATUS &
OSC_RC32MRDY_bm)); CCP =
CCP_IOREG_gc;
CLK.CTRL = CLK_SCLKSEL_RC32M_gc;
gfx_mono_init();
PORTE.OUTSET =
PIN4_bm;
gfx_mono_draw_string("Hello World!", 0, 0,
&sysfont); while(1)
{
;
}
}
TODO Run the project by hitting F5.
33
35. CHAPTER-5
RESULT
5.1 RESULT ANALYSIS:
In this project there will be three modes, they are:
1.) Mode 1: Finger print mode.
2.) Mode 2: keypad mode.
3.) Mode 3: GSM and keypad mode.
1.) Mode 1: Finger print mode.
Initially when we power ―ON‖ the supply then the LCD displays ―welcome!
select the mode‖ and then here we have to select the mode as mode 1from the keypad and then
it displays ―checking for mode‖ and it enters into the finger print mode then it displays ―please
scan your finger!‖ and immediately when person places finger it displays ―countdown
5,4,3,2,1‖ and it enrolls the finger and it displays ―enroll ok‖ and ―genchar ok‖ , ―successful
matching of finger print !‖ and it displays ―matched open the door !‖ if it does not matches then
the control goes to the selection mode that is it displays ―welcome ! select the mode‖.
Screen shot.5.1. Finger print mode
35
36. 2.) Mode 2: Keypad mode.
When the person selects the mode 2 then the control goes to the keypad by
pressing 2 on the keypad now it displays ―Enter key!‖ ,if the key matches then the control
enters into the keypad and it displays ―Enter password now!‖and if password matches then the
LCD displays ―matched! Open the door‖ and if the password does not matches the controls
goes to the selection mode and it displays ―Welcome! Select the mode‖.
Screen shot..5.2. Keypad mode.
3.) Mode 3:GSM and keypad.
When the person selects mode 3 then the control goes to the GSM and then here
we have to press 3 on keypad and LCD displays ―waiting for owner‖ and then when
authorized person(owner) calls to the GSM module and if cell number matches with the
GSM then LCD displays ―Enter GSM password!‖ and if the password matches then
LCD displays ― GSM password accepted!‖ and it displays ―matched ! open the door‖
and if the password does not matches the control goes to the selection mode and it
displays ―welcome! Select mode.‖
36
38. CONCLUSION
In this way we have successfully implemented ―programmable intelligent door
locking system with two level of security.‖This project can be used at high security area such as
banks, homes, offices and corporate companies.
Here, we are two level security because, if unauthorized person hacks password then
that person may enter the room and stoles important things i.e..robbery Hence we are
keeping two levels of security.
38
39. FUTURE SCOPE
When person enters into the room in any case if that person is injured severely then
no one can know outside if there is only person in the room.
In this case there will be a camera inside the room so that owner can view when
a person got injured.
39