With the development of science and technology, intelligent control technology has begun to be widely used in the field of electronic testing. In modern industrial measurement and control systems, people often hang various sensors on the field bus to form a sensor network system. Various sensor devices are used as network nodes, and the field bus is used to realize information transmission between the node and the control center and between nodes. Usually, people choose CAN bus to connect most sensors. Therefore, the sensors also need to be intelligent and have a unified data interface. This paper designs a temperature, humidity and pressure digital sensor system with a CAN communication interface based on the C8051F060 microcontroller. The system can perform signal conditioning and analog-to-digital conversion on the pressure analog signal output by the pressure sensor; it can process and transmit temperature, humidity and pressure data, and build a CAN bus sensor network to realize data collection and communication.
Digital sensor system overall design
According to the tasks and functions of the digital sensor system, the working principle of the system is shown in Figure 1. First, the sensor collects the pressure signal and performs follow-up filtering on the pressure signal. Then, the temperature and humidity data are collected and framed and communicated. After the sensor collects and preprocesses the data, it is transmitted to the CAN bus through the CAN data communication interface according to the specified CAN application protocol. The data is collected and stored by the corresponding node, or directly transmitted to the host computer, and the data of each node is monitored in real time through the host computer software.
Figure 1 Working principle diagram of digital sensor system
The digital sensor system is mainly composed of control center module, pressure acquisition module, temperature and humidity acquisition module, CAN bus module and power module. The control center module uses C8051F060 single chip microcomputer; in order to realize the collection of temperature, humidity and pressure data, the data acquisition module uses SHT15, MPX4200A, TLV2402 and MAX291 and other devices; in order to complete the establishment of communication network, data transmission and bus redundancy, the CAN bus module uses high-speed optocoupler, CD4052, TJA1050 and other devices.
Digital sensor system hardware design
Control center module design
The control center module uses the C8051F060 microcontroller, which is a fully integrated mixed-signal system-on-chip MCU launched by Cygnal, USA. The C8051F060 microcontroller uses the patented core CIP-51 compatible with 8051, with a speed of up to 25MIPS, and has 59 digital I/O pins, 5 16-bit general-purpose timers, and 6 programmable timer/counter arrays with capture/compare modules. At the same time, the chip also integrates two 16-bit, 1Msps ADCs and 2 12-bit DACs, 3 voltage comparators, a watchdog timer, a VDD monitor, and a temperature sensor. The chip integrates 64KB of FLASH and 4352B of internal RAM, as well as hardware-implemented SPI, SMBus/I2C, and 2 UART serial interfaces. Most importantly, the C8051F060 microcontroller also integrates a CAN bus controller, which makes the C8051F060 microcontroller developed using the CAN bus have the characteristics of strong anti-interference, low development cost, and applicability to industrial field applications.
The working principle of the control center module is shown in Figure 2. As the core device of the control center module, the C8051F060 microcontroller is mainly responsible for controlling SHT15 to collect temperature and humidity data, as well as collecting and converting pressure data after follow-up filtering, and then performing data processing (filtering, data framing, data caching, etc.) on these signals. At the same time, since the C8051F060 microcontroller itself has a CAN communication interface, it can also realize data transmission.
The specific circuit of the control center module designed according to Figure 2 is shown in Figure 3. Before the C8051F060 microcontroller runs normally, the application port and clock must be initialized. The port pins of the C8051F060 microcontroller can withstand a voltage value of 3V~5V, and the mode status of the P0~P3 pins can be configured according to requirements; in order to realize the system clock, this design uses an external crystal oscillator drive circuit to drive the external crystal oscillator.
Figure 2: Working principle diagram of control center module[page]
Figure 3 Control center module circuit diagram
Pressure acquisition module design
According to the requirements of the digital sensor system, the pressure acquisition module is mainly composed of an analog sensor, a voltage follower circuit and a low-pass filter circuit.
The analog sensor uses MPX4200A to obtain the detected information and is responsible for analog-to-digital conversion. In order to ensure the accuracy of the collected signal, the pressure signal needs to be processed by the follower filter module. The filter circuit is used to follow and simulate the pressure signal detected by the sensor. Analog filtering can greatly improve the sensor acquisition accuracy. This design uses the switched capacitor filter MAX291 as the core component for analog filtering of the sensor pressure signal. MAX291 is an eighth-order Butterworth type switched capacitor active low-pass filter produced by MAXIM. Its 3dB cutoff frequency can be selected between 0.1kHz and 25kHz. The switched capacitor filter needs a clock to drive the circuit to work. The frequency of the clock should be 100 times the 3dB cutoff frequency. It can use two methods: external clock or internal clock. The follower filter principle of the pressure acquisition module is shown in Figure 4. The module mainly includes the pressure acquisition sensitive head composed of MPX4200A, the voltage signal follower circuit composed of TLV2402, and the low-pass filter circuit composed of MAX291. Its working process is: MPX4200A converts the collected pressure signal into an electrical signal and transmits it to TLV2402. After completing the signal following, TLV2402 transmits the signal to MAX291 for analog filtering. Then, under the control of C8051F060 microcontroller, the ADC1 (16-bit A/D conversion module) embedded in the microcontroller collects and converts the pressure signal. Finally, the collected and converted data is transmitted to the data recorder through the CAN communication module after framing. The reason why this design uses the embedded ADC1 of the C8051F060 microcontroller to collect and convert the pressure signal is to meet the needs of system miniaturization design. The C8051F060 microcontroller has two 16-bit AD conversion modules, ADC1 and ADC0, embedded inside, and their conversion speed can reach up to 1Msps.
Figure 4 Schematic diagram of pressure acquisition module following filter
Design of temperature and humidity acquisition module
The structure of the temperature and humidity acquisition module is shown in Figure 5. In the circuit of this module, the C8051F060 single-chip microcomputer I/O port is directly connected to the temperature and humidity sensor SHT15, the C8051F060 single-chip microcomputer pin P2.1 port is connected to the clock pin SCK of SHT15 as a clock line, and the C8051F060 single-chip microcomputer pin P2.0 port is connected to the data pin DATA of SHT15 as a data line. This connection method has the advantages of convenient interface, simple control, and high communication rate. The working principle of the temperature and humidity acquisition module is: the C8051F060 single-chip microcomputer sends control commands to SHT15 through the data line and clock line, and receives the temperature and humidity data collected and converted by SHT15. After receiving the temperature and humidity data, the C8051F060 single-chip microcomputer performs simple framing and other fast processing on the data, and finally transmits it to the data recorder (host computer) through the CAN bus interface for data processing and real-time monitoring.
Figure 5 Temperature and humidity acquisition module structure diagram [page]
This design uses the temperature and humidity sensor SHT15 to collect temperature and humidity data. SHT15 is a digital temperature and humidity sensor chip launched by Sensirion, Switzerland. Its main features are: ① Integrate temperature and humidity sensing, signal conversion, A/D conversion and I2C bus interface functions into one chip; ② Provide two-wire digital serial interface SCK and DATA, and support CRC transmission verification; ③ Provide temperature compensation and humidity measurement value and high-quality dew point calculation function; ④ Measurement accuracy is programmable and adjustable, with built-in A/D converter; ⑤ Due to the use of CMOSensTM technology, SHT15 can be immersed in water for measurement. The performance parameters of SHT15 are as follows: ① The temperature measurement range is -40~+123.8℃; ② The humidity measurement range is 0~100%RH; ③ The temperature measurement accuracy is ±0.3℃; ④ The humidity measurement accuracy is ±2.0%RH; ⑤ The response time is 8s. The digital temperature and humidity sensor SHT15 is an 8-pin SMD surface mount package, with pin 1 connected to the ground, pin 4 connected to the power supply, and an operating voltage of 2.4~5.5VDC. In order to achieve the highest accuracy of SHT15, the power supply voltage is 3.3V; pin 2 is the data line, pin 3 is the clock line, and pins 5~8 are empty pins. SHT15 contains a temperature sensitive element made of energy gap material and a capacitive polymer humidity sensitive element. These two sensitive elements convert temperature and humidity into electrical signals respectively. The electrical signal is first amplified by a weak signal amplifier, then enters a 14-bit A/D converter, and finally outputs a digital signal via a two-wire serial digital interface.
CAN bus module design
The CAN bus module is a collection of components used in digital sensor systems to implement the CAN bus protocol and complete functions such as message sending and receiving. The module consists of the C8051F060 microcontroller, the high-speed optocoupler HCPL0600, and the CAN bus driver TJA1050. In order to protect the CAN controller and improve the anti-interference ability, the interface between the bus driver and the CAN bus adopts certain safety and anti-interference measures: the CANL and CANH pins of the TJA1050 are each connected to the CAN bus through a 5 resistor, which can protect the TJA1050 from overcurrent impact; a small 30pF capacitor is connected in parallel between CANL and CANH and the ground, which can filter out high-frequency interference on the bus as much as possible and improve the bus's ability to prevent electromagnetic radiation.
In order to ensure the reliability of the communication network, the CAN bus module adopts the network redundancy method to design a controllable bus redundancy for the bus and its driver. The redundancy design principle of the CAN bus module is shown in Figure 6. The CAN communication interface of this module consists of a CAN controller, two CAN bus drivers and two pairs of differential lines. We can switch between the two buses by controlling the analog multiplexer CD4052. A1 and A0 are the control signals of CD4052, which are controlled by the main controller of the node. When A1A0=01, the X channel selects X3 and the Y channel selects Y3. At this time, the bus driver U4 works and the data is transmitted through bus 1; when A1A0=10, the X channel selects X2 and the Y channel selects Y2. At this time, the bus driver U3 works and the data is transmitted through bus 2. When the CAN network is working normally, the two buses are backup for each other (one bus is working and the other is in backup state). In order to detect the working status of each node, the CAN network will send detection commands at a fixed frequency. The detection commands are usually sent by a fixed master node on the CAN network. After the master node sends the detection command, it determines whether there is a node damaged and which node is damaged based on the predetermined response situation; other nodes are called slave nodes. The slave nodes receive the detection commands sent by the master node. If they receive the detection commands, they will promptly return the response information to the master node. If the master node has not received the detection information within the predetermined time, the controller will control the bus switching and alarm.
Figure 6 CAN bus module redundancy design schematic
Power module design
According to the on-site situation, the CAN network provides 24V voltage to the sensor, and the sensor needs 5V or 3.3V power supply, so a power module is needed to convert the 24V voltage to 5V and 3.3V. This design uses TPS5410 to convert the 24V voltage to 5V, and MAX1658 to convert the 5V voltage to 3.3V; in addition, in order to power the optocoupler and CAN driver, the CAN communication circuit needs a 5V power supply that is not grounded with the previous power supply. DCR010505 is used here to achieve this, and the isolated 5V is defined as W5V, and its ground is W5VGND.
The TPS5410 voltage conversion circuit is shown in Figure 7. TPS5410 is a switching power supply chip of TI's SWIFT series, with an input voltage range of 5.5V~36V; a switching conversion frequency of 500KHz; a conversion efficiency of up to 95%; overcurrent, overvoltage and thermal overload protection functions; can provide a maximum current of 1A; and a simple peripheral circuit.
Figure 7 TPS5410 voltage conversion circuit diagram
The MAX1658 voltage conversion circuit is shown in Figure 8. MAX1658 is a 5V to 3.3V switching power supply chip from MAXIM, with a conversion efficiency of up to 95%; an input voltage range of 2.7V to 16.5V; overcurrent, thermal overload protection, and power reverse connection protection; can provide a maximum current of 350mA; and the peripheral circuit is simple.
Figure 8 MAX1658 voltage conversion circuit diagram
The DCR010505 isolated 5V circuit is shown in Figure 9. DCR010505 is an isolated switching power supply chip from TI, which can isolate the 5V voltage into another 5V with no common ground; the switching frequency is 400KHz; the conversion efficiency is 80%; it has 1000Vrms isolation capability and overheat protection capability; it provides a maximum current of 200mA; and the maximum input voltage is 7V.
Figure 9 DCR010505 isolated 5V circuit diagram
Conclusion
With the rapid development of electronic technology, sensor technology and field network technology, digital sensors with CAN communication interface have also developed rapidly. This paper designs a temperature, humidity and pressure digital sensor system with CAN communication interface based on C8051F060 single-chip microcomputer. Firstly, the overall design scheme of the digital sensor system is introduced, and then the hardware design of the system is elaborated in detail, including the control center module, pressure acquisition module, temperature and humidity acquisition module, CAN bus module and power module design. The digital sensor system has stable performance, integrates temperature and humidity sensors, pressure sensors, etc., has CAN communication interface, and has the characteristics of integration and miniaturization.
Previous article:14 Frequently Asked Questions about MCS-51 Microcontroller
Next article:Some differences between 51 MCU and AVR MCU
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- 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
- 5G in 60: An introduction to 5G
- Battery system state of charge calculation algorithm problem
- I'm a newbie in your place, please take care of me, thank you!
- Choosing Machine Learning Processors at the Edge
- EEWORLD University Hall----MATLAB Applications Complete Book Video
- All-inclusive OLED
- c0000 28335 Program automatic upgrade problem
- TMS320C62x Boot Mode
- Any port generates a square wave with half duty cycle
- 【MicroPython】Using MCO as a clock