SlideShare a Scribd company logo
1
Chapter-1
Introduction
1.1 SCOPE AND OBJECTIVES
In Recent Innovations Automobiles, contains many digital control systems as
technology is growing faster. Recently released Vehicles have many Electronic Control
Systems and Electronic Control Units embedded in it. The growth in automotive electronics
resulted that many parties of the buyers and customers wish to have a better safety along
with good comfort and also many other luxurious and saving features like improved
emission control and also reduced fuel consumption. There are many other messaging
protocols used in vehicles but some automotive industries uses Controller Area Network
(CAN) as an in-vehicle network for the purpose of Engine Management, for the body
electronics like door as well as roof control, air conditioning, lighting and for the
entertainment control. Now-a-days almost many car manufacturing companies have started
implementing the CAN based vehicle automation system.CAN networks are used for the
engine management to interconnect several Electronic Control Units’.
Figure1.1:-Different Features present in a modern car
2
Existing System Proposed System
 In existing system, there is no remote
car locking system implemented.
 Only for the purpose avoiding the car
steeling this system used.
 Also there is no possible ways for
finding the position of car after theft.
Drawbacks
 There is no wireless system for data
transfer.
 Finding location of car after theft is
not possible.
 There is no remote controlling
process of car.
 In this system, CAN protocol is
implemented for Communication.
 GSM and GPS technology will help
for locating the car.
 Remote controlling and locking is
possible here.
Advantages
 Very effective method to avoid form
being theft.
 Without car owner awareness no one
can start the engine.
 Very fast response over control
remotely.
1.2 WORKING PRINCIPLE:
a. In proposed system whenever the vehicle is started by a person, a message with the GPS
coordinate along with the location of the vehicle will be sent as an SMS to the vehicle
owner’s number.
b. On receiving the message the vehicle owner will send a reply to lock or antilock that is
stop the vehicle or allow the vehicle to run.
c. The system at first checks and verifies the owner number and if exact it checks the SMS
sent and performs the corresponding action.
d. All this process is achieved through in vehicular network, CAN.
e. When the car engine is started it sends the information to the Master node in CAN which
in turn fetches the location coordinates attached with it and generates the SMS. On
receiving locking or anti-locking code it sends the respective command to the slave node
which takes the intended action.
3
Figure 1.2:-flowchart for working Principle
4
Chapter-2
Controller Area Network (CAN) Overview
2.1. CAN HISTORY
Bosch has developed the CAN in 1985 for in-vehicular communication. Before
days, automotive manufacturers have connected all electronic devices in vehicles using
point-to-point wiring systems respectively. Manufacturers have started using more
electronic units in vehicles, which have got resulted in bulk of wire connections that were
heavy and also very expensive. Then they have replaced wiring with in-vehicle networks,
which in turn reduced wiring cost, weight and complexity. CAN is a highly integrated serial
bus system for networking the intelligent devices, which has emerged as the standard in-
vehicle network. The automotive industry has quickly adopted CAN and in 1993 it became
the international standard known as ISO 11898.from 1994, many higher-level protocols
been standardized based on CAN. Many Other markets have been widely adopted these
additional protocols, which are now main standards for industrial communications.
2.2. CAN & ITS ADVANTAGES
LOW-COST AND LIGHTWEIGHT NETWORK
This decreases overall cost and weight in automobiles. An advantage to this is that
electronic control units (ECUs) can have a single CAN interface rather than Analog and
digital inputs to every device in the system. CAN provide inexpensive, durable network
which helps multiple CAN devices to communicate with one another.
BROADCAST MECHANISM FOR COMMUNICATION
All devices on the network see all transmitted messages. Each of the devices on the network
has a CAN controller chip and is therefore intelligent. This structure allows modifications to
CAN networks with minimal impact. Each device can decide if a message is relevant or if it
should be filtered. Additional non-transmitting nodes can be added without modification to
the network.
PRIORITYASSIGNMENT
This arbitration is non-destructive and results in non-interrupted transmission of the highest
priority message. Every message has a priority, so if two nodes try to send messages
simultaneously, the one with the higher priority gets transmitted and the one with the lower
priority gets postponed.
5
ERROR HANDLING CAPABILITIES
Frames with errors are disregarded by all nodes, and an error frame can be transmitted to
signal the error to the network. The CAN specification includes a Cyclic Redundancy Code
(CRC) to perform error checking on each frame's contents. Global and local errors are
differentiated by the controller, and if too many errors are detected, individual nodes can
stop transmitting errors or disconnect itself from the network completely.
Figure 2.2 CAN networks will significantly reduce wiring
2.3. APPLICATIONS OF CAN
In addition, you can find CAN buses in many aerospace applications, ranging from in-flight
data analysis to aircraft engine control systems such as fuel systems, pumps, and linear
actuators. Medical equipment manufacturers use CAN as an embedded network in medical
devices. You can find CAN on different levels of the multiple networks within these
vehicles – for example, in linking the door units or brake controllers, passenger counting
units, and more. Lifts and escalators use embedded CAN networks, and hospitals use the
CAN open protocol to link lift devices, such as panels, controllers, doors, and light barriers,
to each other and control them. CAN open also is used in nonindustrial applications such as
laboratory equipment, sports cameras, telescopes, automatic doors, and even coffee
machines. Railway applications such as streetcars, trams, undergrounds, light railways, and
long-distance trains incorporate CAN.
6
In fact, some hospitals use CAN to manage complete operating rooms. Hospitals control
operating room components such as lights, tables, cameras, X-ray machines, and patient
beds with CAN-based systems. CAN also have applications in aircraft with flight-state
sensors, navigation systems, and research PCs in the cockpit. CAN was first created for
automotive use, so its most common application is in-vehicle electronic networking.
However, as other industries have realized the dependability and advantages of CAN over
the past 20 years, they have adopted the bus for a wide variety of applications.
2.4 TERMINOLOGY OF CAN
All CAN devices will send data across CAN networks in the form of packets called frames.
And a CAN frame will have following sections.
 Frame -- Frames also are referred to as messages. An entire CAN transmission has
arbitration ID, data bytes, acknowledge bit.
Figure 2.4.1:-Frame Format of CAN.
 SOF (start-of-frame) bit –it always indicates the beginning of a message with a
dominant bit that is logic 0.
 Arbitration Mechanism ID –. Frames will come in two formats -- standard, which
uses a 11-bit arbitration ID, and will be extended, which always uses a 29-bit arbitration
ID and also it identifies a message will indicate the message's priority
 Identifier Extension bit – it allows to diffrentiate between standard and the extended
frames.
 CAN Data Field – it will contain 0 to 8 bytes of data.
 Data Length Code(DLC) –it indicates the no of bytes that the data field will contain.
 Remote Transmission request bit – the recessive RTR bit that is (logic 1) will indicate
a remote frame. A dominant RTR bit that is (logic 0) will indicate a data frame. It also
serves to differentiate a remote frame from the data frame.
 cyclic redundancy check(CRC) – it contains 15-bit cyclic redundancy check code and
a recessive delimiter bit and the CRC field is used for the error detection.
 Acknowledgement slot(ACK)– any CAN controller which receives the message will
send ACK bit at the end of a message. Therefore the transmitting node will check the
7
presence of the ACK bit on bus and will attempt transmission again if there is no
acknowledgement is detected.
In below figure six channels that contained in the data field of a single CAN frame. Here
each signal contains 8 bits of data.
Figure 2.4.2:- Defining Signals inside the CAN frame.
2.5 HOW THE COMMUNICATION IN CAN WORKS
There is no master control when individual nodes have access to read and write data on
CAN bus. CAN will be peer-to-peer network. When CAN node is ready to transmit data, it
checks to see whether bus is busy and then it simply writes a CAN frame onto network. The
CAN frames transmitted has no addresses of either the transmitting node or receiving
nodes. An arbitration ID that is unique throughout the network labels the frame.
All nodes on the CAN network will receive the CAN frame, depending on the arbitration ID
of that transmitted frame, each CAN node on the network decides whether to accept the
frame. If multiple nodes try to transmit a message on to the CAN bus at a time, the node
with the highest priority (lowest arbitration ID) will automatically get bus access.
Nodes with Lower-priority should wait until bus become available before trying to transmit
again.
8
Figure 2.5:- CAN will contain inbuilt priority for the messages to avoid conflicts.
9
Chapter-3
Design and Implementation
Figure 3.1:- Module Block diagram
CAN Controller
PIC16F877A
PIC16F877A
CAN Controller
Power Supply
CAN
Bus
CANH
CANL
PIC16F877A
CAN Transceiver
CAN Transceiver
LCD
Relay Driver
DC Motor
MAX
232 GSM Modem
MAX
232 GPS Receiver
10
Figure 3.2:-Port Connections
11
3.1 REQUIREMENTS
3.1.1 HARDWARE REQUIREMENTS
 Power Supply
 PIC16F877A Controller
 SIMCOM GSM board
 GPS Receiver board
 Liquid Crystal Display module
 CAN Controller and CAN Transceiver
 Alarm
 DC Motor
 MAX232
3.1.2 SOFTWARE REQUIREMENTS
 Embedded C.
 KEIL compiler
3.2 APPLICATIONS
 It’s Very efficient way to avoid vehicle theft.
 It can be applied in all vehicles.
 One of the Easy way to trace the location of car when theft.
 Engine can be put to Off State through wireless.
12
Chapter-4
Overview of Hardware and Software
4.1. PIC16F887MICROCONTROLLER – DEVICE OVERVIEW
4.1.1. PIC16F877A INTRODUCTION
PIC16F877A is very convenient to use where coding, programming is easier. Main
advantage is it can write-erase because it uses FLASH memory technology. It has a number
of 40 pins where 33 pins for input and output. It contains many applications in
digital electronics circuits.
Figure 4.1.1:-PIC16F877A Microcontroller
13
4.1.2 FEATURES OF MICROCONTROLLER -PIC16F877A
PIC16F877A series has advanced features compared to its previous series where important
features of PIC16F877A series are stated below.
4.1.2.1 GENERAL FEATURES OF PIC
o types of addressing modes such as direct, Indirect, relative addressing modes.
o Power on Reset (POR).
o Power-Up Timer and the oscillator start-up timer.
o Low power and high speed CMOS flash EEPROM.
o Full static design.
o Wide range of operating voltages (2.0 – 5.56) volts.
o High sink and source current (25mA).
o Commercial, industrial and extended temperature ranges.
o power consumption is Low and has High performance RISC CPU.
o contains 35 simple word instructions.
o Interrupt capability is up to 14 sources.
o contains 368×8bit of RAM, 256×8 of EEPROM, 8k×14 of flash memory.
4.1.2.2. PERIPHERAL FEATURES OF PIC
o Timer 0: 8 bit timer/counter that is pre-scalar.
o Timer 1:16 bit timer/counter which is pre-scalar.
14
o Timer 2: is 8 bit timer/counter contains 8 bit period registers which will be pre-scalar
and post-scalar.
o 10bit multichannel Analog to Digital converter
o Synchronous Serial Port along with SPI (master code) and with I2C (master/slave).
o USART with 9 bit address detection capability.
o Parallel Slave Port that is 8 bit wide with the external RD, WR and CS controls.
4.1.2.3. KEY FEATURES OF PIC
o Maximum operating frequency is up to 20MHz.
o Flash program memory is 8KB.
o Data memory is up to 368.
o EEPROM data memory is up to 256.
o 5 in/out ports.
o contains 3 timers.
o there are 2 CCP modules.
o contains 2 serial communication ports i.e (MSSP, USART).
o PSP is parallel communication port
o 10bit A/D module i.e with 8 channels
15
4.1.2.4. ANALOG FEATURES OF PIC
o has 10bit, up to 8 channel A-D converter.
o contains Brown Out Reset function.
o Analog comparator module is present.
4.1.2.5 SPECIAL FEATURES OF PIC
o capable of 100000 times erase and write cycle enhanced memory.
o capable of 1000000 times erase/write cycle data EEPROM memory.
o Self programmable under the software control.
o In-circuit serial programming, in-circuit debugging capability.
o has Single 5V, DC supply for circuit serial programming
o Programmable code protection is present.
o Power saving sleep modes.
o Selectable oscillator options.
16
4.1.3 PIN CONFIGURATION OF PIC16F877A
There are 40 pins in this microcontroller IC. It has two 8 bit and one 16 bit timer
respectively. Capture and compare modules, serial ports, parallel ports and 5 input/output
ports are also present in it.
Figure 4.1.3:- Pin diagram of PIC16F877A Microcontroller
17
4.1.4 DESCRIPTION OF PORTS IN PIC16F877A
PIC16F877A has 5 input and output ports. They are usually denoted by PORT A, B, C, D
AND E i.e (R A (RB) (RC) (RD) and (RE). These ports are all used for input and output
interfacing. In the controller, “PORT A” is 6 bits wide (RA-0 to RA-7), ”PORT B” ,
“PORT C”,”PORT D” will be8 bits wide (RB-0 to RB-7,RC-0 to RC-7,RD-0 to RD-7),
”PORT E” is 3 bit wide (RE-0 to RE-7).All the ports are all bi-directional ports. The
direction of port will be controlled by using TRIS(X) registers (TRIS A to set the direction
of PORT-A, TRIS B will set the direction for PORT-B, etc.). Setting TRIS(X) bit ‘1’ will
set a corresponding PORT(X) bit as an input. Clearing TRIS(X) bit ‘0’ will set the
corresponding PORT(X) bit as the output .If we want PORT A as input, just set the
TRIS(A) bit to logical ‘1’ and if we want to set PORT B as an output, just set the PORT B
bits to the logical ‘0’.
o AN0 TO AN7 (Analog input port): these ports are used for interfacing analog inputs.
o TX, RX: These are the USART transmission and reception ports.
o SCK: these pins are used for giving a synchronous serial clock input.
o SCL: these pins act as an output for both modes SPI and I2C.
o DT: synchronous data terminals.
o CK: synchronous clk input.
o SD0: SPI data output.
o SD1: SPI Data input.
o SDA: data input and output in I2C Mode.
o CCP1 and CCP2: these are capture, compare, PWM modules.
o OSC1: oscillator input and external clock.
18
o OSC2: oscillator output or clock out.
o MCLR: master clr pin (Active low reset).
o Vpp: is programming voltage input.
o THV: High voltage test mode controlling pin.
o Vref (+/-): is reference voltage.
o SS: Slave select used for the synchronous serial port.
o T0CK1: indicates clock input to TIMER 0.
o T1OSO: indicates Timer 1 oscillator output.
o T1OS1: indicates Timer 1 oscillator input.
o T1CK1: indicates clock input to Timer 1.
o PGD: is Serial programming data.
o PGC: will be serial programming clock.
o PGM: is Low Voltage Programming input.
o INT: is an external interrupt.
o RD: will be Read control for parallel slave port.
o CS: is the Select control for parallel slave.
o PSP0 to PSP7: are Parallel slave ports.
o VDD: is positive supply for logic and input pins.
19
o VSS: is Ground reference for logic and input or output pins.
4.1.5 PROGRAMING THE PIC16F877A
we have 5 input and output ports such as PORTA, PORTB, PORTC, PORTD, PORT E
which can be digital and also analog configured based on our requirements. In the case of
analog mode, ports can only act as inputs. There is a built in A/D converter used in such
cases. Multiplexer circuits are used in digital mode. We can configure the ports as output or
as input through programming. There is a register named as ‘TRIS’ which controls the
direction of ports. For different ports there are different registers such as TRISA, TRISB
etc. If we set a bit of the TRIS register to 0, then corresponding port bit will act as the
digital output. If we set a bit of the TRIS register to 1, then corresponding port bit will act as
the digital input. We use MP LAB IDE for programming and Proteus for Designing.
4.2 GSM MODULE
we use GSM modem for sending the information to the monitoring section as a message if
the buses are arrived at the bus stop. In monitoring section we have another GSM modem to
receive the message and upload the message in internet via max232.SIM908 module is a
Quad Band GSM and GPRS module which combines the GPS technology for the satellite
navigation. The compact design which has integrated GPRS and GPS in the SMT package
will save time and cost .Featuring an industry standard interface and a GPS function; it
allows variable assets to be tracked seamlessly at any location and anytime with signal
coverage.
4.2.1. GENERAL FEATURES OF GSM MODULE
o Uses Quad Band
o Operating at 850/900/1800/1900 MHz
o Has GPRS multi slot
o Is class 10
o GPRS mobile station is class B
o Will be Compliant to GSM phase 2/2+
o Is Class 4 (2 W @850/900 MHz)
o Is Class 1 (1 W @ 1800/1900MHz)
20
o Has Dimensions: 30 x 30 x 3.2 mm
o Has Weight: 5.2 g
o Will Control via AT commands (GSM 07.07 ,07.05 and SIMCOM enhanced AT
Commands)
o Contains SIM application toolkit
o Supply voltage range for GPRS: 3.2 ~ 4.8 V,GPS: 3.0 ~ 4.5V
o Has Low power consumption
o Its Operation temperature: 40°
o Has C to +85 °C
4.2.2 GSM SPECIFICATIONS FOR DATA TRANSFER
o Has GPRS class 10: max. 85.6 kbps (downlink)
o Is PBCCH support
o Uses Coding schemes CS 1, 2, 3, 4
o Has CSD up to 14.4 kbps
o Will be USSD
o Is Non transparent mode
o Has PPP stack
o Is Integrated TCP/IP stack
4.2.3 GSM SPECIFICATIONS FOR SMS VIA GSM/GPRS
o Will have Point to point MO and MT
o Uses SMS cell broadcast
o Contains Text and PDU mode
4.2.4 GSM SPECIFICATIONS FOR GPS
o Is Receiver type
o Has 42channel
o Will have GPS L1 C/A code,
o Gives High performance
o Has STE engine
o Has Sensitivity
o Obtains Tracking: 160
o Uses dBm
21
o Will have Cold starts: 143
o Uses Time To First Fix
o Has Accuracy Horizontal position : <2.5m CEP
o Uses Power consumption (GSM engine in idle mode)
o Has Acquisition 77mA
o Tracking 76mA
4.2.5 GSM SPECIFICATIONS FOR VOICE
o Is Tri codec
o Has Half rate (HR)
o Has Full rate (FR)
o Is Enhanced Full rate (EFR)
o Has Echo cancellation
o Will be Hands free
o Uses operation (Echo suppression)
4.2.6 GSM INTERFACES
o Will have 80pad
o Will be with SMT type
o Is Interface to external SIM 3V/ 1.8V
o Has Dual analog audio interfaces
o Contains RTC backup
o uses SPI interface
o has Serial interface and debug interface for GSM/GPRS
o will have Debug interface for GPS NMEA information output
o has Two separate antenna connectors for GSM/GPRS&GPS
22
4.3. MAX232 OVERVIEW
It is used to convert the voltage level during communicate the data with microcontroller and
Personal Computer. Here message will be transmitted to the monitoring section via GSM
modem. To give the information to the GSM modem we are going for the max232. In this
project the position of the robot, the detection of the cracks will be send as the message to
the monitoring section.Max232 is designed by the Maxim Integrated Products. This IC has
been widely used in RS232 Communication in which the voltage level conversion is
required to make the TTL devices compatible with PC serial port. This chip will contain
charge pumps that pump the voltage to Desired Level. It can also be powered by single +5
volt power supply and output can be reached to +_7.5 volts.MAX232 will come with 16 Pin
Dip and other packages contain Dual Drivers. It is used as a hardware layer convertor for
two systems to communicate simultaneously.Max232 is to be used in most of the problems
of signal voltage level conversion.
Figure 4.3:- Pin Diagram of MAX 232 IC
23
4.3.1 CONSTRUCTION OF MAX232 IC
MAX232 will be used in 16-pin DIP package. It has three major blocks .It can be powered
by 5 volts to make compatible with most of the embedded systems. First block is voltage
doubler, In this IC, switched capacitor techniques is used to make the voltage double .Once
the voltage is doubled second block will convert that voltage to +10 and -10. The third
block consists of 2 transmitters and 2 receivers which actually convert the voltage levels.
Figure 4.3.1.1:-Internal Circuit of MAX232 IC
24
4.3.2 APPLICATION AND USES OF MAX232 IC
MAX232 is used for Serial communication. Here Problem arises when we have to
communicate between TTL logic and CMOS logic based systems. In TTL logic 0 is defined
is by 0 volt and 1 is defined by 5 volt so in this scenario this is a very handy IC to be
incorporated. RS232 is internationally defined standard named as EIA/TIA-232-E and in
this standard logic 0 is the voltage between +3 to +15 and logic 1 is defined as the voltage
between -3 to -15.
4.4 GPS RECIEVER MODULE
The GPS a satellite navigation system that will location, time information in all weather,
anywhere on the Earth, where there is an unobstructed line of sight to 4 or more GPS
satellites. It has been maintained by United States government which will be freely
accessible to any individual with a GPS receiver.GPS receivers will receive almanac data
from the satellite and calculate the position by calculating its distance from the visible
satellites and by using method called triangulation it will calculate its position. The data is
configured according to the standards set up by National Marine Electronics Association
(NMEA) and is serially transmitted at the baud rate of 4800 bps. The NMEA has developed
the standards that will describe the interface between various marine electronic
equipments. The standards allow the marine electronics to send information to the
computers and to other marine equipments.
Figure 4.4:-GPS Receiver
25
4.5 DC MOTOR OVERVIEW
A DC motor has been designed to run on DC electric power. Two examples of pure DC
designs will be Michael Faraday's homo polar motor, and a ball bearing motor. The
common DC motor types are brushed and brushless types, which will use internal and
external commutation to create an oscillating AC current from DC source so they will not
be purely DC machines.
Figure 4.5:- Construction of DC Motor
26
4.6. LCD DISPLAY
LCD display is an electronic display module and is commonly used in various devices and
circuits. These are easily programmable and economical which has no limitation of
displaying special and also even custom characters animations. A 16x2 LCD will mean that
it will display 16 characters per line and has 2 such lines. In the LCD each character will be
displayed in 5x7 pixel matrix. This LCD has 2 registers, Command and Data. The command
register will store the command instructions where command is an instruction given to the
LCD to do a predefined task such as initializing, clearing, setting the position of cursor,
controlling display etc. The data register will store data that is to be displayed on the LCD
which will be an ASCII value.
Figure4.6:-16x2LCD interfacing with PIC16F877A
27
Table 4.6:-LCD PIN DESCRIPTION
Pin No Pin Function Pin Name
1 (0V) Ground Ground pin
2 5V (4.7V – 5.3V) Supply voltage Vcc pin
3 Contrast adjustment through a variable resistor VEE pin
4
when low Selects command register; and when high data
register
Register Select
pin
5 Low is to write to the register; High is to read from the register Read/write pin
6 It Sends data to data pins when the high to low pulse is given Enable pin
7
These are 8-bit data pins
DB0
8 DB1
9 DB2
10 DB3
11 DB4
12 DB5
13 DB6
14 DB7
15 (5V)Backlight VCC LED+
16 (0V)Backlight Ground LED-
28
4.7 SOFTWARE REQUIREMENTS
4.7.1 MPLAB IDE
It is called as Integrated Development Environment, because it provides a single integrated
"environment" to develop code for embedded microcontrollers. MPLAB X IDE is software
that runs on a PC to develop applications for Microchip microcontrollers and digital signal
controllers. Unlike previous versions of the MPLAB IDE which were developed completely
in-house, MPLAB X IDE is based on the open source Net Beans IDE from Oracle. MPLAB
X Integrated Development Environment has brought many changes to PIC microcontroller
development tool chain. This path allowed us to add frequently requested features quickly
and easily, also providing much more extensible architecture to bring even more new
features in the future.
4.7.2 PROTEUS
Proteus is software for simulation of microprocessor, schematic capture, and also for PCB
design which has developed by Lab Center Electronics. It combines the ISIS schematic
capture and the ARES PCB layout programs in order to provide powerful, integrated tools
for a professional PCB Design. Here more advanced routing modes are also included in
Proteus PCB Design Level 2 and higher whilst simulation capabilities can be enhanced by
purchasing the Advanced Simulation option and/or micro-controller simulation capabilities.
Using this Proteus software a simulated connection can be given between the components
and tested before fetching the code into the Controller.
29
Appendices
MASTER NODE
#include<htc.h>
#include"lcd_sub.c"
#include"uart_sub.c"
#include"spi.c"
#include"can.c"
#include"gps.c"
#define sw RB2
#define mot RB7
unsigned int q1;
void main()
{
TRISD=0X00;
TRISB=0X06;
TRISC6=0;
TRISC7=1;
TRISC3=0;
TRISC4=1;
TRISA5=1;
TRISC5=0;
TRISE=0x00;
ADCON1=0x02;
30
mot=0;
init();
lcdcmd(0x80);
strr("CAN ");
delay(10000);
lcdcmd(0xc0);
delay(10000);
strr("MASTER ");
delay(65000);
delay(65000);
lcdcmd(0x01);
while(1)
{
uart_init();
gps_check();
TXSTA=0X00;
RCSTA=0X00;
lcdcmd(0x80);
strr(&d);
lcdcmd(0xc0);
strr(&s);
if(sw==0)
{
31
while(sw==0);
mot=1;
q1=0;
do
{
uart_init();
gps_check();
TXSTA=0X00;
RCSTA=0X00;
lcdcmd(0x80);
strr("ENGINE ON ");
delay(10000);
spi_init();
can_init();
can_tx();
delay(65000);
delay(65000);delay(65000);
delay(65000);delay(65000);
}while(q1!=100);
}
//while(1);
}
}
32
SLAVE NODE
#include<htc.h>
#include"lcd_sub.c"
#include"uart_sub.c"
#include"spi.c"
#include"can.c"
#include"gsm.c"
#define gs RB2
#define mot RB3
#define buz RB4
void main()
{
unsigned char h;
TRISD=0X00;
TRISB=0X00;
TRISC6=0;
TRISC7=1;
TRISC3=0;
TRISC4=1;
TRISA5=1;
TRISC5=0;
TRISE=0x00;
ADCON1=0x02;
33
gs=0;mot=0;
buz=1;
init();
lcdcmd(0x80);
strr("CAN ");
delay(10000);
lcdcmd(0xc0);
delay(10000);
strr("SLAVE ");
delay(65000);
delay(65000);
lcdcmd(0x01);
spi_init();
while(1)
{
can_init();
can_rx();
mot=1;
uart_init();
lcdcmd(0x80);
strr("sms sending....");
34
gsm_send();
lcdcmd(0x80);
strr("message send");
gs=1;
delay(100);
RCSTA=0X90;
do
{
h=rx();
lcddata(h);
}while(h!='+');
mot=0;
buz=0;
lcdcmd(0x80);
strr("VEHICLE THEFT");
lcdcmd(0xc0);
strr("ENGINE OFF");
gsm_send1();
while(1);
}
}
35
References
[1] A. Saad and U. Weinmann, “Automotive software engineering and concepts,” GI.
Jahrestagung., vol. 34, pp. 318–319, 2003.
[2] E. Nickel, “IBM automotive software foundry,” in Proc. Conf. Comput. Sci. Autom.
Ind., Frankfurt, Germany, 2003.
[3] M. Wolf, A. Weimerskirch, and T. Wollinger, “State of the art: Embedding security in
vehicles,” EURASIP J. Embedded Syst., vol. 2007, no. 5, p. 1,2007.
[4] R. Charette, This Car Runs on Code. [Online]. Available: http://www.
spectrum.ieee.org/feb09/7649
[5] T. Nolte, H. Hansson, and L. L. Bello, “Automotive communications-past, current and
future,” in Proc. IEEE Int. Conf. Emerging Technol. Factory Autom., 2005, vol. 1, pp. 992–
999.
[6] K. H. Johansson, M. Torngren, and L. Nielsen, “Vehicle applications of controller area
network,” in Handbook of Networked and Embedded Control Systems. New York, NY,
USA: Springer-Verlag, 2005, pp. 741–765.
[7] T. Hoppe and J. Dittman, “Sniffing/replay attacks on CAN buses: A simulated attack on
the electric window lift classified using an adapted CERT taxonomy,” in Proc. Conf.
Embedded Syst. Security, 2007, pp. 1–6.
[8] T. Hoppe, S. Kiltz, and J. Dittmann, “Security threats to automotive CAN networks—
Practical examples and selected short-term countermeasures,” Rel. Eng. Syst. Safety, vol.
96, no. 1, pp. 11–25, Jan. 2011.
[9] K. Koscher et al., “Experimental security analysis of a modern automobile,”
in Proc. IEEE Security Privacy. Symp., Oakland, CA, USA, 2010,pp. 447–462.
[10] The EVITA project, 2008, Webpage. [Online]. Available: http://evita-project.org
[11] H. Schweppe, Y. Roudier, B. Weyl, L. Apvrille, and D. Scheuermann, “Car2X
communication: Securing the last meter—A cost-effective approach for ensuring trust in
36
Car2X applications using in-vehicle symmetric cryptography,” in Proc. Conf. Veh.
Technol., San Francisco, CA, USA, 2011, pp. 1–5.
[12] H. Schweppe et al., “Securing Car2X applications with effective hardware Software
co-design for vehicular on-board networks,” in Proc. Conf. Autom. Security, Berlin,
Germany, 2011.
[13] D. K. Nilsson, U. E. Larson, and E. Jonsson, “Efficient in-vehicle delayed
data authentication based on compound message authentication codes,” in Proc. Conf. IEEE
68th Int. Conf. Veh. Technol., Calgary, BC, Canada, 2008, pp. 1–5.
[14] B. Groza and S. Murvay, “Efficient protocols for secure broadcast in controller area
networks,” IEEE Trans. Ind. Informa., vol. 9, no. 4,pp. 2034–2042, Nov. 2013.

More Related Content

What's hot

Controller area network protocol
Controller area network protocolController area network protocol
Controller area network protocol
Sneha Nalla
 
CAN (Controller Area Network) Bus Protocol
CAN (Controller Area Network) Bus ProtocolCAN (Controller Area Network) Bus Protocol
CAN (Controller Area Network) Bus Protocol
Abhinaw Tiwari
 
Controller area network (can bus)
Controller area network (can bus)Controller area network (can bus)
Controller area network (can bus)
nassim unused
 
DefCamp 2013 - In vehicle CAN network security
DefCamp 2013 - In vehicle CAN network securityDefCamp 2013 - In vehicle CAN network security
DefCamp 2013 - In vehicle CAN network securityDefCamp
 
Communication stack
Communication stackCommunication stack
Communication stack
Medhat HUSSAIN
 
Automotive Networks : A Review
Automotive Networks : A ReviewAutomotive Networks : A Review
Automotive Networks : A Review
IJAEMSJORNAL
 
Controller area network
Controller area networkController area network
Controller area network
Craig Kielb
 
CAN, BY MD.ABDULLAH
CAN, BY MD.ABDULLAHCAN, BY MD.ABDULLAH
CAN, BY MD.ABDULLAH
sameer abdullah
 
Controller Area Network (CAN) Protocol || Automotive Electronics || Hariharan K
Controller Area Network (CAN) Protocol || Automotive Electronics || Hariharan KController Area Network (CAN) Protocol || Automotive Electronics || Hariharan K
Controller Area Network (CAN) Protocol || Automotive Electronics || Hariharan K
Hariharan Krishnan
 
Wolf etal securebus kom syst
Wolf etal securebus kom systWolf etal securebus kom syst
Wolf etal securebus kom syst
jueja
 
Canbus presentation
Canbus presentationCanbus presentation
Canbus presentation
Kurt von Ahnen
 
Accident avoidanve using controller area network protocol
Accident avoidanve using controller area network protocolAccident avoidanve using controller area network protocol
Accident avoidanve using controller area network protocol
Madhuri Apar
 
AUTOSAR 403 CAN Stack
AUTOSAR 403 CAN StackAUTOSAR 403 CAN Stack
AUTOSAR 403 CAN Stack
Rania Nabil
 
Design flow for Controller Area Network systems
Design flow for Controller Area Network systemsDesign flow for Controller Area Network systems
Design flow for Controller Area Network systems
Alexios Lekidis
 
Controller Area Network (Basic Level Presentation)
Controller Area Network (Basic Level Presentation)Controller Area Network (Basic Level Presentation)
Controller Area Network (Basic Level Presentation)
Vikas Kumar
 
Performance Evaluation Of IEEE 802.11p For Vehicular Communication Networks
Performance Evaluation Of IEEE 802.11p For Vehicular Communication NetworksPerformance Evaluation Of IEEE 802.11p For Vehicular Communication Networks
Performance Evaluation Of IEEE 802.11p For Vehicular Communication NetworksAmir Jafari
 
Control Area Network (CAN) based accident avoidance system
Control Area Network (CAN) based accident avoidance systemControl Area Network (CAN) based accident avoidance system
Control Area Network (CAN) based accident avoidance system
Nitin Jagtap
 
Can protocol implementation for data communication (2)
Can protocol implementation for data communication (2)Can protocol implementation for data communication (2)
Can protocol implementation for data communication (2)
karuna418
 
Epma 013
Epma 013Epma 013
Epma 013
Lecturer
 

What's hot (20)

Controller area network protocol
Controller area network protocolController area network protocol
Controller area network protocol
 
CAN (Controller Area Network) Bus Protocol
CAN (Controller Area Network) Bus ProtocolCAN (Controller Area Network) Bus Protocol
CAN (Controller Area Network) Bus Protocol
 
Controller area network (can bus)
Controller area network (can bus)Controller area network (can bus)
Controller area network (can bus)
 
DefCamp 2013 - In vehicle CAN network security
DefCamp 2013 - In vehicle CAN network securityDefCamp 2013 - In vehicle CAN network security
DefCamp 2013 - In vehicle CAN network security
 
Communication stack
Communication stackCommunication stack
Communication stack
 
Automotive Networks : A Review
Automotive Networks : A ReviewAutomotive Networks : A Review
Automotive Networks : A Review
 
Controller area network
Controller area networkController area network
Controller area network
 
CAN, BY MD.ABDULLAH
CAN, BY MD.ABDULLAHCAN, BY MD.ABDULLAH
CAN, BY MD.ABDULLAH
 
Controller Area Network (CAN) Protocol || Automotive Electronics || Hariharan K
Controller Area Network (CAN) Protocol || Automotive Electronics || Hariharan KController Area Network (CAN) Protocol || Automotive Electronics || Hariharan K
Controller Area Network (CAN) Protocol || Automotive Electronics || Hariharan K
 
Wolf etal securebus kom syst
Wolf etal securebus kom systWolf etal securebus kom syst
Wolf etal securebus kom syst
 
Canbus presentation
Canbus presentationCanbus presentation
Canbus presentation
 
Accident avoidanve using controller area network protocol
Accident avoidanve using controller area network protocolAccident avoidanve using controller area network protocol
Accident avoidanve using controller area network protocol
 
AUTOSAR 403 CAN Stack
AUTOSAR 403 CAN StackAUTOSAR 403 CAN Stack
AUTOSAR 403 CAN Stack
 
Design flow for Controller Area Network systems
Design flow for Controller Area Network systemsDesign flow for Controller Area Network systems
Design flow for Controller Area Network systems
 
Control Area Network
Control Area NetworkControl Area Network
Control Area Network
 
Controller Area Network (Basic Level Presentation)
Controller Area Network (Basic Level Presentation)Controller Area Network (Basic Level Presentation)
Controller Area Network (Basic Level Presentation)
 
Performance Evaluation Of IEEE 802.11p For Vehicular Communication Networks
Performance Evaluation Of IEEE 802.11p For Vehicular Communication NetworksPerformance Evaluation Of IEEE 802.11p For Vehicular Communication Networks
Performance Evaluation Of IEEE 802.11p For Vehicular Communication Networks
 
Control Area Network (CAN) based accident avoidance system
Control Area Network (CAN) based accident avoidance systemControl Area Network (CAN) based accident avoidance system
Control Area Network (CAN) based accident avoidance system
 
Can protocol implementation for data communication (2)
Can protocol implementation for data communication (2)Can protocol implementation for data communication (2)
Can protocol implementation for data communication (2)
 
Epma 013
Epma 013Epma 013
Epma 013
 

Similar to 11.chapters

Can basics
Can basicsCan basics
Can basics
cdackp
 
International Journal of Engineering Research and Development
International Journal of Engineering Research and DevelopmentInternational Journal of Engineering Research and Development
International Journal of Engineering Research and Development
IJERD Editor
 
Vehicle Automation Using Controller Area Network
Vehicle Automation Using Controller Area NetworkVehicle Automation Using Controller Area Network
Vehicle Automation Using Controller Area Network
IRJET Journal
 
Bus Data Acquisition and Remote Monitoring System Using Gsm & Can
Bus Data Acquisition and Remote Monitoring System Using Gsm & CanBus Data Acquisition and Remote Monitoring System Using Gsm & Can
Bus Data Acquisition and Remote Monitoring System Using Gsm & Can
IOSR Journals
 
Embedded One.pdf
Embedded One.pdfEmbedded One.pdf
Embedded One.pdf
Sezzar
 
Controller Area Network (CAN) Different Types
Controller Area Network (CAN) Different TypesController Area Network (CAN) Different Types
Controller Area Network (CAN) Different Types
FebinShaji9
 
How to Hack Your Mini Cooper. Reverse Engineering CAN Messages on Passenger A...
How to Hack Your Mini Cooper. Reverse Engineering CAN Messages on Passenger A...How to Hack Your Mini Cooper. Reverse Engineering CAN Messages on Passenger A...
How to Hack Your Mini Cooper. Reverse Engineering CAN Messages on Passenger A...
Guy Boulianne
 
CONNECTED vehicle ECU.pptx
CONNECTED vehicle ECU.pptxCONNECTED vehicle ECU.pptx
CONNECTED vehicle ECU.pptx
VairaPrakash2
 
Controller Area Network (CAN Bus)I need to know why this network i.pdf
Controller Area Network (CAN Bus)I need to know why this network i.pdfController Area Network (CAN Bus)I need to know why this network i.pdf
Controller Area Network (CAN Bus)I need to know why this network i.pdf
fashiionbeutycare
 
Cancheck
CancheckCancheck
Response time analysis of mixed messages in CAN
Response time analysis of mixed messages in CANResponse time analysis of mixed messages in CAN
Response time analysis of mixed messages in CAN
IJERA Editor
 
[IJET-V2I2P16] Authors: Jariwala Hiren, Patel Chintan, Prasad Kuldip, Shukla ...
[IJET-V2I2P16] Authors: Jariwala Hiren, Patel Chintan, Prasad Kuldip, Shukla ...[IJET-V2I2P16] Authors: Jariwala Hiren, Patel Chintan, Prasad Kuldip, Shukla ...
[IJET-V2I2P16] Authors: Jariwala Hiren, Patel Chintan, Prasad Kuldip, Shukla ...
IJET - International Journal of Engineering and Techniques
 
Lasseq f can
Lasseq f canLasseq f can
Lasseq f can
fouziaaddal
 
Shubham chakravarty ppt_wcan
Shubham chakravarty ppt_wcanShubham chakravarty ppt_wcan
Shubham chakravarty ppt_wcan
ShubhamChakravarty1
 
What is AUTOSAR Communiation Stack
What is AUTOSAR Communiation StackWhat is AUTOSAR Communiation Stack
What is AUTOSAR Communiation Stack
Embitel Technologies (I) PVT LTD
 
P26093098
P26093098P26093098
P26093098
IJERA Editor
 
14 12 may17 18nov16 13396 m f hashmi
14 12 may17 18nov16 13396 m f hashmi14 12 may17 18nov16 13396 m f hashmi
14 12 may17 18nov16 13396 m f hashmi
IAESIJEECS
 
Controller Area Network for Monitoring and Controlling the Industrial Paramet...
Controller Area Network for Monitoring and Controlling the Industrial Paramet...Controller Area Network for Monitoring and Controlling the Industrial Paramet...
Controller Area Network for Monitoring and Controlling the Industrial Paramet...
International Journal of Science and Research (IJSR)
 
Controller area network
Controller area networkController area network
Controller area network
Divi1597
 

Similar to 11.chapters (20)

Can basics
Can basicsCan basics
Can basics
 
International Journal of Engineering Research and Development
International Journal of Engineering Research and DevelopmentInternational Journal of Engineering Research and Development
International Journal of Engineering Research and Development
 
Vehicle Automation Using Controller Area Network
Vehicle Automation Using Controller Area NetworkVehicle Automation Using Controller Area Network
Vehicle Automation Using Controller Area Network
 
Bus Data Acquisition and Remote Monitoring System Using Gsm & Can
Bus Data Acquisition and Remote Monitoring System Using Gsm & CanBus Data Acquisition and Remote Monitoring System Using Gsm & Can
Bus Data Acquisition and Remote Monitoring System Using Gsm & Can
 
Embedded One.pdf
Embedded One.pdfEmbedded One.pdf
Embedded One.pdf
 
Controller Area Network (CAN) Different Types
Controller Area Network (CAN) Different TypesController Area Network (CAN) Different Types
Controller Area Network (CAN) Different Types
 
How to Hack Your Mini Cooper. Reverse Engineering CAN Messages on Passenger A...
How to Hack Your Mini Cooper. Reverse Engineering CAN Messages on Passenger A...How to Hack Your Mini Cooper. Reverse Engineering CAN Messages on Passenger A...
How to Hack Your Mini Cooper. Reverse Engineering CAN Messages on Passenger A...
 
CONNECTED vehicle ECU.pptx
CONNECTED vehicle ECU.pptxCONNECTED vehicle ECU.pptx
CONNECTED vehicle ECU.pptx
 
Controller Area Network (CAN Bus)I need to know why this network i.pdf
Controller Area Network (CAN Bus)I need to know why this network i.pdfController Area Network (CAN Bus)I need to know why this network i.pdf
Controller Area Network (CAN Bus)I need to know why this network i.pdf
 
Cancheck
CancheckCancheck
Cancheck
 
Response time analysis of mixed messages in CAN
Response time analysis of mixed messages in CANResponse time analysis of mixed messages in CAN
Response time analysis of mixed messages in CAN
 
[IJET-V2I2P16] Authors: Jariwala Hiren, Patel Chintan, Prasad Kuldip, Shukla ...
[IJET-V2I2P16] Authors: Jariwala Hiren, Patel Chintan, Prasad Kuldip, Shukla ...[IJET-V2I2P16] Authors: Jariwala Hiren, Patel Chintan, Prasad Kuldip, Shukla ...
[IJET-V2I2P16] Authors: Jariwala Hiren, Patel Chintan, Prasad Kuldip, Shukla ...
 
Project-Report
Project-ReportProject-Report
Project-Report
 
Lasseq f can
Lasseq f canLasseq f can
Lasseq f can
 
Shubham chakravarty ppt_wcan
Shubham chakravarty ppt_wcanShubham chakravarty ppt_wcan
Shubham chakravarty ppt_wcan
 
What is AUTOSAR Communiation Stack
What is AUTOSAR Communiation StackWhat is AUTOSAR Communiation Stack
What is AUTOSAR Communiation Stack
 
P26093098
P26093098P26093098
P26093098
 
14 12 may17 18nov16 13396 m f hashmi
14 12 may17 18nov16 13396 m f hashmi14 12 may17 18nov16 13396 m f hashmi
14 12 may17 18nov16 13396 m f hashmi
 
Controller Area Network for Monitoring and Controlling the Industrial Paramet...
Controller Area Network for Monitoring and Controlling the Industrial Paramet...Controller Area Network for Monitoring and Controlling the Industrial Paramet...
Controller Area Network for Monitoring and Controlling the Industrial Paramet...
 
Controller area network
Controller area networkController area network
Controller area network
 

11.chapters

  • 1. 1 Chapter-1 Introduction 1.1 SCOPE AND OBJECTIVES In Recent Innovations Automobiles, contains many digital control systems as technology is growing faster. Recently released Vehicles have many Electronic Control Systems and Electronic Control Units embedded in it. The growth in automotive electronics resulted that many parties of the buyers and customers wish to have a better safety along with good comfort and also many other luxurious and saving features like improved emission control and also reduced fuel consumption. There are many other messaging protocols used in vehicles but some automotive industries uses Controller Area Network (CAN) as an in-vehicle network for the purpose of Engine Management, for the body electronics like door as well as roof control, air conditioning, lighting and for the entertainment control. Now-a-days almost many car manufacturing companies have started implementing the CAN based vehicle automation system.CAN networks are used for the engine management to interconnect several Electronic Control Units’. Figure1.1:-Different Features present in a modern car
  • 2. 2 Existing System Proposed System  In existing system, there is no remote car locking system implemented.  Only for the purpose avoiding the car steeling this system used.  Also there is no possible ways for finding the position of car after theft. Drawbacks  There is no wireless system for data transfer.  Finding location of car after theft is not possible.  There is no remote controlling process of car.  In this system, CAN protocol is implemented for Communication.  GSM and GPS technology will help for locating the car.  Remote controlling and locking is possible here. Advantages  Very effective method to avoid form being theft.  Without car owner awareness no one can start the engine.  Very fast response over control remotely. 1.2 WORKING PRINCIPLE: a. In proposed system whenever the vehicle is started by a person, a message with the GPS coordinate along with the location of the vehicle will be sent as an SMS to the vehicle owner’s number. b. On receiving the message the vehicle owner will send a reply to lock or antilock that is stop the vehicle or allow the vehicle to run. c. The system at first checks and verifies the owner number and if exact it checks the SMS sent and performs the corresponding action. d. All this process is achieved through in vehicular network, CAN. e. When the car engine is started it sends the information to the Master node in CAN which in turn fetches the location coordinates attached with it and generates the SMS. On receiving locking or anti-locking code it sends the respective command to the slave node which takes the intended action.
  • 3. 3 Figure 1.2:-flowchart for working Principle
  • 4. 4 Chapter-2 Controller Area Network (CAN) Overview 2.1. CAN HISTORY Bosch has developed the CAN in 1985 for in-vehicular communication. Before days, automotive manufacturers have connected all electronic devices in vehicles using point-to-point wiring systems respectively. Manufacturers have started using more electronic units in vehicles, which have got resulted in bulk of wire connections that were heavy and also very expensive. Then they have replaced wiring with in-vehicle networks, which in turn reduced wiring cost, weight and complexity. CAN is a highly integrated serial bus system for networking the intelligent devices, which has emerged as the standard in- vehicle network. The automotive industry has quickly adopted CAN and in 1993 it became the international standard known as ISO 11898.from 1994, many higher-level protocols been standardized based on CAN. Many Other markets have been widely adopted these additional protocols, which are now main standards for industrial communications. 2.2. CAN & ITS ADVANTAGES LOW-COST AND LIGHTWEIGHT NETWORK This decreases overall cost and weight in automobiles. An advantage to this is that electronic control units (ECUs) can have a single CAN interface rather than Analog and digital inputs to every device in the system. CAN provide inexpensive, durable network which helps multiple CAN devices to communicate with one another. BROADCAST MECHANISM FOR COMMUNICATION All devices on the network see all transmitted messages. Each of the devices on the network has a CAN controller chip and is therefore intelligent. This structure allows modifications to CAN networks with minimal impact. Each device can decide if a message is relevant or if it should be filtered. Additional non-transmitting nodes can be added without modification to the network. PRIORITYASSIGNMENT This arbitration is non-destructive and results in non-interrupted transmission of the highest priority message. Every message has a priority, so if two nodes try to send messages simultaneously, the one with the higher priority gets transmitted and the one with the lower priority gets postponed.
  • 5. 5 ERROR HANDLING CAPABILITIES Frames with errors are disregarded by all nodes, and an error frame can be transmitted to signal the error to the network. The CAN specification includes a Cyclic Redundancy Code (CRC) to perform error checking on each frame's contents. Global and local errors are differentiated by the controller, and if too many errors are detected, individual nodes can stop transmitting errors or disconnect itself from the network completely. Figure 2.2 CAN networks will significantly reduce wiring 2.3. APPLICATIONS OF CAN In addition, you can find CAN buses in many aerospace applications, ranging from in-flight data analysis to aircraft engine control systems such as fuel systems, pumps, and linear actuators. Medical equipment manufacturers use CAN as an embedded network in medical devices. You can find CAN on different levels of the multiple networks within these vehicles – for example, in linking the door units or brake controllers, passenger counting units, and more. Lifts and escalators use embedded CAN networks, and hospitals use the CAN open protocol to link lift devices, such as panels, controllers, doors, and light barriers, to each other and control them. CAN open also is used in nonindustrial applications such as laboratory equipment, sports cameras, telescopes, automatic doors, and even coffee machines. Railway applications such as streetcars, trams, undergrounds, light railways, and long-distance trains incorporate CAN.
  • 6. 6 In fact, some hospitals use CAN to manage complete operating rooms. Hospitals control operating room components such as lights, tables, cameras, X-ray machines, and patient beds with CAN-based systems. CAN also have applications in aircraft with flight-state sensors, navigation systems, and research PCs in the cockpit. CAN was first created for automotive use, so its most common application is in-vehicle electronic networking. However, as other industries have realized the dependability and advantages of CAN over the past 20 years, they have adopted the bus for a wide variety of applications. 2.4 TERMINOLOGY OF CAN All CAN devices will send data across CAN networks in the form of packets called frames. And a CAN frame will have following sections.  Frame -- Frames also are referred to as messages. An entire CAN transmission has arbitration ID, data bytes, acknowledge bit. Figure 2.4.1:-Frame Format of CAN.  SOF (start-of-frame) bit –it always indicates the beginning of a message with a dominant bit that is logic 0.  Arbitration Mechanism ID –. Frames will come in two formats -- standard, which uses a 11-bit arbitration ID, and will be extended, which always uses a 29-bit arbitration ID and also it identifies a message will indicate the message's priority  Identifier Extension bit – it allows to diffrentiate between standard and the extended frames.  CAN Data Field – it will contain 0 to 8 bytes of data.  Data Length Code(DLC) –it indicates the no of bytes that the data field will contain.  Remote Transmission request bit – the recessive RTR bit that is (logic 1) will indicate a remote frame. A dominant RTR bit that is (logic 0) will indicate a data frame. It also serves to differentiate a remote frame from the data frame.  cyclic redundancy check(CRC) – it contains 15-bit cyclic redundancy check code and a recessive delimiter bit and the CRC field is used for the error detection.  Acknowledgement slot(ACK)– any CAN controller which receives the message will send ACK bit at the end of a message. Therefore the transmitting node will check the
  • 7. 7 presence of the ACK bit on bus and will attempt transmission again if there is no acknowledgement is detected. In below figure six channels that contained in the data field of a single CAN frame. Here each signal contains 8 bits of data. Figure 2.4.2:- Defining Signals inside the CAN frame. 2.5 HOW THE COMMUNICATION IN CAN WORKS There is no master control when individual nodes have access to read and write data on CAN bus. CAN will be peer-to-peer network. When CAN node is ready to transmit data, it checks to see whether bus is busy and then it simply writes a CAN frame onto network. The CAN frames transmitted has no addresses of either the transmitting node or receiving nodes. An arbitration ID that is unique throughout the network labels the frame. All nodes on the CAN network will receive the CAN frame, depending on the arbitration ID of that transmitted frame, each CAN node on the network decides whether to accept the frame. If multiple nodes try to transmit a message on to the CAN bus at a time, the node with the highest priority (lowest arbitration ID) will automatically get bus access. Nodes with Lower-priority should wait until bus become available before trying to transmit again.
  • 8. 8 Figure 2.5:- CAN will contain inbuilt priority for the messages to avoid conflicts.
  • 9. 9 Chapter-3 Design and Implementation Figure 3.1:- Module Block diagram CAN Controller PIC16F877A PIC16F877A CAN Controller Power Supply CAN Bus CANH CANL PIC16F877A CAN Transceiver CAN Transceiver LCD Relay Driver DC Motor MAX 232 GSM Modem MAX 232 GPS Receiver
  • 11. 11 3.1 REQUIREMENTS 3.1.1 HARDWARE REQUIREMENTS  Power Supply  PIC16F877A Controller  SIMCOM GSM board  GPS Receiver board  Liquid Crystal Display module  CAN Controller and CAN Transceiver  Alarm  DC Motor  MAX232 3.1.2 SOFTWARE REQUIREMENTS  Embedded C.  KEIL compiler 3.2 APPLICATIONS  It’s Very efficient way to avoid vehicle theft.  It can be applied in all vehicles.  One of the Easy way to trace the location of car when theft.  Engine can be put to Off State through wireless.
  • 12. 12 Chapter-4 Overview of Hardware and Software 4.1. PIC16F887MICROCONTROLLER – DEVICE OVERVIEW 4.1.1. PIC16F877A INTRODUCTION PIC16F877A is very convenient to use where coding, programming is easier. Main advantage is it can write-erase because it uses FLASH memory technology. It has a number of 40 pins where 33 pins for input and output. It contains many applications in digital electronics circuits. Figure 4.1.1:-PIC16F877A Microcontroller
  • 13. 13 4.1.2 FEATURES OF MICROCONTROLLER -PIC16F877A PIC16F877A series has advanced features compared to its previous series where important features of PIC16F877A series are stated below. 4.1.2.1 GENERAL FEATURES OF PIC o types of addressing modes such as direct, Indirect, relative addressing modes. o Power on Reset (POR). o Power-Up Timer and the oscillator start-up timer. o Low power and high speed CMOS flash EEPROM. o Full static design. o Wide range of operating voltages (2.0 – 5.56) volts. o High sink and source current (25mA). o Commercial, industrial and extended temperature ranges. o power consumption is Low and has High performance RISC CPU. o contains 35 simple word instructions. o Interrupt capability is up to 14 sources. o contains 368×8bit of RAM, 256×8 of EEPROM, 8k×14 of flash memory. 4.1.2.2. PERIPHERAL FEATURES OF PIC o Timer 0: 8 bit timer/counter that is pre-scalar. o Timer 1:16 bit timer/counter which is pre-scalar.
  • 14. 14 o Timer 2: is 8 bit timer/counter contains 8 bit period registers which will be pre-scalar and post-scalar. o 10bit multichannel Analog to Digital converter o Synchronous Serial Port along with SPI (master code) and with I2C (master/slave). o USART with 9 bit address detection capability. o Parallel Slave Port that is 8 bit wide with the external RD, WR and CS controls. 4.1.2.3. KEY FEATURES OF PIC o Maximum operating frequency is up to 20MHz. o Flash program memory is 8KB. o Data memory is up to 368. o EEPROM data memory is up to 256. o 5 in/out ports. o contains 3 timers. o there are 2 CCP modules. o contains 2 serial communication ports i.e (MSSP, USART). o PSP is parallel communication port o 10bit A/D module i.e with 8 channels
  • 15. 15 4.1.2.4. ANALOG FEATURES OF PIC o has 10bit, up to 8 channel A-D converter. o contains Brown Out Reset function. o Analog comparator module is present. 4.1.2.5 SPECIAL FEATURES OF PIC o capable of 100000 times erase and write cycle enhanced memory. o capable of 1000000 times erase/write cycle data EEPROM memory. o Self programmable under the software control. o In-circuit serial programming, in-circuit debugging capability. o has Single 5V, DC supply for circuit serial programming o Programmable code protection is present. o Power saving sleep modes. o Selectable oscillator options.
  • 16. 16 4.1.3 PIN CONFIGURATION OF PIC16F877A There are 40 pins in this microcontroller IC. It has two 8 bit and one 16 bit timer respectively. Capture and compare modules, serial ports, parallel ports and 5 input/output ports are also present in it. Figure 4.1.3:- Pin diagram of PIC16F877A Microcontroller
  • 17. 17 4.1.4 DESCRIPTION OF PORTS IN PIC16F877A PIC16F877A has 5 input and output ports. They are usually denoted by PORT A, B, C, D AND E i.e (R A (RB) (RC) (RD) and (RE). These ports are all used for input and output interfacing. In the controller, “PORT A” is 6 bits wide (RA-0 to RA-7), ”PORT B” , “PORT C”,”PORT D” will be8 bits wide (RB-0 to RB-7,RC-0 to RC-7,RD-0 to RD-7), ”PORT E” is 3 bit wide (RE-0 to RE-7).All the ports are all bi-directional ports. The direction of port will be controlled by using TRIS(X) registers (TRIS A to set the direction of PORT-A, TRIS B will set the direction for PORT-B, etc.). Setting TRIS(X) bit ‘1’ will set a corresponding PORT(X) bit as an input. Clearing TRIS(X) bit ‘0’ will set the corresponding PORT(X) bit as the output .If we want PORT A as input, just set the TRIS(A) bit to logical ‘1’ and if we want to set PORT B as an output, just set the PORT B bits to the logical ‘0’. o AN0 TO AN7 (Analog input port): these ports are used for interfacing analog inputs. o TX, RX: These are the USART transmission and reception ports. o SCK: these pins are used for giving a synchronous serial clock input. o SCL: these pins act as an output for both modes SPI and I2C. o DT: synchronous data terminals. o CK: synchronous clk input. o SD0: SPI data output. o SD1: SPI Data input. o SDA: data input and output in I2C Mode. o CCP1 and CCP2: these are capture, compare, PWM modules. o OSC1: oscillator input and external clock.
  • 18. 18 o OSC2: oscillator output or clock out. o MCLR: master clr pin (Active low reset). o Vpp: is programming voltage input. o THV: High voltage test mode controlling pin. o Vref (+/-): is reference voltage. o SS: Slave select used for the synchronous serial port. o T0CK1: indicates clock input to TIMER 0. o T1OSO: indicates Timer 1 oscillator output. o T1OS1: indicates Timer 1 oscillator input. o T1CK1: indicates clock input to Timer 1. o PGD: is Serial programming data. o PGC: will be serial programming clock. o PGM: is Low Voltage Programming input. o INT: is an external interrupt. o RD: will be Read control for parallel slave port. o CS: is the Select control for parallel slave. o PSP0 to PSP7: are Parallel slave ports. o VDD: is positive supply for logic and input pins.
  • 19. 19 o VSS: is Ground reference for logic and input or output pins. 4.1.5 PROGRAMING THE PIC16F877A we have 5 input and output ports such as PORTA, PORTB, PORTC, PORTD, PORT E which can be digital and also analog configured based on our requirements. In the case of analog mode, ports can only act as inputs. There is a built in A/D converter used in such cases. Multiplexer circuits are used in digital mode. We can configure the ports as output or as input through programming. There is a register named as ‘TRIS’ which controls the direction of ports. For different ports there are different registers such as TRISA, TRISB etc. If we set a bit of the TRIS register to 0, then corresponding port bit will act as the digital output. If we set a bit of the TRIS register to 1, then corresponding port bit will act as the digital input. We use MP LAB IDE for programming and Proteus for Designing. 4.2 GSM MODULE we use GSM modem for sending the information to the monitoring section as a message if the buses are arrived at the bus stop. In monitoring section we have another GSM modem to receive the message and upload the message in internet via max232.SIM908 module is a Quad Band GSM and GPRS module which combines the GPS technology for the satellite navigation. The compact design which has integrated GPRS and GPS in the SMT package will save time and cost .Featuring an industry standard interface and a GPS function; it allows variable assets to be tracked seamlessly at any location and anytime with signal coverage. 4.2.1. GENERAL FEATURES OF GSM MODULE o Uses Quad Band o Operating at 850/900/1800/1900 MHz o Has GPRS multi slot o Is class 10 o GPRS mobile station is class B o Will be Compliant to GSM phase 2/2+ o Is Class 4 (2 W @850/900 MHz) o Is Class 1 (1 W @ 1800/1900MHz)
  • 20. 20 o Has Dimensions: 30 x 30 x 3.2 mm o Has Weight: 5.2 g o Will Control via AT commands (GSM 07.07 ,07.05 and SIMCOM enhanced AT Commands) o Contains SIM application toolkit o Supply voltage range for GPRS: 3.2 ~ 4.8 V,GPS: 3.0 ~ 4.5V o Has Low power consumption o Its Operation temperature: 40° o Has C to +85 °C 4.2.2 GSM SPECIFICATIONS FOR DATA TRANSFER o Has GPRS class 10: max. 85.6 kbps (downlink) o Is PBCCH support o Uses Coding schemes CS 1, 2, 3, 4 o Has CSD up to 14.4 kbps o Will be USSD o Is Non transparent mode o Has PPP stack o Is Integrated TCP/IP stack 4.2.3 GSM SPECIFICATIONS FOR SMS VIA GSM/GPRS o Will have Point to point MO and MT o Uses SMS cell broadcast o Contains Text and PDU mode 4.2.4 GSM SPECIFICATIONS FOR GPS o Is Receiver type o Has 42channel o Will have GPS L1 C/A code, o Gives High performance o Has STE engine o Has Sensitivity o Obtains Tracking: 160 o Uses dBm
  • 21. 21 o Will have Cold starts: 143 o Uses Time To First Fix o Has Accuracy Horizontal position : <2.5m CEP o Uses Power consumption (GSM engine in idle mode) o Has Acquisition 77mA o Tracking 76mA 4.2.5 GSM SPECIFICATIONS FOR VOICE o Is Tri codec o Has Half rate (HR) o Has Full rate (FR) o Is Enhanced Full rate (EFR) o Has Echo cancellation o Will be Hands free o Uses operation (Echo suppression) 4.2.6 GSM INTERFACES o Will have 80pad o Will be with SMT type o Is Interface to external SIM 3V/ 1.8V o Has Dual analog audio interfaces o Contains RTC backup o uses SPI interface o has Serial interface and debug interface for GSM/GPRS o will have Debug interface for GPS NMEA information output o has Two separate antenna connectors for GSM/GPRS&GPS
  • 22. 22 4.3. MAX232 OVERVIEW It is used to convert the voltage level during communicate the data with microcontroller and Personal Computer. Here message will be transmitted to the monitoring section via GSM modem. To give the information to the GSM modem we are going for the max232. In this project the position of the robot, the detection of the cracks will be send as the message to the monitoring section.Max232 is designed by the Maxim Integrated Products. This IC has been widely used in RS232 Communication in which the voltage level conversion is required to make the TTL devices compatible with PC serial port. This chip will contain charge pumps that pump the voltage to Desired Level. It can also be powered by single +5 volt power supply and output can be reached to +_7.5 volts.MAX232 will come with 16 Pin Dip and other packages contain Dual Drivers. It is used as a hardware layer convertor for two systems to communicate simultaneously.Max232 is to be used in most of the problems of signal voltage level conversion. Figure 4.3:- Pin Diagram of MAX 232 IC
  • 23. 23 4.3.1 CONSTRUCTION OF MAX232 IC MAX232 will be used in 16-pin DIP package. It has three major blocks .It can be powered by 5 volts to make compatible with most of the embedded systems. First block is voltage doubler, In this IC, switched capacitor techniques is used to make the voltage double .Once the voltage is doubled second block will convert that voltage to +10 and -10. The third block consists of 2 transmitters and 2 receivers which actually convert the voltage levels. Figure 4.3.1.1:-Internal Circuit of MAX232 IC
  • 24. 24 4.3.2 APPLICATION AND USES OF MAX232 IC MAX232 is used for Serial communication. Here Problem arises when we have to communicate between TTL logic and CMOS logic based systems. In TTL logic 0 is defined is by 0 volt and 1 is defined by 5 volt so in this scenario this is a very handy IC to be incorporated. RS232 is internationally defined standard named as EIA/TIA-232-E and in this standard logic 0 is the voltage between +3 to +15 and logic 1 is defined as the voltage between -3 to -15. 4.4 GPS RECIEVER MODULE The GPS a satellite navigation system that will location, time information in all weather, anywhere on the Earth, where there is an unobstructed line of sight to 4 or more GPS satellites. It has been maintained by United States government which will be freely accessible to any individual with a GPS receiver.GPS receivers will receive almanac data from the satellite and calculate the position by calculating its distance from the visible satellites and by using method called triangulation it will calculate its position. The data is configured according to the standards set up by National Marine Electronics Association (NMEA) and is serially transmitted at the baud rate of 4800 bps. The NMEA has developed the standards that will describe the interface between various marine electronic equipments. The standards allow the marine electronics to send information to the computers and to other marine equipments. Figure 4.4:-GPS Receiver
  • 25. 25 4.5 DC MOTOR OVERVIEW A DC motor has been designed to run on DC electric power. Two examples of pure DC designs will be Michael Faraday's homo polar motor, and a ball bearing motor. The common DC motor types are brushed and brushless types, which will use internal and external commutation to create an oscillating AC current from DC source so they will not be purely DC machines. Figure 4.5:- Construction of DC Motor
  • 26. 26 4.6. LCD DISPLAY LCD display is an electronic display module and is commonly used in various devices and circuits. These are easily programmable and economical which has no limitation of displaying special and also even custom characters animations. A 16x2 LCD will mean that it will display 16 characters per line and has 2 such lines. In the LCD each character will be displayed in 5x7 pixel matrix. This LCD has 2 registers, Command and Data. The command register will store the command instructions where command is an instruction given to the LCD to do a predefined task such as initializing, clearing, setting the position of cursor, controlling display etc. The data register will store data that is to be displayed on the LCD which will be an ASCII value. Figure4.6:-16x2LCD interfacing with PIC16F877A
  • 27. 27 Table 4.6:-LCD PIN DESCRIPTION Pin No Pin Function Pin Name 1 (0V) Ground Ground pin 2 5V (4.7V – 5.3V) Supply voltage Vcc pin 3 Contrast adjustment through a variable resistor VEE pin 4 when low Selects command register; and when high data register Register Select pin 5 Low is to write to the register; High is to read from the register Read/write pin 6 It Sends data to data pins when the high to low pulse is given Enable pin 7 These are 8-bit data pins DB0 8 DB1 9 DB2 10 DB3 11 DB4 12 DB5 13 DB6 14 DB7 15 (5V)Backlight VCC LED+ 16 (0V)Backlight Ground LED-
  • 28. 28 4.7 SOFTWARE REQUIREMENTS 4.7.1 MPLAB IDE It is called as Integrated Development Environment, because it provides a single integrated "environment" to develop code for embedded microcontrollers. MPLAB X IDE is software that runs on a PC to develop applications for Microchip microcontrollers and digital signal controllers. Unlike previous versions of the MPLAB IDE which were developed completely in-house, MPLAB X IDE is based on the open source Net Beans IDE from Oracle. MPLAB X Integrated Development Environment has brought many changes to PIC microcontroller development tool chain. This path allowed us to add frequently requested features quickly and easily, also providing much more extensible architecture to bring even more new features in the future. 4.7.2 PROTEUS Proteus is software for simulation of microprocessor, schematic capture, and also for PCB design which has developed by Lab Center Electronics. It combines the ISIS schematic capture and the ARES PCB layout programs in order to provide powerful, integrated tools for a professional PCB Design. Here more advanced routing modes are also included in Proteus PCB Design Level 2 and higher whilst simulation capabilities can be enhanced by purchasing the Advanced Simulation option and/or micro-controller simulation capabilities. Using this Proteus software a simulated connection can be given between the components and tested before fetching the code into the Controller.
  • 29. 29 Appendices MASTER NODE #include<htc.h> #include"lcd_sub.c" #include"uart_sub.c" #include"spi.c" #include"can.c" #include"gps.c" #define sw RB2 #define mot RB7 unsigned int q1; void main() { TRISD=0X00; TRISB=0X06; TRISC6=0; TRISC7=1; TRISC3=0; TRISC4=1; TRISA5=1; TRISC5=0; TRISE=0x00; ADCON1=0x02;
  • 32. 32 SLAVE NODE #include<htc.h> #include"lcd_sub.c" #include"uart_sub.c" #include"spi.c" #include"can.c" #include"gsm.c" #define gs RB2 #define mot RB3 #define buz RB4 void main() { unsigned char h; TRISD=0X00; TRISB=0X00; TRISC6=0; TRISC7=1; TRISC3=0; TRISC4=1; TRISA5=1; TRISC5=0; TRISE=0x00; ADCON1=0x02;
  • 35. 35 References [1] A. Saad and U. Weinmann, “Automotive software engineering and concepts,” GI. Jahrestagung., vol. 34, pp. 318–319, 2003. [2] E. Nickel, “IBM automotive software foundry,” in Proc. Conf. Comput. Sci. Autom. Ind., Frankfurt, Germany, 2003. [3] M. Wolf, A. Weimerskirch, and T. Wollinger, “State of the art: Embedding security in vehicles,” EURASIP J. Embedded Syst., vol. 2007, no. 5, p. 1,2007. [4] R. Charette, This Car Runs on Code. [Online]. Available: http://www. spectrum.ieee.org/feb09/7649 [5] T. Nolte, H. Hansson, and L. L. Bello, “Automotive communications-past, current and future,” in Proc. IEEE Int. Conf. Emerging Technol. Factory Autom., 2005, vol. 1, pp. 992– 999. [6] K. H. Johansson, M. Torngren, and L. Nielsen, “Vehicle applications of controller area network,” in Handbook of Networked and Embedded Control Systems. New York, NY, USA: Springer-Verlag, 2005, pp. 741–765. [7] T. Hoppe and J. Dittman, “Sniffing/replay attacks on CAN buses: A simulated attack on the electric window lift classified using an adapted CERT taxonomy,” in Proc. Conf. Embedded Syst. Security, 2007, pp. 1–6. [8] T. Hoppe, S. Kiltz, and J. Dittmann, “Security threats to automotive CAN networks— Practical examples and selected short-term countermeasures,” Rel. Eng. Syst. Safety, vol. 96, no. 1, pp. 11–25, Jan. 2011. [9] K. Koscher et al., “Experimental security analysis of a modern automobile,” in Proc. IEEE Security Privacy. Symp., Oakland, CA, USA, 2010,pp. 447–462. [10] The EVITA project, 2008, Webpage. [Online]. Available: http://evita-project.org [11] H. Schweppe, Y. Roudier, B. Weyl, L. Apvrille, and D. Scheuermann, “Car2X communication: Securing the last meter—A cost-effective approach for ensuring trust in
  • 36. 36 Car2X applications using in-vehicle symmetric cryptography,” in Proc. Conf. Veh. Technol., San Francisco, CA, USA, 2011, pp. 1–5. [12] H. Schweppe et al., “Securing Car2X applications with effective hardware Software co-design for vehicular on-board networks,” in Proc. Conf. Autom. Security, Berlin, Germany, 2011. [13] D. K. Nilsson, U. E. Larson, and E. Jonsson, “Efficient in-vehicle delayed data authentication based on compound message authentication codes,” in Proc. Conf. IEEE 68th Int. Conf. Veh. Technol., Calgary, BC, Canada, 2008, pp. 1–5. [14] B. Groza and S. Murvay, “Efficient protocols for secure broadcast in controller area networks,” IEEE Trans. Ind. Informa., vol. 9, no. 4,pp. 2034–2042, Nov. 2013.