Design of intelligent temperature and humidity acquisition system based on CAN bus

Publisher:RadiantWhisperLatest update time:2016-12-28 Source: eechina Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

0 Introduction

The temperature and humidity monitoring system is a field environmental control system widely used in environmental testing, scientific research (such as planting, breeding, bioengineering, chemical engineering), industrial production and other fields. It can simulate various environmental conditions, that is, accurately control the temperature and humidity of the environment according to actual requirements, creating good environmental conditions for studying different biochemical processes. Therefore, the temperature and humidity monitoring system is widely used in scientific research, modern agriculture, medicine, metallurgy, chemical industry, forestry, environmental science and biological genetic engineering.

In order to meet the needs of chemical industrial processes for environmental conditions, we have done a lot of research and feasibility analysis on sensor intelligent control solutions and specific applications, and developed a temperature and humidity monitoring system with intelligent functions. The system consists of a data acquisition module and an interface module. The data acquisition module adopts a structural framework with a single-chip microcomputer AT89S52 as the core and an external sensor, which ensures the real-time and accuracy of the system's acquisition of field temperature and humidity signals. The interface module uses the USB -CAN conversion interface module, which is at the forefront of the current communication field, to provide a solid communication guarantee for the real-time performance of the entire system, and the author believes that this communication method has become the development direction of industrial communication.

1 Hardware circuit design of temperature and humidity acquisition

module The hardware circuit of the temperature and humidity acquisition module consists of the SJA1000 controller of the CAN bus , the TJA1050 transceiver , the temperature sensor ADS90, the humidity sensor HM1500 and the single-chip microcomputer TA89S52 chip. Its circuit block diagram is shown in Figure 1.

1.gif 

1.1 Temperature detection circuit

The core of the temperature detection circuit adopts the two-terminal integrated temperature- current sensor AD590 produced by the American AD company. The device is small in size, light in weight, stable in performance, small in nonlinear error, convenient in calibration, good in interchangeability, extremely low in power consumption, and suitable for dynamic temperature testing and long-distance temperature measurement. The design of the temperature signal acquisition circuit is shown in Figure 2.

2.gif 

In terms of sensor output signal processing, since the measured value contains certain interference signals, the amplifier chip LM324 and the voltage regulator tube D are used to perform secondary processing on the measured signal. The power supply voltage range of AD590 is 4 to 30 V, which can withstand 44 V forward voltage and 20 V reverse voltage, so the device will not be damaged even if it is reversely connected. The voltage regulator D1 is connected to an adjustable resistor to ensure the input voltage at point A (i.e., the inverting end of the amplifier); the voltage regulator D2 limits the voltage and current provided by the power supply, and by connecting an adjustable resistor, the input voltage at point B (i.e., the non-inverting end of the amplifier) ​​is ensured. Moreover, by appropriately changing the resistance values ​​of R8 and R9, the linear amplification factor of the output voltage can be changed.

1.2 Humidity detection circuit

The humidity detection circuit uses an integrated temperature sensor HM1500, whose output voltage varies linearly with temperature between 1 and 4 V. Since the design uses a single power supply structure, the humidity signal acquisition circuit design is shown in Figure 3.

3.gif 

The linear voltage output integrated humidity sensor HM1500 is designed and manufactured using the humidity sensitive resistor HS1101. Its humidity measurement range is 5% to 99% (relative humidity); the relative humidity accuracy is 3%; the operating temperature is -30 to +60℃; the operating humidity range is 0% to 100% (relative humidity); the power supply voltage is 5 V (the maximum voltage is DC 16 V); the output DC voltage is 1 to 4 V; the response time is 5 s, which is suitable for dynamic temperature measurement.

Since there is no negative pressure in this circuit, the main body of the circuit adopts a differential subtraction circuit. The gain can be adjusted by setting the four precision resistors R3, R4, R6, and R7. The calculation formula for its output voltage is:

4.gif 

R1 in Figure 3 can be used to eliminate the error caused by sensor differences.

2  CAN bus interface circuit

This system selects the CAN bus controller SJA1000 and the transceiver TJA1050 of PHILIPS Company. Considering that SJA1000 is an independent CAN bus controller and supports CAN 2. OA and CAN 2.0B protocol, the communication rate can reach 1 Mb/s, which can meet all the requirements of the communication protocol. JA1050 is the interface between the CAN bus controller and the physical bus. It is a standard high-speed CAN transceiver, which can provide differential transmission performance for the bus and differential reception performance for the CAN controller. SJA1000 is mainly responsible for the work of the data link layer, and sends the information in the transmission buffer to TJA1050 after processing. The data is placed in the receiving buffer after processing and waits for the microprocessor to read. The block diagram of the CAN bus interface circuit is shown in Figure 4.

5.gif 

3 USB-CAN conversion module interface circuit

Since the computer does not have a dedicated CAN bus interface, it is necessary to design a module unit to convert the data on the CAN bus into USB interface data. One end of the module is connected to the USB interface of the monitoring computer, and the other end is connected to the CAN bus network interface. This system design uses Atmel 's ATmega 162 chip. The bus controller SJA1000 realizes the sending and receiving of CAN data, and the receiving mode still uses the interrupt mode; the USB communication control chip FT245BM realizes the sending and receiving of USB data; ATF16V8 is responsible for encoding the addresses of the two interface chips. The structure diagram of the USB-CAN conversion module is shown in Figure 5.

6.gif 

4 System software design

The system software mainly includes: monitoring PC communication processing software, temperature and humidity control algorithm software and field measurement and control node data acquisition and processing software. The software system adopts modular design and is divided into several relatively independent functional modules. Appropriate entry and exit parameters are arranged for each module, so that the interconnection and combination between modules are flexible and convenient. The system software module mainly consists of data acquisition, linearization correction of temperature sensor, keyboard input, measurement data display, output control, CAN bus communication, etc. Each module coordinates work under the scheduling of the monitoring program.

4.1 Communication processing software

uses Window XP SP3 as the platform and VC++ language for programming. It includes functional modules such as system parameter setting, monitoring status setting, data sending and receiving, local status query, upper and lower limit alarm, interrupt receiving data management, etc. The monitoring PC first initializes the CAN bus adapter and itself, and then sends a command to notify a specific node to send data to the CAN bus. After conversion through the CAN bus adapter, the monitoring PC performs corresponding processing according to the actual situation. The monitoring PC uses a timed cycle scanning method to issue commands to each node and uses an interrupt method to receive data.

4.2 Node software

The node software consists of three parts: initialization, data transmission and data reception. The initialization program is placed at the front end of the main program. Considering the system's requirements for program operation efficiency, data transmission and data reception are performed in interrupt mode. When the monitoring PC requests data acquisition, the temperature and humidity of the area where the sampling point is located and the CAN node status data are transmitted to the host computer to complete the sampling and control algorithm of the temperature and humidity sensor.

5 Conclusion

The intelligent sensor based on the CAN bus realizes the automatic measurement of temperature and humidity in the industrial process, which is conducive to the realization of automation.Remote temperature and humidity control, maintaining the ambient temperature and humidity in line with process requirements, provides an efficient means of measurement and control. The use of USB-CAN data conversion makes the data transmission rate far exceed the traditional RS 232 conversion, and supports "hot plug and unplug", which is easy to use and has a wide range of application prospects.

Reference address:Design of intelligent temperature and humidity acquisition system based on CAN bus

Previous article:Design of high-power LED intelligent lighting control system
Next article:51 Hidden Initializer

Latest Microcontroller Articles
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号