Top Banner
Project Report on Design and Development of PIC microcontroller Based vehicle monitoring system using Controller Area Network(CAN) protocol, By Md. Abdullah Ahamad Regd.No-12K31D5506 Embedded system(2012-014)
34
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: Embedded system

Project Report on Design and Development of PIC microcontroller Based vehicle monitoring system using Controller Area Network(CAN) protocol,

By

Md. Abdullah Ahamad Regd.No-12K31D5506 Embedded system(2012-014)

Page 2: Embedded system

INTRODUCTION:-. Controller Area Network (CAN) is an attractive alternative in the automotive

and automation industries due to its ease in use, low cost and provided reduction

in wiring complexity. It was developed by Robert Bosch for communication

between various digital devices inside an automobile where heavy electrical

interferences and mechanical vibrations are present. This project is aimed at the

implementation of CAN protocol using PIC for vehicle monitoring system. The

main feature of the system includes monitoring of various vehicle parameters

such as Temperature, presence of CO level in the exhaust, Battery Voltage and

Light due to spark or fire.

Page 3: Embedded system

Aims & objectives:- The main objective of the project is to provide the latest technology for the vehicle monitoring system.The system uses the sensors to sense the various parameters like temprature,CO,and battery voltage with LDR.These parameter are then given to the Microcontroller which transfers the parameters to the receiver section by using the Control Area Network (CAN) protocol. In the receiver section the parameters are received by CAN receiver and are then given to the microcontroller which displays on the LCD. The LCD located near the driver seat. By implementing this system we are implementing the CAN protocol which is fast and accurate when compared to any other system.

Page 4: Embedded system

Existing system:-The traditional forms of peer-to-peer

connect between electronic control units and electronic devices cannot meet the need of real time control control of distributed system in automobile. Meanwhile,

The continuing increase of electronice devices results in geometric growth of lead number and wiring becomes hard in limited space in automobile, restricts the expention internal control of functions.

Page 5: Embedded system

Advantages & Disadvantages

Advantages of Proposed system:-

Disadvantage of Existing system:-

The system uses the letest technology Which is CAN protocol which is implemented with the microcontroller.

Proposed system uses fewer wires than any other traditional system can use and the system is more accurate and fast in response.

The existing uses the peer-to-peer connection which takes more wires to transfer the information from the electronics devices to the display unit which is their main disadvantage.

This system is slow and less accurate if more the number of electronic devices are added and the more time is consumed.

Page 6: Embedded system

2. Project Description:-Introduction to Embedded system:-An embedded sysytem can be defined as a computing device that does a specific focused job. Appliances such as the air-conditioner, VCD player, printer, fax machine, mobile phone etc. are examples of embedded systems. Each of these appliances will have a processor and special hardware to meet the specific requirement of the application along with the embedded software that is executed by the processor for meeting that specific requirement. The embedded

software is also called “firm ware”.Embeded system have to work against some deadlines. A specific job has to be completed within a specific time.if the missing a deadline may cause a catastrophe-loss of life or damage to property. Mostly embedded system operate through a battery, and the power comsumption has to be very low.

Page 7: Embedded system

Hardware & software requirement:-Hardware Requirements: Power Supply PIC16F877A Microcontroller 9V Battery Temperature Sensor GAS Sensor LDR CAN Controller and Transceiver 16x2 LCD MAX232Software Requirements:Embedded CCCS Compiler .net

Page 8: Embedded system

Application Areas of Emb, system:-

Approx 99 percent processors manufactured end up in embedded system.Now a day the embedded system market is one of the highest growth areas as these system are used in very market segment like consumer electronics, office automation, industrial automation, biomedical engineer, wireless communication, data communication, transportation,military and so on,,,,,,,

Page 9: Embedded system

EMBEDDED SYSTEM ARCHITECTURE & OVERVIEWFig:- Building blocks of the hardware of an Embedded system.

Page 10: Embedded system

Control Area network(CAN):- Controller Area Network (CAN) was initially created by

German automotive system supplier Robert Bosch in the mid-1980s for automotive applications as a method for enabling robust serial communication. The goal was to make automobiles more reliable, safe and fuel-efficient while decreasing wiring harness weight and complexity. Since its inception, the CAN protocol has gained widespread popularity in industrial automation and automotive truck applications. Other markets where networked solutions can bring attractive benefits like medical equipment, test equipment and mobile machines are also starting to utilize the benefits of CAN. The goal of this application note is to explain some of the basics of CAN and show the benefits of choosing CAN for embedded systems networked applications.

Page 11: Embedded system

Features of CAN:-

Supports 1 Mb/s operation

Implements ISO-11898 standard physical layer requirements

Suitable for 12V and 24V systems

Externally-controlled slope for reduced RFI emissions

Detection of ground fault (permanent dominant) on TXD input

Power-on reset and voltage brown-out protection

An unpowered node or brown-out event will not disturb the CAN bus

Low current standby operation

Protection against damage due to short-circuit conditions (positive or

negative battery voltage)

Protection against high-voltage transients

Automatic thermal shutdown protection

Up to 112 nodes can be connected

High noise immunity due to differential bus Implementation

Page 12: Embedded system

Block diagram of CAN:-

Pin Descriptions The 8-pin pinout is listed in Table below:

Pin

Number

Pin Name Pin Function

1 TXD Transmit Data Input

2 VSS Ground

3 VDD Supply Voltage

4 RXD Receive Data Output

5 VREF Reference Output Voltage

6 CANL CAN Low-level Voltage I/O

7 CANH CAN High-level Voltage I/O

8 RS Slope-Control Input

Page 13: Embedded system

The CAN protocol was optimized for systems that need to transmit and receive relatively

small amounts of information (as compared to Ethernet or USB, which are designed to

move much larger blocks of data) reliably to any or all other nodes on the network.

Transmitter Function The CAN bus has two states: Dominant and Recessive. A dominant state occurs when the

differential voltage between CANH and CANL is greater than a defined voltage

(e.g.,1.2V). A recessive state occurs when the differential voltage is less than a defined

voltage (typically 0V). The dominant and recessive states correspond to the low and high

state of the TXD input pin, respectively. However, a dominant state initiated by another

CAN node will override a recessive state on the CAN bus.

Receiver Function

The RXD output pin reflects the differential bus voltage between CANH and CANL. The

low and high states of the RXD output pin correspond to the dominant and recessive

states of the CAN bus, respectively.

Page 14: Embedded system

Operating modes of CAN:- Before CAN control:-

Page 15: Embedded system

WITH CAN:-Control with engine

Page 16: Embedded system

Flow chart for CAN based monitoring in the engine:-

Page 17: Embedded system

ii. Flow chart for CAN based monitoring in the engine

Page 18: Embedded system

Adventages of CAN:-

High throughput under light loads

Local and global prioritization possible

Arbitration is part of the message - low overhead.

Page 19: Embedded system

PIC microcontroller:- PIC 16F877 is one of the most advanced microcontroller

from Microchip. This controller is widely used for experimental and modern applications because of its low price, wide range of applications, high quality, and ease of availability. It is ideal for applications such as machine control applications, measurement devices, study purpose, and so on. The PIC 16F877 features all the components which modern microcontrollers normally have. The figure of a PIC16F877 chip is shown below

Page 20: Embedded system

PIN diagram of PIC microcontroller:-

Page 21: Embedded system

INPUT/OUTPUT PORT:-PIC16F877 has 5 basic input/output ports. They are usually

denoted by PORT A (R A), PORT B (RB), PORT C (RC), PORT D (RD), and PORT E (RE). These ports are used for input/ output interfacing. In this controller, “PORT A” is only 6 bits wide (RA-0 to RA-7), ”PORT B” , “PORT C”,”PORT D” are only 8 bits wide (RB-0 to RB-7,RC-0 to RC-7,RD-0 to RD-7), ”PORT E” has only 3 bit wide (RE-0 to RE-7).

PORT-A RA-0 to RA-5….6 bit widePORT-B RB-0 to RB-7….8 bit widePORT-C RC-0 to RC-7…,8 bit widePORT-D RD-0 to RD-7..8 bit widePORT-E RE-0 to RE-2.. 3 bit widTable: Ports of PIC Microcontroller

Page 22: Embedded system

Adventages:-

Small instruction set to learn

Inexpensive microcontrollers

It is a RISC (Reduced Instruction Set Computer)

design

Only thirty seven instructions to remember

Its code is extremely efficient, allowing the PIC to

run with typically less program memory than its

larger competitors. It is low cost, high clock speed

Page 23: Embedded system

Light Dependent Resister(LDR):-

Page 24: Embedded system

LDR symbol & Application:-

Light Dependent Resistor Symbol Used In Circuit Diagrams

Application

The photo-resistor or light dependent resistor is attractive in many electronic circuit

designs because of its low cost, simple structure and rugged features. While it may not

have some of the features of the photo-diode and photo-transistor, it is ideal for many

applications. As a result the photo-resistor is widely used in circuits such as photographic

meters, flame or smoke detectors, burglar alarms, card readers, controls for street lighting

and many others.

Page 25: Embedded system

Gas sensor:- A gas detector is a device which detects the presence of

various gases within an area, usually as part of a safety system. This type of equipment is used to detect a gas leak and interface with a control system so a process can be automatically shut down. A gas detector can also sound an alarm to operators in the area where the leak is occurring, giving them the opportunity to leave the area. This type of device is important because there are many gases that can be harmful to organic life, such as humans or animals.

Page 26: Embedded system

Features & Application:-FEATURES :-

High sensitivity to LPG, natural gas, town gas.

Small sensitivity to alcohol, smoke.

Fast response.

Stable and long life.

Simple drive circuit.

APPLICATION :-

They are used in gas leakage detecting equipments family

and industry, These are,

suitable for detecting of LPG, natural gas, town gas, avoid

the noise of alcohol and cooking fumes and cigarette smoke.

Page 27: Embedded system

Software specification:-MATLABGENERAL:- The term digital image refers to processing of a two dimensional picture by a digital computer. In a broader context, it implies digital processing of any two dimensional data. A digital image is an array of real or complex numbers represented by a finite number of bits. An image given in the form of a transparency, slide, photograph or an X-ray is first digitized and stored as a matrix of binary digits in computer memory. This digitized image can then be processed and/or displayed on a high-resolution television monitor. For display, the image is stored in a rapid-access buffer memory, which refreshes the monitor at a rate of 25 frames per second to produce a visually continuous display.

Page 28: Embedded system

The image processing system:-

Page 29: Embedded system

MP LAB:-

Introduction :- MPLAB® X IDE is a software program that runs on a PC (Windows®,

Mac OS®, Linux®) to develop applications for Microchip microcontrollers and digital signal controllers. It is called an Integrated Development Environment (IDE), because it provides a single integrated “environment” to develop code for embedded microcontrollers.

MPLAB® X Integrated Development Environment brings many changes to the PIC® microcontroller development tool chain. Unlike previous versions of MPLAB® which were developed completely in-house, MPLAB® X is based on the open source NetBeans IDE from Oracle. Taking this path has allowed us to add many frequently requested features very quickly and easily while also providing us with a much more extensible architecture to bring you even more new features in the future.

Page 30: Embedded system

Application of sansors in cars:-

Page 31: Embedded system

Snapshot of Hardware

Page 32: Embedded system

Working principle:-This is mainly implemented for monitoring parameter of vehicle

using the help of Control Area Network (CAN) protocol. The

monitoring parameters are temperature, battery voltage, light

due to due to spark or fire and CO level n exhaust engine. For

monitoring the above parameters, LM 35 sensor, gas sensor,

12V battery, LDR, are used. For implementing this, the

programming of LED, ADC and LCD interfacing with PIC

microcontroller is done using Embedded C. Then the

simulation results are obtained using PROTEUS professional

schematic software. The programming of PIC microcontroller

interfacing using CAN Protocol is verified using a general

purpose board. Hardware schematic is drawn using orCAD.

Implemented hardware and software is ported to it.

Page 33: Embedded system

Future scope:-1. This project is implemented for

a two node. But according to users requirement this can be extended to 4-nodes, 8-nodes, 16-nodes etc for vehicle monitoring applications.

2.. Response time analysis can be done. Since response time analysis for CAN aims to provide a method of calculating the worst-case response time of each message.

3. Cost analysis can be done.

Page 34: Embedded system

Thank You!