Vehicle Automation using CAN Protocol with MSP430

Download Full-Text PDF Cite this Publication

Text Only Version

Vehicle Automation using CAN Protocol with MSP430

Vishnu Vardhan. R, Anusubhashini. R. P, Carolene Prem Leela. R, Kiruthika. M

Abstract – In current scenario Automobile Automation is a growing field which focuses on power, cost, fuel and time efficiency of the system. All modern vehicles today include an Engine Control Unit (ECU). This unit is responsible for the co- ordination of all subsystem of the vehicle, it reads sensor values from different parts of the engine and depending on these values it performs appropriate actions. This project aims in designing ECU of the vehicle using ultra low power consuming MSP430 and high data rate transmission CAN Protocol.

Key words: LDR, Battery voltage, Temperature, Fuel level, Rain water, CAN (Controller Area Network), MSP430, MCP2515, Energia

  1. INTRODUCTION

    Today embedded systems are inventions that have made the world to think and bring out different innovations and developments in the field of automobiles. Embedded System is basically a system of hardware and software designed for control and access of data. As a system it includes a controller as the brain. Today embedded systems applications are popular and their development has become a boon to automobile industry. Applications in the form of home appliances, automobiles, entertainments, consumer electronics, medical and telecommunication etc., are every day in the mode of development. Mechanical systems in automobiles are largely replaced by electronic systems. Today Automobile industry is making great use of embedded systems. Ranging from wiper controls to complex anti-lock brake controls and air bags, embedded systems have gained the overall control of recent automobiles. The automobiles that are built around using MSP430 controllers, digital signal processors or using both the processors are commonly called as Electronic Control Units. Some of the current trends of embedded systems in automobiles include airbag controllers, navigation systems, satellite radio, adaptive cruise control, drive by wire, heads up displays etc.

    Controller Area Network (CAN) is a multi-cast based communication protocol that specifies a maximum signaling rate of 1Mbps (Mega Bit per second). It is a serial communication protocol developed by Robert Bosch in early 1980s. Unlike other networks such as USB, Ethernet, CAN does not send large blocks of data from point to point. With rapidly changing computer and information technology and much of the technology finding way into vehicles. They are undergoing dramatic changes in their capabilities and how they interact with the drivers. Although some vehicles have provisions for deciding to either generate warnings for the human driver or controlling the vehicle autonomously, they usually must make these decisions in

    real time with only incomplete information. So, it is important that human drivers still have some control over the vehicle. Advanced in-vehicle information systems provide vehicles with different types and levels of intelligence to assist the driver. The introduction into the vehicle design has allowed an almost symbiotic relationship between the driver and vehicle by providing a sophisticated and intelligent driver-vehicle interface through an intelligent information network. This project aims to develop such a control frame work for the vehicle which is called as digital- driving behavior, consists of a joint mechanism between the driver and vehicle for perception, decision making and control. A vehicle was generally built with an analog driver vehicle interface for indicating various parameters of vehicle status like temperature, pressure and speed etc. To improve the driver vehicle interface, an interactive digital system is designed. A MSP430 controller based data acquisition system that uses ADC to bring all control data from analog to digital format is used. Since the in-vehicle information systems are spread out all over the body of a practical vehicle, a communication module that supports to implement a one stop control of the vehicle through the master controller of the digital driving system.

  2. HARDWARE STRUCTURE

    A.MSP_EXP430G2553

    The MSP-EXP430G2 Launch Pad Development Kit is an easy-to-use microcontroller development board for the low- power and low-cost MSP430G2x MCUs. It has on-board emulation for programming and debugging and features a 14/20-pin DIP socket, on-board buttons and LEDs & Booster Pack Plug-in Module pin outs that support a wide range of modules for added functionality such as wireless, displays & more. The MSP-EXP430G2 Launch Pad also comes with 2 MSP430 devices, with up to 16kB Flash, 512B RAM, 16MHz CPU speed and integrated peripherals such as 8ch 10-bit ADC, timers, serial communication (UART, I2C & SPI) & more. The MSP430 can be used for low powered embedded devices. The current drawn in idle mode can be less than 1 µA. The top CPU speed is 25 MHz It can be throttled back for lower power consumption.

    Fig A.1.MSP_EXP430G2553 kit PIN DIAGRAM:

    Fig A.2 .MSP_EXP430G2553 kit

    BLOCK DIAGRAM

    A.3 Block diagram of proposing method B.CAN TRANSCEIVER

    The MCP2551 is a high-speed CAN,fault-tolerant device that serves as the interface between a CAN

    protocol controller and the physical bus.The MCP2551 device provides differential transmit and receive capability for the CAN protocol controller, and is fully compatible with the ISO-11898 standard, including 24V requirements. It will operate at speeds of up to 1 Mb/s. Each node in a CAN system must have a device to convert the digital signals generated by a CAN controller to signals suitable for transmission over the bus cabling (differential output). It also provides a buffer between the CAN controller and the high-voltage spikes that can be generated on the CAN bus by outside sources

    (EMI, ESD, electrical transients, etc.).

    Fig B.1.MCP2551 Transceiver

    B1.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.

    B2.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.

    B3. THERMAL SHUTDOWN PROTECTION

    The important safety feature for CAN transceiver is the thermal shutdown circuitry. This feature protects a device against the destructive currents and resulting heat that occur in a short circuit condition. Once thermal shutdown is activated, the device remains shutdown until the circuitry is cool.

    B4.VOLTAGE REGULATOR

    A voltage stabilizer is any device that keeps the voltage of a circuit at a specified level. There are many different types of voltage stabilizers but integrated circuit (IC) voltage stabilizers are among the most common. You will frequently

    need a voltage stabilizer for components that require regulated power. You can demonstrate the use of a voltage stabilizer in a circuit with a few components from an electronics parts store.

    Fig.C.2 CAN Bus Arbitration in nodes D.STANDARD DATA FRAME

    C.CAN BUS

    Fig B4.1 7805 Voltage Regulator

    A fundamental CAN characteristic shown is the opposite logic state between the bus, and the driver input and receiver output. Normally, a logic-high is associated with a one, and a logic-low is associated with a zero but not so on a CAN bus. This is why TI CAN transceivers have the driver input and receiver output pins passively pulled high internally, so that in the absence of any input, the device automatically defaults to a recessive bus state on all input and output pins.

    Fig. C.1 CAN Bus Arbitration

    Bus access is event-driven and takes place randomly. If two nodes try tooccupy the bus simultaneously, access is implemented with a nondestructive,bit-wise arbitration. Nondestructive means that the node winning arbitration justcontinues on with the message, without the message being destroyed orcorrupted by another node. The allocation of priority to messages in theidentifier is a feature of CAN that makes it particularly attractive for use with in a real-time control environment.

    The lower the binary message identifier number, the higher its priority.An identifier consisting entirely of zeros is the highest priority message on anetwork because it holds the bus dominant the longest. Therefore, if two nodes begin to transmit simultaneously, the node that sends a last identifier bit as a zero (dominant) while the other nodes send a one (recessive) retains control of the CAN bus and goes on to complete its message. A dominant bit always overwrites a recessive bit on a CAN

    Fig.D.1 Frame format for CAN

    SOF called as Start of frame. It is used synchronize the nodes during transmission. The standard 11 bit identifier is used to show the priority of the message. RTR called as Remote Transmission Request, is dominant when the information is required from another node. Single dominant Identifier (IDE) occurs when no extension occurs. DLC shows the data length of the frame. CRC called as checksum used to check the error occurred or not. EOF called end of frame and Inter Frame Space is the spacing between two frames

  3. MONITORING SYSTEM

    A. BATTERY VOLTAGE

    The nominal operating voltage range for MSP430 is 2.2V to 5V. The output voltage is proportional to the temperature. The battery used in the project is lead acid battery.

    B.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 °C). It measures temperature more accurately than a using a thermistor. The sensor circuitry is sealed and not subject to oxidation, etc. The LM35 generates a higher output voltage than thermocouples and may not require that the output voltage be amplified. It has an output voltage that is proportional to the Celsius temperature. The scale factor is

    .01V/°C.

    Fig.B.1 LM35 Temperature sensor

    bus.

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

    +100°C. Another important characteristic of the LM35 is that it draws only 60 micro amps from its supply and possesses a low self-heating capability. The sensorselfheating causes less than 0.1 °C temperature rise in still air. The sensor has a sensitivity of 10mV / °C.

    C.LDR

    A photo resistor or light-dependent resistor (LDR)or photocell is a light controlled variable resistor works on the principle of photo conductivity. Photo conductivity is an optical phenomenon in which the materials conductivity reduces when light is absorbed by the material. When light falls i.e., photons fall on the device, the electrons in the valence band of the semiconductor material are excited to the conduction band.

    These photons in the incident light should have energy greater than the band gap of the semiconductor material to make the electrons jump from the valance band to the conduction band. Hence when light having enough energy is incident on the device more & more electrons are excited to the conduction band which results in large number of charge carriers.

    Fig.C.1 LDR circuit

    D.LCD

    LCD (Liquid Crystal Display) screen is an electronic display module and find a wide range of applications. A 16×2 LCD display is very basic module and is very commonly used in various devices and circuits. These modules are preferred over seven segments and other multi segment LEDs. The reasons being: LCDs are economical; easily programmable; have no limitation of displaying special & even custom characters (unlike in seven segments), animations and so on.

    A 16×2 LCD means it can display 16 characters per line and there are 2 such lines. In this LCD each character is displayed in 5×7 pixel matrix. This LCD has two registers, namely, Command and Data.

    Fig. D.1 LCD Pin Diagram

  4. DESIGN OF VEHICLE MONITORING SYSTEM

    In transmitter side, 12V supply is given to the voltage regulator and it gives the regulated voltage as 5V. It is used to run the MSP430 microcontroller. Pin 1 of the controller is connected to high supply voltage in order to clear the controller. Every time, when we start it will clear the microcontroller. Colpitts oscillator is used in micro controller in order to maintain the constant frequency. A 10k ohm resistor is connected to pin 1in transmitter side and it acts as a pull up resistor. 22microF is used in the controller to reduce the spikes in the transmitter side.Gas sensor is connected to the 4 pin of the controller ,temperature sensor is connected to the 1st pin and LDR is connected to the 1.1rd pin of the controller, In LCD , VSS pin is connected to the supply and VDD is connected to ground. The control signal is RS pin connected to the 2.1th pin of the controller. RW is connected to the 2.2pin and EN is connected to the 2.3 pin of the controller. The data pins D1 to D4 of the LCD connected to the 2.3th to 2.6th of the controller. And 1.5th pin is connected to the transmitter of mcp2551 transceiver.

    In receiver side, similar to transmitter it has a

    microcontroller.A 12V supply is given to the voltage regulator and it gives the regulated voltage as 5V. It is used to run the MSP430 microcontroller. Pin 1 of the controller is connected to high supply voltage in order to clear the controller. Every time, when we start it will clear the microcontroller. Colpitts oscillator is used in micro controller in order to maintain the constant frequency. A 10k ohm resistor is connected to pin 1in transmitter side and it acts as a pull up resistor. 22microF is used in the controller to reduce the spikes in the receiver side.

    1.6th pin is connected to the receiver of the mcp2551 transceiver in the receiver side. And LCD is interface with MSP430 microcontroller as, VSS pin is connected to the supply and VDD is connected to ground. The control signals RS pin is connected to the 2.1pin of the controller, RW is connected to the 2.2 th pin and EN is connected to the 2.3th of the controller. The data pin D1 to D4 of the LCD is connected to the 27 to30 pin of the controller.

  5. SYSTEM IMPLEMENTATION

    Initially, the supply from the transformer is given to the microcontroller and the relay circuit. The 230V from the transformer is converted to 5V using rectifier and voltage regulator, this 5V given to the controller. The voltage regulator 7805 is used to give 5V constant dc supply. The capacitor of about 1000uf is used as a filter. The relay circuit

    is used to isolate low power circuit from high power circuit. The diode in4007 is used in relay circuit to protect controller from back emf.

    There are master and slave modules in this vehicle control system implementation. In master module, sensor has been interfaced. Analog sensors like Temperature sensor and Rain water sensor which are connected to ADC ports, Where the Analog values are converted into digital.MSP430G2553 has a10 bit ADC, so the maximum precision is 1023 as digital value .Digital sensor like Fuel level sensor is used.

    These values from different sensors are transmitted through CAN frames using CAN transceiver MCP2551 which supports 1Mbps operation. One CAN transceiver at the transmitter end, which is on Master controller and other CAN transceiver at the receiver end, which is on Slave controller. These CAN transceivers are interconnected by using CAN bus.

    In slave module, the MSP430G2553 controller is interfaced with MAX232 which is a dual transmitter / dual receiver that converts signals from a TIA-232 (RS-232) serial port to signals suitable for use in TTL-compatible digital logic circuits. It is an alternate serial port output of the sensor values.

    The serial monitor in ENERGIA can display the digital values of the sensors, provided com port of the USB and device should be similar, Baud rate of the controller terminal should be 9600Hz and tool selection should be made. Through receiver which is slave module the datas are displayed in serial monitor.

    1. RESULT POWER REPORT

      BATTERY LIFE PERIOD

      HARDWARE SETUP

      OUTPUT

    2. CONCLUSION

      This project describes about the implementation of CAN bus inautomobile industries. Instead of using multiple wires, two wires are used. Thusthe requirement of wires and complexity are reduced. Because of wide usage ofvehicles and rapid development of embedded technology, CAN protocol is usedfor data transmission and it is known for its low cost, high reliability and better error handling mechanism. Vehicle conditions are monitored by CO sensor,LM35 for temperature measurement, 12V battery and LDR to measure the light intensity. The main advantage of using this CAN protocol its high speed datarate.

      The programming for the microcontroller interfacing with CAN protocol isverified using a general purpose board. The temperature of engine, batteryvoltage, presence of head light, and CO level in the exhaust are transferred fromengine side to dashboard side via CAN protocol and these readings are displayed through LCD on the dashboard.

    3. REFERENCES

  1. Vijayalakshmi.S. Vehicle control system implementation Using CAN protocol. IJAREEIE, Volume 2, Issue 6, June 2013.

  2. Kumar, M. A.Verma, and A. Srividya, Response-Time Modeling of Controller Area Network (CAN). Distributed Computing and Networking, Lecture Notes in Computer Science Volume 5408, p 163-174, 2009.

  3. Tindell, K., A. Burns, and A.J. Wellings, Calculating controller area network (CAN) message response times. Control Engineering Practice, 3(8): p. 1163-1169, 2005.

  4. Li, M., Design of Embedded Remote Temperature Monitoring System based on Advanced RISC Machine. Electrotechnics Electric, 06, p. 273, 2009.

  5. Prodanov, W., M. Valle, and R. Buzas, A controller area network bus transceiver behavioral model for network design and simulation. IEEE Transactions on Industrial Electronics, 56(9): p. 3762-377, 2009.

  6. ISO (1993). Road Vehicles: Interchange of Digital Information: Controller Area Network (CAN) for High Speed Communication. ISO 11898:1993.

  7. B.Gmbh, CAN specifications vol 1 Version 2.0, 1991.

  8. Pazul, Controller Area Network (CAN) Basics, Microchip technology Inc., AN713, May 1999.

  9. Wilfried Voss, A comprehensive guide to controller area network, Copperhill Media Corporation, 2005-2008.

  10. Benjamin C Kuo, M. Farid Golnaraghi,Automatic Control systems, Eight edition, John wiley & sons., Inc 2003

Leave a Reply

Your email address will not be published. Required fields are marked *