A remote temperature monitoring system based on single chip microcomputer and FPGA

Publisher:石头12345Latest update time:2010-04-09 Source: 舒斌Keywords:MCU Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

Temperature has different degrees of influence on industrial and agricultural production and national defense. There are many kinds of power equipment failures, but most of them are accompanied by heating, and the loss of an accident is huge; in industries such as textiles, food, and tobacco, high temperatures can easily cause product deterioration and electronic instruments to malfunction; in greenhouse cultivation and industrial production, if the temperature is not controlled, it will seriously affect the output and quality. There are also many areas where the temperature may be high or low, and people cannot get close or there is no need for manpower on site to monitor. The traditional temperature measurement method has a long cycle and cannot be monitored in real time. In addition, the surveyor must go to the site to measure and start the power equipment to adjust the temperature. The work efficiency is very low and it is not easy to manage. For this reason, this remote measurement and control system is designed, so that the site can be monitored while sitting in the office, which is convenient and saves manpower.

1 Overall design of the system

This design is a temperature monitoring system based on a single-chip microcomputer and NiosⅡ soft core, and its system block diagram is shown in Figure 1. This system uses Dallas single-wire digital temperature sensor DS18B20 to collect temperature data, breaking the traditional idea of ​​collecting temperature through A/D conversion using thermal resistors and thermocouples. The digital signal is processed and controlled by Atmel's FLASH single-chip microcomputer AT89S51, and transmitted to the embedded processor composed of NiosⅡ through the RS 232 serial port to monitor and alarm the temperature. The embedded Web server of Nios II allows users to browse the web pages stored in the FLASH chip through the IE browser. Since the CPU itself is implemented in a soft core mode, its functions can be customized according to needs, which is very flexible.

2 Hardware Design of Monitoring System

2.1 A brief introduction and instructions for using DS18B20

DS18B20 is a single-line digital temperature sensor produced by DALLAS, USA. It has the advantages of miniaturization, low power consumption, high performance, strong anti-interference ability, and easy matching with microprocessors. It is particularly suitable for forming a multi-point temperature measurement and control system. It can directly convert the temperature into a serial digital signal for microcomputer processing. Moreover, each DS18B20 has a unique product number and can be stored in its ROM. When forming a large temperature measurement and control system, multiple DS18B20 chips can be hung on a single line. It only takes one port line to read or write DS18B20 information from DS18B20. The power for reading, writing and temperature conversion comes from the data bus. The bus itself can also supply power to the connected DS18B20 without additional power supply. DS18B20 can provide 9-bit temperature readings. It can easily form a temperature detection system without any peripheral hardware. DS18B20 is smaller in size, has a wider applicable voltage and is more economical. The measurement temperature range is -55~+125℃, and the accuracy is ±0.5℃ in the range of -10~+85℃. The temperature collection process of DS18B20 controlled by single chip microcomputer must go through three steps: initialization, writing operation and reading operation, and there must be strict time intervals.

2.2 Description of NiosⅡ Processor

Altera's NiosⅡ processor is an embedded system microprocessor IP core with a 32-bit instruction set and data channel that users can configure and build at any time. It uses the Avalon bus structure communication interface and has enhanced memory debugging and software functions. LWIP is a network communication protocol designed specifically for embedded system applications. It supports Internet Message Control Protocol (ICMP), User Datagram Protocol (UDP), Dynamic Host Configuration Protocol (DHCP), Address Resolution Protocol (ARP) and standard Socket interface provided to applications. Therefore, it can complete most of the functions of the traditional TCP/IP protocol, but the resource occupation is smaller than that of the TCP/IP protocol, so it is very suitable for systems with NiosⅡ processor as the core. Based on the above considerations, the embedded Web server uses NiosⅡ processor as the core and LWIP as the network communication protocol to realize simple web browsing functions. Users can browse web pages stored in FLASH through the network.

2.3 Hardware Circuit Design Description

The hardware circuit of this system includes a single-chip temperature acquisition circuit, a level conversion circuit and a NiosⅡ-based embedded host computer system.

2.3.1 Temperature acquisition circuit

The temperature acquisition circuit is mainly composed of DS18B20 and a single chip, as shown in Figure 2. The system uses the 8051 single chip (U1) as the core; C1, C2 and Y1 form a clock circuit, and the crystal oscillator is 12 MHz; S1, C12 and R3 form a reset circuit; P1.0 of U1 is connected to a light-emitting diode for program execution indicator; R5 is a current limiting resistor; DQ is connected to the P2.1 terminal of 8051; R1 is a pull-up resistor between the signal and the 5 V power supply.

[page]

2.3.2 Level conversion circuit

The communication circuit between the microcontroller and the host computer is shown in Figure 3. The 8051 microcontroller itself provides a set of full-duplex serial transmission interfaces, with the TXD pin transmitting serial data and the RXD pin receiving data, but its working logic level is TTL level (0 V, 5 V). Therefore, the data communication between the microcontroller and the PC must be converted by the RS 232 signal (+12 V, -12 V) level. This system uses the MAX232 level conversion chip, and the interface level conversion can be completed by adding 4 capacitors. The 11th pin (TXD) of the microcontroller is connected to the 10th pin of 232, and the 10th pin (RXD) of the microcontroller is connected to the 9th pin of 232. The RS 232-C interface connected to the host computer uses a DB-9 9-pin plug socket, and the transmission line uses a shielded twisted pair. The power supply part uses a commercially available 9 V DC regulated power supply, which is filtered and stabilized by 7805 to obtain a stable 5 V power supply.

2.3.3 NiosⅡ-based embedded host computer

The system mainly includes the following parts: NiosⅡ soft-core CPU, timer used by the operating system, timer used by the network protocol stack, interface between CPU and peripheral devices (Avlaon bus); EPCS4 is used to configure FPGA when powered on; FLASH is mainly used to store software code and some parameters that need to be saved; SRAM is used to store code and data when the system is running; the network interface chip uses Smsc's LAN91C111 chip as the network interface. This device is an Ethernet controller that implements the functions of the transport layer and MAC layer in the network 7-layer protocol stack. In addition, it has functions such as 10/100 Mb/s self-adaptation and duplex/half-duplex self-adaptation, and has good network compatibility. It uses serial UART to communicate with the microcontroller. The CPU built using SOPC Builde in QuartusⅡ is shown in Figure 4.

3. Software Design of Monitoring System

The block diagram of the single chip microcomputer control program design is shown in Figure 5 and Figure 6.

The function of the serial port interrupt program is to receive the data acquisition cycle and start and stop instructions sent by the host computer. The temperature signal filtering is implemented by software. The filtering algorithm adopts the weighted average method, that is, the maximum and minimum values ​​of the latest detected N temperature signal sequences are removed and the weighted average operation is taken. [page]

4 Implementation of Web Server Based on NiosⅡ

The constructed CPU and corresponding modules are analyzed for pin assignment and integrated before compilation. The embedded real-time multi-task control system is realized by transplanting the real-time operating system μCLinux using NiosⅡIDE (Integrated Development Environment), and the corresponding web pages are developed and the server is transplanted and configured. This system uses Boa under μCLinux. Boa is a single-threaded HTTP server. It is different from other traditional Web servers. It does not create a process for each connection. It only creates a new process when the CGI program is running. The Web server function of the intelligent monitoring system is realized by transplanting Boa. Finally, the dynamic Web interaction function is realized by writing CGI programs and combining Flash animations.

5 Conclusion

The remote temperature control system designed with AT89S51 series single chip microcomputer, sensor DS18B20 and NiosⅡ has the advantages of novel structure, simple circuit, small size and convenient control. It can be widely used in remote temperature monitoring of relevant key equipment in power stations, schools, hospitals, etc. It is also suitable for temperature monitoring in high temperature or dangerous places that are inaccessible to human body. If the conversion sensor is slightly changed, it can also become a remote monitoring system for other parameters, such as pressure, humidity or gas.

Keywords:MCU Reference address:A remote temperature monitoring system based on single chip microcomputer and FPGA

Previous article:Design of an intelligent guide dog based on FPGA technology
Next article:Design of image compression wireless transmission system based on DSP

Recommended ReadingLatest update time:2024-11-16 17:55

The Concept of a Simple MicroBlaze Microcontroller
MicroBlaze is an embedded microprocessor based on architecture. Its significant advantage is that it can meet the needs of complex applications. In addition to running simple general-purpose applications, it can also run operating systems. Designers can implement MicroBlaze soft processors in all current Xili
[Industrial Control]
The Concept of a Simple MicroBlaze Microcontroller
Essential basic knowledge of microcontroller serial port
If you want to be familiar with MCU, you must first look at the structure and special registers of MCU, which are the key to your software writing. As for the special function registers needed for serial communication, they are SCON, TCON, TMOD, SCON, etc. What do they mean? SBUF data buffer register This is a seria
[Microcontroller]
51 single chip microcomputer-simple application of timer
1. Details In the previous lecture, we know that the initial value of the "16-bit variable" synthesized by TH0 and TL0 must be at least 0 and cannot be a negative number. So we have to satisfy: 65536-(x/(12/11059200)) =0. The solution is x = 0.071111 seconds = 71.111 milliseconds. That is to say, the longest t
[Microcontroller]
Single chip microcomputer 1602 Chinese characters and time display program (year, month, day 3 Chinese characters)
//* //-------------------------Program function-------------------------//         Use timer 0 to run, 1602 display, and buttons to adjust time.                 //---------------------------Remark---------------------------//         //-------------------------Instructions for use-------------------------//      
[Microcontroller]
The similarities and differences between Flash and EEPROM on microcontrollers
    The full name of FLASH is FLASHEEPROM, but the operation method is different from that of conventional EEPROM.     The biggest difference between FLASH and EEPROM is that FLASH operates by sector, while EEPROM operates by byte. The two have different addressing methods and different storage unit structures. The c
[Microcontroller]
A brief talk about the feelings of two months of single chip microcomputer design and development
When I wrote this article, my two-month microcontroller design and development had already ended. I felt quite emotional, so I wrote this article. First of all, let me introduce to you what a single-chip microcomputer is. The full name of a single-chip microcomputer is "single-chip microcomputer", and its English na
[Microcontroller]
Design of Gas Alarm Based on 51 Single Chip Microcomputer
Introduction At present, with the continuous development of mining technology, the safety of underground operations is increasingly guaranteed, but there are still many mining enterprises with low mechanization levels, which pose a potential threat to the life safety of on-site mining workers. In particula
[Microcontroller]
Design of Gas Alarm Based on 51 Single Chip Microcomputer
System Expansion of Large Capacity Data Storage in Single Chip Microcomputer System
1 Introduction When the MCS-51 single-chip microcomputer system is expanded, the P0 port is generally used as the lower 8 bits of the address (time-sharing with the data port), and the P2 port is used as the higher 8 bits of the address. It has a total of 16 address buses and an addressing space of 64KB. However, in
[Microcontroller]
Latest Embedded 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号