Design and Application of 32 Channel Remote Pulse Unit Based on ATmega128

Abstract: Introduce a design principle of ARTU-P32 remote pulse unit based on 8-bit single-chip ATmega128 as the main control chip, with 32 pulse signal input, and the main technical indicators and application cases of the product.

0 INTRODUCTION With the introduction of energy consumption measurement and evaluation standards for national government buildings and large public buildings, the installation of electrical energy measurement devices on main electrical trunk lines has become one of the contents of design, plan approval and completion acceptance. Consumption monitoring system.
However, wall-mounted mechanical energy meters are usually installed on the main electrical trunk lines of built buildings, without RS485 communication interface. Dismantling and reinstalling smart meters not only causes waste, but also increases costs. This article introduces an ARTU-P32 with 32 channels of remote pulse contact input. The device can accept 32 channels of active or passive energy pulse signals, accumulate the pulses of each channel separately, and then communicate with the host computer monitoring system. Data exchange not only wastes the original meter, but also realizes the centralized meter reading of electric energy, reduces the cost of manual meter reading and improves the management efficiency.

1 Circuit design principle
ARTU-P32 remote pulse unit hardware circuit includes, main CPU chip, DIP switch setting input, real-time clock, dual RS485 communication, pulse count storage, power management and watchdog control, photoelectric isolation input acquisition, power supply module, etc. 8 parts. (see picture 1)

Figure 1 Circuit structure

1.1 Main control CPU
The 32-channel switch signal acquisition unit (ARTU-P32) is designed using ATMEL's ATmega128, a single chip to achieve dual RS485 communication, data processing, pulse recording access, display status control, etc. ATmega128 is an 8-bit RISC structured high-speed low-power single-chip microcomputer introduced by ATMEL. The system performance can reach 16MIPS at 16M clock frequency, with 128k Flash, 4k EEPROM, 4k system SRAM; 64k external memory can be expanded; two UART communication port. At the same time, the chip has a JTAG online programming port, which is convenient for user debugging and reduces development costs. 53 programmable I / O ports can connect enough peripheral devices.
1.2 DIP switch setting The input DIP switch provides users with a simplified man-machine interface for setting address, baud rate, data format and other setting functions in RS485 communication, and 10-bit data of the DIP switch (SW1) The ports are connected to a 10k resistor and pulled up to Vcc. The circuit uses a 74HC244 (IC5) data buffer to transfer the status of the DIP switch to the 8-bit data bus. The remaining two data lines are directly connected to the CPU's I / O port. (See Figure 2)

Figure 2 DIP switch setting input circuit

1.3 Real-time clock The real-time clock chip RX-8025A (IC4) provides the current time data for the system. The chip has a 400kHz serial IIC bus interface, and its built-in 32.768 kHz quartz oscillator provides real-time time data with wide temperature and high stability.
1.4 Communication mode The communication mode adopts the dual-channel RS485 mode. The debugging and setting and the communication part of the host computer are physically divided into two channels, which do not interfere with each other, effectively preventing possible misoperation. (See Figure 3)

Figure 3 Dual RS485 communication circuit

1.5 Pulse count storage The pulse count memory uses 32k low-power SRAM (IC3) IC61C256AH and the backup power supply to form a data storage unit that is not lost when the power is turned off. The data latch 74HC373 (IC2) and the PC port of the CPU are used to form a 15-bit data address Perform data storage operations on IC3. (See Figure 4)

Figure 4 pulse count storage circuit

1.6 The watchdog controls the power-saving automatic saving part to use MAX691CWE (IC8) as the power management. When the system has auxiliary power supply, ensure that IC3 is powered by the main power supply Vcc. When the main power supply is powered off, it automatically switches to the backup battery power supply mode. At the same time, this chip also has a watchdog function, in the extreme case of system crash, reset the CPU in time, so that the system quickly returns to a controlled state. (See Figure 5)

Figure 5 Watchdog circuit

1.7 Opto-isolated input signal state acquisition External switch signal acquisition uses optocouplers (IC1, IC2 only draw four of them) for electrical isolation, and a data buffer 74HC244 (IC9) is used to buffer the optocoupler output signal at the optocoupler output After the data bus is transferred to the CPU for the CPU to read. (See Figure 6)

Figure 6 Signal state acquisition

1.8 Power supply The power supply module adopts the Switching Power Supply chip of PI Company, the input range is AC / DC 80-270V, the power supply has 3 outputs, and provides power to the CPU, 12V power output, communication and other circuits.

2 Software design software process see Figure 7

Figure 7 Software flow chart

3 Product features
ARTU-P32 is installed with DIN35mm rail. The front end has two groups of indicators for communication indication and signal running channel indication. It only takes 1ms to scan 32 channels in a week. Each input channel can count up to 4294967296. At the same time, it has GPS time adjustment function, which can realize the freezing and unfreezing of energy counting. And other functions, after the external power supply is powered off, it can ensure that the pulse data record is not lost within one month. There are two RS485 interfaces for communication, one for setting and debugging of general parameters, and the other for communication with the host computer. There is a dial switch window at the top of the product, and the product communication address and baud rate can be set through the dial switch. The product meets the standards of JB / T10388-2002 "General Technical Conditions for Intelligent Measurement and Control Node Products with Bus Communication", GB / T7261-2000 "Basic Test Methods for Relays and Devices" and GB / T13729-2002 "Remote Terminal Equipment" standards.

4 Technical indicators
The main technical indicators of the products are shown in Table 1

Table 1

Item
Index
Input circuit / mode
32 active wet contacts or passive dry contacts
Bus mode
Two-wire half-duplex RS485, ModBus—RTU protocol
Bus capacity
≤32
Pulse Width
≥10ms
Accumulated pulse number (MAX)
4294967296 (four bytes)
Enclosure rating
IP20
power supply
DC24V or AC / DC200V
Power consumption
< 5W

5 Application case Taking the measurement of the electrical energy of 32 electrical trunk lines as an example, the energy meter is of the DTM862-2 type. The primary scheme is shown in Figure 8 (a), and the secondary collection of electrical energy pulses is shown in Figure 8 (b). Use traditional mechanical electric energy meter with pulse interface and use intelligent pulse receiving device to realize remote centralized meter reading function.

Picture 8

6 Conclusion
The ARTU-P32 remote pulse unit was tested at the National Relay Protection and Automation Equipment Quality Supervision and Inspection Center in December 2007 and met the relevant requirements. This product has been used in a power distribution monitoring system of an oil field water supply company, a tax building in Suzhou, a coal mine in Inner Mongolia, etc., which reduces investment costs and produces good social and economic benefits.

Surface Treatment DC Power Supply

Electrolysis Dc Power Supply,Charging Dc Power Supply,Motor Test Dc Power Supply,Experiment Dc Power Supply

Yangzhou IdealTek Electronics Co., Ltd. , https://www.idealtekpower.com

This entry was posted in on