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.
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
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
- Today at 10:00 am, Keysight Technologies' award-winning live broadcast begins | Evolution and updates of signal integrity testing
- Proteus simulation implementation of simple single-chip calculator
- 【GD32L233C-START Review】 Second Development Board Function Review
- Technologies such as RFID enhance the security of smart IoT
- I2C Pressure Sensor
- Differences between CPU and CLA in C28x+FPU architecture and error handling techniques
- The drilling marks are clear, why is there a hole missing on the PCB?
- Prize-winning quiz | TE "New Energy Application Solutions White Paper"
- Why are XH connector manufacturers so stupid?
- A summary of the most downloaded electronic technical materials this week (2020.6.1~5)