Alternating voltage and frequency detection system

文档序号:850174 发布日期:2021-03-16 浏览:15次 中文

阅读说明:本技术 一种交流电压及频率检测系统 (Alternating voltage and frequency detection system ) 是由 陈太茂 于 2020-11-30 设计创作,主要内容包括:本发明提供的一种交流电压及频率检测系统;包括电压采样电路和频率采样电路,电压采样电路和频率采样电路分别与单片机连接;本发明通过外围电路整流降压将交流模拟输入信号变成小直流电压信号,再把该信号传送给HCNR201芯片,利用该芯片带负反馈的隔离且宽线性区的特性,更精确的把模拟信号传送给单片机,从而使之实现交流电压160V~260V的数据采集。(The invention provides an alternating voltage and frequency detection system; the voltage sampling circuit and the frequency sampling circuit are respectively connected with the single chip microcomputer; the invention changes the AC analog input signal into a small DC voltage signal through the rectification and voltage reduction of the peripheral circuit, then transmits the signal to the HCNR201 chip, and more accurately transmits the analog signal to the singlechip by utilizing the characteristics of the isolation and wide linear region with negative feedback of the chip, thereby realizing the data acquisition of the AC voltage of 160V-260V.)

1. An alternating voltage and frequency detection system, characterized by: the voltage sampling circuit and the frequency sampling circuit are respectively connected with the single chip microcomputer;

the voltage sampling circuit inputs an alternating voltage signal to the singlechip after the alternating voltage signal passes through the signal conditioning circuit A and the isolating circuit in sequence;

the frequency sampling circuit inputs an alternating voltage signal to the singlechip after the alternating voltage signal passes through the signal conditioning circuit B, the zero-crossing comparison circuit and the optical coupling isolation circuit in sequence.

2. The ac voltage and frequency detection system of claim 1, wherein: the signal conditioning circuit A comprises a rectifier bridge B1, an alternating voltage signal Vin is connected to the input end of the rectifier bridge B1, the anode of the output end of the rectifier bridge B1 is sequentially connected with a resistor R2 and a resistor R3 in series, the cathode of the output end of the rectifier bridge B1 is grounded, the anode of the output end of the rectifier bridge B1 is further grounded through a polar capacitor C3, and the space between the resistors R2 and R3 is grounded through a resistor R5.

3. The ac voltage and frequency detection system of claim 1, wherein: the isolation circuit comprises a linear optocoupler U2, wherein a pin 1 of the linear optocoupler U2 is connected with a resistor R4, a pin 2 of the linear optocoupler U2 is connected with a power supply V1, a pin 3 and a pin 4 of the linear optocoupler U2 are respectively connected with a pin 3 and a pin 1 of an amplifier U1, and a pin 5 and a pin 6 of the linear optocoupler U3 are respectively connected with a pin 1 and a pin 3 of an amplifier U3; the other end of the resistor R4 is connected with a pin 4 of an amplifier U1, a pin 3 of the amplifier U1 is also connected with a resistor R3, a capacitor C1 is also connected between the pin 4 and the pin 3 of the amplifier U1, and a pin 5 of the amplifier U1 is connected with a power supply V1; a5-pin of the amplifier U3 is connected with a power supply V2, a 4-pin of the amplifier U3 is connected with the single chip microcomputer through a resistor R6, a resistor R1 and a capacitor C2 are connected between a 3-pin and the 4-pin of the amplifier U3 in parallel, and two ends of the resistor R6 are grounded through a polar capacitor C4 and a polar capacitor C5 respectively.

4. The ac voltage and frequency detection system of claim 1, wherein: the signal conditioning circuit B comprises a resistor R1 and a resistor R8, one ends of the resistor R1 and the resistor R8 are respectively connected with two poles of an alternating voltage signal, the other ends of the resistor R1 and the resistor R8 are commonly connected with a resistor R7, the other end of the resistor R7 is sequentially connected with the anode of a diode D1 and the cathode of a diode D2, the cathode of the diode D1 and the anode of a diode D2 are grounded, and the end, connected with the alternating voltage signal, of the resistor R8 is grounded through a resistor R9.

5. The ac voltage and frequency detection system of claim 1, wherein: the zero-crossing comparison circuit comprises a comparator U4, a pin 1 and a pin 3 of the comparator U4 are respectively connected with the anode and the cathode of a diode D2, a pin 5 of the comparator U4 is connected with a power supply V1, a pin 2 of the comparator U4 is grounded, a pin 4 of the comparator U4 is connected with the optical coupling isolation circuit through a resistor R11, and a resistor R10 is connected between the pin 4 and the pin 5 of the comparator U.

6. The ac voltage and frequency detection system of claim 1, wherein: the optical coupling isolation circuit comprises an optical coupler U5, wherein a pin 1 of the optical coupler U5 is connected with a resistor R11, a pin 2 is grounded, a pin 4 of the optical coupler U5 is connected with a power supply V2, a pin 3 of the optical coupler U5 is connected with a single chip microcomputer, and a pin 3 of the optical coupler U5 is grounded through a resistor R12 and a capacitor C6.

7. The ac voltage and frequency detection system of claim 3, wherein: the power supply V1 is a 12V power supply.

8. The ac voltage and frequency detection system of claim 3, wherein: the power supply V2 is a 3.3V power supply.

Technical Field

The invention relates to an alternating voltage and frequency detection system.

Background

The current universal alternating voltage measuring method adopts an AC-DC conversion mode based on an analog circuit, and the measuring precision is limited due to some inherent defects of the analog circuit.

Disclosure of Invention

In order to solve the above technical problems, the present invention provides an ac voltage and frequency detection system.

The invention is realized by the following technical scheme.

The invention provides an alternating voltage and frequency detection system; the voltage sampling circuit and the frequency sampling circuit are respectively connected with the single chip microcomputer;

the voltage sampling circuit inputs an alternating voltage signal to the singlechip after the alternating voltage signal passes through the signal conditioning circuit A and the isolating circuit in sequence;

the frequency sampling circuit inputs an alternating voltage signal to the singlechip after the alternating voltage signal passes through the signal conditioning circuit B, the zero-crossing comparison circuit and the optical coupling isolation circuit in sequence.

The signal conditioning circuit A comprises a rectifier bridge B1, an alternating voltage signal Vin is connected to the input end of the rectifier bridge B1, the anode of the output end of the rectifier bridge B1 is sequentially connected with a resistor R2 and a resistor R3 in series, the cathode of the output end of the rectifier bridge B1 is grounded, the anode of the output end of the rectifier bridge B1 is further grounded through a polar capacitor C3, and the space between the resistors R2 and R3 is grounded through a resistor R5.

The isolation circuit comprises a linear optocoupler U2, wherein a pin 1 of the linear optocoupler U2 is connected with a resistor R4, a pin 2 of the linear optocoupler U2 is connected with a power supply V1, a pin 3 and a pin 4 of the linear optocoupler U2 are respectively connected with a pin 3 and a pin 1 of an amplifier U1, and a pin 5 and a pin 6 of the linear optocoupler U3 are respectively connected with a pin 1 and a pin 3 of an amplifier U3; the other end of the resistor R4 is connected with a pin 4 of an amplifier U1, a pin 3 of the amplifier U1 is also connected with a resistor R3, a capacitor C1 is also connected between the pin 4 and the pin 3 of the amplifier U1, and a pin 5 of the amplifier U1 is connected with a power supply V1; a5-pin of the amplifier U3 is connected with a power supply V2, a 4-pin of the amplifier U3 is connected with the single chip microcomputer through a resistor R6, a resistor R1 and a capacitor C2 are connected between a 3-pin and the 4-pin of the amplifier U3 in parallel, and two ends of the resistor R6 are grounded through a polar capacitor C4 and a polar capacitor C5 respectively.

The signal conditioning circuit B comprises a resistor R1 and a resistor R8, one ends of the resistor R1 and the resistor R8 are respectively connected with two poles of an alternating voltage signal, the other ends of the resistor R1 and the resistor R8 are commonly connected with a resistor R7, the other end of the resistor R7 is sequentially connected with the anode of a diode D1 and the cathode of a diode D2, the cathode of the diode D1 and the anode of a diode D2 are grounded, and the end, connected with the alternating voltage signal, of the resistor R8 is grounded through a resistor R9.

The zero-crossing comparison circuit comprises a comparator U4, a pin 1 and a pin 3 of the comparator U4 are respectively connected with the anode and the cathode of a diode D2, a pin 5 of the comparator U4 is connected with a power supply V1, a pin 2 of the comparator U4 is grounded, a pin 4 of the comparator U4 is connected with the optical coupling isolation circuit through a resistor R11, and a resistor R10 is connected between the pin 4 and the pin 5 of the comparator U.

The optical coupling isolation circuit comprises an optical coupler U5, wherein a pin 1 of the optical coupler U5 is connected with a resistor R11, a pin 2 is grounded, a pin 4 of the optical coupler U5 is connected with a power supply V2, a pin 3 of the optical coupler U5 is connected with a single chip microcomputer, and a pin 3 of the optical coupler U5 is grounded through a resistor R12 and a capacitor C6.

The power supply V1 is a 12V power supply.

The power supply V2 is a 3.3V power supply.

The invention has the beneficial effects that: the alternating current analog input signal is changed into a small direct current voltage signal through rectification and voltage reduction of a peripheral circuit, the signal is transmitted to the HCNR201 chip, and the analog signal is transmitted to the single chip more accurately by utilizing the characteristics of isolation and wide linear region with negative feedback of the chip, so that the data acquisition of the alternating current voltage of 160V-260V is realized.

Drawings

FIG. 1 is a schematic diagram of the voltage sampling circuit of the present invention;

FIG. 2 is a schematic diagram of the frequency sampling circuit of the present invention;

FIG. 3 is a waveform diagram of the frequency sampling Vin and Vout of the present invention;

FIG. 4 is a table of voltage sampling data for the voltage sampling circuit of the present invention;

FIG. 5 is a line graph of the output AC voltage of 160V-260V for the voltage sampling circuit of the present invention;

FIG. 6 is a pulse waveform diagram of the frequency sampling circuit Vout of the present invention;

Detailed Description

The technical solution of the present invention is further described below, but the scope of the claimed invention is not limited to the described.

An AC voltage and frequency detection system; the voltage sampling circuit and the frequency sampling circuit are respectively connected with the single chip microcomputer;

the voltage sampling circuit inputs an alternating voltage signal to the singlechip after the alternating voltage signal passes through the signal conditioning circuit A and the isolating circuit in sequence;

the frequency sampling circuit inputs an alternating voltage signal to the singlechip after the alternating voltage signal passes through the signal conditioning circuit B, the zero-crossing comparison circuit and the optical coupling isolation circuit in sequence.

The signal conditioning circuit A comprises a rectifier bridge B1, an alternating voltage signal Vin is connected to the input end of the rectifier bridge B1, the anode of the output end of the rectifier bridge B1 is sequentially connected with a resistor R2 and a resistor R3 in series, the cathode of the output end of the rectifier bridge B1 is grounded, the anode of the output end of the rectifier bridge B1 is further grounded through a polar capacitor C3, and the space between the resistors R2 and R3 is grounded through a resistor R5.

The isolation circuit comprises a linear optocoupler U2, wherein a pin 1 of the linear optocoupler U2 is connected with a resistor R4, a pin 2 of the linear optocoupler U2 is connected with a power supply V1, a pin 3 and a pin 4 of the linear optocoupler U2 are respectively connected with a pin 3 and a pin 1 of an amplifier U1, and a pin 5 and a pin 6 of the linear optocoupler U3 are respectively connected with a pin 1 and a pin 3 of an amplifier U3; the other end of the resistor R4 is connected with a pin 4 of an amplifier U1, a pin 3 of the amplifier U1 is also connected with a resistor R3, a capacitor C1 is also connected between the pin 4 and the pin 3 of the amplifier U1, and a pin 5 of the amplifier U1 is connected with a power supply V1; a5-pin of the amplifier U3 is connected with a power supply V2, a 4-pin of the amplifier U3 is connected with the single chip microcomputer through a resistor R6, a resistor R1 and a capacitor C2 are connected between a 3-pin and the 4-pin of the amplifier U3 in parallel, and two ends of the resistor R6 are grounded through a polar capacitor C4 and a polar capacitor C5 respectively.

The signal conditioning circuit B comprises a resistor R1 and a resistor R8, one ends of the resistor R1 and the resistor R8 are respectively connected with two poles of an alternating voltage signal, the other ends of the resistor R1 and the resistor R8 are commonly connected with a resistor R7, the other end of the resistor R7 is sequentially connected with the anode of a diode D1 and the cathode of a diode D2, the cathode of the diode D1 and the anode of a diode D2 are grounded, and the end, connected with the alternating voltage signal, of the resistor R8 is grounded through a resistor R9.

The zero-crossing comparison circuit comprises a comparator U4, a pin 1 and a pin 3 of the comparator U4 are respectively connected with the anode and the cathode of a diode D2, a pin 5 of the comparator U4 is connected with a power supply V1, a pin 2 of the comparator U4 is grounded, a pin 4 of the comparator U4 is connected with the optical coupling isolation circuit through a resistor R11, and a resistor R10 is connected between the pin 4 and the pin 5 of the comparator U.

The optical coupling isolation circuit comprises an optical coupler U5, wherein a pin 1 of the optical coupler U5 is connected with a resistor R11, a pin 2 is grounded, a pin 4 of the optical coupler U5 is connected with a power supply V2, a pin 3 of the optical coupler U5 is connected with a single chip microcomputer, and a pin 3 of the optical coupler U5 is grounded through a resistor R12 and a capacitor C6.

The power supply V1 is a 12V power supply.

The power supply V2 is a 3.3V power supply.

As shown in fig. 1, the operational amplifier U1, the LED and the PD1 form an analog input of the isolation circuit, the PD2 and the operational amplifier U3 form an analog output circuit, the linear optocoupler HCNR201 is a current-type driving device, the operating current of the LED is 1mA to 40mA, and the operational amplifier must be selected to satisfy that the output current of the operational amplifier has sufficient driving capability to drive the LED diode, so the LMV321 operational amplifiers are selected for the U1 and the U2, and the output current of the operational amplifier can reach 40 mA. U1 converts the voltage signal into the current signal, U2 converts the current signal into the voltage signal and enhances the load driving ability, in addition, R1 is the current limiting resistor, R2 controls the luminous intensity of the LED, and C1 and C2 are feedback capacitors.

The PD1 in the isolation circuit forms negative feedback, when voltage Vin is input, the output of the operational amplifier U1 makes current i1 flow through the LED, the LED is driven to emit light to convert an electric signal into an optical signal, the optical signal is detected by the PD1 to generate a photocurrent ipd1, meanwhile, the input voltage Vin also generates current to flow through the R1, and if the U1 is an ideal operational amplifier, no current flows into the input end of the U1 according to the principle of 'virtual break', and the current flowing through the R1 flows to the ground through the PD1, so that the current flowing through the R1 flows to the ground, and therefore

Since the light emitted from the LED is simultaneously irradiated onto the PD2 and the luminous flux is equal to the luminous flux irradiated onto the PD1, ideally, if the ipd1 is equal to the ipd2, and a coefficient K is defined, the LED will emit light with a constant luminous flux, and the PD2 will be irradiated onto the LED with a constant luminous flux, and the LED will be irradiated onto the LED with a constant luminous flux

ipd1=K×ipd2....................②;

The value of K is 1 +/-5%;

the operational amplifiers U2 and R3 convert ipd2 to the output voltage Vout, so

Vout=ipd2×R3....................③;

The relation between the output voltage and the input voltage is obtained by a formula

Therefore, the output voltage Vout has stability and linearity, the gain of which can be achieved by adjusting the values of R1 and R3, and R1 is R3, K is 1, so:

Vout=Vin;

namely, the input voltage Vin and the output voltage Vout of the HCNR201 peripheral configuration circuit are equal.

The signal conditioning circuit is composed of input voltage signals Vin, B1, C3, R2, R3 and R5, and mainly has the functions of rectifying, filtering and reducing the voltage of the input voltage signals Vin; the HCNR201 isolation circuit adopts a basic peripheral configuration circuit of the chip; in order to realize signal isolation, power supplies for front and back work of a supply circuit are also isolated, U1 and U3 are supplied with power by independent power supplies to play a role in isolating interference, and due to the chip characteristics of HCNR201 and LMV321, Vout ranges from 0V to 3V, the output voltage is approximately equal to the input voltage, namely Vout is V3, and the characteristics are the basis of the circuit design.

Through the value range (0-3V) of the V3 potential and the measurement range of Vin (160V-260V), a reasonable rectification filtering step-down circuit is designed, as shown in FIG. 4, an alternating current input Vin is firstly subjected to full-wave rectification through B1 and C3, and the effective value of an output voltage after rectification filtering is 1.2 times of the input voltage, namely:

V4=1.2×Vin;

according to the input range of Vin, the potential of V4 ranges from 192V to 312V.

The input voltage V3 of the isolation circuit calculated by the voltage dividing circuit principle is:

the input voltage is 0-3V from V3, so R2 and R5 need to select proper resistance values and types, the power consumption range of the circuit is met, and the safety and reliability of circuit input are ensured

According to the operating principle characteristic of HCNR201, R1 is equal to R3, and its value cannot be too small, otherwise it affects the magnitude of the input voltage, otherwise it cannot be too large, otherwise it cannot drive the isolation circuit, and it is found through experiments that to realize the collection of ac voltage 160V to 260V, R1 ═ R2 ═ 75K is a suitable value. The output voltage range can be obtained by isolating the input and output characteristics of the chip and a formula (iv) by HCNR201

When the ac input voltage Vin is 160V, V4 is 192V, and Vout is V3 is 1.4V;

when the ac input voltage Vin is 260V, V4 is 312V, and Vout is V3 is 2.4V;

therefore, the theoretical calculation range of the output voltage Vout is 1.4V to 2.4V.

Data in the range are processed through the single chip microcomputer, and collection and display of the alternating voltage of 160-260V are achieved.

As shown in fig. 5 and 6, the linear relationship between the ac input Vin and the output voltage Vout is as follows from experimental data and graphs:

Vin=102.42×Vout+0.9993;

the experimental data is basically consistent with the theoretical calculation data, and the linearity of the voltage measuring device in the measuring voltage range meets the requirement.

As shown in fig. 2, the signal conditioning circuit conditions the high-bandwidth voltage input signal into a small dc voltage input signal, the zero-crossing comparison circuit mainly uses the zero-crossing comparator as a core to perform a configuration design of related peripheral circuits, and finally, the high and low levels output by the circuit are processed by the single chip microcomputer to realize the frequency acquisition and display.

Vin, R1, R8, R7, R9, D1 and D2 are signal conditioning circuits, wherein Vin is an alternating voltage 220V, R2 and R5 are voltage division circuits, V3 divides voltage and inputs 12V, R7 and R9 reduce circuit current, and D1 and D2 are forced clamping diodes, so that the voltage of the input end of the U4 of the LM193 chip is about 1V, and the stability and reliability of the circuit are enhanced

The zero-crossing comparison circuit mainly comprises a comparator LM393, an isolation circuit is composed of R10, R11, U4, R12, C6 and power supply sources V1 and V2, wherein V1 is 12V, V2 is a 3.3V power supply, physical isolation between the circuits is achieved through an isolation optical coupler, and R12 and C1 have the function of output filtering.

When the input end V + of the LM393 comparator U4 is more than V-, the output end of the comparator outputs high level, and R1 and R4 apply proper resistance values to enable the current of the rear-end circuit to drive U2 (isolation optocoupler) to act and output high level;

when the input end V + < V-of the LM393 comparator U4, the output end of the comparator outputs low level at the moment, and the current can not drive U2, so that the low level is output;

the output terminal outputs corresponding high and low levels through different signal inputs, the waveform diagrams of the input voltage signal Vin and the output voltage signal Vout are shown in fig. 3,

the singlechip can calculate the number of pulses by acquiring the rising edge of the pulse square wave signal of the output voltage signal Vout and an internal program of the singlechip, thereby calculating the frequency of the input alternating current signal.

As shown in fig. 6, the waveform of the voltage output signal Vout of the frequency sampling circuit is approximately a stable square wave, the output frequency is 50Hz (error ± 5Hz), and the measurement accuracy and range thereof meet the use requirements.

9页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:实现壁挂式单相无源串联稳压的通信方法及其系统

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!