Development of an Environmental Protection Equipment Operation Recorder

Publisher:美好梦想Latest update time:2012-02-27 Source: 中国IC网 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

The lack of monitoring methods for the operation status of pollution treatment facilities and pollution emission indicators has affected the supervision and management of environmental protection departments. We have developed a series of environmental protection equipment operation monitoring systems. This system has stable operation, accurate data recording, large storage capacity, and convenient networking. It has been adopted by many environmental protection supervision departments and has achieved good social and economic benefits.

1 System composition and main functions

The environmental protection equipment operation monitoring system consists of an environmental protection equipment operation recorder, a barcode reader, and a management computer. The recorder is installed at the environmental protection equipment operation site to monitor and record the operation status of the environmental protection equipment and the main pollutant emission indicators around the clock; the barcode reader is used to control and operate the recorder and read the data from the recorder; the management computer is used to count, report, store and query the original data. The recorder can be operated alone or form a regional environmental protection monitoring network, as shown in Figure 1.

The recorder is the core of the whole system, and its main functions are as follows:

(1) The recorder has 8 data acquisition channels, which can receive 4-20mA (or 0-10mA) current signals output by field instruments or sensors. Each channel can be freely set as a switch channel (real-time recording of the startup/shutdown operation of environmental protection equipment), a cumulative channel (such as accumulating the discharged sewage flow) or an instantaneous channel (recording the concentration of discharged pollutants) according to the monitored object.

(2) The recorder can generate its own operation records (recorder power-on/power-off time).

(3) The operating current range of the monitored environmental protection equipment can be set through a barcode reader or a management computer, and an over-limit alarm will be issued for the operating current of the monitored environmental protection equipment.

(4) The recorder provides a standard RS-232 interface for communicating with the management computer and the barcode reader.

(5) The recorder has a built-in universal MODEM and MODEM controller, which can communicate remotely with the management computer. [page]

2 Hardware Design

According to the functional requirements and the working characteristics of the recorder, we mainly consider the three aspects of recorder operation reliability, recorded data accuracy and data storage capacity during design. The recorder uses ATMEL's AT89C52 microcontroller, which integrates 8K FLASH program memory on the chip, without the need for external program memory expansion, which improves the system operation stability. Figure 2 shows the structural block diagram of the recorder.

2.1 Data acquisition channel

The data acquisition channel A/D converter uses the high-performance 10-bit serial A/D converter TLC1549 from TI of the United States. The A/D converter uses CMSO technology, has a sampling frequency of up to 40kHz, has a wide operating voltage range (3~6V, typical value is 5V), low power consumption, simple interface with the microcontroller, and occupies less resources (three-wire interface).

2.2 Real-time clock

In order to accurately record the startup/shutdown time of environmental protection equipment, the recorder uses the DALLAS calendar chip DS12887, which is widely used in various industrial control instruments. DS12887 has built-in batteries and crystal oscillators, and can be directly connected to the microcontroller data bus. It has good operating stability and high accuracy, and the maintenance-free time can reach more than 10 years, which meets the recorder's time requirements. And it has a 114-byte RAM that can be powered off, which provides convenience for the power-off system maintenance of the recorder.

2.3 Large-capacity flash memory

The recorder requires a large-capacity data storage with power-off memory. Through comparative testing, TI's flash memory FLASH-MEMORY TMS29F040 (512KB 8-bit EEPROM) was selected. In addition to the expanded 512KB flash memory, the recorder also has multiple I/O interface chips, and the required address space has exceeded the conventional 64KB off-chip RAM space of the 51 series microcontroller. The 64KB space is determined by 16 address lines, which are provided by the P0 port with the lower 8 bits and the P2 port with the higher 8 bits. To expand the space, only address lines can be added, such as the P1 port line can be used as the address line. In this system, the expansion of the 512KB flash memory requires the addition of 3 address lines, and the P1 port line has P1.7 available. For this reason, we adopted the line selection method shown in Figure 3 to achieve the expansion of ultra-large capacity memory.

[page]

The addresses of the calendar chip DS12887 and the parallel output port 74HC377 (1, 2, 3) in Figure 3 overlap with the address of the flash memory TMS29F040. However, when P1.7 is set to "1", the chip select signal of the flash memory TMS29F040 is not ready. At this time, the CPU can operate the above I/O interface chip. The outputs Q0, Q1, and Q2 of the parallel output port 74HC377 (1) are used as the high three bits of the address A16, A17, and A18 of the flash memory TMS29F040, and the outputs Q3, Q4, and Q5 are used as the channel addresses A, B, and C of the sampling channel multi-way analog switch. When the CPU operates the flash memory TMS29F040, first set P1.7 to "1", output the high 3-bit address A16, A17, A18 of the flash memory TMS29F040 through the parallel output port 74HC377 (1) Q0, Q1, Q2, then clear P1.7 to "0", select the flash memory TMS29F040, and then program it in the usual way. The program is as follows:

SETB P1.7

MOV A, #add; #add is the high 3-bit address of the flash memory TMS29F040.

MOV DPTR, #0FDFFH; FDFFH is the address of the parallel output port 74HC377 (1)

MOVX@DPTR,A

CLR P1.7 ……

2.4 Communication Interface

According to the characteristics of the recorder with "black box" function, in order to simplify the human-machine interface during design, only the necessary channel status LED display is retained. All kinds of initialization and recording data copying of the recorder are completed through serial communication. The MAX202 single +5V power supply RS-232 interface chip of MAXIM Company is used to provide the standard RS-232 level for communication with PC. Communication is divided into short-range and long-range modes. Short-range communication is directly through the standard RS-232 port, while long-range communication is realized through the built-in telemetry module.

3 Software Design

The recorder software is mainly composed of sampling filtering, data recording, database management, communication management and other functional modules.

3.1 Sampling and filtering module

The module inputs the analog signals of eight channels into the data buffer through the A/D converter according to the set sampling cycle, and filters out the power frequency interference in the signal through the average value filtering algorithm to improve the accuracy of the recorded data.

3.2 Data Recording Module

The eight channels of the recorder can be freely set as switch quantity, cumulative quantity or instantaneous quantity channels. The program first determines the recording type of each channel, and then processes the sampled data accordingly according to the channel type to generate the corresponding operation record. Figure 4 shows the flow chart of this module.

In order to prevent data loss when the recorder loses power, the record data buffer is set up in the DS12887 non-volatile RAM unit. When the power is on, the program analyzes and processes the record data buffer status to ensure the integrity of the data.

3.3 Communication Management Module

All operations on the recorder are realized through RS-232 serial communication. The communication management module completes the functions of receiving operation commands, error correction, password and serial number recognition, command interpretation and execution, data transmission, etc.

3.4 Database Management Module

This module is used for query, storage management, data deletion and other functions of operation data. The code reader or management computer reads the operation data stored in the flash memory of the recorder through the RS-232 serial port with the channel number and the recording time range as keywords. The management module searches according to the above keywords and sends the records that meet the conditions to the sending buffer, which is sent by the communication management module through the serial port.

The operation records generated by the recorder are written into the flash memory by the database management module. Before programming, the remaining storage capacity is determined. If the remaining bytes cannot write a complete record, the management module will sort out the storage area to obtain storage space. The barcode reader or management computer can query the percentage of the remaining storage capacity of the recorder.

The working environment of the recorder is poor and is susceptible to electromagnetic interference. In order to improve the reliability of the recorder, in addition to adopting measures such as instruction redundancy and software traps, the hardware also uses a "watchdog" MAX813L. When the program jumps into a temporary infinite loop and the redundant instructions and software traps are powerless and cause a "freeze", the system is forced to reset.

Reference address:Development of an Environmental Protection Equipment Operation Recorder

Previous article:Design and implementation of a frequency coded keyboard
Next article:Realizing high-speed data acquisition based on DMA block transfer in single-chip system

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号