Automatic testing tool and method for optocouplers of electric energy meter and electricity consumption information acquisition terminal
By designing an automated test tool for optocouplers of electricity meters and electricity consumption information collection terminals, and utilizing MCU, constant current control circuit, and time characteristic detection circuit, the problem of incomplete detection of optocoupler performance indicators in the existing technology is solved. Accurate measurement of optocoupler performance indicators and high- and low-level switching simulation are achieved, thereby improving the reliability and portability of the test.
Patent Information
- Application Number
- CN202510809100.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-17
- Publication Date
- 2025-09-16
AI Technical Summary
Existing technologies are unable to accurately test the key performance indicators of optocouplers, such as current transfer ratio, primary-side voltage drop, secondary-side voltage drop, primary-side current, secondary-side current, etc., and are unable to simulate the high- and low-level switching conditions of optocouplers during operation, resulting in incomplete detection.
An automated test fixture for optocouplers of electric energy meters and electricity consumption information collection terminals was designed. It includes an MCU, a constant current control circuit, a current detection circuit, and a time characteristic detection circuit. By precisely controlling the primary-side current and simulating the high- and low-level switching of the optocoupler, accurate testing of multiple performance indicators can be achieved.
It realizes accurate detection of optocoupler performance indicators, including precise measurement of current transfer ratio, turn-on time, turn-on delay time, turn-off time and turn-off delay time, thus improving the reliability and portability of the test.
Smart Images

Figure CN120652383A_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the field of optical coupler testing, and in particular relates to an optical coupler testing tool and an optical coupler testing method. Background Art
[0002] Optocouplers (photoelectric couplers) play a key role in energy meters and power consumption information collection terminals. They are primarily used to achieve electrical isolation between strong and weak currents, ensuring system safety and signal transmission reliability. Because the performance of optocouplers directly affects the reliability and measurement accuracy of energy meters and power consumption information collection terminals, accurate testing of their key parameters is crucial.
[0003] Currently, optocoupler testing mainly relies on a multimeter. By adjusting the input current on the primary side of the optocoupler and observing whether the secondary side output current changes with the input, the basic function of the optocoupler can be judged. However, this method has the following defects: First, it cannot control the signal quality of the input current. Therefore, it can only verify whether the optocoupler has the signal conversion capability, and cannot accurately evaluate its performance indicators, such as current transfer ratio (CTR) and primary side voltage drop (V F ), secondary side voltage drop (V CE ), primary side current (I F ), secondary side current (I C ) etc. Secondly, traditional methods cannot simulate the high and low level switching conditions of the optocoupler during operation, and cannot complete the detection of indicators such as turn-on time (Tr), turn-on delay time (Ton), turn-off time (Tf) and turn-off delay time (Toff). Summary of the Invention
[0004] The present invention proposes an automated testing tool and method for optocouplers of electric energy meters and electricity consumption information collection terminals, the purpose of which is to improve the control capability of input current signals, simulate the high and low level switching conditions of optocouplers during operation, and achieve accurate testing of multiple performance indicators.
[0005] The technical solutions of the present invention are as follows:
[0006] An automatic test fixture for optocoupler parameters of electric energy meters and electricity consumption information collection terminals, including an MCU, a constant current control circuit, a current detection circuit, and a time characteristic detection circuit;
[0007] The constant current control circuit is connected to the primary side of the optocoupler and is used to control the current on the primary side of the optocoupler;
[0008] The current detection circuit is used to detect the current on the secondary side of the optocoupler;
[0009] The time characteristic detection circuit is connected to the secondary side of the optocoupler and is used to obtain the conduction state of the optocoupler;
[0010] The MCU is connected to the constant current control circuit, the current detection circuit and the time characteristic detection circuit respectively, and is used to control the magnitude of the current output by the constant current control circuit to the primary side, and obtain the detection result of the secondary side current and the state detection result captured by the time characteristic detection circuit.
[0011] As a further improvement to the test method of the automated test tool for the optocoupler parameters of the electric energy meter and the electricity consumption information collection terminal: the constant current control circuit includes an operational amplifier D2A and an NPN transistor V1. The operational amplifier D2A controls the base current of the NPN transistor V1 according to the current control signal sent by the IF_DAC pin of the MCU. The collector of the NPN transistor V1 is connected to the negative electrode of the primary side of the optocoupler, and the emitter is grounded through a resistor R10; the positive electrode of the primary side of the optocoupler is connected to the VCC power supply.
[0012] As a further improvement to the test method of the automated test tool for the optocoupler parameters of the electric energy meter and the electricity consumption information collection terminal: the non-inverting input terminal of the operational amplifier D2A is connected to the IF_DAC pin of the MCU through the resistor R7, the inverting input terminal is connected to the emitter of the NPN transistor V1, and the output terminal is grounded through the resistors R8 and R9 connected in series in sequence, and the connection point between the resistors R8 and R9 is connected to the base of the NPN transistor V1.
[0013] As a further improvement to the test method of the automated test tool for the optocoupler parameters of the electric energy meter and the electricity consumption information collection terminal: the constant current control circuit also includes a feedback circuit, which is used to collect the voltage of the resistor R10 and send the voltage collection result to the MCU. The MCU calculates the current on the primary side of the optocoupler based on the voltage of the resistor R10, and then adjusts the output value of the IF_DAC pin accordingly.
[0014] As a further improvement to the test method of the automated test tool for the optocoupler parameters of the electric energy meter and the electricity consumption information collection terminal: the feedback circuit includes an operational amplifier D2B, the non-inverting input terminal of the operational amplifier D2B is connected to the emitter of the NPN transistor V1, the inverting input terminal is grounded through a resistor R12, and the inverting input terminal is also connected to the output terminal of the operational amplifier D2B through a resistor R13. The output terminal of the operational amplifier D2B is connected to the IF_ADC pin of the MCU for sending the voltage collection results.
[0015] As a further improvement to the test method of the automatic test tool for the optocoupler parameters of the energy meter and the electricity consumption information collection terminal: the collector of the secondary side of the optocoupler is connected to the VCC power supply, the emitter is connected to one end of the current limiting resistor R17, and the other end of the current limiting resistor R17 is grounded;
[0016] The current detection circuit includes an operational amplifier D3A, the non-inverting input terminal of the operational amplifier D3A is connected to one end of the current limiting resistor R17, the inverting input terminal is grounded through a resistor R18, and is also connected to the output terminal of the operational amplifier D3A through a resistor R19. The output terminal of the operational amplifier D3A is connected to the IC_DAC pin of the MCU, and is used to send the secondary side current detection result to the MCU.
[0017] As a further improvement of the test method of the automatic test tool for optocoupler parameters of the electric energy meter and the electricity consumption information collection terminal: it also includes a strong and weak pull-up circuit, the strong and weak pull-up circuit includes the current limiting resistor R17, and also includes an NPN transistor V2, an NPN transistor V3 and a current limiting resistor R14;
[0018] The base of NPN transistor V2 is connected to the IC_CTL0 pin of the MCU through resistor R15, the collector is connected to the secondary emitter of the optocoupler through current-limiting resistor R14, and the emitter is connected to one end of current-limiting resistor R17;
[0019] The base of the NPN transistor V3 is connected to the IC_CTL1 pin of the MCU through the resistor R16, the collector is directly connected to the secondary side emitter of the optocoupler, and the emitter is connected to one end of the current limiting resistor R17.
[0020] As a further improvement to the test method of the automatic test tool for the optocoupler parameters of the electric energy meter and the electricity consumption information collection terminal: the secondary side emitter VE of the optocoupler is connected to the time characteristic detection circuit;
[0021] The time characteristic detection circuit includes a comparator D1A and a comparator D1B. The non-inverting input terminal of the comparator D1A is used to receive a first threshold signal, and the non-inverting input terminal of the comparator D1B is used to receive a second threshold signal. The signal value of the first threshold signal is greater than the second threshold signal. The inverting input terminal of the comparator D1A and the inverting input terminal of the comparator D1B are simultaneously connected to the secondary side emitter VE of the optocoupler.
[0022] The output of comparator D1A is connected to the EXTI_0 pin of the MCU through resistor R5, and the output of comparator D1B is connected to the EXTI_1 pin of the MCU through resistor R6. The MCU obtains the conduction state of the optocoupler through the EXTI_0 pin and the EXTI_1 pin.
[0023] As a further improvement to the test method of the automatic test tool for the optocoupler parameters of the electric energy meter and the electricity consumption information collection terminal: it also includes a front-end and rear-end voltage detection circuit; the front-end and rear-end voltage detection circuit has four channels, and the input ends of the four channels are respectively connected one-to-one with the primary side positive pole, the primary side negative pole, the secondary side collector and the secondary side emitter of the optocoupler, and the output ends of the four channels are respectively connected one-to-one with the four ADC input ends of the MCU.
[0024] As a further improvement to the test method of the automatic test tool for optocoupler parameters of the electric energy meter and the electricity consumption information collection terminal: during the test, the conduction and shutdown of the optocoupler, as well as the primary side current size when the optocoupler is turned on, are controlled by a constant current control circuit;
[0025] When the optocoupler is in the on state, the voltages of the primary side positive electrode, primary side negative electrode, secondary side collector and secondary side emitter are obtained through the front-end and rear-end voltage detection circuits. Then, the voltage difference between the primary side positive electrode and the primary side negative electrode is used as the primary side voltage drop detection result, and the voltage difference between the secondary side collector and the secondary side emitter is used as the secondary side voltage drop detection result.
[0026] When the optocoupler is in the on state, the primary current is controlled by the constant current control circuit, and the secondary current under different primary currents is obtained by the current detection circuit. The ratio of the corresponding secondary current to the primary current is then used as the current transfer ratio detection result under the corresponding primary current.
[0027] The primary side current of the optocoupler is controlled by a constant current control circuit to switch between a set value and 0. Assume that the primary side current switches from 0 to the set value at time T0, and switches from the set value to 0 at time T3. The moment when the EXTI_1 pin changes from a low level to a high level is recorded as T1, the moment when the EXTI_0 pin changes from a low level to a high level is recorded as T2, the moment when the EXTI_0 pin changes from a high level to a low level is recorded as T4, and the moment when the EXTI_1 pin changes from a high level to a low level is recorded as T5. The time from T0 to T1 is the detection result of the turn-on delay time Ton, the time from T1 to T2 is the detection result of the turn-on time Tr, the time from T3 to T4 is the detection result of the turn-off delay time Toff, and the time from T4 to T5 is the detection result of the turn-off time Tf.
[0028] Compared with the prior art, the present invention has the following positive effects:
[0029] 1. The present invention accurately controls the current on the primary side through a constant current control circuit and samples the current on the secondary side, thereby obtaining the secondary side current under different primary side currents and realizing accurate detection of the current transfer ratio (CTR).
[0030] 2. The present invention can simulate high and low level modes, and accurately capture the optocoupler's turn-on time (Tr), turn-on delay time (Ton), turn-off time (Tf) and turn-off delay time (Toff) by using the time characteristic detection circuit during the optocoupler's "on-off" process.
[0031] 3. The present invention can also measure the voltages of the four pins of the optocoupler through the front-end and rear-end voltage detection circuits to obtain the voltage drops on both sides.
[0032] 4. The measurement process is controlled by the MCU. You can configure the test items through the key circuit and OLED display module to perform manual testing, or you can implement a one-button quick test by writing a program in advance, which makes it convenient for engineers to obtain test data and make analysis and judgment on its reliability.
[0033] 5. The present invention can be connected to an external power source through a TYPE-C interface or powered by a built-in battery, and has the advantages of small size and good portability. BRIEF DESCRIPTION OF THE DRAWINGS
[0034] Figure 1 This is the architecture diagram of the optocoupler parameter automated test tool;
[0035] Figure 2 This is a schematic diagram of the connection relationship between the optocoupler to be tested and the time characteristic detection circuit, constant current control circuit, and strong and weak pull-up circuits;
[0036] Figure 3 This is the circuit diagram of the constant current control circuit;
[0037] Figure 4 This is the circuit diagram of the current detection circuit.
[0038] Figure 5 This is the circuit diagram of the strong and weak pull-up circuit;
[0039] Figure 6 This is a schematic diagram of the optocoupler time characteristics;
[0040] Figure 7 This is a circuit diagram of a time characteristic detection circuit; DETAILED DESCRIPTION
[0041] The technical solution of the present invention will be described in detail below with reference to the accompanying drawings. Obviously, the embodiments described are only a part of the embodiments of the present invention, rather than all the embodiments.
[0042] like Figure 1 , an automatic testing tool for optocoupler parameters of electricity meters and electricity consumption information collection terminals, including MCU, constant current control circuit, current detection circuit, time characteristic detection circuit, front and rear voltage detection circuits, strong and weak pull-up circuits, power supply module, storage unit, serial port communication unit, button circuit and OLED display module.
[0043] The power supply module includes a power supply circuit, a Type-C interface, and a battery. The power supply circuit connects to an external power source via the Type-C interface, or it can be powered by the internal battery. The storage unit stores test results. The serial communication unit is used to write programs to the MCU and receive test results. Testers can configure the test process using the keypad circuit and OLED display module.
[0044] The front-end and back-end voltage detection circuit is a four-way voltage divider circuit. The four inputs are connected to the primary positive electrode, primary negative electrode, secondary collector, and secondary emitter of the optocoupler, respectively. The four outputs are connected to the four ADC inputs of the MCU, respectively. The MCU can directly obtain the voltage values of the four pins of the optocoupler.
[0045] like Figure 2 The constant current control circuit is connected to the primary side of the optocoupler and is used to control the current on the primary side of the optocoupler.
[0046] Specifically, if Figure 3 The constant current control circuit includes an operational amplifier D2A and an NPN transistor V1. The operational amplifier D2A controls the base current of the NPN transistor V1 according to the current control signal sent by the IF_DAC pin of the MCU. The collector of the NPN transistor V1 is connected to the negative electrode of the primary side of the optocoupler, and the emitter is grounded through a resistor R10; the positive electrode of the primary side of the optocoupler is connected to the VCC power supply.
[0047] The specific structure of the constant current control circuit is as follows: the non-inverting input terminal of the operational amplifier D2A is connected to the IF_DAC pin of the MCU through the resistor R7, the inverting input terminal is connected to the emitter of the NPN transistor V1, and the output terminal is grounded through the resistors R8 and R9 connected in series in sequence. The connection point between the resistors R8 and R9 is connected to the base of the NPN transistor V1.
[0048] The MCU's internal DAC output voltage is fed through the IF_DAC pin to the non-inverting input of operational amplifier D2A. If the collector current of transistor V1 increases, the voltage across sampling resistor R10 increases, which, through the negative feedback circuit, is fed to the inverting input of D2A. This decreases the voltage at D2A's output, reducing the base current of V1 and, ultimately, the collector current (i.e., the primary current of the optocoupler), thereby achieving constant current control. By setting different voltages for IF_DAC, the output current to the optocoupler's primary side can be varied to meet diverse testing requirements. IF_DAC can be set by an internal program or by the tester using a keypad.
[0049] Furthermore, the constant current control circuit also includes a feedback circuit for collecting the voltage of resistor R10 and sending the voltage collection result to the MCU. The MCU calculates the current on the primary side of the optocoupler based on the voltage of resistor R10 and then adjusts the output value of the IF_DAC pin accordingly to ensure that the primary current is within a set range. Specifically, the feedback circuit includes an operational amplifier D2B. The non-inverting input of operational amplifier D2B is connected to the emitter of NPN transistor V1, the inverting input is grounded via resistor R12, and the inverting input is also connected to the output of operational amplifier D2B via resistor R13. The output of operational amplifier D2B is connected to the IF_ADC pin of the MCU for transmitting the voltage collection result.
[0050] The current detection circuit is used to detect the current on the secondary side of the optocoupler. Figure 2 、 Figure 4 、 Figure 5 The strong and weak pull-up circuits include a current limiting resistor R17, an NPN transistor V2, an NPN transistor V3 and a current limiting resistor R14.
[0051] The secondary collector of the optocoupler is connected to the VCC power supply, the emitter is connected to one end of the current limiting resistor R17 (IC end in the figure) (including direct connection and indirect connection), and the other end of the current limiting resistor R17 is grounded.
[0052] like Figure 4 The current detection circuit includes an operational amplifier D3A. Its non-inverting input is connected to one end of current-limiting resistor R17 (the IC end in the figure). Its inverting input is grounded via resistor R18 and connected to the output of operational amplifier D3A via resistor R19. The output of operational amplifier D3A is connected to the IC_DAC pin of the MCU, transmitting the secondary-side current detection results to the MCU. The MCU calculates the secondary-side current based on the voltage at the IC end and the resistance value of current-limiting resistor R17.
[0053] Furthermore, the value of the secondary-side current-limiting resistance can be changed by using strong or weak pull-up circuits, thereby simulating different actual working conditions and measuring the current and voltage drop on the secondary side under conditions close to the actual working conditions.
[0054] Specifically, if Figure 5In the strong and weak pull-up circuits, the base of NPN transistor V2 is connected to the IC_CTL0 pin of the MCU via resistor R15. Its collector (terminal 3S in the figure) is connected to the emitter of the optocoupler's secondary side via current-limiting resistor R14, and its emitter is connected to one end of current-limiting resistor R17. Simultaneously, the base of NPN transistor V3 is connected to the IC_CTL1 pin of the MCU via resistor R16. Its collector (terminal 3S in the figure) is directly connected to the emitter of the optocoupler's secondary side, and its emitter is connected to one end of current-limiting resistor R17. When the MCU controls the IC_CTL0 pin high and the IC_CTL1 pin low, V2 turns on and V3 turns off. At this point, the current-limiting resistors on the secondary side are R14 and R17 in series. When the MCU controls the IC_CTL1 pin high and the IC_CTL0 pin low, V2 turns off and V3 turns on. At this point, the current-limiting resistors on the secondary side are R17 alone. By adjusting the size of the current limiting resistor, different actual working conditions can be simulated.
[0055] The time characteristic detection circuit is connected to the secondary side of the optocoupler and is used to obtain the conduction state of the optocoupler.
[0056] Specifically, if Figure 2 and Figure 7 The optocoupler's secondary-side emitter VE is connected to the time characteristics detection circuit. This circuit includes comparators D1A and D1B. Comparator D1A's non-inverting input receives a first threshold signal (2.6V, divided by resistors R1 and R2). Comparator D1B's non-inverting input receives a second threshold signal (0.6V, divided by resistors R3 and R4). The inverting inputs of both comparators D1A and D1B are connected to the optocoupler's secondary-side emitter VE.
[0057] The output of comparator D1A is connected to the EXTI_0 pin of the MCU through resistor R5, and the output of comparator D1B is connected to the EXTI_1 pin of the MCU through resistor R6. The MCU obtains the conduction state of the optocoupler through the EXTI_0 pin and the EXTI_1 pin.
[0058] The MCU serves as a control module and is connected to the constant current control circuit, the current detection circuit, and the time characteristic detection circuit, respectively. It is used to control the magnitude of the current output by the constant current control circuit to the primary side, and obtain the detection results of the secondary side current, the voltage of each pin, and the state detection results captured by the time characteristic detection circuit. Then, the processing calculation is completed internally to obtain the final test result.
[0059] The working principle of this test fixture is as follows:
[0060] During the test, the constant current control circuit is used to control the on and off of the optocoupler, as well as the primary side current when the optocoupler is on.
[0061] When the optocoupler is in the on state, the voltages of the primary side positive electrode, primary side negative electrode, secondary side collector and secondary side emitter are obtained through the front-end and rear-end voltage detection circuits, and then the voltage difference between the primary side positive electrode and the primary side negative electrode is used as the primary side voltage drop detection result, and the voltage difference between the secondary side collector and the secondary side emitter is used as the secondary side voltage drop detection result.
[0062] When the optocoupler is in the on state, the primary current is controlled by the constant current control circuit, and the secondary current under different primary currents is obtained by the current detection circuit. The ratio of the corresponding secondary current to the primary current is then used as the current transfer ratio (CTR) detection result under the corresponding primary current.
[0063] When the primary drive current of the optocoupler changes, the conduction state of the secondary side of the optocoupler also changes, and the voltage of the emitter also changes accordingly. Therefore, the present invention controls the conduction and shutdown of the optocoupler by controlling the magnitude of the primary current, and then obtains the test value of the time characteristic parameter.
[0064] like Figure 6 and Figure 7 , manually or through program control constant current control circuit, so that the primary side current of the optocoupler switches between the set value and 0. Assume that at time T0 the primary side current switches from 0 to the set value, turning on the optocoupler, and at time T3 the primary side current switches from the set value to 0, turning off the optocoupler. The control state of the primary side (i.e., at time T0 and T3) is determined by the voltage at the IF_ADC terminal, and the actual conduction state of the secondary side is determined by the voltage at the VE terminal. Figure 6 The first waveform line is the voltage change waveform line of the IF_ADC terminal (the upper end of the resistor R10). When the voltage at this point rises to a high level, it means that the primary side drive current reaches the set value. When it drops to a low level, it means that there is no drive current on the primary side. Figure 6 The second waveform is the voltage change waveform at the VE terminal. The voltage at this point indicates the actual on / off status of the secondary side. T1 is the time when the EXTI_1 pin changes from low to high (the VE voltage rises to 0.6V), T2 is the time when the EXTI_0 pin changes from low to high (the VE voltage rises to 2.6V), T4 is the time when the EXTI_0 pin changes from high to low (the VE voltage drops to 2.6V), and T5 is the time when the EXTI_1 pin changes from high to low (the VE voltage drops to 0.6V). The duration from T0 to T1 is the result of the on-delay time Ton, the duration from T1 to T2 is the result of the turn-on time Tr, the duration from T3 to T4 is the result of the turn-off delay time Toff, and the duration from T4 to T5 is the result of the turn-off time Tf.
[0065] Testers can configure test items using the push-button circuit and OLED display module for manual testing, or they can pre-program a program for quick, one-click testing, making it easier for engineers to obtain test data and analyze its reliability. The final results can be uploaded to a computer, exported, and saved as Excel files.
[0066] It should be noted that it is obvious to those skilled in the art that the present invention is not limited to the details of the exemplary embodiments described above, and that the present invention can be implemented in other specific forms without departing from the spirit or essential characteristics of the present invention. The scope of the present invention is defined by the claims rather than the foregoing description.
Claims
1. An automatic test tool for optocoupler parameters of electric energy meters and electricity consumption information collection terminals, characterized by: Including MCU, constant current control circuit, current detection circuit and time characteristic detection circuit; The constant current control circuit is connected to the primary side of the optocoupler and is used to control the current on the primary side of the optocoupler; The current detection circuit is used to detect the current on the secondary side of the optocoupler; The time characteristic detection circuit is connected to the secondary side of the optocoupler and is used to obtain the conduction state of the optocoupler; The MCU is connected to the constant current control circuit, the current detection circuit and the time characteristic detection circuit respectively, and is used to control the magnitude of the current output by the constant current control circuit to the primary side, and obtain the detection result of the secondary side current and the state detection result captured by the time characteristic detection circuit.
2. The automatic test fixture for optical coupler parameters of electric energy meters and electric energy information collection terminals according to claim 1, characterized in that: The constant current control circuit includes an operational amplifier D2A and an NPN transistor V1. The operational amplifier D2A controls the base current of the NPN transistor V1 according to the current control signal sent by the IF_DAC pin of the MCU. The collector of the NPN transistor V1 is connected to the negative electrode of the primary side of the optocoupler, and the emitter is grounded through a resistor R10; the positive electrode of the primary side of the optocoupler is connected to the VCC power supply.
3. The automatic test fixture for optical coupler parameters of an electric energy meter and an electric energy information collection terminal according to claim 2, characterized in that: The non-inverting input of operational amplifier D2A is connected to the IF_DAC pin of the MCU through resistor R7, the inverting input is connected to the emitter of NPN transistor V1, and the output is grounded through resistors R8 and R9 connected in series. The connection point between resistors R8 and R9 is connected to the base of NPN transistor V1.
4. The automatic test fixture for optical coupler parameters of an electric energy meter and an electric energy information collection terminal according to claim 3, characterized in that: The constant current control circuit also includes a feedback circuit, which is used to collect the voltage of resistor R10 and send the voltage collection result to the MCU. The MCU calculates the current on the primary side of the optocoupler based on the voltage of resistor R10, and then adjusts the output value of the IF_DAC pin accordingly.
5. The automatic test fixture for optical coupler parameters of an electric energy meter and an electric energy information collection terminal according to claim 4, characterized in that: The feedback circuit includes an operational amplifier D2B, the non-inverting input terminal of the operational amplifier D2B is connected to the emitter of the NPN transistor V1, the inverting input terminal is grounded through a resistor R12, and the inverting input terminal is also connected to the output terminal of the operational amplifier D2B through a resistor R13. The output terminal of the operational amplifier D2B is connected to the IF_ADC pin of the MCU for sending the voltage acquisition result.
6. The automatic test fixture for optical coupler parameters of an electric energy meter and an electric energy information collection terminal according to claim 1, characterized in that: The collector of the secondary side of the optical coupler is connected to the VCC power supply, the emitter is connected to one end of the current limiting resistor R17, and the other end of the current limiting resistor R17 is grounded; The current detection circuit includes an operational amplifier D3A, the non-inverting input terminal of the operational amplifier D3A is connected to one end of the current limiting resistor R17, the inverting input terminal is grounded through a resistor R18, and is also connected to the output terminal of the operational amplifier D3A through a resistor R19. The output terminal of the operational amplifier D3A is connected to the IC_DAC pin of the MCU, and is used to send the secondary side current detection result to the MCU.
7. The automatic test fixture for optical coupler parameters of an electric energy meter and an electric energy information collection terminal according to claim 6, characterized in that: It also includes a strong and weak pull-up circuit, which includes the current limiting resistor R17, an NPN transistor V2, an NPN transistor V3 and a current limiting resistor R14; The base of NPN transistor V2 is connected to the IC_CTL0 pin of the MCU through resistor R15, the collector is connected to the secondary emitter of the optocoupler through current-limiting resistor R14, and the emitter is connected to one end of current-limiting resistor R17; The base of the NPN transistor V3 is connected to the IC_CTL1 pin of the MCU through the resistor R16, the collector is directly connected to the secondary side emitter of the optocoupler, and the emitter is connected to one end of the current limiting resistor R17.
8. The automatic test fixture for optical coupler parameters of an electric energy meter and an electric energy information collection terminal according to claim 1, characterized in that: The secondary side emitter VE of the optocoupler is connected to the time characteristic detection circuit; The time characteristic detection circuit includes a comparator D1A and a comparator D1B. The non-inverting input terminal of the comparator D1A is used to receive a first threshold signal, and the non-inverting input terminal of the comparator D1B is used to receive a second threshold signal. The signal value of the first threshold signal is greater than the second threshold signal. The inverting input terminal of the comparator D1A and the inverting input terminal of the comparator D1B are simultaneously connected to the secondary side emitter VE of the optocoupler. The output of comparator D1A is connected to the EXTI_0 pin of the MCU through resistor R5, and the output of comparator D1B is connected to the EXTI_1 pin of the MCU through resistor R6. The MCU obtains the conduction state of the optocoupler through the EXTI_0 pin and the EXTI_1 pin.
9. The automatic test fixture for optical coupler parameters of an electric energy meter and an electric energy information collection terminal according to claim 8, characterized in that: It also includes a front-end and rear-end voltage detection circuit; the front-end and rear-end voltage detection circuit is four-way, and the input ends of the four ways are respectively connected to the primary side positive pole, primary side negative pole, secondary side collector and secondary side emitter of the optocoupler in a one-to-one correspondence, and the output ends of the four ways are respectively connected to the four ADC input ends of the MCU in a one-to-one correspondence.
10. The testing method based on the automatic testing tool for optical coupler parameters of the electric energy meter and the electric energy information collection terminal according to claim 9 is characterized in that: During the test, the constant current control circuit is used to control the on and off of the optocoupler, as well as the primary side current when the optocoupler is on; When the optocoupler is in the on state, the voltages of the primary side positive electrode, primary side negative electrode, secondary side collector and secondary side emitter are obtained through the front-end and rear-end voltage detection circuits. Then, the voltage difference between the primary side positive electrode and the primary side negative electrode is used as the primary side voltage drop detection result, and the voltage difference between the secondary side collector and the secondary side emitter is used as the secondary side voltage drop detection result. When the optocoupler is in the on state, the primary current is controlled by the constant current control circuit, and the secondary current under different primary currents is obtained by the current detection circuit. The ratio of the corresponding secondary current to the primary current is then used as the current transfer ratio detection result under the corresponding primary current. The primary side current of the optocoupler is controlled by a constant current control circuit to switch between a set value and 0. Assume that the primary side current switches from 0 to the set value at time T0, and switches from the set value to 0 at time T3. The moment when the EXTI_1 pin changes from a low level to a high level is recorded as T1, the moment when the EXTI_0 pin changes from a low level to a high level is recorded as T2, the moment when the EXTI_0 pin changes from a high level to a low level is recorded as T4, and the moment when the EXTI_1 pin changes from a high level to a low level is recorded as T5. The time from T0 to T1 is the detection result of the turn-on delay time Ton, the time from T1 to T2 is the detection result of the turn-on time Tr, the time from T3 to T4 is the detection result of the turn-off delay time Toff, and the time from T4 to T5 is the detection result of the turn-off time Tf.