In the test of the electronic ignition module, in order to simulate the real working conditions of the electronic ignition system, the electronic ignition module is often placed in an environment higher than normal temperature for electronic ignition experiments to obtain ignition parameter data closest to the real working conditions of the car. Due to the heat generated by the electronic ignition module itself, the temperature of its core components becomes an important factor affecting the performance of the electronic module; in addition, it is also necessary to consider whether the ambient temperature meets the requirements of simulating the real working conditions.
This article introduces a design scheme of temperature detection node using LM35 temperature sensor and PICMicro to detect the core module temperature and ambient temperature of electronic ignition module in the process of simulating automobile electronic ignition. It will explain the module structure, working principle and sampling value quantization method.
Node principle and structure
The temperature detection node is composed of sensor circuit, signal conditioning circuit, microcontroller application system, CAN bus interface, etc. The basic working principle of the circuit is: the sensor circuit outputs the sensed temperature signal to the signal conditioning circuit in the form of voltage, and the signal is input to the A/D sampling circuit after conditioning, and the ADC sends the digital value to the microcontroller system. The microcontroller system will monitor the real-time temperature. When the temperature exceeds the warning value and the dangerous value, the microcontroller will actively send a warning message to the host computer to remind the operator to check. The module logic structure is shown in Figure 1.
Figure 1 Logical structure of temperature detection node
The sensor circuit uses the temperature sensor LM35, the power supply voltage is 15V DC, the working current is 120mA, the power consumption is extremely low, the current changes very little when working in the full temperature range, and the voltage output adopts the differential signal mode, which is directly output from pins 2 and 3. The LM35 output signal passes through an LP filter composed of RC to filter out high-frequency noise interference.
The core MCU of this node is PIC16F87x, which is a low-power 8-bit microcontroller launched by Microchip. PIC16F87x has a reduced instruction set and an execution speed of 200ns. The CAN controller uses Microchip's MCP2510, the bus driver uses PCA82C250, the bus
isolation
circuit uses optocoupler 6N317, and the signal conditioning circuit uses LF412. The hardware structure of the temperature monitoring module is shown in Figure 2.
Figure 2 Hardware structure of temperature monitoring module
The signal conditioning circuit mainly completes the functions of sensor signal amplification and limiting, and adjusts the DC voltage of the sensor circuit output, which varies in the range of about 2V, to the voltage range that meets the AD interface of PICMicro. It should not exceed the AD sampling range, but also have a considerable signal accuracy. The microcontroller collects the temperature data of the sensor through the A/D sampling channel and calculates the temperature range.
The peripheral device circuit is the necessary peripheral device for the operation of the PIC16F87x minimum system. The PIC16F87x exchanges data with the MCP2510 through the SPI bus to complete the sending and receiving of CAN bus data packets. Its interface circuit is shown in Figure 3.
Figure 3 Interface circuit between PIC16F877 and MCP2510
Among them, SCK is the SPI bus clock, the SPI interface of the PIC16F87x module is connected to the SI, SO, and SCK of the MCP2510, and RA4 and RA1 control the chip reset and chip select of the MCP2510 respectively. INT accepts the interrupt request of the MCP2510.
System software design
System software process
In order to avoid malfunction due to interference, the software adopts some redundancy and fault-tolerant processing. When the A/D module processes the sampled data, software filtering measures are used to filter out the spike interference that may appear in the circuit.
The method is to sample five times continuously, remove the maximum and minimum values through comparison and judgment, and take the average value after summing up the values of the remaining three times. The average value is used as the effective data for the CPU to divide the temperature range. The parsing and encapsulation of the data packet follow the CAN application layer protocol. The main program flow is shown in Figure 4.
Figure 4 Main program flow
[page]
When the CPU detects an abnormal temperature, it will send an abnormal temperature alarm to the host computer according to the abnormal temperature range. This is the only data frame that the CPU of this node actively sends to the host computer. The temperature-related data of this node is stored in the buffer. When no data request from the host computer is received, the data in the buffer will be continuously refreshed by new data to ensure the real-time nature of the node data. The interruption process is shown in Figure 5.
Figure 5 CAN receive interrupt process
Quantization method of sample value
The accurate quantization of the sampling value is the key to the normal operation of the temperature control circuit. Here, the following conversion method is used for quantization. Assume that the voltage after signal conditioning is Ui, then -10V
Ui=-10V+ΔT•Kt=-10V+55℃×0.111V/℃=-3.895V。
After Ui is converted into digital quantity, the voltage value corresponding to each digital quantity is 19.531mV, which is represented by Ks. The corresponding relationship between the change of digital quantity and the change of temperature can be obtained: Kt/Ks=(0.111V/℃)/(19.531mV/digital quantity)=5.683 digital quantity/℃.
The digital quantities corresponding to other temperatures can also be calculated using the above method.
SPI
interface
Communication
PIC16F87x exchanges data with MCP2510 via the SPI interface.
The MCP2510 is designed to connect directly to the Serial Peripheral Interface (SPI) of many microcontrollers. External data and commands are transmitted to the device through the SI pin, and data is transmitted on the rising edge of the SCK clock signal.
The MCP2510 sends the instruction byte for all operations listed in Table 1 through the SO pin on the falling edge of SCK.
At the beginning of the read operation, the CS pin will be set to a low level. Then the read instruction and the 8-bit address code (A7~A0) will be sent to the MCP2510 in sequence. After receiving the read instruction and address code, the data in the address register specified by the MCP2510 will be shifted out and sent through the SO pin. After each data byte is shifted out, the address pointer inside the device will automatically increase by one to point to the next address. Therefore, the next continuous address register can be read. This method can be used to read the data in any continuous address register sequentially. The read operation can be ended by pulling the CS pin level high, as shown in Figure 6.
The temperature control node developed based on LM35 has strong working stability, high reliability, small size, high sensitivity, short response time, strong anti-interference ability, etc. The node is low-cost, and the devices are all conventional components, with high engineering value. This node has a CAN interface and can be used as an independent detection system or as a key part of a distributed test system. The upper layer protocols of CAN can be implemented in software, making the interface of this node flexible and not restricted by the upper layer protocols.
Taking PIC16F87x sending a read instruction to MCP2510 as an example, the SPI interface communication process is explained.
Figure 6 SPI interface communication timing
Previous article:NXP Car Radio CD/MP3 Player Solution
Next article:Full contact with car reversing radar: six generations of technology developed in five years
- Popular Resources
- Popular amplifiers
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- A collection of practical automotive electronics information, free points download for a limited time
- Analyze whether it is the rising edge or the falling edge that reads and writes data
- How to design the step-up transformer for electrostatic generator
- Subnet mask problem
- TMS320F28335 generates SPWM
- [Sipeed LicheeRV 86 Panel Review] 5-Tina System Image Compilation Test
- Recruiting QT software engineers (PC side), QT software engineers (Linux side), hardware design engineers, R&D test engineers,...
- CC2640R2F: A must-read for beginners
- How to select a display detector
- [Zero-knowledge ESP8266 Tutorial] Zero-knowledge WIFI Tutorial - http WEB Server Example