Ammu Internship (1) Merged
Ammu Internship (1) Merged
Ammu Internship (1) Merged
An Internship Report on
Submitted By
SUGUNA 1GG20EC039
Internship carried out at
Karnataka German Technical Training Institute,
Manjunath Nagar, Bagalakunte, Bengaluru - 560073
INTERNSHIP CERTIFICATE
External Viva
Name of the Examiner Signature with Date
1) ………………………………
………………………………
2) ………………………………
………………………………
COMPANY CERTIFICATE
DECLARATION
I, SUGUNA, bearing the USN: 1GG20EC039 a student of 8th semester ,
Electronics and Communication Engineering, Government Engineering College
Ramanagara, hereby declare that the internship Work entitled “Embedded
Programming & Interface of 8/16/32 bit Microcontroller” has been
independently carried out by me under the supervision and the guidance of
Mr. AMIR AHMED Z, KGTTI, Bengaluru and Dr. Imran Khan, Head of
Department, Department of Electronics and Communication Engineering,
GECR, submitted by me as a partial fulfilment of the course requirements of 8th
semester, Bachelor of Engineering in Electronics and Communication
Engineering as prescribed by VISVESVARAYA TECHNOLOGICAL
UNIVERSITY, Belagavi during the academic year 2023-2024.
I also declare that, to the best of my knowledge and belief, the work report here
does not from part of any other report based on which a degree or award was
conferred an earlier occasion on this by any other student.
SUGUNA
(1GG20EC039)
ACKNOWLEDGEMENT
I would like to express my gratitude to Dr. G PUNDARIKA, Principal,
Government Engineering College, Ramanagara for providing me the excellent
facilities and academic ambience which has helped me in satisfactory completion
of this Bachelor’s Degree.
I also express my sincere thanks and heartfelt gratitude to my internal guide and
internship coordinator, Dr. IMRAN KHAN, Head of Department, Department of
Electronics and Communication Engineering, for his inspiring guidance,
throughout the course of the present work. .
SUGUNA
(1GG20EC039)
GOVERNMENT ENGINEERING COLLEGE RAMANAGARA
DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING
➢ To enhance educational opportunities for the students from rural and weaker sections
of the society.
Department Vision
Department Mission
M1: To inculcate strong fundamentals and technical skills through innovative solutions and
teamwork with ethics and human values to cater to societal needs.
M2: To impart quality education in Electronics & Communication Engineering that bridges
the gap between industry and institute through training, internship and research.
M3: To provide an ambience for quality education and research to the students from rural and
weaker section of society to become Global Professional and Entrepreneurs.
1. Apply engineering and management principles in solving real time problems at their
workplace.
2. Identify, write down, and carry out performance objectives, optimized solutions
related to their job assignment using modern tools
3. Develop team work, good communication, interpersonal and other critical skills for
job interview process.
4. Develop work habits and practice of professional ethics for lifelong learning.
Program outcomes:
The students gain confidence and meaningful experience in the area of their work during
internships. This learning may be listed by the National Board of Accreditation (NBA) in the areas
of Engineering knowledge (PO1), Individual and team work (PO9) and Lifelong Learning (PO12).
CO-PO Mapping:
No Course Outcome CL Linked POs
Apply engineering and management principles in solving
CO 1 L4 1,2,3,4,5,7
real time problems at their workplace
Identify, write down, and carry out performance objectives,
CO 2 optimized solutions related to their job assignment using L4 1,2,3,4,5,6,7,9,10,11
modern tools
Develop team work, good communication, interpersonal
CO 3 L4 1,2,9,10
and other critical skills for job interview process.
Develop work habits and practice of professional ethics for
CO 4 L4 1,8,12
lifelong learning.
PO 1 PO 2 PO 3 PO 4 PO 5 PO 6 PO 7 PO 8 PO PO PO PO PSO PSO
9 10 11 12 1 2
CO 1 3 2 2 2 2 - 1 - - - - - 3 -
CO 2 3 2 2 2 2 2 2 - 2 3 2 - 3 3
CO 3 3 2 - - - - - - 2 3 - - - -
CO 4 3 - - - - - - 3 - - - 3 3 -
RUBRICS FOR INTERNSHIP PRACTICE EVALUATION (18ECI85)
SL
Parameter Split Details CO
NO
Organization
Internship Report Abstract and Conclusions
1 of chapters
20M 10M
10M
Answering the
Relevant and convincing answers
3 queries
10M
10M
1. COMPANY PROFILE………………………………………………………………………………….… 1
2. INTRODUCTION TO EMBEDDED SYSTEM
2.1 DEFINATION OF EMBEDDED SYSTEM ………...…………………..………………………………. 3
5.3 MICROCONTROLLER…………………………………………………………………………………….…. 24
5.8 CODE…………………………………………………………………………………………………………….. 29
6. CONCLUSION ………………………………………………………………………………………………………….. 50
7. REFERENCE………………………………………………………….…………………………………………………… 51
EMBEDDED PROGRAMMING & INTERFACE OF 8/16/32 BIT MICROCONTROLLER 1GG20EC039
CHAPTER 1
COMPANY PROFILE
All programs follow German vocational education and training standards that are demand
oriented and directly imply a close relationship with industry. To provide International
Standards and Hands-on training the centre is equipped with extensive state-of-art training
facilities which are incomparable.
With its world-class vocational training centres, KGTTI has set a benchmark in skill
development. The focus is to offer skill-specific training that will help students find excellent
job opportunities in the global workplace and encourage entrepreneurship among the youth.
1.1 OBJECTIVES
The overall objective of KGTTI is to provide skill development, advanced technology hands-
on-training and to enhance employment opportunities. To achieve this objective, the DSATM
will mobilize its students/participants to undergo skill-development training to make them
industry ready/fit.
1.2 MISSION
KGTTI will generate high quality skilled manpower in close association with the industry,
will operating with operational flexibility and striving financial self-sustainability.
1.3 VISION
To develop KGTTI as world class training centres that offers specialized skills training
programs in alignment with the industry requirements in Karnataka and beyond.
1.4 AIMS
1.5 STRENGTHS
CHAPTER 2
An embedded system is one kind of a computer system mainly designed to perform several
tasks like to access, process, store and also control the data in various electronics-based
systems.
Embedded systems are a combination of hardware and software where software is usually
known as firmware that is embedded into the hardware.
As with any electronic system, an embedded system requires a hardware platform on which it
performs the operation. Embedded system hardware is built with a microprocessor or
microcontroller. The embedded system hardware has elements like input output (I/O)
interfaces, user interface, memory and the display. Usually, an embedded system consists of:
➢ Power Supply
➢ Processor
➢ Memory
➢ Timers
➢ Serial communication ports
A system is said to be real time, if it is essential to complete its work and deliver its service on
time. Real time operating system manages the application software and affords a mechanism
to let the processor run. The Real Time operating system is responsible for handling the
hardware resources of a computer and host applications which run on the computer.
CHAPTER 3
INTRODUCTION TO 8051-MICROCONTROLLER
3.1 8051-MICRONTROLLER
8051 is one of the first and most popular microcontrollers also known as MCS-51. Intel
introduced it in the year 1981. Initially, it came out as an N-type metal-oxide-semiconductor
(NMOS) based microcontroller, but later versions were based on complementary metal-oxide-
semiconductor (CMOS) technology. These microcontrollers were named 80C51, where C in
the name tells that it is based on CMOS technology. It is an 8-bit microcontroller which means
the data bus is 8-bit. Therefore, it can process 8 bits at a time. It is used in a wide variety of
embedded systems like robotics, remote controls, the automotive industry, telecom
applications, power tools, etc.
➢ Pins 1 to 8- These pins are known as PORT 1. This port doesn’t serve any other
functions. It is internally pulled up, bi-directional I/O port.
➢ Pins 9- It is a RESET pin. Which is used to Reset the microcontroller to its initial
values.
➢ Pins 10 to 17- These pins are known as PORT 3. This port serves some functions like
interrupt, timer input, control signals, serial communication signals RxD and TxD, etc.
➢ Pins 18 to 19- These pins are used for interfacing an external crystal to get the system
clock.
➢ Pin 20- This pin provides the power supply to the circuits.
➢ Pins 21 to 28- These pins are known as PORT 2. It serves as I\O port. Higher order
address bus signals are also multiplexed using this port.
➢ Pin 29- This pin PSEN pin which stands for External Program Store Enable. It is used
to read a signal from external program memory.
➢ Pin 30- This is EN pin which stands for External Access input. It is used to
enable/disable the external memory interfacing,
➢ Pin 31- This pin is ALE pin which stands for Adress Latch Enable. It is used to
demultiplexing the address data signal of port.
➢ Pins 32 to 39- These pins are known as PORT 0. It serves as I\O port, Lower order
address and data bus signals are multiplexed using this port.
➢ Pin 40- This pin is used to provide power supply to the circuits.
2.Setup Development Environment: - Install the necessary software tools, like an Integrated
Development Environment (IDE), compiler and programmer software.
4.Write Code: - Develop your program using the programming language supported by the
microcontroller. Write code to initialize peripherals, handle inputs/outputs and implement the
desired functionality.
5.Compile code: - Use the compiler to translate your code into machine readable instruction
for the microcontroller.
6.Load Code onto Microcontroller: - Use a programmer tool to transfer the microcontroller’s
memory.
7.Debugging: - Test and debug your code to identify and fix any errors or issues.
8.Configure Peripherals: - Set up and configure any peripherals, such as sensor, actuators or
communication modules, as needed for your projects.
CHAPTER 4
A light-emitting diode (LED) is a two-lead semiconductor light source device used for
indicating the output status by making it ON or OFF.
An LED is nothing but a p–n junction diode, which emits light when provided with power
supply. When voltage is applied to the leads of an LED, it forces the electrons to recombine
with electron holes within the device, emitting energy in the form of photons. This effect of
emitting energy in form of photons is called electroluminescence.
The colour of the light is determined by the energy band gap of the semiconductor
corresponding to the energy of the photon.
#include<reg51.h>
void delay ()
{
TMOD=0X01;
TH0=0XDB;
TL0=0XFF;
TR0=1;
while (TF0==0)
TF0=0;
}
void main ()
{
while (1)
{
P1=0xAA;
delay ();
P1=0x55;
delay ();
P2=0xFF;
delay ();
P2=0x00;
delay ();
}
}
4.2 LIQUID CRYSTEL DISPLAY (LCD)
LCDs (Liquid Crystal Displays) are used for displaying status or parameters in embedded
systems. LCD 16x2 is 16 pin device which has 8 data pins (D0-D7) and 3 control pins (RS,
RW, EN). The remaining 5 pins are for supply and backlight for the LCD.
The control pins help us configure the LCD in command mode or data mode. They also help
configure read mode or write mode and also when to read or write.
LCD 16x2 can be used in 4-bit mode or 8-bit mode depending on the requirement of the
application. In order to use it we need to send certain commands to the LCD in command mode
and once the LCD is configured according to our need, we can send the required data in data
mode.
Since we are using LCD in 4-bit mode, we require only 4 Data pins.
LCD Data pins D4-D7 are connected to respective pins.
LCD control pins RS, RW and EN are connected to their respective pins.
INTERFACING LCD PROGRAM TO 8051 MICROCONTROLLER
#include<reg51.h>
#define display P2
sbit rs=P3^7;
sbit rw=P3^6;
sbit en=P3^5;
void delay()
{
int i,j;
for(i=0;i<100;i++)
for(j=0;j<100;j++);
}
void lcdcmd(unsigned char cmd)
{
display=cmd;
rw=0;
rs=0;
delay();
en=1;
delay();
en=0;
delay();
}
void lcddat(unsigned char dat)
{
display=dat;
rw=0;
rs=1;
delay();
en=1;
delay();
en=0;
delay();
}
void lcdstr(char*str)
{
while(*str!='\0')
{
lcddat(*str);
str++;
}
}
void main()
{
while(1)
{
lcdcmd(0x38);
lcdcmd(0x01);
lcdcmd(0x0e);
lcdcmd(0x80);
lcdstr("RAMALINGEGOWDA");
lcdcmd(0xc0);
lcdstr("SUGUNAGOWDA");
}
}
4.3 SWITCH
The switch is a basic input device, use to control the operation of any output device using the
microcontroller or control unit.
4.4 DC MOTOR
The term ‘DC motor’ is used to refer to any rotary electrical machine that converts direct
current electrical energy into mechanical energy. DC motors can vary in size and power from
small motors in toys and appliances to large mechanisms that power vehicles, pull elevators
and hoists, and drive steel rolling mills. But how do DC motors work?
DC motors include two key components: a stator and an armature. The stator is the stationary
part of a motor, while the armature rotates. In a DC motor, the stator provides a rotating
magnetic field that drives the armature to rotate.
A simple DC motor uses a stationary set of magnets in the stator, and a coil of wire with a
current running through it to generate an electromagnetic field aligned with the centre of the
coil. One or more windings of insulated wire are wrapped around the core of the motor to
concentrate the magnetic field.
The windings of insulated wire are connected to a commutator (a rotary electrical switch), that
applies an electrical current to the windings. The commutator allows each armature coil to be
energised in turn, creating a steady rotating force (known as torque).
When the coils are turned on and off in sequence, a rotating magnetic field is created that
interacts with the differing fields of the stationary magnets in the stator to create torque, which
causes it to rotate. These key operating principles of DC motors allow them to convert the
electrical energy from direct current into mechanical energy through the rotating movement,
which can then be used for the propulsion of object.
sbit In2=P1^6;
void main()
{
sw1=sw2=1;
In1=In2=0;
while(1)
{
if(sw1==1&sw2==0)
{
In1=1;
In2=0;
}
else if(sw1==0&sw2==1)
{
In1=0;
In2=1;
}
else
{
In1=0;
In2=0;
}
}
}
4.5 RELAY
A relay is an electrically operated switch. It consists of a set of input terminals for a single or
multiple control signals, and a set of operating contact terminals. The switch may have any
number of contacts in multiple contact forms, such as make contacts, break contacts, or
combinations thereof. It works on electromagnetic induction and has operating voltage of +5V.
4.6 BUZZER
#include<213x.h>
void delay()
{
Int i, j;
for(i=0; i<200;i++)
for(j=0; j<200;j++);
}
void main()
{
IODIR=1<<20;
while(1)
{
IOSET=1<<20;
delay();
IOCLR=1<<20;
delay();
}
}
A stepper motor, also known as step motor or stepping motor is an electrical motor that rotates
in a series of small angular steps, instead of continuously. Stepper motors are a type of digital
actuators. Stepper motors are an electromagnetic actuator; it converts electromagnetic energy
into mechanical energy to perform mechanical work.
A stepper motor is a brushless DC electric motor that divides a full rotation into a number of
equal steps. The motor's position can be commanded to move and hold at one of these steps
without any position sensor for feedback (an open-loop controller), as long as the motor is
correctly sized to the application in respect to torque and speed.
Switched reluctance motors are very large stepping motors with a reduced pole count, and
generally are closed-loop commutated.
A 4×4 matrix keypad consisting of microswitch buttons. The module has four holes 3mm (M3)
holes for mounting. The pin designations on each PCB are shown on each PCB. Four pins are
thus used as an ‘x’ coordinate and the other 4 as a ‘y’ coordinate.
#include<reg51.h>
#define display P1
sbit RS=P3^1;
sbit E=P3^2;
sbit r1=P2^0;
sbit r2=P2^1;
sbit r3=P2^2;
sbit r4=P2^3;
sbit c1=P2^7;
sbit c2=P2^6;
sbit c3=P2^5;
void delay()
{
int i,j;
for(i=0;i<100;i++)
for(j=0;j<100;j++);
}
void lcd_cmd(unsigned char cmd)
{
display=cmd;
RS=0;
delay();
E=1;
delay();
E=0;
delay();
}
void lcd_dat(unsigned char dat)
{
display=dat;
RS=1;
delay();
E=1;
delay();
E=0;
delay();
}
void main()
{
P1=0x00;
lcd_cmd(0x38);
lcd_cmd(0x01);
lcd_cmd(0x0e);
lcd_cmd(0x80);
while(1)
{
r1=0;
if(c1==0)
{
lcd_dat('1');
delay();
}
if(c2==0)
{
lcd_dat('2');
delay();
}
if(c3==0)
{
lcd_dat('3');
delay();
}
r1=1;r2=0;
if(c1==0)
{
lcd_dat('4');
delay();
}
if(c2==0)
{
lcd_dat('5');
delay();
}
if(c3==0)
{
lcd_dat('6');
delay();
}
r2=1;r3=0;
if(c1==0)
{
lcd_dat('7');
delay();
}
if(c2==0)
{
lcd_dat('8');
delay();
}
if(c3==0)
{
lcd_dat('9');
delay();
}
r3=1;r4=0;
if(c1==0)
{
lcd_dat('*');
delay();
}
if(c2==0)
{
lcd_dat('0');
delay();
}
if(c3==0)
{
lcd_dat('#');
delay();
}
r4=1;
}
}
CHAPTER 5
PROJECT OUTCOME
PASSWORD BASED DOOR LOCKING SYSTEM USING
MICROCONTROLLER
ABSTRACT
The purpose of this project is to provide security at (house, ATM, office etc.) in this system the
user will have to register a unique password. The information will be stored in data base.
Whenever the right password will be received, the controller will accordingly give instruction
to dc motor. Dc motor will perform the action on door unlocking. We want to utilize the
electronic technology to build an integrated and fully customized home security system at a
reasonable cost.
5.1 INTRODUCTION
Many time we forgot to carry the key of our home. Or sometimes we come out of our home
and door latch closes by mistake. In this case it is really difficult to get inside the house. This
project is designed to solve this purpose. Main concept behind this project is of a door-latch
opening using a password entered through keypad. As well as turning on the Buzzer when
password is entered wrong. Today people are facing more problems about security in all over
world, nowadays security is the most essential issue everywhere in the world so security of
everything gains higher and higher importance in recent years. The main component in the
circuit is 8051-Microcontroller. Here, 4*4 keypad is used to enter the password. The entered
password is compared with the predefined password. If it is correct password, the system opens
the door by rotating door motor and displays the status of door on LCD. If the password is
wrong then door remains closed and displays password is wrong on LCD. It can be used at
organizations to ensure authorized access to highly secured places. With a slight modification
by replacing the motor driver with a relay driver, this circuit can be used to control the
switching of loads through code. This circuit can be also modified by using EEPROM chip
interfaced to the microcontroller and store the entered password in the chip. Such an
automatic lock system consists of electronic control assembly which controls the output load
through a password. This output load can be a motor or a lamp or any other
mechanical/electrical load.
➢ 8051 Microcontroller
➢ LCD display
➢ Buzzer
➢ 4x4 Keypad
5.3.1 MICROCONTROLLER
This is the CPU (central processing unit) of our project. We are going to usea Microcontroller
of 8051 family. The various functions of microcontroller are like:
We are going to use 16x2 alphanumeric Liquid Crystal Display (LCD) which means it can
display Alphabets along with numbers on 2 lines each are containing 16 characters.
5.3.3 BUZZER
We are going to use a buzzer to indicate the wrong password to open the door.
input User will enter the password using the keypad. In our project we are using 4*4 matrix
to providethe inputs.
The Actuator's are those devices which actually gives the movement or to do a task like motor's.
In the real world there are various types of motors available which works on different voltages.
So, we need motor driver for running them through the controller. To get interface between
motor and Microcontroller. We use L293D motor driver IC in our circuit.
5.4 METHODOLOGY
Electronic Code Lock System Circuit Design: Password Based Door Locking System design
uses five major components – a Microcontroller, an L293D Motor Driver, a DC motor, a 4×4
matrix keypad and anLCD. Here AT89C52 Microcontroller is used and it is an 8-bit controller.
This controller requires a supply voltage of +5V DC. In order to provide regulated 5V DC
voltage to the controller we need to use 7805 power supply circuit. We can use 9V DC battery
or 12V, 1A adaptor as a power source.
Reset Circuit Design: The reset pin of the microcontroller is kept active till the power supply
is inthe specified range and a minimum oscillation level is maintained. In other words to ensure
the supply voltage does not falls below the threshold level of 1.2V and the reset pulse width is
greater than 100ms (recommended for 89C51), we select the values of resistor and capacitor
such that RC >=100ms. Here we select a 10K resistor and a 10uF electrolyte capacitor.
Oscillator Circuit Design: A crystal oscillator is used to provide external clock signal to the
microcontroller. To ensure smooth operation, we connect two ceramic capacitors ranges from
20pF to 40pF. This crystal oscillator is connected between pin 18 and 19 of the
microcontroller.
Compilation of Microcontroller Code: Once the circuit is designed and drawn on a piece of
paper, the next step is to write and compile the code. Here we select the Kiel µVision
software to write the program in C language. Prior to writing the code, general steps needs to
be followed like creating a new project and selecting the target device or the required
microcontroller. Once the code is written, we saved it with .c extension and then added it to the
source file group under the target folder. The code is then compiled by pressing F7 key. Once
the code is compiled, a hex file is created. In the next step, we use Proteus software to draw the
circuit. The code is dumped into the microcontroller by right clicking on the IC and then adding
the hex file
The Microcontroller based door locker is an access control system that allows only authorized
person to access a restricted area. The system is fully controlled by the 8-bit microcontroller
8051 which has a 2Kbytes of ROM for the program memory. The password is stored in the
EPROM so that we can change it at any time. The system has a keypad by which the password
can be entered through it. When the entered password equals with the password stored in the
memory then the relay gets on and so that the door is opened. If we entered a wrong password
then the alarm is switched on. An easy way to comply with the conference paper formatting
requirements is to use this document as a template and simply type your text into it.
Principle Behind the Circuit: The main component in the circuit is 8051 microcontroller.
Here, 4×3 keypad is used to enter the password. The entered password is compared with the
predefined password. If it is correct password, the system opens the door by rotating door motor
and displays the status of door on LCD.
If the password is wrong then door remains closed and displays ―pwd is wrong‖ on LCD Its
design and working are very interesting and easy to implement. If you are interested to get
detailed information about its design, working and applications, read the post Electronic Code
Lock System using 8051 Microcontroller. Traditional lock systems using mechanical lock and
key mechanism are being replaced by new advanced techniques of locking system. These
techniques are an integration of mechanical and electronic devices and highly intelligent. One
of the prominent features of these innovative lock systems is their simplicity and high
efficiency.
Circuit Description: The total functioning of the―CODE LOCK SYSTEM is based on the
software program which is burn inside the microcontroller IC 8051.The at89c51 IC is heart of
the given circuitry because this IC is programmable 40pin dip IC in which we burn the program
in rom. This IC has a 32 input lines through which we take the output pin no 9 is used for reset
the microcontroller and make it in a initial condition pin no 31 is enable pin, it required low
pulse for activating the microcontroller depends on the crystal connected to the xtal1 & xtal2.
pin no 18 & 19 is used for providing the VCC of +5v pin 20 is grounded.
The operating frequency of the controller is set by the external oscillator of crystal oscillator
of crystal having frequency of 12MHZ. Capacitor having 33pF in parallel connection with
ground is for the proper undammed frequency. Reset for the controller is normally ground and
10uf 10v electrolytic capacitor is also connected on reset for the slowly on and off to the
controller during the supply is turning on and off. The keypad used to give input signal is been
interfaced with microcontroller are port0 (p0.1- p0.7). The controller fetches the hex code
according to the instruction. The LCD is used for display device it is a 16 slots device usually
used to show output status from the microcontroller. The output signal which be fetched by
relay status followed by on/off status of electronic lock.
5.8 CODE
#include "uart.h"
#include "timer0.h"
void GSM_init(void)
{
serial_print("ATE0");
serial_tx(0x0D);//carriage return
delay_max_t0m1(14);
serial_print("AT+IPR=9600");
serial_tx(0x0D);
delay_max_t0m1(14);
serial_print("AT");
Serial_tx(0x0D);
delay_max_t0m1(14);
}
void sendSMS(unsigned int otp)
{
serial_print("AT+CMGF=1");
serial_tx(0x0D);
delay_max_t0m1(14*2);
serial_print("AT+CMGS=\"+918749069465\"");
serial_tx(0x0D);
delay_max_t0m1(1);
serial_print("New Password for Door Lock is :");
serial_print_int(otp);
serial_tx(0x1A);// End of file or ctrl + Z
delay_max_t0m1(14*2);
}
#ifndef GSM
#define GSM
void GSM_init(void);
data1 = P1&0x0f;
if(data1==0x0e)
{
return 2;
while((data1==0x0e));
}
else if(data1==0x0d)
{
return 5;
while(data1==0x0d);
}
else if(data1==0x0b)
{
return 8;
while(data1==0x0b);
}
else if(data1==0x07)
{
return 0;
while(data1==0x07);
}
P1=0xdf; //3
data1 = P1&0x0f;
if(data1==0x0e)
{
return 3;
while((data1==0x0e));
}
else if(data1==0x0d)
{
return 6;
while(data1==0x0d);
}
else if(data1==0x0b)
{
return 9;
while(data1==0x0b);
}
else if(data1==0x07)
{
return 35;
while(data1==0x07);
}
}
}
#ifndef keypad
#define keypad
unsigned int GetKeypadValue(void);
#endif
#define lcd P2
#include "lcd_2x16.h"
//#include<string.h>
sbit rs = P3^7;
sbit en = P3^5;
sbit rw=P3^6;
void lcd_cmd(unsigned char cmd)
{
lcd = cmd;
rw=0;
rs =0;
en =1;
lcd_delay(1);
en=0;
}
void lcd_begin(void)
{
lcd_cmd(0x38); //setting as 8 bit 2 line
lcd_cmd(0x0c); //display on cursor
lcd_cmd(0x01); //clear
lcd_cmd(0x06); //aut increment
}
void lcd_cursor(unsigned char r,unsigned char pos) //pos starts from 0
{
unsigned char set;
rw=0;
if(r==0)
{
set=0x80+pos;
lcd_cmd(set);
}
else if(r==1)
{
set=0xc0+pos;
lcd_cmd(set);
}
}
void lcd_print(unsigned char *data1)
{
while(*data1!='\0')
{
lcd =*data1;
rw=0;
rs =1;
en =1;
lcd_delay(10);
en=0;
data1++;
}
}
void lcd_clear()
{
lcd_cmd(0x01); //display on cursor
}
void lcd_data(unsigned char data1)
{
lcd =data1;
rw=0;
rs =1;
en =1;
lcd_delay(10);
en=0;
}
void lcd_print_int_3d(unsigned int i)
{
lcd_data((i/100)%10+0x30);
lcd_data((i/10)%10+0x30);
lcd_data((i/1)%10+0x30);
}
void lcd_delay(int d)
{
unsigned i,j;
for(i=0;i<d;i++)
{
for(j=0;j<10;j++);
}
}
#ifndef LCD_2X16
#define LCD_2X16
void lcd_begin(void);
void lcd_cmd(unsigned char cmd);
void lcd_print(unsigned char *data1);
void lcd_cursor(unsigned char r,unsigned char pos);
void lcd_clear();
void lcd_data(unsigned char data1);
void lcd_print_int_3d(unsigned int i);
void lcd_delay(int d);
#endif
#include "lcd_2x16.h"
#include "keypad.h"
#include "main.h"
#include "lcd_2x16.h"
#include "timer0.h"
#include "motor.h"
#include "uart.h"
#include "gsm.h"
unsigned int passrd=940,c=1;
unsigned char Value;
sbit intr=P2^1;
}
lcd_data('*'); //Printing 2nd value
delay_max_t0m1(7); //1sec delay
{
d3=GetKeypadValue(); //Password 3rd Digit value
}
lcd_data('*');
//Printing 3rd value
delay_max_t0m1(7); //1sec delay
FinalValue=d1*100+d2*10+d3;
//Combined Final value
lcd_cursor(1,1);
//Cursor to 2nd line to print value
lcd_print_int_3d(FinalValue); //Printing Final value
delay_max_t0m1(14); //1sec delay
} //d1=-1;d2-1;d3=-1;
return FinalValue;
}
unsigned int checking(void)
{
static unsigned int FinalValue;
FinalValue=GetValue();
//Getting Number entered
if(FinalValue == passrd)
//Comparing Password entered
{
OneMsg(" Correct Password"); //Msg="Correct Password";
delay_max_t0m1(14); //1sec delay
return 0;
}
else
{
// done:
while(c)
{
for(a1=9;a1>=0;a1--) //Number generation
{
for(a2=9;a2>=0;a2--)
{
for(a3=9;a3>=0;a3--)
{
//Value=(a1|a2|a3);
Value = (a1 * 100) + (a2 * 10) + a3;
if(intr==0)
{
GSM_init();
sendSMS(Value);
intr=1;
c=0;
//goto done;
return;
}
}
}
}
}
}
int otpgen(void)
{
unsigned char Val;
msg(" OTP will be send","to your Phn No.");
delay_max_t0m1(14*3);
//1sec delay//---------------------------------//---------------------------------
new:
msg(" Press Switch 3 ","for sending OTP.");
delay_max_t0m1(14);
srand();
c=1;
msg(" Enter the OTP "," after Recieving ");
delay_max_t0m1(14*5);
Val=GetValue();
if(Val == Value)
{
msg(" Entered OTP is "," Correct. ");
delay_max_t0m1(14*3);
msg(" Entered the New "," Password. ");
delay_max_t0m1(14*5);
passrd=GetValue();
msg(" New Password is"," is Set ");
delay_max_t0m1(14*5);
//1sec delay
return 0;
}
else
{
return 1;
}
}
void OTP(void)
{
//int z;
while(otpgen())
{
{
/*lcd_clear();
lcd_cursor(0,2);
//Cursor to 2nd line to print value
lcd_print_int_3d(Value);
delay_max_t0m1(14*3);*/
msg(" Entered OTP is "," InCorrect. ");
delay_max_t0m1(14*3);
}
}
}
void true(void)
{
msg(" Please Enter"," The House ");
//Printing Welcome Message
delay_max_t0m1(14*3);
//5sec delay
DoorMotor();
//Open Door If Password is correct
msg(" The Door is "," Closed NOW ");
//Printing Welcome Message
delay_max_t0m1(14*30);
//5sec delay
}
void main()
{
static unsigned char start1[17]=" Wellcome to",start2[17]=" Smart Home";
//Variable Declaration
unsigned char check=1,i=0;
intr=1;
while(1)
{
lcd_begin();
//LCD start
msg(start1,start2);
//Printing Welcome Message
delay_max_t0m1(14*5);
//5sec delay
//while(1)
{
if(check=checking())
{
if(check=checking())
{
if(check=checking())
{
OTP();
//Sending OTP to Mobile
msg(" Password Change "," is Successful. ");
//Printing Welcome Message
delay_max_t0m1(14*5);
//5sec delay
}
else
{
I1=0;
delay_max_t0m1(14*5); //3sec delay
I1=0;
I2=1;
delay_max_t0m1(14*5); //5sec delay
I2=0;
delay_max_t0m1(14*5); //3sec delay
}/*
main()
{
lcd_begin();
lcd_cursor(0,1);
lcd_print(" Motor Starting");
delay_max_t0m1(14*2);
DoorMotor();
lcd_clear();
lcd_cursor(0,1);
lcd_print(" Motor stopped");
delay_max_t0m1(14*2);
}*/
#ifndef motor
#define motor
void DoorMotor(void);
#endif
#include "timer0.h"
#include "lcd_2x16.h"
sbit I1=P0^0;
sbit I2=P0^1;
sbit E1=P0^2;
void DoorMotor(void)
{
E1=1; //1st Direction
I1=1;
I2=0;
delay_max_t0m1(14*5); //5sec delay
I1=0;
delay_max_t0m1(14*5); //3sec delay
I1=0;
I2=1;
delay_max_t0m1(14*5); //5sec delay
I2=0;
delay_max_t0m1(14*5); //3sec delay
}/*
main()
{
lcd_begin();
lcd_cursor(0,1);
lcd_print(" Motor Starting");
delay_max_t0m1(14*2);
DoorMotor();
lcd_clear();
lcd_cursor(0,1);
lcd_print(" Motor stopped");
delay_max_t0m1(14*2);
}*/
#include "timer0.h"
void delay_max_t0m1(unsigned int d)
{
unsigned int j; //one time run gives 71.17msec
TMOD =0x01;
}
#include "uart.h"
char serialBuff[10];
void serial_begin_9600(void)
{
TMOD = TMOD | 0x20;
SCON = 0x50;
TL1 = -3;
TH1 = -3;
TR1 = 1;
}
void serial_print(unsigned char *p)
{
serial_begin_9600();
while( (*p)!='\0' )
{
SBUF = *p;
TR1 = 1;
while(TI == 0);
TI = 0;
p++;
}
}
void serial_tx(unsigned char p)
{
serial_begin_9600();
SBUF = p;
while(TI == 0);
TI=0;
}
Simulation of project is performed on PROTEUS and the code was written Kiel software. Code
for the microcontroller to run DC motors IC (L293D) is written. In the simulation the relevant
data to the Microcontroller is send through keypad. The Microcontroller processed the data
and sent the information to the Actuator IC (L293D). The Actuator IC upon receiving
information showed response by driving the DC motors.
Here we are discussing the result in different cases as once when wrong password is entered
the LCD displays “wrong password” entered and when correct password is entered the LCD
shows the “access granted” and the motor rotates to open the door.
CHAPTER 6
CONCLUSION
The work was done successfully. It is evidence that the use of keypad with the right circuitry
can be used to operate a security system. These systems have the ability to accesses a secure
place (house, ATM, industries, office etc). A password-based recognition system can easily
perform variation. In variation the system compares an input password to the enrolled password
of a specific user to determine, if they are forming the same password. Now the security of
our home,office etc.
FUTURE SCOPE
CHAPTER 7
REFERENCE
1. Technology Intelligent Home: SMS Based Home Security System with Immediate
Feedback International Journal of Advance Research In Science And Engineering
http://www.ijarse.com IJARSE, Vol. No.2, Issue No.5, May, 2013 ISSN-2319-
8354(E).
2. Liu, T., Guo, H., and Wang, Y., A new approach for colour-based object recognition
aqwith fusion of colour models‖, Congress on Image and Signal Processing Conference,
Sanya-China, vol. 3, pp. 456-460, May 2008.
3. Wang, B., and Yuan, T., Traffic Police Gesture Recognition using Accelerometer‖,
IEEE SENSORS Conference, Lecce-Italy, pp. 1080-1083, Oct. 2008.
4. Lalanne, Colour recognition with a camera: a supervised algorithm for classification‖,
IEEE Southwest Symposium on Image Analysis and Interpretation, Tucson-Arizona,
pp. 198-204, April 1998.
5. Signals, Systems and Computers, 2004 Conference Record of the Thirty-Eighth
Asilomar Conference on Publication 7-Nov-2004 Volume: 1, on page(s): 577-581
Vol.1.
6. International Journal of Advanced Research in Computer Science and Software
Engineering, Volume 2, Issue 10, October 2012.
7. International Journals of Biometric and Bioinformatics, Volume (3): Issue (1).
8. Mukesh Kumar Thakur, Ravi Shankar Kumar, Mohit Kumar, Raju Kumar Wireless
Fingerprint Based Security System using Zigbee‖ , International Journal of Inventive
Engineering and Sciences (IJIES) ISSN: 2319–9598, Volume-1, Issue-5, April 2013.
9. Mary Lourde R and Dushyant Khosla, Fingerprint Identification in Biometric
Security Systems‖, International Journal of Computer and Electrical Engineering, Vol.
2, No. 5, October, 2010.
10. Song, M., Kim, B., Ryu, Y., Kim, Y., and Kim, S., A design of real time control robot
system using android Smartphone‖ The 7th International Conference on Ubiquitous
Robots and Ambient Intelligence (URAI), Busan Korea, Nov. 2010.
11. Shilpa, V., Pradeep, H. S., and Kurian, M. Z., The Symbian Robot ‖ International
Journal of Computer Science and Informatics (IJCSI), Vol- 1, Issue-3.