Design of intelligent tester for leakage protection device based on ATmega32

Publisher:Xiaohan521Latest update time:2014-10-30 Source: ednchinaKeywords:ATmega32 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere
At present, leakage protectors are widely used as a new type of low-voltage protection electrical appliance, both in cities and in rural areas. The reliability of their work directly affects personal safety. In the United States, it is a government-mandated power safety protection device, and it must be replaced every two years. Although there is no mandatory replacement period for the use of leakage protectors in my country, from the perspective of power safety, regular testing of the working performance of leakage protectors is a must. This article introduces an automatic tester for the action characteristics of leakage protectors, which can measure and record the contact breaking time, leakage action current and non-action current of leakage protectors, and provides important technical indicators for improving the working performance of leakage protectors. It has a high level of detection automation and can detect leakage protectors running online and offline.

1 Hardware Design

The three main parameters that reflect the leakage action performance are: rated leakage action current (I△n), leakage action time and rated leakage non-action current (I△n0).

I△n represents the sensitivity of leakage action and is the leakage action current value of the leakage protector. The leakage action time refers to the time required for the leakage action current to be applied to the leakage protector until the circuit is cut off. I△n0 is the leakage current value that does not act as specified by the national standard to prevent the leakage protector from malfunctioning, and is usually 0.5I△n.

The method for testing the leakage current is: start applying the test current from less than 0.2I△n, and increase it linearly to I△n within 30s. If the current value at the moment of disconnection of the leakage protector is I△, when I△n0n0<I△<I△n is satisfied, the leakage current value of the leakage protector is qualified. Therefore, the uniform growth of the leakage current value tested will directly affect the accuracy of the measurement. It is difficult to increase the current value of the leakage test uniformly using the traditional manual and motor-driven voltage regulator method, and it is difficult to control the random error of the measurement. Using a single-chip microcomputer to control the leakage current value in real time, so that the leakage current increases uniformly, can effectively improve the accuracy of the measurement. Figure 1 shows the structural block diagram of the leakage protector action characteristic tester.

Figure 1 Tester block diagram
Figure 1 Tester block diagram

The tester is based on the ATmega32 single-chip microcomputer, and is equipped with programmable leakage current source, leakage current detection circuit, contact status monitoring circuit, keyboard, display and other peripheral devices. ATmega32 is an 8-bit microcontroller based on the enhanced AVR RISC structure, with advanced instruction set and single clock cycle instruction execution time, which is 8 to 12 times faster than the ordinary 8051 single-chip microcomputer. The operating frequency is up to 16MHz, with 32K bytes of Flash program memory, 1 hardware 16-bit timer and 2 8-bit timers, 4 PWM outputs, 8 A/D conversions, 1 full-duplex asynchronous serial port, and 32 general I/O ports. It has the advantages of low power consumption, high speed, and super strong anti-interference, and has a high cost performance among similar products.

1.1 Programmable leakage current source

The key to ensure measurement accuracy is that the programmable leakage current source can generate a uniformly changing leakage current. The leakage current source consists of a 50Hz sine wave generator and an AC digital-to-analog conversion circuit.

1.1.1 50Hz sine wave generator

The 50Hz RC sine wave oscillation circuit is composed of an operational amplifier. The amplitude of the oscillation signal is stabilized by nonlinear negative feedback. At the same time, the frequency selection circuit of the RC sine wave oscillation circuit is composed of low temperature coefficient resistors and capacitors to ensure the stability of the oscillation frequency. In order to improve the load carrying capacity, the sine wave output signal is output through a voltage follower.

1.1.2 AC digital-to-analog conversion circuit

Figure 2 AC digital-to-analog conversion circuit
Figure 2 AC digital-to-analog conversion circuit [page]

The AC digital-to-analog conversion circuit is the core part of the programmable leakage current source. The amplitude of the sinusoidal AC quantity is controlled by changing the digital quantity, and has good linearity. The digital-to-analog conversion circuit is composed of DAC08 08, which is a binary fast multiplication 8-bit D/A chip. The AC digital-to-analog conversion circuit is shown in Figure 2. In order to ensure the conversion from digital to sinusoidal AC analog signals, VD in the figure is a preset DC bias, which is equal to the Design of intelligent tester for leakage protection deviceamplitude of the output signal of the 50Hz sine wave generator.

According to the circuit shown in the figure, the following relationship can be obtained:

Design of intelligent tester for leakage protection device

It can be seen from formula (5) that when the resistors R1, R4, R5, R, and Rf are fixed values, the magnitude of the output current has nothing to do with RL and is only controlled by the digital quantity. When A1, A2, ... A8 are all "1", adjust the circuit parameters to make IL = 0.5A, and when A1, A2 ... A8 are all "0", make IL = 0A. The current variation range of 0 to 0.5A fully meets the test requirements of the leakage protector currently produced in my country. In order to improve the measurement speed, under the condition of ensuring the accuracy of the simulated leakage current, the output current is divided into four gears of 50mA, 100mA, 200mA and 500mA. The selection of each gear is realized by the size of the ATmega32 switching resistor R1. In different gears, the value of the current increase is different. When the 50mA gear is selected, the current increases by 0.196mA (50mA/255); when the 500mA gear is selected, the current increases by 1.96mA (500mA/255). Therefore, it can fully meet the requirement of providing a linearly increasing leakage current for the leakage protector.

1.2 Contact status monitoring circuit

The contact status monitoring circuit is shown in Figure 3. When the moving and static contacts of the leakage protector are closed, the alternating current of L1 and L2 is rectified, filtered and stabilized, so that the photocoupler G3 is turned on, and the output of pin 2 of the inverter A is high potential. When the moving and static contacts of the leakage protector are disconnected, the photocoupler G3 is cut off, and the output of pin 2 of the inverter A is low potential, which is the moment when the leakage detection ends. When the moving and static contacts of the leakage protector are closed, the current of the photocoupler G3 passes through the moving and static contacts of one phase of the leakage protector, and the current size is 1~2mA. Since it is direct current, it will not generate induced current on the secondary side of the zero-sequence current transformer in the leakage protector, and has no effect on the leakage action current of the leakage protector.

Figure 3 Contact status monitoring circuit
Figure 3 Contact status monitoring circuit

1.3 Control Circuit

The control circuit is shown in Figure 4. The start signal generated by the leakage current of the leakage protector is controlled by the program, and the disconnection signal of the moving and static contacts is sent to the external interrupt input terminal PD2 of ATmega32. The disconnection time of the moving and static contacts of the leakage protector is detected by interruption. Button S1 is used as a test function selection to select the measurement of leakage current or leakage action time. Button S2 is used to select a certain gear of the simulated leakage current of 50mA, 100mA, 200mA and 500mA. Buttons S3 and S4 are used to set the current value of the simulated leakage when measuring the leakage action time. S3 controls the increase of the current value of the simulated leakage, and S4 controls the decrease of the current value of the simulated leakage. S5 is the test start/stop control button. When measuring the leakage current, set the parameters and press S5. ATmega32 outputs data according to the gear selected by S2, so that the simulated leakage current increases from 0 to the maximum value. If the leakage protector is activated when the simulated leakage current reaches a certain current value, then the current value is the actual leakage action current value. When testing the leakage action time, after setting the leakage current parameters, press S5. ATmega32 will directly generate the set simulated leakage current according to the set current value to measure the leakage action time.

Figure 4 A/D conversion and control circuit
Figure 4 A/D conversion and control circuit

2 Software Design

The ATmega32 software is designed based on embedded C language, and the program structure is modular, including the main program, instrument initialization subroutine, function control subroutine, programmable leakage current source subroutine, leakage detection action time subroutine and display subroutine.

The main program is the main control program for detecting the action characteristic parameters of the leakage protector. When the tester is working, the main program runs in a loop and calls the relevant subprograms according to the functional requirements. After the subprogram is executed, it returns to the main program. The instrument initialization subprogram realizes the initialization of the instrument, including instrument parameters, microcontroller pin configuration, timer, analog-to-digital conversion , interrupt initialization, etc. The control function subprogram realizes the scanning of key functions and controls the communication between the instrument and people. The programmable leakage current source subprogram is used to generate leakage current for testing and detect the current value (I△) of leakage when the leakage protector is disconnected. The leakage action time detection subprogram realizes the detection of the leakage action time of the leakage protector. The display subprogram realizes the display of leakage current and leakage action time.

3 Conclusion

This tester is easy to operate, solves the problem of inaccurate measurement in manual test methods, achieves the purpose of automatic measurement, can detect online and offline leakage protectors, improves the level of detection of leakage protector performance, and provides technical means for research on the working performance of leakage protectors, quality inspection and production debugging. The instrument design makes full use of the various functions built into ATmega 32, making the hardware circuit structure simple and effectively improving the cost performance of the instrument. It has been used in many companies and scientific research institutions. The results show that the instrument works reliably and meets the expected technical indicators.

Keywords:ATmega32 Reference address:Design of intelligent tester for leakage protection device based on ATmega32

Previous article:AVR-based closed-loop control system for experimental loading
Next article:Design of handheld measuring instrument based on embedded laser display

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号