Top Banner
Intelligent Vehicle Diagnostics & Monitoring System B.M.S COLLEGE OF ENGINEERING Department of Electrical & Electronics Engineering BANGALORE- 560019 CERTIFICATE Certified that the project work entitled “INTELLIGENT VEHICLE DIAGNOSTICS AND MONITORING SYSTEM USING ARM7 TDMI-S” carried out by Seemalakshmi. A. 1BM06EE052 Chandrakala. R. 1BM07EE400 Manukumar. H.V. 1BM07EE402 Prathap. K.S. 1BM07EE404 are bonafide students of B.M.S College Of Engineering in a partial fulfilment for the award of degree of Bachelor of Engineering in Electrical & Electronics of the Visvesvaraya Technological University, Belgaum during the year 2009-2010. The project report has been approved as it satisfies the academic requirements in respect of Project Work prescribed for the Bachelor of Engineering degree. Signature of the Project Guide Signature of the HOD External Viva Department of EEE, BMSCE – Bangalore -19 Page 1
119

My BE Project

Oct 30, 2014

Download

Documents

Manukumar HV

“Intelligent Vehicle Diagnostics & Monitoring System” – Using ARM7 TDMI(S) - A 32-bit Architecture.
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: My BE Project

Intelligent Vehicle Diagnostics & Monitoring System

B.M.S COLLEGE OF ENGINEERINGDepartment of Electrical & Electronics Engineering

BANGALORE- 560019

CERTIFICATE

Certified that the project work entitled“INTELLIGENT VEHICLE DIAGNOSTICS AND MONITORING SYSTEM USING

ARM7 TDMI-S”

carried out by

Seemalakshmi. A. 1BM06EE052Chandrakala. R. 1BM07EE400Manukumar. H.V. 1BM07EE402Prathap. K.S. 1BM07EE404

are bonafide students of B.M.S College Of Engineering in a partial fulfilment for the award of degree of Bachelor of Engineering in Electrical & Electronics of the Visvesvaraya Technological University, Belgaum during the year 2009-2010. The project report has been approved as it satisfies the academic requirements in respect of Project Work prescribed for the Bachelor of Engineering degree.

Signature of the Project Guide Signature of the HOD

External Viva

Name of the Examiner: Signature with date

1.

2.

Department of EEE, BMSCE – Bangalore -19 Page 1

Page 2: My BE Project

Intelligent Vehicle Diagnostics & Monitoring System

COMPANY PROFILE

Knowx innovations a global solutions company providing custom solutions to high technology companies worldwide. Combining proven expertise in technology, vast knowledge of hardware product design cycle, system design cycle (Board design / development), Embedded software services and an understanding of emerging business domains. Range of services that includes Embedded Systems, DSP development, Device Drivers, Industrial automation, Wireless, Firmware, Application software.

At knowx life is all about delivering the highest quality to customers. Reduced costs, quicker time-to-market, huge value-adds and enhanced productivity are the way of life. The very cornerstone of success has been unerring path to ensuring that QA processes and procedures are met with unwavering dedication.

The focus areas are

Embedded Systems Real time solutions Device Driver Development, Protocols Development, Embedded Testing,

Telecom testing VLSI

Department of EEE, BMSCE – Bangalore -19 Page 2

Page 3: My BE Project

Intelligent Vehicle Diagnostics & Monitoring System

ACKNOWLEDGEMENT

We are thankful to our institution BMS College of Engineering and Knowx

Innovation (p) Ltd. for providing us with all the facilities, which have made this

project success.

It’s my duty to render my sincere gratitude to our esteemed Principal,

Dr. K. Mallikarjun Babu. for granting me an opportunity to undertake the project

work as a part of the BE course.

With immense pleasure, we express our gratitude. regards and thanks to our

Head of the Department, Dr. Ravishankar Deekshit for his excellent

encouragement, valuable suggestions and continuous encouragement at all the stages

of our project work.

We are grateful to our internal guide Professor. Usha A for her guidance in

carrying out this project. We are thankful to her for their valuable guidance,

assistance, moral support rendered in their capacity as my internal guide for this

project and in the preparation of this project and in the preparation of this report.

I would like to extend my profound gratitude to external guide

Mr. Alagar swami. A for his enthusiastic encouragement and courtesy for the help

they rendered me for the successful completion of the Project.

We are thankful to the faculty of Electrical and Electronics department for

inspiring and enlightening us at every step of our project.

Above all we are blessed with such caring parents. We extend our deepest

gratitude to our parents for their valuable love, affection, encouragement and support.

It is great pleasure in thanking the people who have been kind enough in

supporting me to complete this project successfully.

Department of EEE, BMSCE – Bangalore -19 Page 3

Page 4: My BE Project

Intelligent Vehicle Diagnostics & Monitoring System

CONTENTS Page No.

Chapter 1. PREAMBLE

1.1 Introduction................................................................................11.2 Motivation..................................................................................11.3 Document Conventions..............................................................21.4 Objective of the Project..............................................................21.5 Project Report Organization.......................................................3

Chapter 2. SYSTEM OVERVIEW

2.1 Block Diagram 2.1.1 Receiver side Block Diagram..................................................4 2.1.2 Transmitter side Block Diagram.............................................7

Chapter 3. HARDWARE DESCRIPTION

3.1KNOWX Board 3.1.1 LPC 2129..........................................................................9 3.1.1.1 General description 3.1.1.2 Features 3.1.1.3 Jumper Settings 3.1.1.4 ARM 7 3.1.2 CAN Controller...............................................................17 3.1.3 EEPROM........................................................................213.1.3.1 I2C3.1.4 LCD Display...................................................................243.1.6 MAX 232.......................................................................253.1.6 RELAYS.........................................................................28

3.2 Sensors.....................................................................................29 3.2.1 Pressure Sensor 3.2.2 Ultratonic Sensor 3.2.3 Temperature Sensor 3.2.4 Proximity Sensor

3.3 DC Motors................................................................................33 3.4 GSM Module............................................................................34 3.5 Ignition key , Brake Module & Seat-Belt................................37

3.6 RF Communication System.....................................................37 3.6.1 RFTransmitter.......................................................................39 3.6.1.1 AT89S52 3.6.1.2 Encoder

Department of EEE, BMSCE – Bangalore -19 Page 4

Page 5: My BE Project

Intelligent Vehicle Diagnostics & Monitoring System

3.6.2 RF Receiver..........................................................................42 3.6.2.1 Decoder 3.7 Power Supply Unit..................................................................43 3.8 Components used....................................................................45

Chapter 4. WORKING PRINCIPLE

4.1 Principle of Operation.............................................................46 4.2 Flow Chart...............................................................................46 4.3 Internal Circuits.......................................................................51 4.3.1 RF-Receiver & Main Block Internal Circuits......................51 4.3.2 RF-Transmitter Block Internal Circuits...............................55

Chapter 5. SOFTWARE USED & SOURCE CODE

5.1 Software & Protocols used....................................................56 5.2 Source Code............................................................................57 5.2.1 Source Code for 32-bit µC 5.2.2 Source Code for 8-bit µC

Chapter 6. PHOTOGALLERY......................................................................59

Chapter 7. CONCLUSION.............................................................................62

7.1 Features 7.2 Advantages 7.3 Applications 7.4 Future Implementation

Chapter 8. BIBLIOGRAPHY..........................................................................64

APPENDIX........................................................................................................65

Department of EEE, BMSCE – Bangalore -19 Page 5

Page 6: My BE Project

Intelligent Vehicle Diagnostics & Monitoring System

ABSTRACT

This project is an implementation of vehicular safety system using ARM7-TDMI(S) a 32-bit Architecture and GSM technology. Here we have used a 32-bit microcontroller LPC-2129 which is having the architecture of ARM7-TDMI(S). To simulate the speed control of a vehicle we have used RF-technology.

This system performs diagnostic check of vehicle failure parameters such as brake failure, engine temperature, bumper’s pressure, & precaution parameters such as lane detection, obstacle distance detection & control devices failure such as CAN bus, GSM module. Depending upon the failure of foresaid parameters , it will take the further actions such as switching on/off of the motor, sending SMS to the concerned persons & finally stores all parameter values in memory & displays them on LCD

Department of EEE, BMSCE – Bangalore -19 Page 6

Page 7: My BE Project

Intelligent Vehicle Diagnostics & Monitoring System

1.1 INTRODUCTION

Black Box

With any airplane crash, there are many unanswered questions as to what brought the plane down. Investigators turn to the airplane's flight data recorder (FDR) and cockpit voice recorder (CVR), also known as "black boxes," for answers. The FDR contains parameters of flight data, and the CVR recorded a little more than 30 minutes of conversation and other audible cockpit noises. These recording devices, which reveal details of the events immediately preceding the accident.

Boxes are sealed in insulated titanium boxes to protect them from fire, impact and water pressure. Each Black box has a “Pinger”, an electronic sounding device to help locate the box.

Here we are implementing the some of the features of the Black Box to a Car using LPC 2129(A 32-bit Microcontroller) which has ARM7 TDMI-S - A 32-bit architecture (Which is embedded in the KNOWX Board) and GSM technology. Here the KNOWX Board is a Kit Designed by an embedded and telecom company KNOWX. It incorporates Microcontroller, CAN Controllers, EEPROM, MAX 232, Crystal of 12 MHz & Relays.

At Ignition ON, it checks each vehicle critical failure parameters such as Brake, Seat Belt, CAN bus, & GSM module and display the status of each failure parameter on the LCD. If any one of the four parameters fails it doesn’t allow the motor to switch ON and goes back to the diagnose loop to check each parameter again. It continues to check all the parameters until they are tested as OK.

At Power ON, the system allows the motor to switch-on. Here we have used the RF technology to control the motor. When the vehicle is under running condition , the system checks the four minor parametrs such as Engine temperature, Bumper’s pressure, Lane detection & obstacle detection. If any minor failure occurs, it informs the driver by displaying its status on the LCD. If an accident occurs, the change in the Bumper’s pressure is sensed by the pressure sensor. If the sensed pressure exceeds the limit, the system will switch-off the motor and simultaneously sends an SMS to the concerned person and retrive the data from the EEPROM and display on the LCD.

1.2 Motivation

The motivation behind this project is, since the standard of living of our country is increasing day by day, the trend of owning a car has increased. So it is necessary to adopt a safety system to these vehicles which is a step towards a cutting edge

Department of EEE, BMSCE – Bangalore -19 Page 7

Page 8: My BE Project

Intelligent Vehicle Diagnostics & Monitoring System

technology. It helps us to know the reason of accident and to take future precaution to avoid its reoccurrence.

1.3 Document Conventions

The following are the list of conventions & acronyms used in this document & the project as well.

ARM 7: Advanced RISC Machine. It is a 32-bit architecture, released by ACORN Ltd.

RISC: Reduced Instruction Set Computer.

LPC 2129: Low Power Consumption is a 32-bit micro-controller released by Philips.

GSM: Global System for Mobile Communication is the most popular standard for mobile communication in the world.

GSM Modem: It is a wireless modem that works with a GSM wireless network. It can be an external device, such as Wavecom FASTTRACK Modem. By Inserting a SIM card into this modem, & connecting the modem to a serial port a wireless communication has been set up.

CAN: Control Area Network is a two-wire multi-transmitter serial data bus and is designed by Bosch as automobile network.

RF technology: Radio Frequency technology used for wireless communication.

Jumper: It’s a link to connect the open terminals which is used to enable the multi-function of ports.

1.4 Objective of the Project

With the well known proverb “Necessity is the Mother of Invention” We aim at the design & implementation of the “Vehicle Diagnostics & Monitoring System” for Car using ARM-7 Processor technology. After the successful demonstration of the algorithm with simulation, the project development would be implemented on Embedded C platform. A low cost implementation would mark the successful completion of this project.

Department of EEE, BMSCE – Bangalore -19 Page 8

Page 9: My BE Project

Intelligent Vehicle Diagnostics & Monitoring System

1.5 Project Report Organization

The report has been segregated into chapters to make the reader to realize the project description user friendly. This report consists of Eight Chapters, references & datasheets. The frame work for this project report is described as follows.

Chapter 1 tells about What is Black Box & Introduces about the project with a brief explanation of working of the “Vehicle Diagnostics & Monitoring System” for Car using ARM-7 Processor technology .It gives the details about the document conventions.

Chapter 2 gives the complete details of each & every blocks of Receiver & Transmitter side Block Diagram.

Chapter 3 has the description of all the Hardware used in the project with their technical details.

Chapter 4 explains the working principle of the System & control flow of its operation using Flow chart. It also presents the internal circuits of all blocks.

Chapter 5 gives the list of the software & protocols used in the implementation of project.

Chapter 6 presents all system hardware & complete model pictures for better understanding

Chapter 7 puts Conclusions for the System covering the Features, Advantages, Applications & Future Implementations.

Chapter 8 covers the Source & References of all data presented in the Report.

Appendix has the Data Sheets of the main Hardware of the System

Department of EEE, BMSCE – Bangalore -19 Page 9

Page 10: My BE Project

Intelligent Vehicle Diagnostics & Monitoring System

This chapter gives overview of the system & block diagram of Receiver & Transmitter side.

2.1 Block Diagram

In this project we have used 2 Microcontrollers, One is of 32-bit & other is of 8-bit. The 32-bit micro-controller is used in the receiver side & the 8-bit is used on the transmitter side.

2.1.1 Receiver side Block Diagram

The below diagram is a receiver side block diagram, which depicts the sensors, motors, CAN, RF Receiver & GSM interface to the LPC 2129 Micro-controller as shown. To implement this project we have used the KNOWX Board which is provided by KNOWX – An Embedded Company.

Department of EEE, BMSCE – Bangalore -19 Page 10

Page 11: My BE Project

Intelligent Vehicle Diagnostics & Monitoring System

LPC 2129

This 32-bit micro-controller is the heart of the ‘Receiver Module’, which controls each and every activities of the system. It is a 64 pin quad package, having 2 i/o ports P0 and P1. P0 is of capacity 32-bit and P1 is of 16 bit. It has 16 kB on-chip Static RAM & 256 kB on-chip Flash Program Memory. In-System Programming (ISP), In- Application Programming (IAP) & Flash programming are the main features of it. It has 2 interconnected CAN interfaces, 4 channel 10-bit A/D converter, two 32-bit timers, PWM unit (6 outputs), RTC and Watchdog, Multiple serial interfaces including two UARTs, Fast I2C(400 kbits/s) and two SPIs. Its On-chip crystal oscillator is of 12MHz. It needs dual power supply.

Ignition Key: It is a ‘Push Button switch used to Simulate the insertion of key into the Car. The switch is connected to P0.15 of controller.

Sensors

The sensor converts any physical quantity in to electrical signal. Here we have used four sensors.

Pressure sensor: This measures the pressure in the Bumper of the car. In this system we have connected this to Port 0.30 pin of controller.

Temperature sensor: This measures the Engine temperature of the Car. It is interfaced to the Port 0.27 pin.

Ultrasonic sensor: This detects the obstacle in & around the car and measures the distance between the car and the obstacle. It is interfaced to ‘Comport 1’ of the ‘KNOWX Board’.

Proximity sensor: This is used for lane detection. It is interfaced to Port 0.22 pin.

Brake & Seat Belt are interfaced to P0.4 & P0.5 respectively & they are simulated as jumpers. The Jumpers are sensed by the controller to decide the status of them.

Motors

Here we have used two DC motors for motion control of the vehicle. They can be driven from a variable supply of anything up to 9V. We are controlling these motors

Department of EEE, BMSCE – Bangalore -19 Page 11

Page 12: My BE Project

Intelligent Vehicle Diagnostics & Monitoring System

using relays. The speed and direction of the Car is controlled using wireless ‘RF communication’.

CAN

It is a two-wire multi-transmitter serial data bus and designed by Bosch as

automobile network. It uses 2 lines namely CAN High (CANH) and CAN Low (CANL). These 2 buses are carrying signals opposite to each other (to overcome noise interruption that simultaneously interferes on the bus). A CAN refers to a network of independent controllers. It’s a serial communication that efficiently supports distributed real-time control with high level of security

EEPROM

It is a memory device of capacity 512 x 8 (4K). It operates at 2.7 to 5.5V . It can be interfaced using 2-wire Serial Interface. It has a Bi-directional data transfer protocol & write protect pin for hardware data protection.

GSM

GSM is global system for mobile communication. We have used this technology to inform the concern person in case of an accident. It is the most popular standard for mobile phones in the world. One of the key features of GSM is the SIM (Subscriber Identity Module) commonly known as a SIM card.

‘AT COMMANDS’ forms the basic communication between ‘MODEM’ and the target device. Target device can be a microcontroller, processor, PC hyper-terminal or a mobile. These commands are used in all the mobiles where the modem and the processor interact.

In our project, using AT Commands message is sent to the specified number. If in case accident occurs means, sends a message to the specified number stored in the program. So that immediate action could be taken to save the life.

LCD-LM016L

Here we have used 16*2 (16 characters x 2 lines) LCD display to display the

characters and integers. It’s a 16 pin device & it has the Controller LSI ‘HD44780’. It works with +5v single power supply.

Department of EEE, BMSCE – Bangalore -19 Page 12

Page 13: My BE Project

Intelligent Vehicle Diagnostics & Monitoring System

RF Receiver

This is interfaced to the controller through P0.17 to P0.20 using a decoder ‘HD12D’. It receives the RF encoded signal by its antenna, which has sent by the ‘RF transmitter’ located at the transmitter side with a personal computer.

Power Supply Unit

Here to power the system we have used 2 adaptors of capacity 12V/2A & 9V/1A. The controller needs two different voltage levels for its operation, 1.8V for its CPU & 3.3V for its on chip peripherals. These voltages are obtained by 2 regulators. The other peripherals like LCD, Relays, Proximity sensor, Ultrasonic sensor, Temperature sensor & EEPROM needs 5V, it is derived from a regulator of 5V. The GSM Module & Pressure sensor needs 9V for its operation so it is also derived from a regulator of 9V.

2.1.2 Transmitter side Block Diagram

The below diagram gives the complete details of transmitter side module. Here the 8 bit micro-controller AT89S52 is the heart of the module which controls serial communication of the module with the PC. The particular key pressed in the keyboard is sent from the PC to the RF transmitter through the 8-bit micro-controller. The ASCII code sent from the PC is encoded in the ‘HT12E’ Encoder and sent to the ‘RF Transmitter’. This encoded data is sent to the ‘RF Receiver’ later through Antenna.

Department of EEE, BMSCE – Bangalore -19 Page 13

Page 14: My BE Project

Intelligent Vehicle Diagnostics & Monitoring System

PC The PC which we are going to use should have the ‘HyperTerminal’ to send the pressed key from the PC to the RF transmitter serially.

RS232 It’s a serial cable used to connect the Micro-controller to the PC’s Comport 0/1. Here the pins 2 & 3 of Comport are connected to P3.0 and P3.1 port pins of micro-controller.

Micro-controller Here we have used a 8 bit micro-controller 89S52 which controls the serial communication between PC & ‘RF Transmitter’ & the RF signal transmission.

Encoder Here we have used ‘HT12E’ Encoder of four word transmission capacity. The data pins of encoder are connected to P0.0 to Po.3 port pins of micro-controller. It encodes the data sent from micro-controller to the ‘RF Transmitter’.

RF transmitter

This transforms the encoded data in to RF signal and sends at 453-454MHz through Antenna.

Department of EEE, BMSCE – Bangalore -19 Page 14

Page 15: My BE Project

Intelligent Vehicle Diagnostics & Monitoring System

This Chapter presents the details of complete Hardware used in our System.

3.1 KNOWX BOARD

3.1.1 LPC 2129

3.1.1.1 GENERAL DESCRIPTION

The LPC2119/2129/2194/2292/2294 are based on a 16/32 bit ARM7TDMI STM CPU with real-time emulation and embedded trace support, together with 128/256 kilobytes of embedded high speed flash memory.

A 128-bit wide internal memory interface and a unique accelerator architecture enable 32-bit code execution at maximum clock rate. For critical code size applications, the alternative 16-bit Thumb Mode reduces code by more than 30% with minimal performance penalty. With their compact 64 and 144 pin packages, low power consumption, various 32-bit timers, combination of 4-channel 10-bit ADC and 2/4 advanced CAN channels or 8-channel 10-bit ADC and 2/4 advanced CAN channels (64 and 144 pin packages respectively), and up to 9 external interrupt pins these microcontrollers are particularly suitable for industrial control, medical systems, access control and point-of-sale.

Number of available GPIOs goes up to 46 in 64 pin package. Being equipped wide range of serial communications interfaces, they are also very well suited for communication gateways, protocol converters and embedded soft modems as well as many other general-purpose applications.

Technical Specifications

Department of EEE, BMSCE – Bangalore -19 Page 15

Page 16: My BE Project

Intelligent Vehicle Diagnostics & Monitoring System

1. Micro processor : LPC 2129 (ARM 7 TDMI). 2.Electrical characteristics :    Uses dual power supply

- CPU operating voltage range of 1.65V to 1.95V (1.8V +/- 8.3%).

- I/O power supply range of 3.0V to 3.6V (3.3V +/- 10%).

3. Device type : CMOS technology. 4. Memory : On chip RAM 16KB, on chip flash 256KB. 5. Out put format : Digital. 6. Frequency used :  60MHz.

3.1.1.2. IMPORTANT FEATURES OF LPC – 2129

It has ARM7 TDMI-S CPU. Comes in 64 pin package with 46 GPIO port pins. 16KB of On-chip Static RAM to store Code &/or Data. 256KB of flash memory. External 8, 16, or 32 bit BUS. ARM supports 1½ port concept. On chip crystal oscillator 1 to 30MHz. 60MHz max CPU clock available from programmable on chip PLL. Supports ISP& IAP via boot loader. Embedded ICE for real time debugging using break points and watch points. Embedded Trace Macro cell ( Support of JTAG interface to debug the program on

the hardware level) 2 CAN Controllers with Acceptance Filters. 4 Channel 10 Bit ADC with conversion time of 2.44micro sec. Two, 32 Bit Timers (4 capture and 4 compare channels). PWM with 6 outputs. RTC 1 Watch Dog Timer. Two UART’s. Two SPI Interface. Fast I2C at 400kbps. Two low power modes IDLE and Power-Down mode. CPU operating voltage +1.8V (1.65 to 1.95) Peripherals operate at +3.3V (3.00 to 3.60) I/O pins operate at +5V. Supports ARM and THUMB mode. Programming the flash memory can be done in the following ways.

Using serial JTAG interface Using ISP & UART0.

Department of EEE, BMSCE – Bangalore -19 Page 16

Page 17: My BE Project

Intelligent Vehicle Diagnostics & Monitoring System

Using IAP. Supports 3 stage pipeline. By default this supports LITTLE ENDIAN, but can be configured as BIG

ENDIAN.

EXPLANATION OF MAIN FEATURES IN DETAIL

1½ Port concept

There are basically 2 ports in LPC2129, Port0 and Port1. Port0 has 32 pins reserved for it. And Port1 has 16 pins. So total it comes to 32+16 = 48 pins. If it were really 2 ports then the number of port pins should have been 32 + 32 = 64.

The features of LPC 2129 tells that the controller has 46 pins but w en we count we get 48 pins...? Out of 48 pins 46 are used for GPIO purpose, and the remaining 2 pins are used for JTAG purpose.

On chip crystal oscillator 1 to 30MHz?

The user cannot go to the extreme value specified by the manufacturer. The user has to limit the oscillator frequency to 24MHz max for proper operation of the controller.

ISP & IAP?

ISP: In System Programming

In a simple way, ISP can be defined as a programming concept where the controller is programmed without removing it from the board and without using any external programming device. ISP needs an UART for programming the controller.

In older systems and 8 bit controllers the user had to carefully remove the controller from the target device and mount it on a separate device called “programmer”, use custom software for the programmer to copy the hex file to the flash of the controller.

In this kind of programming all the external peripheral devices will be non functional at the time of programming the controller. After the programming is done the controller is reset so that it communicates with the external devices.

IAP: In Application Programming

Department of EEE, BMSCE – Bangalore -19 Page 17

Page 18: My BE Project

Intelligent Vehicle Diagnostics & Monitoring System

This is a unique programming technique and a feature provided by latest controllers where the user could program the controller when the application code is under execution.

This gives the user a flexibility to change the value of a variable when the program is executing, and the user can see that the program will take the new modified value from the variable register when-ever it access the variable in the program. There is no need to reset the program.

This needs a dedicated and a very costly hardware. Using this, the user can stop the program execution wherever he needs to check the value of the variable. i.e. the user can debug the program as he likes. The IAP is not restricted to changing the variable in the program, but user can erase / program the complete flash while the application is running.

Both ISP and IAP needs boot loader software to be inside the controller.

ARM and thumb mode

ARM mode: Always executed in the 32 bit data format, word-aligned ARM instructions. The ARM Instruction Set is selected after CPU reset or an interrupt. The data or the opcode are accessed as 32 bit data. ARM mode is executed for all the modes available in 6 modes except USER mode. The execution is always faster and is always seen in privileged mode.

Thumb mode: Always executed in User mode and is always executed by accessing the data and code in the 16bit format and are half word-aligned. Always seen in unprivileged mode. Execution is slower compared to ARM mode.

This is of great importance as the main feature of the Thumb, increasing the code density. Code density is much more efficient and is 65% more compared to ARM mode. The registers in the THUMB mode differs slightly compared to ARM mode.

• Instruction word length shrunk to 16-bits. • Instructions follow their own syntax but each instruction has its native ARM instruction counterpart.• Due to shrinking some functionality is lost.• 19 different Thumb instruction formats.

4 Channel 10-Bit ADC

Department of EEE, BMSCE – Bangalore -19 Page 18

Page 19: My BE Project

Intelligent Vehicle Diagnostics & Monitoring System

The Microcontroller has four channel 10-Bit Analogue to Digital Converter connected to the port pins P0.27 to P0.30. When we connect the analogue signal to any of these port pins, the converted data can be retrieved from the Register ADDR & the conversion can be controlled by bits of Register ADSR

Two UARTs

The Microcontroller has Two inbuilt UARTs UART0 & UART1. The UARTs purpose is to convert bytes from the PC's parallel bus to a serial bit-stream. The cable going out of the serial port is serial and has only one wire for each direction of flow. The serial port sends out a stream of bits, one bit at a time. Conversely, the bit stream that enters the serial port via the external cable is converted to parallel bytes that the computer can understand. UARTs deal with data in byte-sized pieces, which is conveniently also the size of ASCII characters.

We have make use of UART0 for Serial Communication with Ultrasonic Sensor & GSM Module of our System.

Boot Loader Procedure?

At the starting phase of the Programming the µC, it doesn’t have capability to allow the programming through ISP/IAP Mode, but the Boot Loader makes it possible

Department of EEE, BMSCE – Bangalore -19 Page 19

Page 20: My BE Project

Intelligent Vehicle Diagnostics & Monitoring System

APPLICATIONS OF LPC2129

• Industrial control• Medical systems• Access control• Point-of-sale• Communication gateway• Embedded soft modem• general purpose applications

3.1.1.3 Jumper settings for ARM testsTop, middle and bottom pins of each jumper are denoted as 1, 2 and 3

respectively.

Sl. No. Tests Jumper Names Short the pins

1 Blinking LEDs J1 to J6J14

1 and 22 and 3

Department of EEE, BMSCE – Bangalore -19 Page 20

Page 21: My BE Project

Intelligent Vehicle Diagnostics & Monitoring System

J15 1 and 2(caution: if 2 and 3 are shorted in J15, you will get 12V instead of 5V for driving LEDs and stepper motor RM7 pins: 5 and 6)

2 Relays J5 and J6 2 and 33 Keypad - -4 LCD backlight J11 1 and 25 I2C J12 and J13 1 and 26 CAN

(takes analog input from pot P2)

J7 and J8J16

2 and 31 and 2

7 UART1 - -8 Stepper motor J1 to J4

J14J15

2 and 32 and 31 and 2(caution: if 2 and 3 are shorted in J15, you will get 12V instead of 5V for driving LEDs and stepper motor RM7 pins: 5 and 6)

9 SPI10 UART0 - -11 JTAG - -

3.1.1.4 ARM& TDMI-S

Some Basic Facts of ARM

ARM was founded by formerly known as ACORN RISC Machine founded by ACORN COMPUTERS LTD in 1983-85, later named as Advanced Risc Machine in 1990.

ARM is basically a general purpose 32 bit processor. ARM is incorporated with the 32 bit controllers manufactured by Philips

with the banner name LPC series controllers. ARM family started with the series number from ARM 1, 2, 3, 4, 5, 6, 7, 8,

9, 10, 11, 12, 13. The series till ARM 6 were basically 16 bit microcontrollers. ARM 7 was the first 32 bit controller given by ARM. The even number of series was reserved for the company’s R&D purpose

and the odd version was released to the market for commercial purpose. ARM 10 is the only even series that was released to the market.

Knowing the Nomenclature of ARM Family.

ARM-XYZ TDMI - SX - series of ARM processor Y - Support of CACHE MEMORY Z – Support of Memory management and Memory protection Unit. T – Thumb architecture Support of 16 bit instruction. D – Debugger support

Department of EEE, BMSCE – Bangalore -19 Page 21

Page 22: My BE Project

Intelligent Vehicle Diagnostics & Monitoring System

M – Fast Multiplier I – Embedded ICE - In Circuit Emulator S – Synthesizable version means the ARM is a set of software instruction engine that can be compiled on a suitable compiler.

ARM Processor Family

Features of ARM7 TDMI – S

1. It is a general purpose 32 bit controller.2. Follows Von- Neumann Architecture i.e program and data memory are in the

same area of memory.3. Supports 3 stage of pipelining.4. Supports Load and Store Architecture.5. By default it is Little Endian memory organization.6. Supports AMBA bus architecture

LPC 21XX series of microcontroller are based on ARM 7 TDMI – S architecture. LPC stands for Low Power Consumption, because for the reason it have different voltages for operation and not like other controllers where the entire controller (CPU + peripherals of controller operate at +5V VCC)

ARM7 TDM-S Core Diagram

Department of EEE, BMSCE – Bangalore -19 Page 22

Page 23: My BE Project

Intelligent Vehicle Diagnostics & Monitoring System

Operating Modes in ARM

ARM supports 7 modes of operation.• ARM core modes of operation:• User (usr) : Normal program execution state• FIQ (fiq) : Data transfer state (fast irq, DMA-type

transfer)• IRQ (iqr) : Used for general interrupt services• Supervisor (svc) : Protected mode for operating system support• Abort mode (abt) : Selected when data or instruction fetch is

aborted• System (sys) : Operating system ‘privilege’-mode for user• Undefined (und) : Selected when undefined instruction is

fetched.

Department of EEE, BMSCE – Bangalore -19 Page 23

Page 24: My BE Project

Intelligent Vehicle Diagnostics & Monitoring System

CPU RegistersThe ARM CPU provides in user mode 16 general purpose registers (R0 - R15) and

a Program Status Register (PSR) . By software and hardware conventions, the following registers have a special meaning:

R13 is used as stack pointer (SP) that holds the current stack address

R14 is used as link register (LR) that saves return address for the BL and BLX instruction,

R15 is used as program counter (PC) that points to the executed instruction.

The ARM CPU provides shadow registers which are selected on a Operation Mode switch. These shadow registers reduce interrupt latency. All CPU Register are shown in the following picture.

3.1.2 CAN CONTROLLER

CAN is an acronym for ‘Control Area Network’, it is a protocol & its operation is controlled by a CAN Controller.

What is a protocol? Protocol is a set of RULES. These rules are not limited to the only software. So the protocol are defined as

“Set of hardware and software rules based on some standards used for governing the communication of the device or the hardware which is a part of communication”.

Department of EEE, BMSCE – Bangalore -19 Page 24

Page 25: My BE Project

Intelligent Vehicle Diagnostics & Monitoring System

The CAN bus was developed by Robert BOSCH GmBH during mid 80’s in Germany, for connecting electronic control units (ECU’s). It is a Two-wire multi-transmitter serial data bus with a Configurable data rate of 5 kBits/s to 1MBits/s. It can have more than 200 bus masters with the Bus length of 0.2m to 10.000m.

Basics of CAN protocol

Department of EEE, BMSCE – Bangalore -19 Page 25

Page 26: My BE Project

Intelligent Vehicle Diagnostics & Monitoring System

Unlike a traditional network such as USB or Ethernet, CAN does not send large blocks of data point-to-point from node A to node B under the supervision of a central bus master. In a CAN network many short messages like temperature or RPM are broadcast to the entire network, which allows for data consistency in every node of the system.The below figures explains about the life before & after CAN

Department of EEE, BMSCE – Bangalore -19 Page 26

Page 27: My BE Project

Intelligent Vehicle Diagnostics & Monitoring System

Life before CAN

Life after CAN came to existence

Some CAN applicationsCars: Mercedes-Benz, Audi, Volkswagen, BMW, Porsche, Volvo, Saab.

Trucks: Mercedes-Benz, General Motors. Escalators (O&K),Elevators (OTIS), Hospital intensive care control (Sulzer), Computer tomographs (Siemens), X-Ray systems (Philips), U-Bahn Wien, Straßenbahn Bremen (Kiepe Elektrik), Garbage trucks (Moba), Milking machines (Impulsa),Textile machines, weaving machines (Dornier),Industrial roboters (Moog, Bosch), Flight simulators (EUROCOPTER).

Furthermore, CAN can be found as “embedded network” in tree-cutting machines, vending machines, wheelchairs, quality control systems, In the Knowx Innovations company board we have two on board CAN controllers-MCB2155.

Department of EEE, BMSCE – Bangalore -19 Page 27

Page 28: My BE Project

Intelligent Vehicle Diagnostics & Monitoring System

3.1.3 EEPROM

EEPROM stands for ‘Electrically Erasable and Programmable Read-Only Memory’. Serial memory devices offer significant advantages over parallel devices in applications where lower data transfer rates are acceptable. In addition to requiring less board space, serial devices allow microcontroller I/O pins to be conserved. This is especially valuable when adding external memory to low-pin count microcontrollers.

Here we have used the AT24C04 EEPROM which provides 4096 bits of serial EEPROM organized as 128/256/512/1024/2048 words of 8 bits each. The device is optimized for use in many industrial and commercial applications where low-power and low-voltage operation are essential. It is internally organized with 32 pages of 16 bytes each, the 4K requires a 9-bit data word address for random word addressing.

AT24C04 EEPROM

Technical Specifications

1. Specification : AT24C04 4k EEPROM. 2. Operating voltage : Low-voltage and Standard-voltage operation

2.7 (VCC = 2.7V to 5.5V) 1.8 (VCC = 1.8V to 5.5V).

3. Operating frequency : 100 kHz (1.8V) and 400 kHz (2.7V, 5V)4. Time for write cycle : 5 ms max 5. Protocol : I2C

The below diagram shows the pin details of EEPROM

SERIAL CLOCK (SCL):The SCL input is used to positive edge clock data into eachEEPROM device and negative edge clock data out of each device.

Department of EEE, BMSCE – Bangalore -19 Page 28

Page 29: My BE Project

Intelligent Vehicle Diagnostics & Monitoring System

SERIAL DATA (SDA): The SDA pin is bi-directional for serial data transfer. This pin is open-drain driven and may be wire-ORed with any number of other open-drain or open collector devices.DEVICE/PAGE ADDRESSES (A2, A1, A0): The A2, A1 and A0 pins are device address inputs that are hard wired for the AT24C01A and the AT24C02. As many as eight 1K/2K devices may be addressed on a single bus system The AT24C04 uses the A2 and A1 inputs for hard wire addressing and a total of four 4K devices may be addressed on a single bus system. The A0 pin is a no connect.

The AT24C08 only uses the A2 input for hardwire addressing and a total of two 8K devices may be addressed on a single bus system. The A0 and A1 pins are no connects. The AT24C16 does not use the device address pins, which limits the number of devices on a single bus to one. The A0, A1 and A2 pins are no connects.WRITE PROTECT (WP): The AT24C01A/02/04/16 has a Write Protect pin that provides hardware data protection. The Write Protect pin allows normal read/write operations when connected to ground (GND). When the Write Protect pin is connected to VCC, the write protection feature is enabled and operates as shown in the

3.1.3.1 I2C Protocol

The I2C Stands for “Inter Integrated Communication Protocol”. Basically it is a

serial protocol for the purpose of communication. Many devices or components are integrated with in the system.

History of I2C Protocol The problem of connecting limited devices using RS-232 protocol was getting

bigger limitation and threat as the technologies was expanding at an alarming rate. The latest market demanded the need to interface more number of devices to the meet needs of the newer technologies.

A Protocol that could solve most of the problems faced by the most of the fields was underway. Philips laid foundation and came up with a lot of promises to solve the problems seen in RS-232 protocol.

In 1980 Philips raised the curtain and presented the protocol much awaited to solve most of the problems. They named it as “I2C”, “Inter Integrated Communication

Protocol”. This protocol is also referred by other names namely “IIC”, “Hard Wired Software Controlled Protocol”.

Department of EEE, BMSCE – Bangalore -19 Page 29

Page 30: My BE Project

Intelligent Vehicle Diagnostics & Monitoring System

A Master-Slave System connection of I2C

Things to Know about I2C protocol

I2C is “synchronous serial, Half Duplex, 2 wired bus communication protocol”. I2C supports “MASTER AND SLAVE CONCEPT”. It has 2 lines or bus namely “SDA”,”SCL” (Serial Data, Serial Clock). SDA is bi-directional and SCL is uni-directional. In some cases SCL is bi-

directional where master and slave are both microcontrollers. Clock is software generated. Slaves are those devices which support or which have inbuilt I2c protocol. Not all the IC’s available in the market support I2C. We identify the IC whether

it supports I2C or not by verifying the presence of SDA and SCL pins on the IC hardware.

I2C communication is of broadcast type at the beginning, but once the communication starts it is only ONE TO ONE communication.

Always the master begins the communication. When there is no communication all the slaves are in idle state. At any point of time the master has the complete control of the I2C. I2C supports multi master concept. I2C operates is 3 different speeds.

a. 100Kbps with max distance of 10mts.b. 400Kbps with max distance of 6mts.c. 1.4Mbps with max distance of 1 to 2mts.

I2C supports 7 bit and 10 bit addressing format. Data is valid only when the clock is in high state. Multi Master connection of I2C

Department of EEE, BMSCE – Bangalore -19 Page 30

Page 31: My BE Project

Intelligent Vehicle Diagnostics & Monitoring System

When clock is low the data is placed on the SDA line. When the clock is HIGH The data start moving in the SDA line and reaches the slave or the master depending on who is the destination.

3.1.4 LCD DISPLAY

The LCD is an acronym for ‘Liquid Crystal Display’, it is used to display the characters and integers on 16*2 matrix (16 characters x 2 lines). In our system we have used LM016L LCD Display, it has built in Controller LSI HD44780. It needs +5v single power supply for its operation with the Operating Temperature of about 25ºC.

Technical Specifications

1. LCD Display : 16*22. Supply Voltage : 5V DC

3. Input Current : 40mA (Ideal Mode),140mA (Working Mode)

4. Device Type : Liquid Crystal Display

5. Communication : Parallel

6. Output Format : Characters & Integers

Internal pin configuration Pin no Symbol Level Function1 Vss - 0V2 Vdd - +5V3 RS H/L L: Instruction code

inputH: Data input

4 R/W H/L H: Data readL: Data write

5 E H,H to L Enable signal6 DB0 H/L Data bus line7 DB1 H/L8 DB2 H/L9 DB3 H/L10 DB4 H/L11 DB5 H/L

Department of EEE, BMSCE – Bangalore -19 Page 31

Page 32: My BE Project

Intelligent Vehicle Diagnostics & Monitoring System

12 DB6 H/L13 DB7 H/L

3.1.5 MAX 232

The MAX3232 is a line driver IC, which is used for serial communication. It consists of two line drivers, two line receivers, and a dual charge-pump circuit (capacitor circuits) with ±15-kV ESD protection pin to pin (serial-port connection pins, including GND). The MAX232 is an integrated circuit that converts signals from an RS-232 serial port to signals suitable for use in TTL compatible digital logic circuits. The MAX232 is a dual driver/receiver and typically converts the RX, TX, CTS and RTS signals.

Technical Specifications

1. Operating voltage : Operate With Single 5-V Power Supply.2. Operating Speed : 120 Kbit/s.

3. Current rating : 8mA.

4. Input levels : ±30-V Input Levels

5. Communication type : serial communication

The receivers reduce RS-232 inputs (which may be as high as ± 25 V), to standard 5 V TTL levels. These receivers have a typical threshold of 1.3 V, and a typical hysteresis of 0.5 V. The later MAX232A is backwards compatible with the original MAX232 but may operate at higher baud rates and can use smaller external

Department of EEE, BMSCE – Bangalore -19 Page 32

Page 33: My BE Project

Intelligent Vehicle Diagnostics & Monitoring System

capacitors – 0.1 μF in place of the 1.0 μF capacitors used with the original device. The newer MAX3232 is also backwards compatible, but operates at a broader voltage range, from 3 to 5.5V voltage levels it is helpful to understand what occurs to the voltage levels.

When a MAX232 IC receives a TTL level to convert, it changes a TTL Logic 0 to between +3 and +15V, and changes TTL Logic 1 to between -3 to -15V, and vice versa for converting from RS232 to TTL. This can be confusing when you realize that the RS232 Data Transmission voltages at a certain logic state are opposite from the RS232 Control Line voltages at the same logic state.

The table below specify these levels

RS232 Line Type & Logic Level

RS232 Voltage TTL Voltage to/from MAX232

Data Transmission (Rx/Tx) Logic 0

+3 V to +15V 0V

Data Transmission (Rx/Tx) Logic 1

-3V to -15V 5V

Control Signals (RTS/CTS/DTR/DSR) Logic 0

-3V to -15V 5V

Control Signals (RTS/CTS/DTR/DSR) Logic 1

+3V to +15V 0V

Typical Operating Circuit & Capacitor Values

3.1.5.1 RS 232

Electronic data communications between elements will generally fall into two broad categories: single-ended and differential. RS232 (single-ended) was introduced

Department of EEE, BMSCE – Bangalore -19 Page 33

Page 34: My BE Project

Intelligent Vehicle Diagnostics & Monitoring System

in 1962 In telecommunications, RS-232 (Recommended Standard 232) is a standard for serial binary data signals connecting between a DTE (Data Terminal Equipment) and a DCE (Data Circuit-terminating Equipment). It is commonly used in computer serial ports.

The RS-232 interface presupposes a common ground between the DTE and DCE Independent channels are established for two-way (full-duplex) communications. The RS232 signals are represented by voltage levels with respect to a system common (power / logic ground). The high state (logic 1) has the signal level negative with respect to common, and the low state (logic0) has the signal level positive with respect to common. Modern computer equipment ignores the negative level and accepts a zero voltage level as the "OFF" state. In fact, the "ON" state may be achieved with lesser positive potential. This means circuits powered by 5 VDC are capable of driving RS232 circuits directly, however, the overall range that the RS232 signal may be transmitted/received may be dramatically reduced.

The output signal level usually swings between +12V and -12V. An RS-232 port can supply only limited power to another device. The number of output lines, the type of interface driver IC, and the state of the output lines are important considerations. RS232 has numerous handshaking lines (primarily used with modems), and also specifies a communications protocol.

In this project both the ultrasonic sensor and GSM modules are communicated via serial communication itself which uses RS232 for this purpose and its line driver IC MAX232

The below figure shows the Male & Female Connector Serial Cable.

This is a standard 9 pin cable layout for asynchronous data on a PC AT serial cable

Description Signal 9-pin DTE Source DTE or DCE

Carrier Detect CD 1 From modemReceive Data RD 2 From modem

Transmit Data TD 3From terminal/computer

Data Terminal Ready DTR 4 From

Department of EEE, BMSCE – Bangalore -19 Page 34

Page 35: My BE Project

Intelligent Vehicle Diagnostics & Monitoring System

terminal/computerSignal Ground SG 5 From modemData Set Ready DSR 6 From modem

Request to Send RTS 7From terminal/computer

Clear to Send CTS 8 From modemRing Indicator RI 9 From modem

3.1.6 RELAYS

A relay is an electrically operated switch. It consists of a coil of wire surrounding a soft iron core, an iron yoke, which provides a low reluctance path for magnetic flux, a movable iron armature, and a set, or sets, of contacts .The armature is hinged to the yoke and mechanically linked to a moving contact or contacts. It is held in place by a spring so that when the relay is de-energized there is an air gap in the magnetic circuit. In this condition, one of the two sets of contacts in the relay is closed, and the other set is open. Other relays may have more or fewer sets of contacts depending on their function.

Many relays use an electromagnet to operate a switching mechanism, but other operating principles are also used. Relays find applications where it is necessary to control a circuit by a low-power signal, or where Several circuits must be controlled by one signal. Solid-state relays control power circuits with no moving parts, instead using a semiconductor device to perform switching.

In this project we are using two relays with driver for controlling the speed and direction of motor through RF technology, as controller output signal level is not sufficient to drive the relays directly, so we are driving relay through the driver-ULN2803.

Department of EEE, BMSCE – Bangalore -19 Page 35

Page 36: My BE Project

Intelligent Vehicle Diagnostics & Monitoring System

Technical Specifications

1. Supply voltage : 5v 2. Current : 30mA

RELAY DRIVER

As the Microcontroller output Current level is not possible to drive the relays directly & the energy stored in the Relay coil may be discharged through Microcontroller Pins. To overcome from this we have used the Relay Driver circuit. These Drivers has inbuilt anti-parallel Diode which is helpful for discharging the stored energy.

Technical Specifications

1. Specification : ULN28032. Output Voltage VO : 50 V3. Input Voltage (Except ULN2801) VI : 30 V4. Collector Current – Continuous IC :500 mA5. Base Current – Continuous IB :25 mA6. Operating Ambient Temperature Range TA :0 to +70 °C7. Storage Temperature Range :–55 to +150 °C8. Junction Temperature TJ :125 °

3.2 SENSORS

Sensor is a device which converts any non electrical quantity in to an electrical quantity. In our system we have used totally four Sensors, they are Ultrasonic Sensor, Pressure Sensor, Temperature Sensor & Proximity Sensor.

3.2.1 PRESSURE SENSOR

In this project we used this sensor to detect the pressure changes which occur during accidents in the Bumper. The Sensor continuously measures the Pressure in the Bumper while the Vehicle is moving. We have set the limiting value of Pressure to 45kg/cm² in the program. When the pressure exceeds the set value it takes an appropriate measures like Switching OFF the Motors, Retrieving the data from EEPROM & Sending an SMS to concerned Person.

Pressure metrology is the technology of transducing pressure into an electrical quantity. Normally, a diaphragm construction is used with strain gauges either bonded to , or diffused into it, acting as resistive elements. Under the pressure-induced strain, the resistive values change.

Department of EEE, BMSCE – Bangalore -19 Page 36

Page 37: My BE Project

Intelligent Vehicle Diagnostics & Monitoring System

3.2.2 ULTRA SONIC SENSOR

In our System we have used this Sensor to measure the Obstacle distance. In our Vehicle we have placed this sensor in the front.

Ultrasonic sensors (also known as transducers when they both send and receive) work on a principle similar to radar or sonar which evaluate attributes of a target by interpreting the echoes from radio or sound waves respectively.

Ultrasonic sensors generate high frequency sound waves and evaluate the echo which is received back by the sensor. Sensors calculate the time interval between sending the signal and receiving the echo to determine the distance to an object.

This technology can be used for measuring: wind speed and direction (anemometer), fullness of a tank, and speed through air or water. For measuring speed or direction a device uses multiple detectors and calculates the speed from the relative distances to particulates in the air or water. To measure the amount of liquid in a tank, the sensor measures the distance to the surface of the fluid. Further applications

Department of EEE, BMSCE – Bangalore -19 Page 37

Page 38: My BE Project

Intelligent Vehicle Diagnostics & Monitoring System

include: humidifiers, sonar, medical ultrasonography, burglar alarms, and non-destructive testing.

Systems typically use a transducer which generates sound waves in the ultrasonic range, above 20,000 hertz, by turning electrical energy into sound, then upon receiving the echo turn the sound waves into electrical energy which can be measured and displayed.The technology is limited by the shapes of surfaces and the density or consistency of the material.

In this project we used this sensor to measure the distance of obstacles when the vehicle is subjected to accident, only one sensor has been interfaced at the front side of vehicle but we can interface for back ,left & right side of the vehicle also.

Technical Specifications

1. ULTRA SONIC SENSOR : SRF02.2. Mode of Communication : UART/I2C.3. Input DC voltage : + 5V 0.5V.4. Frequency : 40k Hz 500Hz.5. Range of detection : 15cm to 6 m.6. Units : Range reported in cm or inches.7. Size : 24mm w x 20mm d x 17mm h.8. Current Consumption : 4mA (typical).9.

3.2.3 TEMPERATURE SENSOR

The LM35 is an integrated circuit sensor that can be used to measure temperature with an electrical output proportional to the temperature (in oC) .In this project we used this sensor to measure the engine temperature

Why Use LM35s to Measure Temperature?o You can measure temperature more accurately than a using a thermistor.

o The sensor circuitry is sealed and not subject to oxidation, etc.

o The LM35 generates a higher output voltage than thermocouples and may not require that the output voltage be amplified.

o

What Does an LM35 Do?  How does it work?

o It has an output voltage that is proportional to the Celsius temperature.

o The scale factor is .01V/oC

Department of EEE, BMSCE – Bangalore -19 Page 38

Page 39: My BE Project

Intelligent Vehicle Diagnostics & Monitoring System

o The LM35 does not require any external calibration or trimming and maintains an accuracy of  +/-0.4 oC at room temperature and +/- 0.8 oC over a range of 0oC to +100oC.

o Another important characteristic of the LM35DZ is that it draws only 60 micro amps from its supply and possesses a low self-heating capability. The sensor self-heating causes less than 0.1oC temperature rise in still air.

How Can we Use An LM35?  (Electrical Connections)

o Here is a commonly used circuit.  For connections refer to the picture above.

o In this circuit, parameter values commonly used are:

Vc = 4 to 30v

5v or 12 v are typical values used.

Ra = Vc /10-6

Actually, it can range from 80 KW to 600 KW, but most just use 80 KW.

3.2.4 PROXIMITY SENSOR

A proximity sensor is a sensor able to detect the presence of nearby objects without any physical contact. A proximity sensor often emits an electromagnetic or electrostatic field, or a beam of electromagnetic radiation (infrared, for instance), and looks for changes in the field or return signal.

Department of EEE, BMSCE – Bangalore -19 Page 39

Page 40: My BE Project

Intelligent Vehicle Diagnostics & Monitoring System

The object being sensed is often referred to as the proximity sensor's target. Different proximity sensor targets demand different sensors. For example, a capacitive or photoelectric sensor might be suitable for a plastic target; an inductive proximity sensor requires a metal target.

An inductive proximity sensor has four components; The coil, oscillator, detection circuit and output circuit. The oscillator generates a fluctuating magnetic field the shape of a doughnut around the winding of the coil that locates in the device’s sensing face.

When a metal object moves into the inductive proximity sensor’s field of detection, Eddy circuits build up in the metallic object, magnetically push back, and finally dampen the Inductive sensor’s own oscillation field. The sensor’s detection circuit monitors the oscillator’s strength and triggers an output from the output circuitry when the oscillator becomes dampened to a sufficient level.

Here Proximity sensor is used as a Lane Detector. It is a inductive type sensor able to detect the presence of nearby object without any physical contact. It is used for the Lane detection.

1 - Means car out off lane. 0- Means in the lane.

It is connected to the port pin P0.22.

3.3 DC MOTORS

In any electric motor, operation is based on simple electromagnetism. A current-carrying conductor generates a magnetic field; when this is then placed in an external magnetic field, it will experience a force proportional to the current in the conductor, and to the strength of the external magnetic field .The internal configuration of a DC motor is designed to harness the magnetic interaction between a current-carrying conductor and an external magnetic field to generate rotational motion.

Department of EEE, BMSCE – Bangalore -19 Page 40

Page 41: My BE Project

Intelligent Vehicle Diagnostics & Monitoring System

Every DC motor has six basic parts -- axle, rotor, stator, commutates, field magnet(s), and brushes. In most common DC motors, the external magnetic field is produced by high-strength permanent magnets. The stator is the stationary part of the motor -- this includes the motor casing, as well as two or more permanent magnet pole pieces. The rotor (together with the axle and attached commutator) rotates with respect to the stator. The rotor consists of windings (generally on a core), the windings being electrically connected to the commutator. The above diagram shows a common motor layout -- with the rotor inside the stator (field) magnets.

They can be reversed simply by reversing the supply and speed is controlled through on chip PWM’s of processor. The two wheels are controlled separately and hence need controls independent of each other. A left turn for the car calls for the right wheel to be driven, with the left wheel stationary, and vice versa for the right turn. In case this does not produce satisfactory results, we can have bi-directional

control of the motors, by reversing the wheel that was stationary. Regardless of that,

what is clear is that both motors need to be controlled independently of each other. Also, since the motors need to be started and stopped very fast, the control circuit needs to be adequately fast.

Technical Specification1. Supply voltage : 5V2. Current limit : 120mA (min) - 350mA (max)

3.4 GSM MODULE

GSM is an acronym for global system for mobile communication is one of the most widely used technologies in today’s world. The main reason for acceptance is its

Department of EEE, BMSCE – Bangalore -19 Page 41

Page 42: My BE Project

Intelligent Vehicle Diagnostics & Monitoring System

unique feature of SMS service with roaming and Integrated Service Digital Network (ISDN).

GSM (global system for mobile communication), GSM is a digital cellular telephone technology that is based on TDMA (Time Division Multiple Access). GSM is one of the most widely used techniques in today’s world. The main reason for acceptance is its unique features of SMS service with roaming and integrated Service Digital Network (ISDN).

The operation of wireless technology is developed in digital text message and the continues increases in the device density of integrated circuit have made completely digital system viable. One of the key features of GSM is the Subscriber Identity Module (SIM), commonly known as a SIM card.

A variety of data services is offered. GSM users can send and receive data, at rates up to 9600 bps. Since GSM is a digital network, a modem is not required between the user and GSM network, although an audio modem is required inside the GSM network to interwork with POTS.

SMS is a bidirectional service for short alphanumeric (up to 160 bytes) messages. Messages are transported in a store-and-forward fashion. For point-to-point SMS, a message can be sent to another subscriber to the service, and an acknowledgement of receipt is provided to the sender. SMS can also be used in a cell-broadcast mode, for sending messages such as traffic updates or news updates. Messages can also be stored in the SIM card for later retrieval.

In our System we have used it to send an SMS to the concerned person in case of an Accident by initialising the GSM Module with the help of AT Commands. The AT Commands corresponding to Sending a Message are used later to send an SMS to one or many Cell phone number of Relatives, Owner, Police, Hospital etc to inform about the Accident for further action.

Architecture of the GSM networkA GSM network is composed of several functional entities, whose functions and

interfaces are specified. Figure 1 shows the layout of a generic GSM network. The GSM network can be divided into three broad parts. The Mobile Station is carried by the subscriber. The Base Station Subsystem controls the radio link with the Mobile Station. The Network Subsystem, the main part of which is the Mobile services

Department of EEE, BMSCE – Bangalore -19 Page 42

Page 43: My BE Project

Intelligent Vehicle Diagnostics & Monitoring System

Switching Centre (MSC), performs the switching of calls between the mobile users, and between mobile and fixed network users. The MSC also handles the mobility management operations. Not shown is the Operations and Maintenance Centre, which oversees the proper operation and setup of the network. The Mobile Station and the Base Station Subsystem communicate across the Um interface, also known as the air interface or radio link. The Base Station Subsystem communicates with the Mobile services Switching Centre across the Air interface.

The following are the abbreviation used to define GSM network architecture

SIM- SUBSCRIBER IDENTITY MODULE BSC- BASE STATION CONTROLLER MSC- MOBILE SERVICE SWITCHING CENTER ME- MOBILE EQUIPMENT HLR – HOME LOCATION REGISTER EIR- EQUIPMENT IDENTITY REGISTER BTS- BASE TRANSCEIVER STATION VLR- VISITOR LOCATION REGISTER AUC- AUTHENTICATION CENTER

In this project we utilised this technology using external GSM modem, which acts as both transmitter and receiver interfaced through the serial communication with the user friendly ATCOMMANDS INSTRUCTION SET (ATTENTION

COMMANDS) AT COMMANDS forms the basic communication between MODEM

and the target device. Target device can be a microcontroller, processor, PC hyper-

Department of EEE, BMSCE – Bangalore -19 Page 43

Page 44: My BE Project

Intelligent Vehicle Diagnostics & Monitoring System

terminal or a mobile. These commands are used in all the mobiles where the modem

and the processor interact.

Right from powering ON the mobile to any thinkable operation in the mobile till it is switched off, everything is based on AT COMMANDS.

AT COMMANDS

Power ON Call SIM SMS Phonebook Dial Alarm Network Antenna GPRS Headphone area Power off Indication

The GSM modem has to be initialized at Power ON.

1. This is done by sending AT to the modem from the application. 2. After getting this command the modem responds with a response sending “OK”

to the application.3. The application has to send ATE0 indicating echo is OFF. ATE1 is Echo ON.4. The modem sends back OK to the application.5. Then onwards the application has to send suitable AT command to initialize the

modem as per the requirement.

Department of EEE, BMSCE – Bangalore -19 Page 44

Page 45: My BE Project

Intelligent Vehicle Diagnostics & Monitoring System

3.5 IGNITION KEY, SEAT BELT & BRAKE CONTROL

In our project we simulated the ignition key through a push button, seat belt and brake control module of a vehicle using a jumper basically it is a switch.

3.6 RF COMMUNICATION SYSTEM

RF communication works by creating electromagnetic waves at a source and being able to pick up those electromagnetic waves at a particular destination. These electromagnetic waves travel through the air at near the speed of light. For Remote control applications 433 MHz frequency range is used. These waves are sent to the receiver from the transmitter by an antenna.

RF Communication System

1. Simplex RF System

A radio technology that allows only one-way communication from a transmitter to a receiver

Examples: FM radio, Pagers, TV, One-way AMR systems

2. Half-duplex RF Systems

Department of EEE, BMSCE – Bangalore -19 Page 45

Page 46: My BE Project

Intelligent Vehicle Diagnostics & Monitoring System

Operation mode of a radio communication system in which each end can transmit and receive, but not simultaneously

Examples: Walkie-talkie, wireless keyboard mouse3. Full-duplex RF Systems

Radio systems in which each end can transmit and receive simultaneously Example: Cellular phones, satellite communication

Basic Building Blocks of an RF System

RF-IC Transmitter Receiver Transceiver System-on-Chip (SoC); typically transceiver with integrated microcontroller

Crystal Reference frequency for the LO and the carrier frequency

Balun Balanced to unbalanced Converts a differential signal to a single-ended signal or vice versa

Filter Used if needed to pass regulatory requirements / improve selectivity

Antenna Transmit/Receives the RF signals

3.6.1 RF TRANSMITTER

Department of EEE, BMSCE – Bangalore -19 Page 46

Page 47: My BE Project

Intelligent Vehicle Diagnostics & Monitoring System

RF Transmitter transmits the signal to the particular destination using RF Technology. It works at Radio Frequency range.

In our project we have used this phenomenon to control the motor speed and direction through the computer. It houses the 8-bit µC & an Encoder where the data sent through the computer is pickup by the 8-bit µC and is encoded in the encoder to transmit the data using RF technology.

The following are the technical details of the RF Transmitter used in the project.

Technical Specification1. RF Transmitter : TLP434A2. Operating Voltage : 2 to 12 V

3.Peak Current : 1.64mA 4. Input High Voltage : Vcc-0.5 to Vcc+0.5 V 5. Input Low Voltage : 0.3 V 6. Absolute Frequency : 315 MHz 7. RF Output Power (50ohm) : Vcc 9V-12V 8. Data Rate : 200Kbps 9. Modulation : AM, FM

3.6.1.1 AT89S52

The IC AT89S52 is a 8-bit µC, in our System we have used this to control the Serial communication between the PC & µC & RF Communication between RF Transmitter & RF Receiver.

Pin diagram of AT89S52

We have make use of only pin P3.0 (RXD) & P3.1 (TXD) for Serial Communication with the PC, P0.0 to P0.4 ( Data to Encoder) to send the Data to be Encoded for RF Transmission.

Department of EEE, BMSCE – Bangalore -19 Page 47

Page 48: My BE Project

Intelligent Vehicle Diagnostics & Monitoring System

Programming AT89S52 for Serial data transmission

In programming the 8051 to transfer character bytes serially, the following steps must be taken.

1. The TMOD register is loaded with the value of 20H, indicating the use of Timer 1 in mode2 (8-bit auto-reload) to set the baud rate.

2. TH1 is loaded with one of the values from the below table , to set the baud rate(with XTAL crystal frequency of 11.0592 MHz)

3. The SCON register is loaded with the value 50H, indicating serial mode-1, where 8-bit data is framed with start and stop bits.

4. TR1 (Timer-1 ready bit in TCON register) is set to 1 to start timer 1.5. TI flag is cleared with the “CLR TI” instruction.6. The character byte to be transferred serially is written into the SBUF register.7. The TI flag bit is monitored with the use of the instruction “JNB RI, xx” to see

if the entire character has been received completely.8. To receive the next character, go to step 5.

BAUD RATE TH1 (DECIMAL) TH1 (HEX)

9600 -3 FD

4800 -6 FA

2400 -12 F4

1200 -24 E8

Department of EEE, BMSCE – Bangalore -19 Page 48

Page 49: My BE Project

Intelligent Vehicle Diagnostics & Monitoring System

Technical Specification

1. Microcontroller : AT89C51 2. Electrical characteristics : Minimum VCC for Power-down is 2V.

Low-voltage Mode (VPP = 5V), High –voltage Mode (VPP=12V) 3. Device type :

CMOS technology 4. Memory: 128 Bytes of RAM, 4K Bytes of Flash 5. Output

format : Digital.

3.6.1.2 ENCODER

The Encoder we have used in our system is HT12E, which encodes the data sent by the µC. The Encoded data later sent to the RF Transmitter for wireless data transmission.

Features

Operating voltage - 2.4V~12V for the HT12E Low power and high noise immunity CMOS technology Minimum transmission word - Four words for the HT12E Data code has positive polarity Low standby current of < 1μA at 5V supply HT12A/E: 18-pin DIP/20-pin SOP package

General Description

The HT12E encoder is a CMOS IC built especially for remote control system applications. It is capable of encoding 8 bits of address (A0-A7) and 4 bits of data (AD8-AD11) information. Each address/data input can be set to one of the two logic states, 0 or 1. Upon reception of transmit enable (TE-active low), the programmed address/data are transmitted together with the header bits via an RF medium.

Applications Burglar alarm system Smoke and fire alarm system Garage door controllers Car door controllers Car alarm system Security system Cordless telephones Other remote control systems

Department of EEE, BMSCE – Bangalore -19 Page 49

Page 50: My BE Project

Intelligent Vehicle Diagnostics & Monitoring System

Pin Description Encoder HT12E

3.6.2 RF RECEIVER

RF Receiver demodulates the received signal sent from the transmitter & converts to the original data. In this project we have placed this module in the host side of the vehicle in addition to which it has a decoder which decodes the data & sends it to the µC for further process.

Technical Specification1. RF Receiver : RLP434A2. Operating Voltage : 3.3 to 6V 3. Operating Current : 4.5 mA 4. Operating frequency : 315,418 and 433.92 MHz 5. Sensitivity : -110dBm 6. Channel width : ± 500 KHz 7. Noise Equivalent BW : 4 KHz 8. Receiver turn On time : 5ms 9. Operation temperature : -20 to 80 oC 10.Base band data rate : 4.8 KHz

3.6.2.1 DECODERThe Decoder we have used in our system is HT12D, which decodes the data

sent at 453-454MHz by the RF Transmitter. The Decoded data later sent to the µC for further action to be taken for the particular Key Pressed in the PC’s Keyboard & sent by the RF Transmitter Block.

Department of EEE, BMSCE – Bangalore -19 Page 50

Page 51: My BE Project

Intelligent Vehicle Diagnostics & Monitoring System

Features

Operating voltage: 2.4V~12V Low power and high noise immunity CMOS technology

- Low standby current- Capable of decoding 12 bits of information

Binary address setting Received codes are checked 3 times Address/Data number combination

-HT12D: 8 address bits and 4 data bits

General Description

The HT12D is a decoder IC made especially to pair with the HT12E encoder. It is a CMOS IC made for remote control system applications. The decoder is capable of decoding 8 bits of address (A0-A7) and 4 bits of data (AD8-AD11) information. The decoder receives serial addresses and data from a programmed encoder transmitted by a carrier using RF or an IR transmission medium.

3.7 POWER SUPPLY UNIT

The Power Supply Unit is the last & very important Hardware Unit which Power each & every Block of the System.

The block diagram shows a typical power supply which has

1. Transformer 2. Rectifier 3. Filter 4. Regulator

Department of EEE, BMSCE – Bangalore -19 Page 51

Page 52: My BE Project

Intelligent Vehicle Diagnostics & Monitoring System

The first section is the TRANSFORMER which steps down the input line voltage and isolates the power supply from the power line. The RECTIFIER section converts the alternating current input signal to a pulsating direct current, as pulsating dc is not desirable. For this reason a FILTER section is used to convert pulsating dc to a purer, more desirable form of dc voltage. The final section, the REGULATOR maintains the output of the power supply at a constant level in spite of large changes in load current or input line voltages.

So we used two adaptors for this purpose 12V, 2A and 9V, 1A and separate voltages of lower than this is obtained by on board regulators.

The voltages specification for different modules and microcontroller as follows

Regulators Board 12V/2A: From an Adaptor KNOWX Innovations’s Board 7.5/9V : From a 9V Regulator

On Board Regulatorso 5V For LCD, Relays, IO portso 3.3V For On-Chip Peripheralso 1.8V For CPU

RF Receiver 5V: From a 5V Regulator GSM Module 9V: From a 9V Regulator Proximity Sensor 5V: From a 5V Regulator Ultrasonic Sensor 5V: From a 5V Regulator Pressure Sensor 9V: From a 9V Regulator RF Transmitter Board 9V/1A: From an Adaptor

AT89S525V: From a 5V Regulator RF Transmitter: From a 5V Regulator

Department of EEE, BMSCE – Bangalore -19 Page 52

Page 53: My BE Project

Intelligent Vehicle Diagnostics & Monitoring System

3.8 COMPONENTS USED

RECEIVER REQUIREMENTS: TRANSMITTER REQUIREMENTS:

SL no

Components Quantity

1. ARM7 CPU based LPC2129 Microcontroller

1

2. GSM Module 1

3. SIM Card 1

4. CAN Controllers(MCP2551)

2

5. Ultrasonic Sensor(SRF-02)

1

6. Brake control Module(Jumper)

1

7. Proximity Sensor 1

8. Temperature Sensor (LM35)

1

9. Relay(+5V) 2

10. Seat Belt(Jumper) 1

11. Ignition ON key(button switch)

1

12. DC Motors (5v) 2

13. LCD 16*2 1

14. RF Receiver 433MHz 1

15. RF Decoder( HT12D) 1

16. Power Supply Unit  (+12V/2A)

1

17. RS-232 Cable 1

18. ULN2803 for relay driver

1

19. EEPROM(24C04) 1

Department of EEE, BMSCE – Bangalore -19 Page 53

Sl.no Components Quantity

1. Microcontroller (AT89S52)

1

2. RF Transmitter 433MHz

1

3. RF Encoder (HT12E) 1

4. Power Supply Unit  (+12V)

1

5. RS-232 Cable 1

6. Personal Computer with XP

and HYPERTERMINAL

1

7. MAX232 1

Page 54: My BE Project

Intelligent Vehicle Diagnostics & Monitoring System

This chapter gives the complete working principle of the Intelligent Vehicle Diagnostics & Monitoring System.

4. Working Principle

4.1 Principle of Operation

The working of the system has divided into two stages, one is ‘Ignition ON’ & other is ‘Power ON’. When the supply is Switched ON & after we pressed the Reset Button of the kit, the dumped code in the 32 bit µc starts executing. In the beginning the LCD displays “WELCOME TO BLACK BOX FOR VEHICLES”. In the next step it waits for the Ignition Key to be pressed by displaying “Waiting For Key…”. When we pressed the Ignition Key, the “Ignition ON” stage initializes.

At “Ignition ON”, it checks each vehicle critical failure parameters such as Brake, Seat Belt, CAN bus, & GSM module and display the status of each failure parameter on the LCD as “PASS” if it in right condition else it displays “FAIL”. Once all the four critical failure parameters are checked , it checks for the overall status & display as “PASS” if all the parameters are in right condition, if not it displays as “FAIL” & it doesn’t allow the Motors to Switch ON & waits for the Ignition Key to be pressed again. This check continues untill all the four parameters to be in a right condition.

At “Power ON”, the system allows the motor to switch-on. Here we have used the RF technology to control the motion of the motor. When the vehicle is under running condition , the system checks the four minor failure parametrs such as Engine Temperature, Bumper’s Pressure, Lane detection & Obstacle detection. If any minor failure occurs, it informs the driver by displaying its status on the LCD. If an accident occurs, the change in the Bumper’s pressure is sensed by the pressure sensor. If the sensed pressure exceeds the limit which is set by the programmer, the system displays on the LCD as “ACCIDENT OCCURRED” & suddenly Switch-OFF the motor first by displaying as “ MOTOR IS SWITCHED OFF” & simultaneously sends an SMS to the concerned person whose Cell phone number is stored in the program and retrive the data from the EEPROM & display them on LCD as “TEMP =XX”, “PRESSURE =XX” , “LANE =XX” & “ULTRASONIC =XX”. Here the temperature measured is in ºC, pressure is in kg/cm², lane distance is in mm & obstacle distance measured by Ultrasonic Sensor is in cm.

4.2 Flow Chart

The Flow Chart gives the step by step operation of our system diagrammatically. It is very easy for a person to analyse and understand the process involved in the project. The flow of operation is divided as Diagnose of Critical failure Parameters, Motion control of Motors & Diagnose of Minor failure Parameters.

Department of EEE, BMSCE – Bangalore -19 Page 54

Page 55: My BE Project

Intelligent Vehicle Diagnostics & Monitoring System

Diagnose of Critical failure Parameters

Department of EEE, BMSCE – Bangalore -19 Page 55

Start

INITIALIZATION FOR LCD (2*16)

Checks the status of critical parameters

Critical sensor.

Is Brake Module plugged?

Display the Brake Module is OK as “PASS” on the LCD

Yes

No

Is Seat Belt plugged?

A

A

Display the Seat-Belt is OK as “PASS” on the LCD

Display as “PASS”

No

Yes

Display failure of the module as “FAIL” on the LCD

Is CAN Bus is OK?

A

Display the Seat-Belt is OK as “PASS” on the LCD

No

Yes

B

Page 56: My BE Project

Intelligent Vehicle Diagnostics & Monitoring System

Department of EEE, BMSCE – Bangalore -19 Page 56

Is GSM Module OK?

Initialized

No

A

YesDisplay the GSM Module is OK as “PASS” on the LCD

If Status = = Pass

No System Reset

Yes

Display Success of Status check as “PASS” on the LCD

Yes

B

Wait for start command for the DC Motors

Is Start Command received?

START the DC Motors

DC MOTOR

Yes

No

D E

Page 57: My BE Project

Intelligent Vehicle Diagnostics & Monitoring System

Diagnose of Minor failure Parameters

Department of EEE, BMSCE – Bangalore -19 Page 57

If key= =P

If key= =N

If key= =R

If key= =L

DISPLAY MOVING FORWARD

G

No

DISPLAY MOVING REVERSE

G Yes

Yes

No

DISPLAY MOVING RIGHT

G

DISPLAY MOVING LEFT

G

If key= = 0

DC MOTORS are Switched OFF

DC MOTOR 1 & 2 ON

DC MOTOR 2 ON

DC MOTOR 1 OFF , 2 ON

DC MOTOR 2 ON

DC MOTOR 1 & 2 ON

DC MOTOR 2 ON

DC MOTOR 1 ON , 2 OFF

DC MOTOR 2 OFF

No

Yes

H

No No

Yes Yes

G

Waiting for the key to be pressed

Yes

H

If key= =O

No

The DC Motors are turned ON

E

Page 58: My BE Project

Intelligent Vehicle Diagnostics & Monitoring System

Motion control of Motors

Department of EEE, BMSCE – Bangalore -19 Page 58

Display “ACCIDENT OCCURRED” on the LCD

If any Sensor value changes

D

Read the values of All four Sensors

If Bumper is hit /Accident occurs

Store the new values of sensor in the EEPROM

No

Yes

Yes

NoSwitch OFF the Motors & display “Motor is Switched OFF”.

Store the value in EEPROM

Send message of accident to the stored number using GSM

Display all the Sensor values on the LCD.

System Reset

Page 59: My BE Project

Intelligent Vehicle Diagnostics & Monitoring System

4.3. INTERNAL CIRCUITS

4.3.1 RF-Receiver & Main Block Internal Circuits

The circuit description of each & every Block/Module are given below. The internal circuits of various sections of our system are KNOWX’s Board LPC 2129 32-bit µC, GSM Module , CAN controller, RF-Receiver, Pressure sensor, Ultrasonic sensor, Temperature sensor & Proximity sensor.

KNOWX Board’s LPC 2129 32-bit µC

Department of EEE, BMSCE – Bangalore -19 Page 59

Page 60: My BE Project

Intelligent Vehicle Diagnostics & Monitoring System

GSM Module

CAN Controller

RF-Receiver

Department of EEE, BMSCE – Bangalore -19 Page 60

Page 61: My BE Project

Intelligent Vehicle Diagnostics & Monitoring System

Pressure Sensor

Ultrasonic Sensor Temperature Sensor

Proximity Sensor LCD Display

Department of EEE, BMSCE – Bangalore -19 Page 61

Page 62: My BE Project

Intelligent Vehicle Diagnostics & Monitoring System

EEPROM Brake, Seat-Belt & Ignition Key

Motor Driver Power Supply Unit

4.3.2 RF-Transmitter Block Internal Circuits

Department of EEE, BMSCE – Bangalore -19 Page 62

Page 63: My BE Project

Intelligent Vehicle Diagnostics & Monitoring System

RF- Transmitter

Power Supply for RF-Transmitter

Department of EEE, BMSCE – Bangalore -19 Page 63

Page 64: My BE Project

Intelligent Vehicle Diagnostics & Monitoring System

This chapter gives the details of the software & protocols used for our system implementation.

5.1 Software & Protocol Used

In our project we have used the software such as Windows XP, Keil micro-vision 3, Hyper-terminal, Embedded C & Philips Flash utility software and protocols used are I2C, Serial Communication, CAN, GSM AT commands

Windows XP is used as a basic platform to analyze, write, read and do some changes in the required manner.

Keil micro-vision 3 is used as a platform to develop a source code for a 32-bit & 8-bit micro-controller in Embedded C and execute it to get the final result.

Embedded C is a language to write the program in C for micro-controllers. It is developing the code, analyzing and execution becomes quite easy to do.

Philips Flash Utility is used as a tool to dump the source code from the PC to the board ( which has a 32-bit micro-controller) .

Hyper Terminal is used to make the serial communication between the PC & any device using the RS 232 cable which is connected to the comport0/1 of PC. Here using this we are going to have the wireless control of the motor( say speed & direction ) using RF technology. This is done by sending some specific letters from the keyboard to the PC where these letters have the particular ASCII code which will be sent to RF Receiver in encoded form through RF Transmitter.

CAN is a message oriented protocol designed by Bosch. It acts as a backbone for the data communication network. It uses serial communication at the data rate of 5kBits/s to 1MBits/s. Prioritisation of messages is the main feature of CAN.

I2C supports any IC fabrication process (NMOS, CMOS, bipolar). Two wires, serial data (SDA) and serial clock (SCL), carry information between the devices connected to the bus. Each device is recognized by a unique address (whether it’s a microcontroller, LCD driver, memory or keyboard interface) and can operate as either a transmitter or receiver, depending on the function of the device. Obviously an LCD driver is only a receiver, whereas a memory can both receive and transmit data.

Department of EEE, BMSCE – Bangalore -19 Page 64

Page 65: My BE Project

Intelligent Vehicle Diagnostics & Monitoring System

GSM AT Commands is used to do the specified action between two GSM devices such as sending a message, receiving a message, making a call etc,. These AT( Attention) commands are written in the source code for a particular action to be done by a device. In our project if any Accident occurs means a message is immediately sent to the specified number which is stored in the program.

5.2 Source Code

In our project we have two source codes one for 8 bit and other for 32 bit micro-controllers. Both the source codes are written in Embedded C using Keil-µv3.

5.2.1 Source code for RF Receiver & Main Block

It is done by using 32 bit µC. The 32 bit source code has written in such a way that the whole program has divided into many control loops corresponding to the different block/device. The control loops are main.c, lcd.c, gpio.c, brake.c, seatbelt.c, can.c, uart.c, gsm.c, pwm.c, adc.c, i2c.c, sensors.c & RF_rec.c

main.c: Initialize the LCD routine, GSM modem, Timer and Serial Communication at Power ON. After Initialization an infinite loop is executed.

lcd.c: It contains write data & write command functions to send data & commands to LCD

gpio.c: Here the particular port pins are set or cleared to make as input or output port pins

brake.c: It checks the status of Brake, if it is in proper condition it displays “PASS” on the LCD, if not “FAIL” on the LC D.

seatbelt.c: It checks the status of SeatBelt, if it is in proper condition it displays “PASS” on the LCD, if not “FAIL” on the LC D.

can.c: It checks the status of CAN Bus, if it is in proper condition it displays “PASS” on the LCD, if not “FAIL” on the LC D.

UART.c: This Program does initialisation of the uart speed of transmission, transmits char from the uart and also receives char from the serial receive line

gsm.c: It checks the status of GSM Initialization, if it is in proper condition it displays “PASS” on the LCD, if not “FAIL” on the LC D.

Department of EEE, BMSCE – Bangalore -19 Page 65

Page 66: My BE Project

Intelligent Vehicle Diagnostics & Monitoring System

pwm.c: This driver is used to initialise PWM and run at various speed.

adc.c: This function performs analog to digital conversion & this function performs hex to bcd conversion

i2c.c: This Program selects the I2C Registers in which the data can be pass through on board communication and save data in EEPROM, this function is used to initialise I2C, to Start a communication & store the data in EEPROM.

sensors.c: This program selects the different Sensors and read the values and send through can1 and recieve through can2 and store the data in EEPROM &The changed value of each sensor will be updated in EEPROM.

RF_rec.c: This function is used to Recieve the RF data and wait for VT to become high and returns the corresponding data.

5.2.2 Source code for RF Transmitter Block

It is done by using 8bit µC. The 8-bit source code is divided in to two control loops. They are main.c and uart.c .

main.c: which is used for initialization of serial communication and transfer the control word for controlling of dc motor through RF modules.

uart.c: which is used to set the mode, baud rate, and selection of timers for required time slices for serial communication.

Department of EEE, BMSCE – Bangalore -19 Page 66

Page 67: My BE Project

Intelligent Vehicle Diagnostics & Monitoring System

6. PHOTOGALLERY

KNOWX INNOVATION’S BOARD

GSM MODULE

Department of EEE, BMSCE – Bangalore -19 Page 67

Page 68: My BE Project

Intelligent Vehicle Diagnostics & Monitoring System

RF RECEIVER RF TRANSMITTER

Department of EEE, BMSCE – Bangalore -19 Page 68

Page 69: My BE Project

Intelligent Vehicle Diagnostics & Monitoring System

PRESSURE SENSOR PROXIMITY SENSOR

ULTRASONIC SENSOR TEMPERATURE SENSOR

POWER SUPLY UNIT

Department of EEE, BMSCE – Bangalore -19 Page 69

Page 70: My BE Project

Intelligent Vehicle Diagnostics & Monitoring System

COMPLETE MODEL

Department of EEE, BMSCE – Bangalore -19 Page 70

Page 71: My BE Project

Intelligent Vehicle Diagnostics & Monitoring System

7. CONCLUSIONS7.1 FEATURES

Department of EEE, BMSCE – Bangalore -19 Page 71

Page 72: My BE Project

Intelligent Vehicle Diagnostics & Monitoring System

Diagnostic check of vehicle’s Critical failure parameters at IGNITION ON.

Do not allow the vehicle to start in case of any major failure.

Indicate the failure parameters on the car dash board (LCD) instantly.

Diagnose the Minor failure parameters while vehicle is moving.

Interfaced GSM to inform the concerned persons in case of an Accident.

Store the recorded parameters in a Database (EEPROM) for future analysis.

7.2 ADVANTAGES

Because of LPC 2129, Low active power consumption. Code size reduction. Low cost. External connectivity.

Efficient real time operation. Driver friendly,

Indicate the failure parameters on the car dash board instantly. Do not allow the vehicle to start in case of any major failure. Take appropriate measures to avoid accident.

Record the parameters in EEPROM. GSM provides on time information to concerned person.

7.3 APPLICATIONS

Can be implemented to any vehicle.

Can be implemented even to an Electric Vehicle with much more Diagnostics Parameters.

7.4 FUTURE IMPLIMENTATIONS

Implementation of GPS: To locate the place of Accident.

Department of EEE, BMSCE – Bangalore -19 Page 72

Page 73: My BE Project

Intelligent Vehicle Diagnostics & Monitoring System

Speed Sensor: To take care of Speed limit.

Liquid level sensor: For Fuel & Water level (Radiator) Measurement.

Alcohol Sensor: To avoid indiscipline usage of Vehicle.

Biometric Device: To avoid Unauthorized Person accessing the Vehicle.

8. BIBLIOGRAPHY

Websites

Department of EEE, BMSCE – Bangalore -19 Page 73

Page 74: My BE Project

Intelligent Vehicle Diagnostics & Monitoring System

1. http://www.google.com 2. http://www.arm.com 3. http://www.datasheetscatlog.com 4. http://www.philips.com 5. http://www.atmel.com 6. http://www.knowxindia.com 7. http://www.ni.com 8. http://www. keil.com 9. http:// www.hitex.co.uk/arm 10. http://www.howstuffworks.com 11. http://www.8051.com

References

1. The insider guide to the Philips ARM 7 based micro-controller hand book

2. ARM& TDMI technical reference manual

3. ARM 7 architecture application level reference manual

4. Microcontrollers & Embedded Systems By Muhammad Ali Mazidi & Janice Gillispie Mazidi.

5. Programming in Embedded Systems in C & C++ By Michael Barr.

APPENDIX

Department of EEE, BMSCE – Bangalore -19 Page 74

Page 75: My BE Project

Intelligent Vehicle Diagnostics & Monitoring System

LPC2129 PIN DIAGRAM

Department of EEE, BMSCE – Bangalore -19 Page 75

Page 76: My BE Project

Intelligent Vehicle Diagnostics & Monitoring System

Department of EEE, BMSCE – Bangalore -19 Page 76

Page 77: My BE Project

Intelligent Vehicle Diagnostics & Monitoring System

Department of EEE, BMSCE – Bangalore -19 Page 77

Page 78: My BE Project

Intelligent Vehicle Diagnostics & Monitoring System

Department of EEE, BMSCE – Bangalore -19 Page 78

Page 79: My BE Project

Intelligent Vehicle Diagnostics & Monitoring System

Department of EEE, BMSCE – Bangalore -19 Page 79

Page 80: My BE Project

Intelligent Vehicle Diagnostics & Monitoring System

Department of EEE, BMSCE – Bangalore -19 Page 80

Page 81: My BE Project

Intelligent Vehicle Diagnostics & Monitoring System

Department of EEE, BMSCE – Bangalore -19 Page 81

Page 82: My BE Project

Intelligent Vehicle Diagnostics & Monitoring System

Department of EEE, BMSCE – Bangalore -19 Page 82

Page 83: My BE Project

Intelligent Vehicle Diagnostics & Monitoring System

Department of EEE, BMSCE – Bangalore -19 Page 83

Page 84: My BE Project

Intelligent Vehicle Diagnostics & Monitoring System

Department of EEE, BMSCE – Bangalore -19 Page 84

Page 85: My BE Project

Intelligent Vehicle Diagnostics & Monitoring System

Department of EEE, BMSCE – Bangalore -19 Page 85

Page 86: My BE Project

Intelligent Vehicle Diagnostics & Monitoring System

Department of EEE, BMSCE – Bangalore -19 Page 86

Page 87: My BE Project

Intelligent Vehicle Diagnostics & Monitoring System

Department of EEE, BMSCE – Bangalore -19 Page 87

Page 88: My BE Project

Intelligent Vehicle Diagnostics & Monitoring System

Department of EEE, BMSCE – Bangalore -19 Page 88

Page 89: My BE Project

Intelligent Vehicle Diagnostics & Monitoring System

Department of EEE, BMSCE – Bangalore -19 Page 89

Page 90: My BE Project

Intelligent Vehicle Diagnostics & Monitoring System

Department of EEE, BMSCE – Bangalore -19 Page 90

Page 91: My BE Project

Intelligent Vehicle Diagnostics & Monitoring System

Department of EEE, BMSCE – Bangalore -19 Page 91