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.
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.
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.
Previous article:Design of triple-speed sampling method for PIC software serial asynchronous communication
Next article:Development of Intelligent Nodes in Image Acquisition System Based on LON Bus
Recommended ReadingLatest update time:2024-11-16 16:33
- Popular Resources
- Popular amplifiers
- 西门子S7-12001500 PLC SCL语言编程从入门到精通 (北岛李工)
- MCU C language programming and Proteus simulation technology (Xu Aijun)
- 100 Examples of Microcontroller C Language Applications (with CD-ROM, 3rd Edition) (Wang Huiliang, Wang Dongfeng, Dong Guanqiang)
- Single-chip microcomputer technology and application - electronic circuit design, simulation and production (edited by Zhou Runjing)
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
- TI DBV package silkscreen details
- MSP430F6638 baud rate setting
- KiCAD released a new version - 5.1.10
- 2020 National College Student Electronics Contest Test Questions
- High voltage and small size: the latest technology trends of Nichicon's drive film capacitors
- [Chip] Interesting chips, interesting engineer souls
- Serial communication
- TMS320C6678DSP SRIO channel and frequency settings
- Development troubles, what to do when you encounter bad teammates
- Should 5G be blamed for cheating in the college entrance examination?