Design of Ethernet Remote Monitoring System Based on AT89S52 Single Chip Microcomputer

Publisher:真情相伴Latest update time:2011-12-17 Keywords:AT89S52 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere
1 Introduction
The development of computer and network technology has triggered profound technological changes in the field of remote monitoring and surveillance. The development of system structure towards networking and openness will be the main trend of technological development. As the most widely used local area network technology, Ethernet has been increasingly used in the fields of industrial automation and process control due to its advantages such as good openness, low cost, and high data transmission rate. Relying on Ethernet technology to achieve information sharing has brought great changes to office automation and has had a profound impact on system design. This paper takes temperature control as the research object, takes AT89S52 microcontroller as the core, and uses ZNE-100T module as Ethernet interface to design a remote temperature control system based on Ethernet.

2 System composition and principle
The hardware circuit of the Ethernet remote temperature monitoring system based on AT89S52 microcontroller is shown in Figure 1.

System working principle: First, the DS18820 single-line digital temperature sensor is responsible for real-time acquisition of on-site temperature signals, and directly transmits the temperature signals in digital form to the AT89S52 single-chip microcomputer. After the AT89S52 single-chip microcomputer obtains the corresponding value, it is analyzed by the main program and compared with the set value. According to the actual situation, the output signal controls the level of each port of the output circuit to drive the peripheral control circuit to work and realize the control of the controlled object. At the same time, the single-chip microcomputer is connected to ZNE-100T through the UART0 serial port, and connected to the host computer through Ethernet to realize remote communication based on Ethernet.

3 System Hardware Design
The hardware of this system mainly includes the minimum system of the single-chip microcomputer, temperature acquisition circuit, display circuit, alarm circuit, peripheral control circuit and Ethernet interface module. The system uses AT89S52 as the core processor. AT89S52 is a low-power, high-performance CMOS8-bit single-chip microcomputer produced by Atmel. It contains 8k bytes of EPROM and 256 bytes of RAM. It has ISP (in-system programming) function. It has the advantages of high flexibility, easy use and low price. Therefore, this chip has been widely used in embedded control systems. This system uses Dallas single-wire digital temperature sensor DSl8820 to collect temperature data on site, breaking the traditional idea of ​​collecting temperature through A/D conversion using thermal resistors and thermocouples. It uses Atmel's Flash single-chip microcomputer AT89S52 to process and control the digital data, and transmits it to the PC through the RS-232 serial port and Ethernet to achieve remote control. Using the ISP (in-system programming) function of AT89S52, it is very convenient to write the compiled program into the microcontroller, and it is easy to debug, modify and upgrade. The temperature range monitored by this system is 0℃~+90℃, and the accuracy of temperature display is 0.01. Not only can the temperature value be displayed in real time using decimal, but the upper and lower limits of the control temperature can also be set as needed. When the temperature exceeds the set value, the system automatically generates an alarm indication. The following are the circuit functions of each part:
(1) AT89S52 microcontroller
AT89S52 is the core processor of the entire system. The microcontroller first compares the field temperature measured by the sensor with the preset temperature. If it is greater than or less than the preset value, it outputs a signal to control the operation of the heater, thereby realizing temperature control. AT89S52 is also responsible for LCD display, alarm, and communication with the host computer through Ethernet.
(2) Temperature sensor
The temperature sensor is the key component of the system. This paper uses the digital temperature sensor DS18820 produced by Dallas Semiconductor Corporation in the United States. It supports a single bus interface and uses the patented on-board technology. All sensor elements and conversion circuits are integrated in an integrated circuit shaped like a transistor. Its measurement temperature range is -55℃~+125℃, and its accuracy is ±0.5℃ within the range of -10℃~+85℃. The field temperature collected by the temperature sensor DS18820 is directly transmitted in a single bus digital manner, which greatly improves the anti-interference ability of the system and is suitable for field temperature measurement in harsh environments. Such as: environmental control, equipment or process control, temperature measurement consumer electronic products, etc. Unlike the previous generation product (the world's first DS1820 temperature sensor supporting a single bus interface), it supports a voltage range of 3.0V~5.5V, making the system design more flexible and convenient, and the DS18820 is cheaper and smaller in size. The internal structure of DS18820 mainly consists of four parts: 64-bit photolithography ROM, temperature sensor, non-volatile temperature alarm triggers TH and TL, and configuration register. Its temperature detection circuit diagram is shown in Figure 2. The GND pin of DS18820 is the power ground, DQ is the digital signal input/output terminal, and VDO is the external power supply access terminal (grounded when using parasitic power supply). In this system, an external power supply is used, DQ is connected to the P2.0 terminal of AT89852, and Rl is the pull-up resistor between the signal and the 5V power supply. In practice, if multi-point detection is required, multiple DS18820s can be hung on a single bus.

[page]

This system uses furnace temperature as the temperature detection object, and the temperature range of the resistance furnace is 30℃~150℃. The system set temperature is 35℃~80℃, and an alarm is generated when the temperature exceeds the limit. Due to the large inertia of temperature change, the system uses solid-state relays as temperature control elements. Solid-state relays are contactless switching elements composed of solid components. They use the switching characteristics of electronic components to control the disconnection and connection of the circuit. They are reliable, have a long life, and have a fast switching speed, and can achieve a relatively ideal temperature control effect. The solid-state relay used in the system is TOSHIBA's TSSl6J4lS. The system uses a PID regulator. Once the temperature of the resistance furnace exceeds the limit, the PID regulator turns the solid-state relay TSSl6J4lS on or off, thereby controlling the heater and controlling the temperature of the resistance furnace within the set temperature range.
(3) Ethernet interface circuit design
The Ethernet function of the system is realized through the ZNE-100T module. ZNE-100T is an embedded Ethernet to serial port module developed by Zhou Ligong Company. It integrates TCP/IP protocol, is equipped with 32-bit ARM7CPU, 16KB RAM, 128KB FLASH and 10M Ethernet interface, supports RS-232 and RS-485 interfaces, supports dynamic or static acquisition of IP address, has multiple working modes such as TCP Server, TCP Client, UDP, Real COM driver, Group Mode, etc., can be configured using a web browser, and provides a general configuration function library, which is convenient for users to use VC, VB, Delphi and C++Builder to develop applications. Since ZNE-100T Ethernet module can realize transparent transmission of data between serial port devices and Ethernet devices, it can be used to easily complete the network function of embedded devices. The baud rate, start bit, stop bit and working mode of ZNE-100T Ethernet module are designed through configuration software. In this system, its baud rate is set to 9600b/s, the start bit is 1 bit, the stop bit is 1 bit, and the working mode is TCP Sever.
Since the AT89S52 microcontroller itself provides a set of full-duplex serial transmission ports, the TXD pin is used to transmit serial data, and the RXD pin is used to receive data, but the working logic level is TTL level (0V, 5V). The ZNE-100T module is equipped with an RS-232 standard serial interface with a level of (+12V, -12V). The electrical specifications of the two are inconsistent. Therefore, to complete the data communication between the microcontroller and the PC, the TTL level output by the microcontroller must be converted. This system uses the MAX232 level conversion chip produced by MAXIM to realize RS-232 standard interface communication.
(4) Control circuit
The drive circuit adopts a relay drive method. By controlling the on and off time of the relay within the control cycle, the switch control of the heater is realized. Thus, the temperature is controlled. The control signal output by the microcontroller I/O port is amplified by the NPN transistor to drive the relay to work.
(5) Alarm circuit
This design uses a buzzer alarm circuit, which consists of a transistor and a buzzer. The microcontroller I/O port outputs a signal to control the on or off state of the transistor. When the transistor is on, the buzzer sounds an alarm.

4 Implementation of temperature monitoring
When the system is working, the user first sets the expected two-digit temperature value (the value is in decimal, in degrees Celsius, ranging from 35℃ to 80℃). After the temperature value is entered, the power is turned on, the microcontroller automatically resets and initializes. At this time, the LED display shows the set temperature so that the operator can check the set temperature. Then the temperature detection circuit inputs the temperature of the measuring point into the microcontroller, which is filtered by the software as the actual measured temperature. Thereafter, the display will always show the actual measured temperature. The temperature setting of this system can also be set through the host PC at the remote monitoring end. The host PC transmits the given quantity and each setting parameter to the AT89S52 single-chip microcomputer through the ZNE-100T module. The DS18820 temperature sensor also transmits the temperature of the resistance furnace detected in real time on site to the AT89S52 single-chip microcomputer. After the AT89S52 single-chip microcomputer obtains the temperature transmitted by the DS18820 temperature sensor, it is analyzed by the main program and compared with the set value. If the measured temperature is higher than the set temperature, the heater is turned off and an alarm is sounded through the drive circuit; if the measured temperature is lower than the set temperature, the heater is turned on and an alarm is sounded through the drive circuit; if it is within the set temperature range, the heater state remains unchanged.

5 System software design
The system uses AT89S52 as the core processing device. The temperature data collected in real time on site by DSl8820 is stored in the internal data memory of AT89S52, sent to the LCD display, and compared with the preset value. Then the single-chip microcomputer outputs the signal to control the heater. The following issues should be considered in the design of the temperature control program: · Real-time temperature collection; · Temperature display; · Communication program with the upper PC; · Over-limit alarm and processing. The software design mainly includes: main program, initial value setting subroutine, temperature reading subroutine, LCD display subroutine and output control subroutine. The initial value setting subroutine completes the setting of the initial temperature value and data storage; the temperature reading subroutine completes the reading of the temperature sensor data and displays the temperature value through the LCD display subroutine; the output control subroutine completes the control of the output port according to the temperature value. The specific software main program and serial communication interrupt program of AT89S52 are shown in Figure 3 and Figure 4 respectively.

[page]

In Ethernet communication, PC is the host and MCU is the slave. RS-232 serial interface is used between MCU and ZNE-100T module, the communication baud rate is 9600b/s, the data frame format is 1 start bit, 8 data bits, 1 stop bit, no parity bit.

6 Software design of remote monitoring terminal
The management software of the remote monitoring terminal is developed and designed in Visual Basic 6.0V, and the program is written in Microsoft Access database format. The system can run on the Windows operating system platform, which is convenient for future modification and use. It is mainly composed of communication control part, serial port parameter setting part, collection data writing part, collection data display and alarm display part and database maintenance part. The remote monitoring terminal database is generated by Access software, including three tables: Table 1 is a table for storing collection data, Table 2 is a table for storing operators and passwords, and Table 3 is a table for storing each monitoring address. The application software of the remote monitoring terminal provides a good interface, so that maintenance personnel can easily observe the working status of each remote monitoring point through the data table on the interface, and effectively maintain the whole system through the menu. Its composition block diagram is shown in Figure 5.

Some of the software functions of the remote monitoring end are as follows:
(1) The communication control software is mainly responsible for monitoring the serial port, receiving characters from the microcontroller or sending characters to the microcontroller.
(2) The collected temperature display and alarm display software is mainly responsible for displaying the received monitoring temperature data on the main interface. When the collected temperature at the monitoring site exceeds the alarm limit, the alarm location and alarm content are displayed on the alarm panel of the main interface.
(3) The collected temperature writing to the database software is responsible for decoding the received information characters, extracting the time, location and collected temperature data, and analyzing the legitimacy of the above data. If it is legal, it is stored in the database table.
(4) The serial port parameter setting software is responsible for setting which serial port to use, the baud rate, check bit, and stop bit of the serial port.

7 Conclusion
This paper takes AT89S52 microcontroller as the core and uses ZNE-100T Ethernet module to design a simple and practical Ethernet remote monitoring system. The experimental verification shows that the data communication is normal and the detection data fully meets the requirements of the system design. Because the system has simple hardware, low cost, high integration, good stability, convenient debugging and strong anti-interference ability, and can realize remote automatic control of temperature, it has certain practical value.

Keywords:AT89S52 Reference address:Design of Ethernet Remote Monitoring System Based on AT89S52 Single Chip Microcomputer

Previous article:Design of single chip microcomputer control system for automatic chamfering machine of magnetic tile
Next article:51 single chip microcomputer plus CPLD makes the system more efficient

Recommended ReadingLatest update time:2024-11-16 16:48

at89s52 serial port circuit diagram
at89s52 serial port circuit diagram
[Analog Electronics]
at89s52 serial port circuit diagram
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号