Engine Lock 100%progress
Engine Lock 100%progress
YEAR 5 SEMESTER 2
EEE 4502
100% Project presentation submitted in partial fulfilment requirements for the degree in Bachelor of
TENKES NDOINYIO
BSEE/124J/2016
I, TENKES NDOINYIO, declare that the contents of this project report represent my own
unaided work, and that the report has not previously been submitted for academic examination
towards any qualification. Furthermore, it represents my own opinions and not necessarily those
of the Technical University of Mombasa.
Signed Date
ABSTRACT
This project deals with the design & development of an embedded system, which is being used
to prevent /control the theft of a vehicle. The developed instrument is an embedded system
based on GSM technology. The instrument is installed in the engine of the vehicle. An
interfacing GSM modem is also connected to the microcontroller to send the message to the
owner’s mobile.
The main objective of this instrument is to protect the vehicle from any unauthorized access,
through entering a protected password and intimate the status of the same vehicle to the
authorize person (owner) using Global System for Mobile (GSM) communication technology.
This system deals with the concept of network security. The main concept in this design is
introducing the mobile communications into the embedded system. The entire designed unit is
on a single board. A four-digit password is set as default, using the user mobile phone and is
displayed on the 16x2 LCD. If in case we enter a wrong password a message is sent to the
owner’s mobile number and a buzzer is heard after a delay of milli second’s time.
For this 100% progress report, sufficient literature review has been conducted on the embedded
automobile engine locking system using GSM technology, from which the circuit block
diagram was adopted. The possible methodologies of realizing the project goal have equally
been evaluated which then enabled the various circuit designs to be constructed. The overall
circuit has finally been designed and simulated, and the project full construction and
actualization was successful.
ii
DEDICATION
To my family, hope you will find it relevant someday. Also, to any student in the field of
electrical engineering who will find it useful in future research.
iii
ACKNOWLEDGEMENTS
My appreciation goes to all those who have helped me in making this project a success.
I thank God the Almighty for the gift of life, peace, guidance and wisdom that he has given me
throughout the process of developing this project. It is through him that I have been
strengthened to work.
My great gratitude goes to my supervisor Mr. Mukhaya for taking his time to provide
assistance, ideas and guidance in developing this project.
I would like to thank my parents for having always been there for me, providing moral and
financial support in my academic work.
My friends who offered me support, ideas and even actual help in developing this project
iv
TABLE OF CONTENTS
Table of Contents
DECLARATION .................................................................................................................... i
ABSTRACT ......................................................................................................................... ii
DEDICATION ..................................................................................................................... iii
ACKNOWLEDGEMENTS ..................................................................................................... iv
TABLE OF CONTENTS ......................................................................................................... v
LIST OF FIGURES .............................................................................................................. vii
LIST OF TABLES ............................................................................................................... viii
LIST OF ABBREVIATIONS ................................................................................................... ix
CHAPTER ONE ................................................................................................................... 1
1 INTRODUCTION .......................................................................................................... 1
1.1 Background Information .................................................................................................. 1
1.2 Overall and Specific Objectives ........................................................................................ 1
1.2.1 Overall Objective .................................................................................................................1
1.2.2 Specific Objectives ...............................................................................................................1
1.3 Problem statement .......................................................................................................... 2
1.4 Assumptions and Limitations ........................................................................................... 2
1.4.1 Assumptions ........................................................................................................................2
1.4.2 Limitations ...........................................................................................................................2
1.5 Justification ..................................................................................................................... 2
CHAPTER TWO .................................................................................................................. 3
2 LITERATURE REVIEW........................................................................................................... 3
2.1 Introduction .................................................................................................................... 3
2.2 VEHICLE THEFT DETECTION BY GSM ................................................................................. 3
2.3 Anti-Theft Control System Design Using Embedded System .............................................. 4
2.4 Theft control system for an automobile ........................................................................... 4
2.5 vehicle loading monitoring detection using a load sensor and GSM ................................... 5
2.6 Anti-theft GSM based vehicle management systems......................................................... 6
2.7 Microcontrollers .............................................................................................................. 7
2.7.1 ATMEGA 328P microcontroller .............................................................................................7
2.7.1.1 ATmega328P UART Communication Module ................................................................................ 8
2.7.1.2 SPI Communication ATmega328P .................................................................................................. 8
2.7.1.3 I2C Communication Module .......................................................................................................... 8
2.7.1.4 TIMERS MODULES.......................................................................................................................... 8
2.7.1.5 SYSTEM CLOCK ............................................................................................................................... 9
2.7.1.6 COMPARATOR MODULE ................................................................................................................ 9
2.7.1.7 ATmega328P CAPTURE/COMPARE/PWM Channels ...................................................................... 9
2.7.1.8 ANALOG TO DIGITAL CONVERTER Channels .................................................................................. 9
2.8 Relay Control ................................................................................................................. 11
2.9 Liquid Crystal Display (LCD) unit ..................................................................................... 11
2.10 Switching Transistor .................................................................................................... 13
2.11 Buzzer ......................................................................................................................... 14
2.12 Arduino IDE ................................................................................................................. 14
2.13 Simulation Software .................................................................................................... 14
2.12 Literature Review Summary ......................................................................................... 16
v
CHAPTER THREE .............................................................................................................. 17
3 METHODOLOGY .......................................................................................................... 17
3.1 Introduction .................................................................................................................. 17
3.2 Design ........................................................................................................................... 17
3.2.1 Introduction .......................................................................................................................... 17
3.2.2 Understanding circuit component functions and determining performance specification . 17
3.2.2.1 Circuit functions; ....................................................................................................................... 17
3.2.2.2 Alarming to panic culprits ......................................................................................................... 18
3.2.2.3 Starting and stopping the engine ............................................................................................... 19
3.2.2.4 Sending and receiving SMS ....................................................................................................... 20
3.2.2.5 Components performances and Specifications ........................................................................ 21
3.2.2.5.1 Power Supply ..................................................................................................................... 21
3.2.2.5.1.1 TRANSFORMER ............................................................................................................ 21
3.2.2.5.1.2 RECTIFIER .................................................................................................................... 22
3.2.2.5.1.3 Filter Capacitor ............................................................................................................ 23
3.2.2.5.1.4 VOLTAGE REGULATION ............................................................................................... 24
3.2.2.5.2 GSM MODULE ......................................................................................................................... 25
3.2.2.5.3 12V Relay............................................................................................................................ 25
3.2.2.5.4 Buzzer ................................................................................................................................. 27
3.2.3 Overall circuit diagram and circuit operation................................................................... 29
3.2.3.1 Circuit diagram .......................................................................................................................... 29
3.2.5.2 Circuit Operation ....................................................................................................................... 29
3.3 Construction.................................................................................................................. 30
3.3.1 Introduction ...................................................................................................................... 30
3.3.2 Procurement of Components and Parts ........................................................................... 30
3.3.3 Software Simulation Stage ............................................................................................... 30
3.3.4 Breadboard stage .............................................................................................................. 33
3.3.5 Soldering Strip Board Stage .............................................................................................. 34
3.3.6 Housing ............................................................................................................................. 35
3.4 Testing .......................................................................................................................... 36
3.4.1 Introduction ...................................................................................................................... 36
3.4.2 Determining the Test Procedures .................................................................................... 36
3.4.3 Identifying functional test to be done .............................................................................. 36
3.4.4 Functional test measurements and results obtained....................................................... 37
3.5 Challenges encountered/lessons learned ....................................................................... 38
3.6 Deliverables achieved/not achieved ............................................................................... 38
3.7 Project costing ............................................................................................................... 39
3.8 Project Time Management ............................................................................................. 40
3.9 Conclusion..................................................................................................................... 41
3.10 Recommendations........................................................................................................ 41
References ...................................................................................................................... 42
APPENDICES .................................................................................................................... 44
APPENDIX A1: Atmega328 block diagram ................................................................................. 44
APPENDIX A2: Transistor load line characteristics .................................................................... 45
APPENDIX A3: Atmega328p pin configuration .......................................................................... 45
APPENDIX B1: Atmega328p Datasheet ..................................................................................... 46
APPENDIX B2: Project Program Code ....................................................................................... 46
vi
LIST OF FIGURES
Figure 2.1 Block Diagram for Vehicle Theft Control System .................................................................................... 3
Figure 2.2 Block diagram of anti-theft control system ............................................................................................ 4
Figure 2.3 block diagram Theft control system for an automobile.......................................................................... 5
Figure 2.4 block diagram of Vehicle loading monitoring system ............................................................................. 6
Figure 2.5 block diagram of Anti-theft GSM based vehicle management System .................................................. 6
Figure 2.6 ATmega328P Architecture ...................................................................................................................... 7
Figure 2.7 Relay connection diagram .................................................................................................................... 11
Figure 2.8 LCD controller diagram ......................................................................................................................... 12
Figure 2.9 Electromechanical Relay Operation ...................................................................................................... 12
Figure 2.10 NPN Transistor .................................................................................................................................... 13
Figure 3.1 block diagram of the embedded automobile engine locking system ................................................... 18
Figure 3.2 buzzer circuit diagram .......................................................................................................................... 19
Figure 3.3 interfacing ATmega328P with relay circuit diagram ............................................................................ 20
Figure 3.4 GSM shield ............................................................................................................................................ 20
Figure 3.5 power supply blocks.............................................................................................................................. 21
Figure 3.6 structure of a laminated Transformer core .......................................................................................... 21
Figure 3.7 Bridge Rectifier circuit .......................................................................................................................... 23
Figure 3.8 Smoothing diagram .............................................................................................................................. 23
Figure 3.9 LM7805 Pinout Diagram ....................................................................................................................... 24
Figure 3.10 GSM module pinout diagram ............................................................................................................. 25
Figure 3.11 Relay switching circuit ........................................................................................................................ 26
Figure 3.12 Overall project circuit diagram ........................................................................................................... 29
Figure 3.13 Proteus simulation circuit ................................................................................................................... 31
Figure 3.14 Proteus simulation circuit for satisfied operation conditions ............................................................. 32
Figure 3.15 proteus simulation circuit for unsatisfied operating conditions ......................................................... 33
Figure 3.16 breadboard circuit connection ............................................................................................................ 34
Figure 3.17 soldering diagram of the circuit.......................................................................................................... 35
Figure 3.18 project mounted onto the housing ..................................................................................................... 36
Figure 3.19 project diagram when the correct password was entered ................................................................. 37
Figure 3.20 project diagram when the wrong password is entered. ..................................................................... 38
vii
LIST OF TABLES
Table 3.1 Project Costing ....................................................................................................................................... 39
Table 3.2 Project time management ..................................................................................................................... 40
viii
LIST OF ABBREVIATIONS
ix
CHAPTER ONE
1 INTRODUCTION
In these days, automobile thefts are increasing at an alarming rate all over the world. So to
escape from these thieves most of the vehicle owners have started using the theft control
systems. The commercially available anti-theft vehicular systems are very expensive. Here, we
make an attempt to develop an instrument based on 8051 microcontroller and operated using
GSM technology. The instrument is a simple and low-cost vehicle theft control embedded
system.
The Global System for Mobile communications (GSM) is the most popular and accepted
standard for mobile phones in the world established in 1982 and it operates in 900 MHz
frequency. Over billion people use GSM service across the world. The utility of the GSM
standard makes international roaming very common between mobile phone operators, enabling
subscribers to use their phones in many parts of the world. GSM differs significantly from its
predecessors in both signaling and speech clarity, as its channels is digitized. It means that the
GSM system is now considered as a third generation (3G) mobile communication system.
At 100% report, the intensive literature review conducted has delivered sufficient information
leading to fine adjustments in the project, adoption of the suitable circuit designs, components
considerations, the overall circuit design and simulation and finally the circuit hardware was
assembled and the embedded automobile engine locking system is ripe for use in preventing
vehicle theft.
1
1.3 Problem statement
Currently most of the people having their own vehicle, theft is happening on parking
and sometimes in driving insecure places. So, there is a need to develop a system which
can be used to protect the vehicle from any unauthorized access, through entering a
protected password and intimate the status of the same vehicle to the authorized person
(owner) using Global System for Mobile (GSM) communication technology. Therefore,
an embedded automobile engine locking system in this project is efficient in protecting
vehicles from unauthorized access.
1.4.1 Assumptions
i. It is assumed that there is network coverage throughout so as to send SMS
notification to vehicle owners.
ii. It is assumed that there is an existing vehicle over which the circuit will be
connected
iii. Virtual terminal represents GSM system.
1.4.2 Limitations
i. Limited to a network subscriber i.e., Safaricom, Telkom and airtel
1.5 Justification
The development of GSM Car Security System is a solution to all vehicle owners to
increase the security of their vehicle from car theft as it can alert the owner by sending
SMS messages after detecting an intruder and the owner also can monitor their car status
by sending SMS messages.
2
CHAPTER TWO
2 LITERATURE REVIEW
2.1 Introduction
Many researchers have come up with ways and means of solving this common problem of
vehicle theft. Other methods are being faced out while others are being invented. Some of the
systems that have been made using different control modules so as to assist in the reduction of
vehicle theft are highlighted briefly in this chapter. Some of these systems are;
In the works by D. Gurunath, Dr. Sreeja Mole S (2018), This GSM based vehicle theft control
system retrieves vehicle status whether it is in theft mode. This data is fed to the
microcontroller, which is interfaced to a GSM modem. The microcontroller generates the
vibrations and sends an SMS to the concerned authority over GSM modem on periodical
intervals which is set by the user. An LCD display is connected to the microcontroller for
crossing the data received before being sent over GSM.
3
2.3 Anti-Theft Control System Design Using Embedded System
In the works by Vinoth Kumar Sadagopan (2011) designed a system in which when the key
is inserted in the key hole the inductive proximity sensor detects the key and triggers the
microcontroller. A password check message is displayed on the LCD provided inside the car
and at the same time the owner is alerted with a message about the usage of his car.
Totally three trials are provided to enter the correct password. If the entered password is
incorrect a second electronic lock system gets activated and the doors are locked. An alert
message is sent to the police and the owner about the illegal access of his car. With the help of
GPS the exact location of his car is found and the key of the second lock system is available
only with the owner hence a total control over the vehicle is established.
In the works by Wankhade, P.P. and Dahad, S.O., 2011, This project deals with the
design & development of a theft control system for an automobile, which is being used
to prevent/control the theft of a vehicle. The developed system makes use of an
embedded system based on Global System for Mobile communication (GSM)
technology. The designed & developed system is installed in the vehicle. An interfacing
mobile is also connected to the microcontroller, which is in turn, connected to the
engine. Once, the vehicle is being stolen, the information is being used by the vehicle
owner for further processing. The information is passed onto the central processing
insurance system which is in the form of the sms, the microcontroller unit reads the sms
and sends it to the Global Positioning System (GPS) module and using the triangulation
4
method, GPS module feeds the exact location in the form of latitude and longitude to
the user’s mobile. By reading the signals received by the mobile, one can control the
ignition of the engine; say to lock it or to stop the engine immediately. The main concept
in this design is introducing the mobile communication into an embedded system. The
designed unit is very simple & low cost. The entire designed unit is on a single chip.
2.5 vehicle loading monitoring detection using a load sensor and GSM
In the works by Odonkor, E.N. and Ofosu, W.K., 2020, Vehicle overloading is one of
the major problems confronting many developing nations and Ghana is not an exception.
Two attendant problems are accidents, and damage to road infrastructure. Weighing
stations may be the answer to these conditions, but few are used for measuring the
weight of some specific vehicles in Ghana. A vehicle loading monitoring detection using
a load sensor and GSM model with an automatic engine lock system is proposed in this
study as a solution. The proposed system will detect vehicle overloading and
automatically call the owner of the vehicle or the road safety officer in that event.
Proteus software is used for designing and simulating the circuit while programming is
done using the Arduino software. Microcontroller ATMEGA 328 serves as the brain of
the design and Global System for Mobile Communications (GSM) module serves as the
communication link. A Liquid Crystal Display (LCD) is used to display the status of the
vehicle. In addition, a buzzer is to sound an alarm when vehicle overloading is detected.
The system has facilities to lock a vehicle engine automatically.
5
Figure 2.4 block diagram of Vehicle loading monitoring system
Samir Rana, Ritu Mewari, Lata Nautiyal (2018) designed an Anti-theft Security System for
Vehicles. It consists of three modules. First, the user’s license is scanned by means of NFC tag
and when it is read, the microcontroller sends a message to the owner for authorization. The
authorized user can access the vehicle for an authorized period of time.
Second, if the license is lost and finds any illegal activity, the user is allowed to lock the vehicle
by using mobile application to prevent from theft.
Third, if anyone tries to unlock the vehicle, the microelectromechanical system sends a signal
to microcontroller, immediately an emergency alert message sends to both the owner and the
current user, simultaneously alarm blows out to have a surrounding attention.
Figure 2.5 block diagram of Anti-theft GSM based vehicle management System
6
2.7 Microcontrollers
Microcontroller is a device that acts like the brain of any system. It performs complex functions
by taking in signal from various input interfaced to it and consequently providing command to
various outputs connected to it as per the program. There are many types of microcontrollers
available in the market and they vary from one another. These microcontrollers are discussed
as follows.
ATmega328P is one of the high performances AVR technology microcontroller with a large
number of pins and features. It is designed by 8-bit CMOS technology and RSIC CPU which
enhance its performance and its power efficiency get improved by auto sleeps and internal
temperature sensor. This ATmega328P IC comes with internal protections and multiple
programming methods which helps the engineers to priorities this controller for different
situations. The IC allows multiple modern era communications methods for other modules
and microcontrollers itself, which is why the microcontroller ATmega328P usage has been
increasing every day.
7
2.7.1.1 ATmega328P UART Communication Module
Although there are multiple kinds of communication systems within the devices and modules
but the most common one is USART. It is one of the simplest and easiest method for implement
and understanding by most of the developers and systems. In this method, two wires used to
send and receive the data. The USART pins of microcontroller ATmega328P are:
RX – GPIO2
TX – GPIO3
The data can be sent by specified the sending rate within the controllers but it can also use the
external clock pin to keep the data sync.
XCK – GPIO6
USART/UART communication system can be used to program the microcontroller.
SDA – GPIO27
SCL – GPIO28
2.7.1.4 TIMERS MODULES
ATtiny328P has two internal timers. We can use these timers to make counters and to generate
pulses. Both of these timers are dependent on an oscillator. Both timers can use the internal and
external clock to operate, but they also have an internal pin which can be used to count
8
according to the external pulses. All of these pins in microcontroller ATmega328P are given
below:
T0 – GPIO6
T1 – GPIO11
TOSC1 – GPIO9
TOSC2 – GPIO10
ICP1 – GPIO
ICP1 is an input capture pin which can be used to capture the external pulse at a specific interval
of time. When an input pulse will occur on this pin then it will generate a timestamp which can
tell when the external signal was received.
CLKO – GPIO14
2.7.1.6 COMPARATOR MODULE
The microcontroller has internal comparator modules for analog signal. This module takes the
input in inverting and non-inverting form which can be used further for any internal purpose or
it can also be used to generate the output signals. Comparator pins of the microcontroller are
listed below:
OC0B – GPIO11
OC0A – GPIO12
OC1A – GPIO15
OC1B – GPIO16
OC2A – GPIO17
OC2B – GPIO5
2.7.1.8 ANALOG TO DIGITAL CONVERTER Channels
In ATmega328P there are 6 ADC channels that can be used to convert the analog signal to
digital. The analog converter needs to be activated first by its power pin (AVCC). The ADC
9
channels use power supply voltage as a reference to differentiate the different levels of the
analog signal. The analog pins of the controller are:
ADC0 – GPIO23
ADC1 – GPIO24
ADC2 – GPIO25
ADC3 – GPIO26
ADC4 – GPIO27
ADC5 – GPIO28
AVCC – Pin20
AREF PINS
Sometimes the analog signal voltages are fluctuating but it kept measuring by the controller
according to the power input of the controller. To measure it by any other power input or by the
power of analog signal generating device, an analog voltage reference AREF will be used. This
pin will detect the maximum value of the analog signal and then it will be able to give the proper
output. AREF pin in ATmega328P is:
AREF – GPIO21
RESET: In ATmega328 there is some reset to restart the microcontroller in some conditions.
In all of these resets there is an external reset to reset the device using an external signal:
RESET – GPIO1
POWER: Every controller needs the power to operate and it always has a power input pin. In
ATmega328P the power pins are three in number. One pin is for voltage and the remaining two
are for common ground. Both of these ground pins are connected internally, it doesn’t matter
which one is used. The power pins of the microcontroller are:
VCC – Pin7
GND – Pin8, Pin22
OSCILLATOR: The controller comes with 8MHz changeable oscillator. However, it can also
use the external oscillator up to 40MHz. To use the external oscillator, oscillation pins will be
required for input and output of the signal. Those pins are given below:
XTAL1 – GPIO9
XTAL2 – GPIO10
10
2.8 Relay Control
A 16x2 character Line LCD module is a parallel port module. An 8051 program must interact
with the outside world using input and output devices that communicate directly with a human
being. One of the most common devices attached to an 8051 µC is an LCD display. LCD
requires 3 control lines as well as 8 I/O lines for the data bus. So, this LCD will require a total
of 11 data lines.
11
Figure 2.8 LCD controller diagram
The operating circuit (circuit 1), see the figure 16, is connected to a solenoid coil wound round
iron core. A current in the coil forms an electromagnetic which attracts the soft-iron armature.
This brings the contact point together, circuit 2 is closed and current flows. When the circuit 1
is switched off the steel spring returns the armature to the open position and current in circuit 2
is switched off.
If you see, the five pin is arranged in two columns. One column consists of 3
pins where other consist 2 pins. The two-coil pin and a common pin are situated
12
in one side as shown in figure below. The pin which lies in center are common
pin and the two side pins are coil pins.
Transistor switches are used for a wide variety of applications such as interfacing large current
or high voltage devices. Transistor BC547 is used for interfacing a relay a low voltage digital
logic microcontroller. The reason for choosing this transistor over other transistors is because
relay needs a minimum rating of 5mV and 16mA and has comparatively higher rating than
other transistors. In cut-off region, the operating conditions of the transistor are zero input base
current (IB ), zero output collector current ( IC ) and maximum collector voltage ( VCE ) which
results in a large depletion layer and no current flowing through the device. Therefore, the
transistor is switched “Fully-OFF”. In saturation region, the transistor will be biased so that the
maximum amount of base current is applied, resulting in maximum collector current resulting
in the minimum collector emitter voltage drop which results in the depletion layer being as
small as possible and maximum current flowing through the transistor. Therefore, the transistor
is switched “Fully-ON”.
13
circuitry; the resistance of the transistor in the "on" state is too small to affect circuitry; and the
transition between the two states is fast enough not to have a detrimental effect.
2.11 Buzzer
Arduino IDE is a GUI based Software that supports all the Arduino based microcontrollers. It
is a cross platform application written in the programming language Java. It is an open-source
Software (IDE) that makes it very easy to write code and also upload it to the board. It runs on
various operating systems Windows, Mac OS X and Linux. It originated from the IDE for the
languages such as Processing and Wiring. A program written with the IDE for Arduino is called
a "sketch". The Arduino IDE supports the languages such as C and C++ using special rules to
organize the code. The Arduino IDE supplies a software library called Wiring from the Wiring
project, which provides a lot of common input and output procedures.
According to (Banks, 2001), Simulation is the process of imitation of the operation of a real-
world process or system over time. They require the use of models; the model is a representative
of the key characteristics or behaviors of the selected system or process, whereas the simulation
represents the evolution of the model over time. Quite often, computers with the appropriate
software are used to execute the simulations.
14
I. Proteus: It’s described as a Virtual System Modeling and circuit simulation
application. It combines mixed mode SPICE circuit simulation application, animated
components and microprocessor models to facilitate co-simulation of complete
microcontroller-based designs. Proteus has the ability to simulate the interaction
between software running on microcontroller and any analog or digital electronics
connected to it, it simulates Input/Output ports, interrupts, timers, USARTs and all other
peripherals present on each supported processor (Proteus).
Advanced one supports a range of useful functions and features like graph-based
analysis which includes frequency, noise, distortion, Fourier parameters etc. The
software runs on the Windows operating system.
II. CircuitLogix: this is a student version electronics simulation software that enables
performing analog, digital and mixed mode circuit analysis and simulation. It’s a SPICE
simulation software that provides 4000 devices on its student version which is 1/3 of
the pro version. This circuit building software give access to switches, linear IC and
digital IC, FET, Transistors, relays, displays, signal generators, SCR’s, opto isolators,
photo diodes, semiconductors, motors etc. it also works on Windows system.
III. TINA Design Suite: it’s a circuit simulator, circuit designer and PCB design software
package for analyzing, designing, and real time testing of analog, digital, IBIS, HDL,
MCU, and mixed electronic circuits and their PCB layouts. It also analyzes SMPS, RF
and communication and optoelectronic circuits; generates and debugs MCU code using
the integrated flowchart tool; and test microcontroller applications in a mixed circuit
environment
15
2.12 Literature Review Summary
Most of these systems discussed above involved manual operation to some extend and those
automated are too expensive to implement. Their main aim is to protect the vehicle from any
unauthorized access, through entering a protected password and intimate the status of the same
vehicle to the authorize person (owner) using Global System for Mobile (GSM) communication
technology. For instance, Anti-Theft Control System Design Using Embedded Systems
requires the use of a key for it to unlock or lock the engine thus unable to cope with mobility
and can only be controlled within the vicinity due to limited range of operation. Also, for the
Anti-theft GSM based vehicle management systems requires Wi-Fi, the main disadvantage is
that a high-end personal computer is required which increases the cost of installation.
Based on the literature review that had been done, I have learnt that in selecting suitable
components like a GSM, both static and dynamic properties must be considered. These
properties play a significant role in the performance of the specified component or the entire
circuit.
16
CHAPTER THREE
3 METHODOLOGY
3.1 Introduction
This chapter contains the basic flow of methodology and approach for the project. The project
is divided into three parts which are design, construction and testing. Furthermore, the project
comprises of software and hardware parts. The software involves writing code and
programming the microcontroller and debugging to correct any errors in the code. The hardware
implementation involves designing the circuit of the project, constructing and then interfacing
the hardware and the software before testing the project. Each part of the project will be
discussed in details in this chapter.
3.2 Design
3.2.1 Introduction
The design can only be done best by first understanding the objectives of the project through
the block diagram.
17
Power supply Relay
Controller Engine
(Atmega328p)
User phone
Buzzer
Figure 3.1 block diagram of the embedded automobile engine locking system
18
When low pulse is given to base of transistor Q1 transistor, the transistor is turned OFF. Now
12v is given to base of Q2 transistor so the transistor is conducting and buzzer is energized
and produces the sound signal.
19
Figure 3.3 interfacing ATmega328P with relay circuit diagram
20
3.2.2.5 Components performances and Specifications
3.2.2.5.1 Power Supply
Power Supply section is required to convert AC signal to DC signal and also to reduce the
amplitude of the signal. The available voltage signal from the mains is 230V/50Hz which is
an AC voltage, but the required is DC voltage (no frequency) with the amplitude of +5V and
+12V for various applications. The 230V, 50Hz AC mains is stepped down by transformer X1
to deliver a secondary output of 12V, 500 mA. The transformer output is rectified by a full-
wave rectifier comprising diodes D1 through D4, filtered by capacitor C1 and regulated by
ICs 7812 (IC2) and 7805 (IC3). Capacitor C2 bypasses the ripples present in the regulated
supply. LED1 acts as the power indicator and R1 limits the current through LED1.
A power supply can be broken down into a series of blocks, each of which performs a particular
function.
3.2.2.5.1.1 TRANSFORMER
The laminated core transformer is the one used here. This is because of the low frequency
operation. Since the circuit requires 12 V and 300mA to operate, the transformer selected is 240
V to 12V, 500mA step down transformer. This is because the transformer current rating should
21
be slightly above the circuit rated current in order to comfortably handle the power demand. To
get the input current, the transformer equation can be used.
Vp =240V
Vs= 12V
Is= 0.5A
Therefore,
3.2.2.5.1.2 RECTIFIER
Since the aim of using diode is to convert ac to dc, rectifier diode is selected for this purpose.
Each of the four diodes is required to carry the required current of 300mA and withstand a
voltage of at least 12 volts. Therefore, the best diode for this is the one rated just above 300mA
and above 12 volts. Therefore, the ideal diode for this is IN4007. It has a current capacity of 1
ampere and Peak inverse voltage capacity of 1000 volts. Four of them will be used to form a
four-diode bridge rectifier.
22
Figure 3.7 Bridge Rectifier circuit
A smoothing capacitor was used here to generate a ripple free DC. A smoothing capacitor is
also a filter capacitor and it converts the full wave rectified AC output into a smooth DC. The
power rating of the capacitor must be greater than the off load output voltage supply. The ripple
that appears in the capacitor is directly proportional to the load current and inverse to the
capacitive value. The capacitor selected keeps the peak-to-peak values of the ripple minimum
under full load condition. Therefore, knowledge of Ripple factor was essential while designing
the values of capacitors which is given by:
𝒀 = 𝟏⁄𝟒√(𝟑𝒇𝑹𝑪)…………………………………………………Equation 3.1
23
Where: Y= ripple factor
R= resistance calculated
R= V/Ic
C= filtering capacitance
𝑽𝒓
𝑽𝒂𝒄_𝒓𝒎𝒔 =
𝟐
√𝟑…………….……………………………………..Equation 3.3
Therefore, from the above equations, Vr = 5.2-4.8 =0. 4V, Vac-rms = .3464V, Vdc = 5V and
Y=0 .06928. Hence the capacitor value is found out by substituting the ripple factor in equation
3.1 above. Thus, C= 2314 µF and standard 2200µF is chosen
24
3.2.2.5.2 GSM MODULE
GSM (SIM900A) is used as a communication channel to send or receive messages and make
or receive calls just like a mobile phone by using a SIM card of any network provider.
Specification
25
In my case multimeter shows the resistance of 102-ohms (figure 4) but for easy we take 100-
ohms for calculation.
Coil resistance
By using Ohm’s law, we can calculate current required to energized the relay coil
𝑉 =𝐼∗𝑅
𝑉 6
𝐼 = 𝑅 = 100 = 0.06𝐴 = 60𝑚𝐴
As we know that pin of Arduino or any microcontroller cannot handle current more than 40 mA
thus, we have to design a simple switch circuit. The relay switch circuit is shown in figure 6. A
transistor with collector current (IC) bigger than the above calculated value (60mA), is used in
a switching circuit.
We know that
26
ℎ𝑓𝑐 = 𝐼𝑐/𝐼𝑏
So, base current (Ib) can be calculated as;
𝐼𝑐 0.06
𝐼𝑏 = = = 0.0008 = 0.8𝑚𝐴
ℎ𝑓𝑒 75
Minimum current of 0.8mA at base of transistor is required to drive the transistor in conducting
stage.
The base of transistor is connected to signal source (digital pin of Arduino) whose output
voltage is about +5V and current is of about 40mA. Current of 40mA is enough to burnout the
transistor thus we have to use a current limiting resistor.
𝑉𝑜𝑢𝑡 = +5𝑉
𝑉 5
𝑅 𝑟𝑒𝑞𝑢𝑖𝑟𝑒𝑑 = = = 1000 𝑜ℎ𝑚𝑠
𝐼 0.0005
So, roughly we can use resistor of about 1000-ohms.
When the input voltage at base is earthed (i.e. an input of 0 volts). The transistor is reversed
biased and no current flows. The collector current is zero, i.e. no voltage drops at collector. The
voltage at terminal of coil 1 of relay is same as voltage at coil 2 terminal of relay i.e. there is no
potential difference that relay is de-energized.
If the input voltage is given (+5V from arduino board), then there is positive voltage applied to
the base. If this is sufficiently high (say +5V), the transistor is bottomed and the collector
voltage is effectively zero. Hence, relay become energized.
3.2.2.5.4 Buzzer
A 5V Buzzer Module or beeper is used as an audio signaling to create a noise to panic the
culprit, which may be mechanical, electromechanical, or piezoelectric. Typical uses of buzzers
and beepers include alarm devices, timers and confirmation of user input such as a mouse click
or keystroke. Buzzer is an integrated structure of electronic transducers, DC power supply,
27
widely used in computers, printers, copiers, alarms, electronic toys, automotive electronic
equipment, telephones, timers and other electronic products for sound devices. Active buzzer
5V Rated power can be directly connected to a continuous sound.
Specifications:
• Working voltage: 5V
R1 = 1kohm
28
3.2.3 Overall circuit diagram and circuit operation
3.2.3.1 Circuit diagram
29
culprit, followed by sending a message “Alert: INTRUDER DETECTED” through GSM
modem to the owner’s mobile for further action for prevention of his vehicle.
3.3 Construction
3.3.1 Introduction
The physical realization of the project is very vital. The design considerations are put to test.
Here the paper work is transformed into a software and finally into a hardware. After carrying
out all the paper design and analysis, the project was then constructed. The construction at 60%
level was done in two different stages as follows:
3. Breadboard stage
5. Housing
All these components were procured from Nerokas Engineering Solutions whom they offer
high quality component at a cheaper cost. Their delivery cost was also reasonably low as
compared to others and delivery time was less than 24 hours upon placement of the order
30
software. This is an open source and easy-to-use programming tool used for writing code and
uploading to the microcontroller. The programming was based on C and C++ high level
programming languages. An LCD was connected so as to display engine status i.e., when locked
or unlocked.
Simulation testing was first done by loading a hex code from its library to the microcontroller
to activate its operation. The simulation was then run by clicking the run button at the bottom
left corner of the task bar. The password Inputs were changed severally during simulation and
observations on the system working and behavior made. The key idea was to check whether the
system was working as per the command provided by the program loaded to the
microcontroller. The results obtained in simulation by keying the passwords inputs from the
user virtual terminal were then noted if they conform to the functionality of the system.
31
Figure 3.14 shows simulation of the project, when the correct password was entered from the
user phone through the vehicle GSM.
By entering a correct password from the user mobile phone which is send to the vehicle GSM
modem (which is ‘A” in this case), the switching transistor is biased by microcontroller outputs
thus energizing the 12v relays which consequently switched-on the ignition of the engine hence
starts the vehicle. The LCD also displays the status of the engine (Engine unlocked)
32
In contrasts, figure 3.15 show simulation of the project when the wrong password is entered.
If anyone tries to enter the password randomly, then after three trials, the MCU will block
the entry of further password. Then, the buzzer will be turned on to create a noise to panic
the culprit, followed by sending a message “Alert: INTRUDER DETECTED” through
GSM modem to the owner’s mobile for further action for prevention of his vehicle and the
LCD displays the vehicle engine status (i.e., Engine locked)
33
as preliminary stage for checking whether the software simulation results can be reflected in
the prototype.
During soldering process, I divided the circuit into three modules namely; power supply section,
microcontroller section and relay section. This was not only to ensure that there were no short
circuits between these sections but also to provide ease in troubleshooting the circuit and
improve overall performance of the system. Components of each section were soldered as per
the circuit of each section and possibility of short circuits were examined to prevent unnecessary
34
system failure. The figure below shows the circuit implementation on the strip board.
Component’s alignment and positioning are clearly illustrated.
3.3.6 Housing
In designing the case for the system, utmost concern was given to guarding the system from
physical strain and stress during carriage and project presentation. A wooden material was used
for the casing against the glass and metallic material which could easily break and make the
project quite uneconomical, clumsy and heavy respectively. The choice of wooden material was
not only informed by ease of mounting the appliance such as sockets, lamp holder and fan as
well as the sensors and the circuit but also the cost and its availability. Overall circuit size,
sensor sizes as well as appliance to be connected served as guidelines in designing the casing.
The casing was made in a manner that permits easy mounting of the whole circuit board.
After completion of the casing, the system circuit was then mounted keenly in an enclosed
section of the casing ensuring that the surface was free from conducting material which could
lead to short circuiting the components. Sensors and electrical appliances were connected as
peripherals of the circuit using connecting wires. These sensors were ensured to be in a position
of the casing where they can easily detect the room condition without any interference.
35
Figure 3.18 project mounted onto the housing
3.4 Testing
3.4.1 Introduction
Testing is vital process in the development and realization of any design, be it hardware based,
software based or both. Thus in this project testing involves;
The testing procedures adopted were In-Circuit Test (ICT) and Functional Circuit Test (FCT).
ICT involved performance of schematic verification by testing each individual components of
the circuit at a time by comparison against the software model. It was done to detect
construction defects such as solder shorts, missing components, wrong components and open
connections without powering the device under test (DUT). FCT on the other hand are designed
to assure that circuitry functions within specifications. It was carried out in order to detect
functional defects while applying supply power. They reveal issues with digital circuitry like
signal timing (either design or component related) and communication problems and required
thorough understanding of the DUT performance. The components that did not give the
required output specification were isolated and troubleshoot to determine the nature and cause
of the component failure through careful analysis that is examination of the working principles
of the components. Basically most components were tasted using a multimeter.
During the testing phase, continuity test was carried out to ensure that there was proper
communication between components as well as the continuity of the power in the circuit. The
36
board was then powered by connecting it to a laptop via its USB connector cable. A short
program written involving the sensor was then loaded to the microcontroller in the board and
thereafter the GSM was then examined.
After complete coupling of the system, functional circuit test was carried out. The various test
carried out was as follows;
By entering a correct password from the user mobile phone which is send to the vehicle GSM
modem (which is ‘A” in this case), the switching transistor is biased by microcontroller outputs
thus energizing the 12v relays which consequently switched-on the ignition of the engine hence
starts the vehicle. The LCD also displays the status of the engine (Engine unlocked)
Figure 3.19 project diagram when the correct password was entered
In contrast, If anyone tries to enter the password randomly, then after three trials, the MCU
will block the entry of further password. Then, the buzzer will be turned on to create a noise
to panic the culprit, followed by sending a message “Alert: INTRUDER DETECTED”
through GSM modem to the owner’s mobile for further action for prevention of his vehicle
and the LCD displays the vehicle engine status (i.e., Engine locked)
37
Figure 3.20 signalling message when the wrong password is entered.
3.5 Challenges encountered/lessons learned
Like every research and practical engineering work, diverse kinds of challenges and problems
are often encountered. A number of problems and challenges were encountered during the
course of implementing this project. During the construction phase, I had problems with the
GSM. The communication and response time of the GSM dependent on the network subscriber
stability.
The flow of these applications seems to reflect the trajectory of my career from entry level
developer to a qualified circuit developer. This has enabled me gain a thorough understanding
of the design and the construction of the project.
In this section, the objectives of the project are compared with what has been done in order to
determine whether the objectives were either met or not. The deliverables achieved were as
follows:
1. Literature review was conducted on existing vehicle security systems. Analysis and
limitations of these systems was also done in order to design a system which fits in the
gap created by those limitations.
2. A circuit that controls the operation of the vehicle was designed and simulated using
Proteus software. Calculations were done to select the circuit components
5. Testing and analysis of the fully constructed prototype was also done.
38
3.7 Project costing
8 Diode 1N4007 1 10 10
10 Relay 2 50 100
11 Capacitors 3 10 30
12 Resistors 5 10 50
13 Transistors BC547 3 5 15
21 Header pin 2 30 60
22 Led 2 10 20
23 28 pin IC socket 1 20 50
39
24 Housing 500
Time Management is essentially the ability to organize and plan the time spent on activities
in a day. The result of good time management is increased effectiveness and productivity. It
is a key aspect of project management and involves skills such as planning, setting goals and
prioritizing for a better performance.
Simulation
60 % presentation
Prototype design
100% presentation
40
3.9 Conclusion
It is evident from this project work that, this is a unique method of designing and assembling
an individual, compact theft control system for an automobile. This instrument is an ultimate
threat to vehicle thieves. By installing this instrument in the automobile engine, it is very
difficult to access by an unknown person, since it is based on GSM Technology. In future,
there is no doubt, that all of the vehicles will be embedded with this unique kit. In addition to
the above features, we can also add extra features like thumb/face recognition to ascertain more
security of the vehicle.
3.10 Recommendations
In this project I used a GSM system to communicate my password between the vehicle and
myself. Therefore, for better optimization to avoid network failures, I recommend the use of
ZIGBEE technology which does not require a subscriber and can only work when the
transmitter is at least 50m away from the vehicle with a broadband network of 2.4GHZ.
41
References
D. Gurunath, Dr. Sreeja Mole S. vehicle theft detection by GSM. International Journal of
Computer Applications (0975 – 8887), Volume 62– No.6, 2018.
S. TAO. Mobile Phone‐based Vehicle Positioning and Tracking and Its Application in Urban
Traffic State Estimation. Licentiate Thesis, KTH Royal Institute of Technology Stockholm,
Sweden. 2012.
P. Verma, J.S. Bhatia. Design and Development of GPS-GSM based tracking system with
Google Maps Based Monitoring. International Journal of Computer Science, Engineering and
Applications (IJCSEA) Vol.3, No.3, June 2013.
Samir Rana, Ritu Mewari, Lata Nautiyal. Anti-theft GSM based vehicle management
systems. IOSR Journal of Electrical and Electronics Engineering (IOSR-JEEE) e-ISSN:
2278-1676,p-ISSN: 2320-3331, Volume 11, Issue 3 Ver. IV. 2018.
D. Rani, R. K. Reddy. Raspberry Pi Based Vehicle Tracking and Security System For Real
Time Applications. Paper ID: 34386891. 2016.
Vinoth Kumar Sadagopan. Smart Surveillance Monitoring System using Raspberry pi and pir
sensor. International Journal of Innovative Research in Advanced Engineering (IJIRAE)
ISSN: 2349-
2163. Issue 04, Volume 4. 2011.
J. Abdullah. The Design of Mobile Control Car Security System. IACSIT International
Journal of Engineering and Technology, Vol.3, No.3. 2011.
42
Wankhade, P.P, Dahad, S.O., 2011. Real time vehicle locking and tracking system using
GSM and GPS technology-an anti-theft system. International Journal of Technology And
Engineering System (IJTES), 2(3), pp.272-275.
Odonkor, E.N. and Ofosu, W.K., 2020. Design and Construction of Vehicle Loading
Monitoring System Using Load Sensor and GSM. International Journal of Applied, 10(1).
43
APPENDICES
44
APPENDIX A2: Transistor load line characteristics
45
APPENDIX B1: Atmega328p Datasheet
28-pin PDIP
#include <LiquidCrystal.h>
const int rs = A5, en = A4, d4 = A3, d5 = A2, d6 = A1, d7 = A0;
LiquidCrystal lcd(rs, en, d4, d5, d6, d7);
#include <SoftwareSerial.h>
SoftwareSerial Serial1(11, 12);
int engine = 13;
int X = 0;
int buz = 2;
int r = 0;
int s = 0;
int q = 0;
int Z =0;
void setup() {
46
// put your setup code here, to run once:
Serial.begin(9600);
Serial1.begin(9600);
lcd.begin(16, 2);
pinMode(engine, OUTPUT);
pinMode(buz, OUTPUT);
digitalWrite(engine, LOW);
}
void loop() {
// put your main code here, to run repeatedly:
lcd.setCursor(0, 0);
lcd.print("ENGINE STATUS:");
if (Serial1.available() > 0) {
char inByte = Serial1.read();
Serial.write(inByte);
}
if(inByte == 'B'){
r=1;
}
47
if(inByte == 'C'){
s=1;
}
if(inByte == 'D'){
q=1;
}
if( r == 1&s==1&q==1&Z==0) {
lcd.setCursor(0, 1);
lcd.print("LOCKED.");
digitalWrite(buz, HIGH);
Serial.print("INTRUDER DETECTED.");
delay(2000);
Z = 1;
digitalWrite(buz, LOW);
}
}
}
48