1 Introduction
The data collector based on GPRS and MCS-51 microcontroller is a real-time online environmental monitoring system. It uses the packet wireless service GPRS to transmit the environmental conditions detected online in real time to the environmental protection department monitoring information processing center through the Internet. The real-time processing software for monitoring information By sorting and analyzing the collected data, the environmental protection agency can grasp the monitoring indicator information of monitoring points and pollution sources in the jurisdiction without leaving home, so that the management of the environmental protection agency can realize the transformation from manual to informatization in the mechanism, and overcome the problem of In the past, the detection of various environmental indicators mainly relied on environmental protection personnel to go to the site to manually take samples, bring them back to the laboratory for analysis, and then draw conclusions. The problems of long cycle and low efficiency can also be increased. Low, the reliability of the summarized environmental quality and pollution source monitoring information is low.
2. Working process of monitoring system
The specific working process of the entire system is shown in Figure 1. The data collector unit converts the standard 4~20mA current signals output by various on-site measuring instruments such as flow meters, PH meters, COD meters, etc. into digital signals, saves the collected data internally, and then sends it to the computer via wireless transmission through the GPRS module. In the monitoring center, the "monitoring information real-time processing system" software running in the computer of the monitoring center centrally processes and analyzes the monitoring data. Monitoring center personnel can understand the environmental quality status of the collection points based on the processed and analyzed data.
3 Data collector hardware structure
The collector adopts a dual-CPU structure. The main CPU is responsible for data communication and transmission with the monitoring software, as well as range setting and parameter display. The slave CPU is responsible for data collection, conversion and storage of respective channels, which can avoid data caused by switching between channels. Signal interference ensures accurate and reliable data measurement. The CPU uses two methods (RS-485 serial communication method and 4-20mA current loop method) to receive or convert the data of each online monitoring instrument (see Figure 2). Functionally, the collector circuit is divided into the following components:
(1) Microcontroller control unit circuit
The microcontroller control unit circuit includes two microcontrollers AT89S52 (represented by master CPU and slave CPU respectively), high-speed 1K dual-port static RAMIDT7130, E2PROMAT24C512 and other devices. MASTERCPU is mainly used for control and communication (remote communication with the host computer, and communication operations such as receiving data and sending commands with SLAVECPU); SLAVECPU is mainly used for data conversion of collected data and data transfer with MASTERCPU. AT89S52 contains 8K of FLASH as program memory. The high-speed 1K dual-port static RAMIDT7130 serves as the shared RAM for communication between MASTERCPU and SLAVECPU.
Parameter data storage uses an external expansion piece of 64K E2PROM (AT24C512) for data storage, and the data is sent to display or upload as needed.
(2) A/D conversion circuit
The A/D conversion circuit uses MAX197, which is used to convert the 4-20mA analog signal sent from the monitoring instrument into a digital signal and send it to the microcontroller for processing. The MAX197 chip is a new product of the American MAXIM company in recent years. It is a multi-range (±10V, ±5V, 0~10V, 0~5V), 8-channel, 12-bit high-precision A/D converter. It adopts the working method of successive approximation and has a standard microcomputer interface. The three-state data I/O port is used as an 8-bit data bus, and the timing of the data bus is compatible with most general-purpose microprocessors. All logic inputs and outputs are TTL/CMOS level compatible. Compared with ordinary A/D converter chips, the new A/D converter chip MAX197 has an excellent performance-price ratio. It only requires a single +5V power supply and has simple peripheral circuits, which can simplify circuit design.
In this collector system, the slave CPU is used to connect to it. Connect P0.0~P0.7 of AT89C52 to D0~D7 of MAX197. P2.7 is used as the chip select signal, and the address assigned to MAX197 is 7000H. Choose MAX197 as the software to set the low-power working mode, so set the SHDN pin to high level. In this example, the internal reference voltage is used, so REF and REFDJ are both connected to ground through capacitors. The P1.7 pin is used as a selection line for interpreting high and low bit data, and is directly connected to the HBEN pin. The INT pin of MAX197 is connected to P1.6 of the slave CPU as a conversion identification signal.
(3) Communication transmission unit
Since environmental monitoring points are geographically dispersed, remote, and have poor natural conditions, wired transmission requires the establishment of dedicated lines, which is too costly. Wireless transmission is particularly suitable for outdoor use environments with poor conditions and cross-regional applications due to its rapid and flexible networking, short construction period, and low cost. Especially with the development of mobile communication technology, the use of wireless networks to transmit data has become a new development trend. The GPRS wireless data terminal unit (DTU) of Shenzhen Hongdian Company is used as the transmission unit for monitoring data. Its main technical features are:
One is transparent data transmission. H7100GPRSDTU directly provides RS485 or RS232 interface, which is simple and convenient to use, and provides a transparent transmission channel for users' data equipment; second, the background computer support. Ordinary GPRS Modem usually needs to be attached to a PC for virtual dial-up access to the Internet, and uses the resources of the PC to send and receive data and protocol conversion; while H7100 GPRSDTU has built-in automatic network connection and protocol processing modules, without the need for background computer support; third, point, point-to-multipoint, and peer-to-peer etc., real-time data transmission. H7100GPRSDTU can realize peer-to-peer data transmission from point to point, point to multipoint, and center to multipoint. The transmission delay is generally less than 1s; fourth, it is always online. H7100GPRSDTU can automatically attach to the GPRS network as soon as it is turned on, and establish a communication link with the data center to send and receive data from user data devices at any time. Since H7100GPRSDTU directly provides RS485 or RS232 interface, the communication circuit with the main CPU adopts two serial communication methods: RS-485 and RS-232. They are implemented using MAX1487 and MAX202E communication chips of MAXIM Company respectively. Data are transmitted with the remote monitoring information processing center through the default communication protocol and GPRS data transmission unit.
(4) Button and display circuit
This collector uses the BC7281 chip of Bi Hi-tech Company to realize the relevant parameter input and data display on the collector. The chip can drive 8-bit or 16-bit digital tube display, has a 64-key keyboard interface, contains debounce function, has 2 keyboard working modes to adapt to different application requirements, has a unique light column decoding method, and can independently control two 64-bit keyboard interfaces. Segment light column display, segment addressing function facilitates the control of independent LEDs, 16 bits can independently control the flashing attributes, the flashing speed is software adjustable, the segment drive polarity and shift pulse timing are controllable, and can be used with various forms of drivers The circuit and keyboard part have a key value latch function, the contents of the internal display register and control register can be read out, and a 2-wire high-speed serial interface is used to connect to the CPU, which greatly simplifies the circuit design and makes programming more convenient.
4 Collector control program flow
5 Conclusion
The data collector introduced in this article has the functions of automatic continuous collection, conversion, storage and data transmission of multi-channel analog quantities (4~20mA signals), and can automatically save the last 6-30 days of detection data. Due to the RS-232 and RS-485 communication interfaces, other external detection modules can be easily connected. In addition, the collector also uses a GPRS wireless transmission module.
Previous article:Improved noise suppression voice collection solution using LMV1090 amplifier and AT89C51 microcontroller
Next article:Design of intelligent enteral nutrition infusion pump based on 89C51RD2 microcontroller and embedded core
- Popular Resources
- Popular amplifiers
- Learn ARM development(16)
- Learn ARM development(17)
- Learn ARM development(18)
- Embedded system debugging simulation tool
- A small question that has been bothering me recently has finally been solved~~
- Learn ARM development (1)
- Learn ARM development (2)
- Learn ARM development (4)
- Learn ARM development (6)
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- LED chemical incompatibility test to see which chemicals LEDs can be used with
- Application of ARM9 hardware coprocessor on WinCE embedded motherboard
- What are the key points for selecting rotor flowmeter?
- LM317 high power charger circuit
- A brief analysis of Embest's application and development of embedded medical devices
- Single-phase RC protection circuit
- stm32 PVD programmable voltage monitor
- Introduction and measurement of edge trigger and level trigger of 51 single chip microcomputer
- Improved design of Linux system software shell protection technology
- What to do if the ABB robot protection device stops
- Analysis of the application of several common contact parts in high-voltage connectors of new energy vehicles
- Wiring harness durability test and contact voltage drop test method
- From probes to power supplies, Tektronix is leading the way in comprehensive innovation in power electronics testing
- From probes to power supplies, Tektronix is leading the way in comprehensive innovation in power electronics testing
- Sn-doped CuO nanostructure-based ethanol gas sensor for real-time drunk driving detection in vehicles
- Design considerations for automotive battery wiring harness
- Do you know all the various motors commonly used in automotive electronics?
- What are the functions of the Internet of Vehicles? What are the uses and benefits of the Internet of Vehicles?
- Power Inverter - A critical safety system for electric vehicles
- Analysis of the information security mechanism of AUTOSAR, the automotive embedded software framework
- Submit your idea, experience MPS products or evaluation boards for free, and win a backpack, Bluetooth wireless headset, and 10,000 yuan in cash!
- Microchip Spring Sale, popular development tools up to 60% off!
- The 3 big benefits of the start of the Year of the Tiger are brought to you by Murata Tmall flagship store
- Power supply obstacles + small mistakes in charging management
- [NXP Rapid IoT Review] + The mobile APP can finally connect to the kit
- A novice asks for advice, how can a switching power supply achieve a regulated output without using a 431?
- MSP430F5438+DTH11 Example Code
- 【Qinheng RISC-V core CH582】Upgrade program via Bluetooth
- Several parameter issues of audio playback equipment
- MSP430 and Audio