Automobile CAN network Bluetooth wireless transmission signal measurement system

Publisher:bemaiiLatest update time:2014-03-08 Source: elecfans Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

  1 Introduction

  With the development of automotive electronics, there are more and more electronic products in cars, and the number of electronic control units in electronic control systems such as car engines, chassis and body is increasing. At the same time, the communication between them is becoming more and more important. The use of network technology in cars can greatly improve the reliability of information transmission between systems, and at the same time can greatly reduce the number of automotive wiring harnesses and reduce the cost of automotive electrical systems. In recent years, the application of CAN systems in cars has become more and more extensive. CAN (Controller Area Network) is the abbreviation of control area network. It was first introduced by BOSCH in Germany and is used for data communication of measurement and execution components inside cars. Due to its high performance, high reliability, good real-time performance and unique design, it has been widely used in data communication between various detection and execution agencies of control systems. The CAN bus complies with the ISO11898 standard, with a maximum transmission rate of 1Mbps, a maximum transmission distance of 10km, and a transmission medium of twisted pair. This paper proposes and implements a method of using a single-chip microcomputer to form a CAN system and using Bluetooth wireless transmission technology to collect and process car operation data.

  During the operation of the car, on-board radio frequency devices such as car stereo systems, GPS navigation equipment, satellite digital audio radio service (SDARS) devices, GSM radio transceivers and other electrical equipment may cause interference or be interfered with. These radio frequency interference signals will have an adverse effect on the data flow of the car's wireless system. If traditional wireless data transmission technology is used, the rate and accuracy of the transmitted data cannot be very high, so it is impossible to achieve fast and accurate data transmission. Using Bluetooth wireless transmission technology in cars can solve this problem well.

  The Bluetooth module used in this article adopts the BC417 chip of the British CSR company, and forms a module with the 8M FLASH chip 39VF800A of the SST company.

Bluetooth module schematic

Figure 1 Schematic diagram of Bluetooth module

  The main features of this module are as follows:

  1) Adopt CSR mainstream Bluetooth chip, compliant with Bluetooth V210 standard.

  2) The upper baseboard of the serial port module has an RS232 interface and a TTL interface. You can choose any one of the interfaces to use. Use a 313~5V power supply. The serial port is transparent to the user.

  3) The Bluetooth chip uses forward error correction coding, high communication efficiency, automatic frequency hopping, and strong anti-interference ability.

  4) The baud rate is 1200, 2400, 4800, 9600, 19200, 38400, 57600, 115200, 230400, 460800, 921600, 1382400, which can be set in the program according to actual needs.

  5) Sleep current: less than 1MA, working current: 40MA.

  2 System hardware structure schematic diagram

  This paper uses MICROCHIP's 18F4580 chip with built-in CAN controller and CAN transceiver chip MCP2515 to form a CAN network system, and uses the 10-bit AD sensor of the 18F4580 chip to measure the throttle position signal of the automobile engine. At the same time, the intelligent digital sensor DS18B20 is used to measure the water temperature signal of the engine. The Bluetooth module is used to wirelessly transmit the measured signal to the host computer, and the data receiving and processing program is written using VC++ to realize the real-time display and storage of data, and the curve diagram of the change relationship between data value and time can be displayed, and the measurement results are intuitive. The hardware schematic diagram of the system is shown in Figure 2.

Figure 2

Figure 2 Schematic diagram of the measurement system

  Measurement of engine throttle position signal and water temperature signal#e#3 Measurement of engine throttle position signal and water temperature signal

  3.1 Measurement of throttle signal

  The throttle position sensor on the car engine measured here is an adjustable resistor type. The throttle position output signal is a voltage signal of 0 to 5V. According to the relationship between the actual throttle opening and the output voltage, the measured voltage signal is calibrated, and the throttle opening can be converted according to the measured voltage signal. Therefore, the 10-bit AD conversion circuit embedded in the PIC18F4580 microcontroller is used here to complete the measurement of the throttle position sensor output voltage. In order to improve the measurement accuracy, the 5V reference voltage of the microcontroller AD is isolated and stabilized from the system power supply. [page]

  This system uses Microchip's MPLAB development environment to embed the PICC18C program compiler, and uses C program to write data acquisition and CAN data receiving and sending programs. The AD conversion subroutine is written in assembly language. The program takes into account the modularity and good maintainability of C program, and at the same time has the advantage of high efficiency of assembly language.

  The signal is sent to the CAN network through the CAN controller in an extended frame format. The subroutines for data acquisition and CAN data transmission are as follows:

  InitSPI(); //SPI interface initialization

  Init_MCP2515(); //MCP2515 initialization

  …

  TRISA=0B00000001; //AN0>>>>DCinputDC channel input, turn on RA0

  ADCON0=0B00000001; //AN0 channel, allow ADC to work,

  ADCON1=0B00001110; //Except RA0 which is an analog input port, other RA ports and RE ports are ordinary digital ports

  ADCON2=0B10100001; //Conversion result is right-aligned, 8TAD, 1/8FOSC.

  #asm

  ADCON0EQU0FC2H

  GOEQU001H

  bsfADCON0,GO //Start conversion

  ADWAIT:

  btfscADCON0,GO

  gotoADWAIT //Wait for conversion to complete

  #endasm

  write_MCP2515(TXB0CTRL,0x03); //Set to send the highest priority

  write_MCP2515(TXB0SIDH,0xFF);//EID28--21

  write_MCP2515(TXB0SIDL,0xEB); //EID20--EID18, extended frame enable, EID17--EID16

  write_MCP2515(TXB0EID8,0xFF);//EID15--EID8

  write_MCP2515(TXB0EID0,0xFF);//EID7--EID0

  write_MCP2515(TXB0DLC,0x02); //The length of the sent data is 8 bytes

  write_MCP2515(TXB0D0,ADRESH); //Sent data

  write_MCP2515(TXB0D1,ADRESL);

  …

  send_TXB0(); //Request to send

  while((read_MCP2515(TXB0CTRL)&0x08)==0x08);//wait

  Send completed

  …

  3.2 Measurement of water temperature signal

  The water temperature signal in this article is measured using the DS18B20 intelligent digital sensor from DALLAS. DS1820 is the world's first temperature sensor that supports the "one-wire bus" interface. The unique and economical characteristics of the one-wire bus allow users to easily build a sensor network and introduce a new concept for the construction of the measurement system. The measurement temperature range is -55℃~+125℃, and the accuracy is ±015℃ within the range of -10~+85℃. The field temperature is directly transmitted in a digital manner using the "one-wire bus", which greatly improves the system's anti-interference ability. It is suitable for field temperature measurement in harsh environments, such as: environmental control, equipment or process control, temperature measurement consumer electronics products, etc. After the DS1820 completes the acquisition of the temperature signal, it receives the data through the PIC18F4580 chip, and sends the data to the CAN bus in an 8-bit binary format using a standard frame format through the embedded CAN controller. [page]

  4 CAN network transmission system

  The collected signal is sent out through the CAN controller embedded in PIC18F4580. Here, the MCP2551CAN transceiver produced by MICROCHIP is selected to complete the transmission of network signals, and a terminal resistor with a resistance of 120 ohms is added to the CAN network terminal. The signal received by the transceiver at the receiving end of the CAN network is transmitted to another PIC18F4580 chip, and the network signal is taken out through the CAN controller inside the base. If an extended frame is received, the received data is the throttle position signal; if a standard frame is received, the received data is the water temperature signal. After the signal is processed, it is sent to the MAX232 chip through the base's own UART port in the form of a data packet, and the TTL signal level is converted to a 232 level. The hardware schematic diagram of the CAN communication board of the throttle part is shown in Figure 3.

Throttle position signal measurement CAN communication board schematic diagram

Figure 3 Schematic diagram of CAN communication board for measuring throttle position signal

  5. Bluetooth wireless transmission system

  The MAX232 chip transmits the converted signal to the Bluetooth master (transmitter) module composed of CSR's BC417. The BC417 Bluetooth module can set the data transmission rate. Under the condition of ensuring the quality of the transmitted signal, the high transmission rate can be used as much as possible. The transmission rate in this article is 38400bps. After receiving the data signal, the slave (receiver) module composed of another BC417 Bluetooth chip converts the level through the MAX232 chip and transmits it to the serial port of the host microcomputer.

  6 Host computer signal receiving and processing system

  After the serial port of the host computer receives the signal, an object-oriented program is written using the VC++ development tool to process the data packet. In order to intuitively display the data value and its relationship with time, this program can display the actual throttle position signal and water temperature value, and can also display the change curve of the throttle position signal. The interface of the host computer program is shown in Figure 4.

  This article uses the SerialPort class to implement this function. This method only requires users to set the relevant communication parameters, without having to worry about the implementation method of the encapsulation. The program is modular and maintainable [5]. The serial port event response method is used in use. In order to more intuitively display the curve of data changing over time, a display interface implemented by encapsulating the BUTTON class control is written. This control can easily set the data coordinates, background, data unit, data update speed and other properties, and the display effect is good.

Upper computer interface diagram

Figure 4 Upper computer interface diagram

  7 Conclusion

  The system operates well and can measure vehicle operating parameters conveniently, quickly and reliably, providing a good platform for wireless real-time measurement of vehicle network parameters and vehicle fault diagnosis.

Reference address:Automobile CAN network Bluetooth wireless transmission signal measurement system

Previous article:Design of automatic bus stop announcement system based on ZigBee
Next article:Design of motor protection device based on CAN bus

Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号