Implementation of wireless temperature monitoring system based on single chip microcomputer

Publisher:幸福的家园Latest update time:2011-07-30 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

With the development of information science and microelectronics technology, temperature monitoring can be automated and intelligentized by using modern technology. The multi-channel wireless temperature monitoring system is designed towards this goal. This design requires the use of a single-chip microcomputer and a wireless transmission module to realize a wireless temperature monitoring system, and to achieve temperature control range adjustment and over-temperature range alarm.

1 Technical points

Since this system is a real-time monitoring system, the temperature acquisition control is real-time, so the time interval of temperature acquisition, the time difference of data sending and receiving, the data transmission speed between the single-chip microcomputer and the PC, and the analysis and processing of the data by the host computer program are the key to this system. Through the optimization of the temperature sensor and the wireless module, the communication between the single-chip microcomputer and the PC through the high-speed USB interface and the optimization of the host computer code, the real-time monitoring function of this system is realized. At the same time, the various parameters of the temperature sensor, the parameters of the wireless module, and the optimization of the hardware circuit should also be considered.

2 Hardware and software design

In order to make the system work optimally, the selection of system hardware devices will be a very important issue.

(1) Selection of temperature sensor

The system is used for temperature monitoring. The first task is to select the temperature sensor. The correct selection of the temperature sensor has a significant impact on the performance and price of the system. Based on the temperature measurement range, accuracy, response time, stability, linearity and sensitivity of the temperature sensor, this system uses the DS18B20 temperature sensor produced by DALLAS Semiconductor Company of the United States. The reasons for choosing this sensor are: ① DS18B20 and the microprocessor only need one line to achieve two-way communication, simplifying the connection difficulty; ② No other AD conversion devices are required, which reduces the cost and the cost of hardware board manufacturing; ③ The voltage range available is large: 3.0V to 5.5V can be used, and the power consumption of the device is low; ④ The temperature measurement resolution is high, up to 0.125 degrees, which is convenient for precise temperature control; ⑤ Support multi-point testing, multiple DS18B20 can be connected in parallel on one line to achieve multi-point temperature measurement.

(2) Selection of wireless module

This system is multi-point monitoring, and its data transmission is through wireless transmission, so the wireless transmission module needs to support multi-point data transmission. Considering stability, data transmission speed, error rate and other aspects, this system uses NRF905 wireless data transmission module. The reasons for choosing this module are: ①433MHZ open ISM band license-free use, no need to apply for additional bands; ②High transmission rate, the maximum data transmission rate can reach 50KB, meeting the needs of real-time monitoring; ③With CRC error correction function, strong anti-interference ability. The required voltage is only 3.3V, low power consumption; ④125 channels, support multi-point communication, meet the needs of multi-point monitoring of the system.

(3) Selection of main control chip

ATmega16 is a low-power CMOS 8-bit microcontroller based on the AVR RISC architecture launched by ATMEL. ATmega16 has an operating speed of 16MIPS at 16MHz and a two-cycle hardware multiplier, which allows designers to strike a balance between power consumption and execution speed. The non-volatile program and data memory resources are large enough to meet the needs of program code design. It has rich peripheral resources: 2 8-bit timers/counters with independent prescaler and comparator functions; a 16-bit timer/counter with independent prescaler and compare/capture functions; supports 4-channel PWM output and 8-channel 10-bit ADC. It supports TWI interface, USART, and SPI interface multi-machine communication to meet the needs of extended functions.

(4) Other peripheral devices

USB control chip PDUSBD12, display module 1602, alarm buzzer, etc. in USB and PC communication.

2.1 System hardware connection method

The hardware mainly consists of two parts, the temperature collection and transmission part and the data reception, analysis and control part.

2.1.1 Temperature collection and transmission part

The main connection devices are NRF905 wireless data transmission module, DS18B20 temperature sensor acquisition module, 1602 display module, alarm module, and temperature anomaly processing module. The connection method is shown in Figure 1. The main control chip M16 sends configuration information to the wireless module through the SPI bus protocol to initialize its work. The connection between the temperature sensor and M16 uses a single bus protocol to collect temperature. The display chip 1602 is used to display the collected temperature, and a buzzer is used as an alarm device. When the temperature is abnormal, the single chip will control the heating device or cooling device to handle the abnormality.

2.1.2 Data reception, analysis and control part

The main connection components are wireless data transmission module, USB transmission module, and PC. The circuit connection is shown in Figure 2. Similarly, the main control chip M16 sends configuration information to the wireless module through the SPI bus protocol to initialize its work. After receiving the temperature, the PDUSBD12 chip uses the USB protocol to send the data to the PC, which can be directly displayed on the VC interface. The PC can automatically analyze whether there is an abnormality in the data. When there is an abnormality, the PC sends a control signal to remotely control the heating or cooling equipment to handle the abnormality, and at the same time sends an alarm signal, which can minimize the danger and achieve automation and intelligence.

Data collection and transmission

Figure 1 Data collection and transmission Figure 2 Data reception and analysis [page]

2.2 Software Program Design

Since the system consists of two modules, the design of the software program is also divided into the temperature acquisition and transmission module programming and the data reception, analysis and control module programming.

2.2.1 Temperature collection and transmission module

The main programs that need to be designed include the internal register configuration of NRF905, the temperature sensor temperature acquisition program, the LCD display module program, and the alarm system program. The program flow chart is shown in Figure 3:

Main program flow chart

Figure 3 Main program flow chart

2.2.2 Data acceptance analysis control module

The main programs that need to be designed include the internal register configuration of NRF905, the driver writing of the USB module, and the establishment of the host computer program. Due to limited space, the source code and flow chart are no longer given.

3 System workflow

This system mainly consists of two modules, the temperature acquisition and sending module and the data receiving and monitoring module.

3.1 Data collection and transmission module

The main function of this module is to collect temperature and send data. When the main control microcontroller issues a command, DS18B20 starts to collect temperature. The temperature sensor transmits the collected temperature back to the main control chip and displays it on 1602. Then the main control chip transmits the data to the wireless transmission module NRF905 through the SPI bus, and the wireless transmission module sends the data out. At the same time, the main control chip will detect whether the temperature is abnormal. When the temperature is abnormal, it will issue an alarm signal and start the abnormality handling module.

The specific workflow is shown in Figure 4:

Collection and sending module workflow

Figure 4 Collection and transmission module workflow

3.2 Data receiving monitoring module

The main function of this module is to receive and process data. The single chip microcomputer controls the wireless module to receive data and controls the USB module to send data to the PC. After receiving the temperature, the PC will analyze and process the temperature. When the temperature is abnormal, an alarm signal will be issued. At the same time, the control command will be sent to the single chip microcomputer, and the wireless module will be used to remotely control the abnormal processing module to perform work, thereby realizing automatic abnormal processing and dual alarms, thereby ensuring the early warning and safety of the monitored area to the greatest extent. The specific workflow is shown in Figure 5:

Acceptance monitoring module workflow

Figure 5: Acceptance monitoring module workflow

4 Conclusion

The system has been tested for long-distance temperature. After data comparison, it is found that the field temperature collection is completely consistent with the upper computer display data, and real-time temperature monitoring can be achieved. At the same time, the single-chip microcomputer can be remotely controlled by a PC, and the performance is stable.

Reference address:Implementation of wireless temperature monitoring system based on single chip microcomputer

Previous article:Development and application of touch screen and real-time operating system based on ARM7
Next article:Design of LED Color Light Controller Using AVR Microcontroller

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号