Design of remote current data acquisition system based on power line carrier technology

Introduced a remote current data acquisition system using semiconductor magnetoresistive current sensor (MRCS) and LM1893 chip. The system hardware is mainly composed of three parts: AT89C2051 single-chip microcomputer main control circuit, serial ADC0832 analog-to-digital conversion circuit, LM1893 power line carrier transmission circuit; the software is compiled in MCS-51 assembly language, and the software design flow chart is given. Due to the use of power line carrier technology, the system can be used for long-distance signal measurement and transmission, and has high practical value.

Introduction: Introduced a remote current data acquisition system using semiconductor magnetoresistive current sensor (MRCS) and LM1893 chip. The system hardware is mainly composed of three parts: AT89C2051 single-chip microcomputer main control circuit, serial ADC0832 analog-to-digital conversion circuit, LM1893 power line carrier transmission circuit; the software is compiled in MCS-51 assembly language, and the software design flow chart is given. Due to the use of power line carrier technology, the system can be used for long-distance signal measurement and transmission, and has high practical value.

In the detection and control of modern production processes, the collection of current parameters is one of the most common and important items. In some data acquisition systems, the measurement site is far away and the environment is harsh, and the computer main control system is far away from the measurement devices and sensors. The traditional method is to use long-distance cable system or radio transmission, but its cost is higher or it takes up radio frequency resources. Power line carrier technology solves these problems well. It only needs to use the existing power line to reliably transmit data, which provides great convenience for the realization of remote data collection and transmission.

With the development of semiconductor sensor technology and communication technology, it is possible to realize low-cost, high-precision, and high-reliability current data collection and remote transmission by power line carrier. In this system, the current data acquisition uses a semiconductor magnetoresistive current sensor (MRCS), the microcontroller uses AT89C2051, and the power line carrier communication uses the LM1893 chip. Due to the use of power line carrier technology, remote data collection does not require rewiring but uses ready-made power lines, which reduces the cost and complexity of system implementation. Therefore, this system is very practical in the application field.

Design of remote current data acquisition system based on power line carrier technology

1 System hardware composition and working principle

1.1 Current sensor

Use indium antimonide-indium (InSb-In) magnetoresistive element (MR) to make current sensor (MRCS)[1], This is a semiconductor sensor based on the magnetoresistive effect. While retaining the excellent characteristics of the Hall current sensor, it also has the advantages of simple structure, high sensitivity, small size, and excellent linearity. Its working principle is to convert the magnetic field around the energized wire into a corresponding voltage signal, and its characteristic is that it can perform non-contact detection of weak current signals. Its structure is shown in Figure 1, mainly composed of wires, insulating substrates, InSb-In magnetoresistive elements MR1 ​​and MR2, permanent magnets, and five pins. Among them, MR1 and MR2 are a pair of magnetoresistive elements placed opposite each other, and their resistance values ​​are equal. The permanent magnet placed vertically under the substrate provides a bias magnetic field B for MR1 and MR2, which can improve the sensitivity of MRCS detection. The wire through which the current to be measured flows is placed at the position of the symmetry axis of MR1 and MR2. When the current flows through pins 4 and 5, a space magnetic field is generated around the wire, and its magnetic induction intensity is △B. When this spatial magnetic field passes through MR1 and MR2 respectively, the direction is opposite at a certain moment, so the effect of this magnetic field and the bias magnetic field B of the permanent magnet inside the MRCS is to increase the resistance of MR1 and MR2. Decrease. According to Ohm’s law, this increase and decrease will cause the voltage at the signal output terminal 2 to change more. Based on this voltage change, MRCS can detect and collect current signals.

Since the output of the current sensor is a voltage signal, an A/D converter is needed to convert the output voltage into a digital signal for the single-chip microcomputer to process. Figure 2 shows the characteristic curve of the relationship between the output voltage and the current to be measured. It can be seen from the figure that when the current changes between 10 and 100mA, the output voltage increases linearly from 0.5V to 4.5V, which shows that the output of the current sensor has good linearity.

Design of remote current data acquisition system based on power line carrier technology

1.2 LM1893

LM1893 is a power line modem chip produced by National Semiconductor, which can realize half-duplex communication of serial data and has all the functions of sending and receiving data. It adopts 18-pin dual in-line type, and its pin diagram is shown in Figure 3. Its main pins are: 5 feet (transmitting and receiving control terminal), 10 feet (transmitting and receiving terminal of carrier signal), 12 feet (demodulation data output terminal) and 17 feet (modulation data input terminal). It consists of two parts: sending circuit and receiving circuit. The working state of the chip is controlled by pin 5. When it is high, the chip is in the sending state; otherwise, it is in the receiving state. The transmitting circuit part is composed of FSK modulator, current controlled oscillator, sine wave generator, output amplifier and automatic level control circuit (ALC). The single-chip microcomputer inputs data from pin 17, and the input data is modulated by FSK to form a switch control current, and the driving current controls the oscillator to generate a triangle wave, and then the sine wave generator forms a modulated sine wave signal, which is amplified by the output amplifier and sent Pin 10 is output to the power line. ALC is used to control the amplitude of the output signal. Pin 18 is an external resistor terminal to adjust the carrier frequency. By adjusting the adjustable resistance of 5kΩ, the center frequency of LM1893 can be selected in the range of 50-300kHz. Pins 8 and 9 are used to connect the emitter and base of the amplifier tube to increase the transmission power. The receiving circuit is composed of a limiting amplifier, a phase-locked loop demodulator, an RC filter, a DC offset elimination circuit and an impulse noise filter circuit. The carrier signal is input by pin 10, amplified by the limiting amplifier, and sent to the phase-locked loop demodulator (PLL) for demodulation. The pulse noise filter circuit filters out the pulse interference in the signal, and outputs the demodulated data signal from pin 12.

The main technical parameters of LM1893 are:

(1) Adopt anti-noise FSK digital frequency shift keying modulation;

(2) The data transmission rate is up to 4.8kbps;

(3) The carrier frequency can be selected between 50~300kHz;

(4) The output power can be adjusted freely within the range of 1~200 times;

(5) Compatible with TTL and CMOS levels;

(6) Suitable for various existing power lines.

Design of remote current data acquisition system based on power line carrier technology

1.3 System hardware design principle

As shown in Figure 4, the whole system is mainly composed of three parts: data acquisition unit, single-chip main control unit and power line carrier transmission circuit.

In the control circuit unit, a single-chip microcomputer is used to realize the collection of current signals and the control of the power line carrier data transmission function. It makes the entire data acquisition system an intelligent organic whole. The one-chip computer uses ATMEL AT89C2051, which contains 2KB flash memory, 128B memory, 15 I/O lines, two timer counters and a full-duplex serial port. In the design, used AT89C2051’s T1 timer and serial port and P1 port line. Because the single-chip microcomputer is compatible with MCS-51, it is more convenient in hardware circuit design and software programming.

The data acquisition unit is mainly composed of MRCS sensor and ADC0832. ADC0832 is an 8-bit successive approximation analog-to-digital converter with serial input and output functions, and its conversion time is 80μs. Its two analog input channels are programmable, and the channels can be designated by the three-bit control word of the serial input port DI, and one of the two working modes of single-ended input and differential input can be selected. MRCS provides the current signal to ADC0832 in the form of voltage signal. CH1 of ADC0832 is selected as single-ended input working mode, and CH0 is not working. The control word input at the DI terminal is “111”, and DI can be fixed to high level. When the P1.2 port of the single-chip microcomputer sets the CS pin of ADC0832 to low level, the control word “111” is input from the DI terminal on the rising edge of the first three pulses of CLK, and the conversion process is completed in the next eight pulses. According to the mechanism of successive approximation, one bit is converted and one bit is stored in the order of high bit first and then low bit. And at the falling edge, the DO terminal outputs a bit; at the falling edge of the subsequent seven pulses, the stored conversion results are output from the DO terminal in the order of low bit and high bit. Therefore, a complete analog/digital conversion process is completed, and the converted eight-bit data is read into the microcontroller from the P1.0 port. From the perspective of practical application, the system must have a communication interface and a remote transmission function on the basis of the acquisition and processing function. The key issue to realize the power line carrier communication is how to select the appropriate MODEM chip and design a reliable interface circuit according to the characteristics of the power line. Because there are many types of electrical equipment on the power line, most of the interference caused by the carrier signal transmission process is low-frequency amplitude modulation interference, so the modulation method of the power MODEM chip should adopt a strong anti-pulse interference frequency modulation method, and at the same time, the carrier signal should be appropriately increased. Power to increase the transmission distance. In this system, LM1893 of FSK standard was selected.

The power line carrier transmission circuit is mainly composed of LM1893 and power line interface (PLI). AT89C2051 communicates with LM1893 through the serial port, the communication adopts standard asynchronous communication mode, and completes data transmission by controlling the receiving and sending status of LM1893. Choose timer 1 as the baud rate generator, and the serial port adopts the working mode 1 with variable baud rate. This method is standard asynchronous communication, and its communication format is 10 bits per frame. The P1.7 port of AT89C2051 controls the 5-pin TX/RX of LM1893 and determines whether the data is sent or received. When it is high level, LM1893 is in sending state. The serial output port TXD of AT89C2051 is connected to pin 17 of the LM1893 modulation and demodulation data input terminal. The data collected by the single-chip microcomputer is sent from pin 17 of LM1893, modulated by FSK into a 150kHz FSK carrier signal, and pin 10 is sent to output the carrier signal. In the interface circuit with the power line, a high-power Zener and resistor are used to form a limiter circuit, which plays a protective role. It can prevent the system from being disturbed by instantaneous overvoltages such as strong lightning pulses. The transistor T and the transformer TN form a tuned power amplifier circuit. Here, the transformer not only couples the carrier signal, but also makes the communication circuit completely isolate the power frequency signal of the power network. The transmission of the carrier signal is connected to the power line through the coupling transformer. The triode T is used to amplify the transmission power of the carrier signal. Through the power amplification of T, the output power of the carrier signal can be increased by nearly 10 times.

2 System software design

In this system, the software is designed with modular structure and written in MCS-51 assembly language. Due to the modularization technology, the system program is more concise and the memory capacity is less.

The system software mainly includes the following programs:

(1) Initialization program, which mainly completes the following tasks: initialize MCU, initialize LM1893, initialize serial port;

(2) A/D conversion subroutine, which mainly completes the following tasks: reset ADC0832, move the control word into ADC0832, start analog/digital conversion, receive data according to the high order and then the low order, and receive the data according to the low order and then the high order;

(3) The carrier transmission subroutine mainly completes the following tasks: setting the working mode of the serial port, and starting the transmission of the serial port.

Design of remote current data acquisition system based on power line carrier technology

By programming according to the system software flowchart shown in Figure 5, current data collection and remote transmission can be realized. The remote computer main control system can receive the data, and analyze, process and Display the data.

In order to ensure the smooth progress of power line communication, the communication protocol adopted by this system complies with the “Regional Power Grid Data Acquisition and Monitoring System General Technical Conditions” and refers to the X-10 protocol. In the process of power line carrier communication, because the communication mode is half-duplex, there must be a transmission protocol that includes a control mechanism to ensure reliable data transmission. Each communication is a message with a fixed frame length. The data format of the frame is: synchronization word, start word, source address, destination address, control word, data block, check code, and end word. The control word contains the command code and the length of the data block. Its length is one byte, the upper four bits are the command code (0: data block is sent, 1: data block is received. 3: data transmission is correct. 4: data transmission error.); the lower four bits are the length of the data block, when the command When sending or receiving data, the length of the data block is given. The length of the data block is 1 to 16 bytes.

As a new type of semiconductor sensor, current sensor (MRCS) has new characteristics and advantages compared with Hall current sensor. The current data acquisition system designed in this paper adopts LM1893 with data modulation and demodulation function and power line connection function. Its advantages are: (1) No need to lay expensive cable system; (2) Does not occupy radio frequency resources. The system design idea can also be used in the remote data acquisition of power monitoring systems and other industrial control systems to realize the monitoring of power parameters.

The Links:   6R1TI30Y-080 KCS104VG2HB-A20