Circuit and method for generating pulse signal

文档序号:1711613 发布日期:2019-12-13 浏览:35次 中文

阅读说明:本技术 一种产生脉冲信号的电路和方法 (Circuit and method for generating pulse signal ) 是由 刘洁 王旭 于 2019-08-23 设计创作,主要内容包括:本发明公开了一种产生脉冲信号的电路,该电路包括:转换单元,用于接收交流信号,当所述交流信号处于正半周期或负半周期时,输出第一电平给脉冲信号产生单元;当所述交流信号处于过零点时刻,输出第二电平给所述脉冲信号产生单元;脉冲信号产生单元,用于当每次收到所述第二电平时,输出脉冲信号。本发明还公开了一种产生脉冲信号的方法。本发明提供的电路和方法实现了交流电转化为直流脉冲信号。(The invention discloses a circuit for generating pulse signals, which comprises: the conversion unit is used for receiving an alternating current signal and outputting a first level to the pulse signal generation unit when the alternating current signal is in a positive half period or a negative half period; when the alternating current signal is at the zero crossing point moment, outputting a second level to the pulse signal generating unit; and the pulse signal generating unit is used for outputting a pulse signal when receiving the second level every time. The invention also discloses a method for generating the pulse signal. The circuit and the method provided by the invention realize the conversion of alternating current into direct current pulse signals.)

1. a circuit for generating a pulse signal, comprising:

The conversion unit is used for receiving an alternating current signal and outputting a first level to the pulse signal generation unit when the alternating current signal is in a positive half period or a negative half period; when the alternating current signal is at the zero crossing point moment, outputting a second level to the pulse signal generating unit;

and the pulse signal generating unit is used for outputting a pulse signal when receiving the second level every time.

2. The circuit of claim 1,

The conversion unit comprises a first resistor, a first capacitor, a direct current power supply, a first photoelectric coupler, a second photoelectric coupler and a second resistor; the first photoelectric coupler or the second photoelectric coupler comprises a light emitting diode and a photosensitive triode;

One end of the first resistor is used as an input end of the conversion unit, and the other end of the first resistor is connected with one end of the first capacitor; the other end of the first capacitor is grounded;

A collector of the phototriode of the first photoelectric coupler and a collector of the phototriode of the second photoelectric coupler are respectively connected with the direct-current power supply, an emitter of the phototriode of the first photoelectric coupler and an emitter of the phototriode of the second photoelectric coupler are respectively connected with one end of the second resistor, the end of the second resistor is used as an output end of the conversion unit, and the other end of the second resistor is grounded;

the anode end of the light emitting diode of the first photoelectric coupler is connected with one end of the first capacitor, and the cathode end of the light emitting diode of the first photoelectric coupler is grounded;

And the cathode end of the light emitting diode of the first photoelectric coupler is connected with one end of the first capacitor, and the anode end of the light emitting diode of the first photoelectric coupler is grounded.

3. The circuit of claim 1,

The pulse signal generating unit comprises a first NAND gate, a second NAND gate, a third NAND gate, a second capacitor and a third resistor;

The first NAND gate, the second NAND gate and the third NAND gate are two-input NAND gates;

A first input end of the first nand gate is used as an input end of the pulse signal generation unit, and an output end of the third nand gate is used as an output end of the pulse signal generation unit;

the output end of the conversion unit is connected with the input end of the pulse signal generation unit, the output end of the first nand gate is respectively connected with one end of the second capacitor and the first input end of the second nand gate, the other end of the second capacitor is respectively connected with one end of the third resistor and the second input end of the second nand gate, and the output end of the second nand gate is respectively connected with the second input end of the first nand gate, the first input end of the third nand gate and the second input end of the second nand gate; the other end of the third resistor is grounded.

4. The circuit of claim 2,

the resistance value of the first resistor is 360k omega, the capacitance value of the first capacitor is 10nF, the voltage of the direct current power supply is 5V, and the resistance value of the second resistor is 220k omega.

5. The circuit of claim 3,

The capacitance value of the second capacitor is 0.1uF, and the resistance value of the third resistor is 5.1k omega.

6. the circuit of claim 3,

the width of the pulse signal generated by the circuit is determined according to the capacitance value of the second capacitor and the resistance value of the third resistor.

7. The circuit of claim 1,

The first level is a high level and the second level is a low level.

8. a method for generating a pulse signal, implemented on the basis of the circuit of any one of claims 1 to 5, comprising:

the conversion unit receives an alternating current signal, and outputs a first level to the pulse signal generation unit when the alternating current signal is in a positive half period or a negative half period; when the alternating current signal is at the zero crossing point moment, outputting a second level to the pulse signal generating unit;

the pulse signal generating unit outputs a pulse signal each time the second level is received.

9. The method of claim 8,

and adjusting the capacitance value of the second capacitor and/or the resistance value of the third resistor to increase or decrease the width of the pulse signal generated by the pulse signal generating unit.

Technical Field

The present invention relates to the field of circuits, and in particular, to a circuit and a method for generating a pulse signal in the field of circuits.

Background

Most of the existing electronic products adopt direct current voltage and direct current pulse as signals, however, the part of circuits entering users from a power grid still is alternating current, and most of the alternating current cannot be directly utilized by electronic equipment

how to convert alternating current into direct current and detect the frequency of the alternating current is a problem to be solved at present. In the prior art, an alternating current to direct current circuit is mostly realized by an integrated circuit, and an integrated chip is used for detecting alternating current frequency or outputting direct current pulse.

disclosure of Invention

The technical problem to be solved by the invention is to provide a circuit and a method for generating a pulse signal, which realize the purpose of converting alternating current into a direct current pulse signal.

In order to solve the above technical problem, an embodiment of the present invention provides a circuit for generating a pulse signal, including:

the conversion unit is used for receiving an alternating current signal and outputting a first level to the pulse signal generation unit when the alternating current signal is in a positive half period or a negative half period; when the alternating current signal is at the zero crossing point moment, outputting a second level to the pulse signal generating unit;

And the pulse signal generating unit is used for outputting a pulse signal when receiving the second level every time.

in an exemplary embodiment, the circuit further has the following features:

The conversion unit comprises a first resistor, a first capacitor, a direct current power supply, a first photoelectric coupler, a second photoelectric coupler and a second resistor; the first photoelectric coupler or the second photoelectric coupler comprises a light emitting diode and a photosensitive triode;

One end of the first resistor is used as an input end of the conversion unit, and the other end of the first resistor is connected with one end of the first capacitor; the other end of the first capacitor is grounded;

a collector of the phototriode of the first photoelectric coupler and a collector of the phototriode of the second photoelectric coupler are respectively connected with the direct-current power supply, an emitter of the phototriode of the first photoelectric coupler and an emitter of the phototriode of the second photoelectric coupler are respectively connected with one end of the second resistor, the end of the second resistor is used as an output end of the conversion unit, and the other end of the second resistor is grounded;

The anode end of the light emitting diode of the first photoelectric coupler is connected with one end of the first capacitor, and the cathode end of the light emitting diode of the first photoelectric coupler is grounded;

and the cathode end of the light emitting diode of the first photoelectric coupler is connected with one end of the first capacitor, and the anode end of the light emitting diode of the first photoelectric coupler is grounded.

in an exemplary embodiment, the circuit further has the following features:

the pulse signal generating unit comprises a first NAND gate, a second NAND gate, a third NAND gate, a second capacitor and a third resistor;

The first NAND gate, the second NAND gate and the third NAND gate are two-input NAND gates;

a first input end of the first nand gate is used as an input end of the pulse signal generation unit, and an output end of the third nand gate is used as an output end of the pulse signal generation unit;

the output end of the conversion unit is connected with the input end of the pulse signal generation unit, the output end of the first nand gate is respectively connected with one end of the second capacitor and the first input end of the second nand gate, the other end of the second capacitor is respectively connected with one end of the third resistor and the second input end of the second nand gate, and the output end of the second nand gate is respectively connected with the second input end of the first nand gate, the first input end of the third nand gate and the second input end of the second nand gate; the other end of the third resistor is grounded.

In an exemplary embodiment, the circuit further has the following features:

The resistance value of the first resistor is 360k omega, the capacitance value of the first capacitor is 10nF, the voltage of the direct current power supply is 5V, and the resistance value of the second resistor is 220k omega.

in an exemplary embodiment, the circuit further has the following features:

the capacitance value of the second capacitor is 0.1uF, and the resistance value of the third resistor is 5.1k omega.

In an exemplary embodiment, the circuit further has the following features:

the width of the pulse signal generated by the circuit is determined according to the capacitance value of the second capacitor and the resistance value of the third resistor.

In an exemplary embodiment, the circuit further has the following features:

The first level is a high level and the second level is a low level.

in order to solve the above problem, the present invention further provides a method of generating a pulse signal, which is implemented based on the circuit of any one of claims 1 to 5, and includes:

The conversion unit receives an alternating current signal, and outputs a first level to the pulse signal generation unit when the alternating current signal is in a positive half period or a negative half period; when the alternating current signal is at the zero crossing point moment, outputting a second level to the pulse signal generating unit;

The pulse signal generating unit outputs a pulse signal each time the second level is received.

in an exemplary embodiment, the method further comprises the following features:

and adjusting the capacitance value of the second capacitor and/or the resistance value of the third resistor to increase or decrease the width of the pulse signal generated by the pulse signal generating unit.

in conclusion, the circuit and the method provided by the embodiment of the invention are built by adopting the discrete components, so that the universality is strong and the cost is low.

Drawings

Fig. 1 is a schematic diagram of a circuit for generating a pulse signal according to an embodiment of the invention.

fig. 2 is a circuit diagram of a circuit for generating a pulse signal according to an embodiment of the present invention.

Fig. 3 is a flowchart of a method of generating a pulse signal according to an embodiment of the invention.

Detailed Description

In order to make the objects, technical solutions and advantages of the present invention more apparent, embodiments of the present invention will be described in detail below with reference to the accompanying drawings. It should be noted that the embodiments and features of the embodiments in the present application may be arbitrarily combined with each other without conflict.

fig. 1 is a schematic diagram of a circuit for generating a pulse signal according to an embodiment of the present invention, as shown in fig. 1, the circuit for generating a pulse signal according to the embodiment includes: a conversion unit and a pulse signal generation unit.

the conversion unit is used for receiving an alternating current signal and outputting a first level to the pulse signal generation unit when the alternating current signal is in a positive half period or a negative half period; when the alternating current signal is at the zero crossing point moment, outputting a second level to the pulse signal generating unit;

And the pulse signal generating unit is used for outputting a pulse signal when receiving the second level every time.

It should be noted that the pulse signal generating unit outputs a low level when receiving the first level for the first time, and outputs a low level when receiving the first level thereafter as long as the pulse signal is not output.

in an optional embodiment, the conversion unit includes a first resistor, a first capacitor, a dc power supply, a first photocoupler, a second photocoupler, and a second resistor; the first photoelectric coupler or the second photoelectric coupler comprises a light emitting diode and a photosensitive triode;

one end of the first resistor is used as an input end of the conversion unit, and the other end of the first resistor is connected with one end of the first capacitor; the other end of the first capacitor is grounded;

A collector of the phototriode of the first photoelectric coupler and a collector of the phototriode of the second photoelectric coupler are respectively connected with the direct-current power supply, an emitter of the phototriode of the first photoelectric coupler and an emitter of the phototriode of the second photoelectric coupler are respectively connected with one end of the second resistor, the end of the second resistor is used as an output end of the conversion unit, and the other end of the second resistor is grounded;

The anode end of the light emitting diode of the first photoelectric coupler is connected with one end of the first capacitor, and the cathode end of the light emitting diode of the first photoelectric coupler is grounded;

And the cathode end of the light emitting diode of the first photoelectric coupler is connected with one end of the first capacitor, and the anode end of the light emitting diode of the first photoelectric coupler is grounded.

in other alternative embodiments, the photocoupler can be replaced by a triode or a field effect transistor.

in an alternative embodiment, the pulse signal generating unit includes a first nand gate, a second nand gate, a third nand gate, a second capacitor, and a third resistor;

the first NAND gate, the second NAND gate and the third NAND gate are two-input NAND gates;

A first input end of the first nand gate is used as an input end of the pulse signal generation unit, and an output end of the third nand gate is used as an output end of the pulse signal generation unit;

the output end of the conversion unit is connected with the input end of the pulse signal generation unit, the output end of the first nand gate is respectively connected with one end of the second capacitor and the first input end of the second nand gate, the other end of the second capacitor is respectively connected with one end of the third resistor and the second input end of the second nand gate, and the output end of the second nand gate is respectively connected with the second input end of the first nand gate, the first input end of the third nand gate and the second input end of the second nand gate; the other end of the third resistor is grounded.

In other embodiments, the nand gate may be replaced by other gates such as a three-input nand gate and a nor gate, as long as the same input and output effects can be achieved.

In an alternative embodiment, the first resistor has a resistance of 360k Ω, the first capacitor has a capacitance of 10nF, the dc power supply has a voltage of 5V, and the second resistor has a resistance of 220k Ω.

In an alternative embodiment, the capacitance of the second capacitor is 0.1uF, and the resistance of the third resistor is 5.1k Ω.

In an alternative embodiment, the width of the pulse signal generated by the circuit is determined according to the capacitance value of the second capacitor and the resistance value of the third resistor.

In an alternative embodiment, the first level is a high level and the second level is a low level.

In other embodiments, other circuits may be used that perform the same function.

Fig. 2 is a circuit diagram of a circuit for generating a pulse signal according to an embodiment of the invention. The working process of the circuit is as follows:

1) when the AC alternating current starts to work, when the AC is in a positive half cycle, the U1 photoelectric coupler is in a conducting state, the U2 is in a cut-off state, and when the AC is in a negative half cycle, the U1 is in a cut-off state, and the U2 is in a conducting state. The lower input of U3 is 1 whether the positive or negative half cycle

2) When the AC alternating current just crosses zero, both U1 and U2 are cut off, so U3 has a lower input of 0 at this time.

3) when the Alternating Current (AC) crosses zero, the output of the U3 is 1 because one end of the U3 has an input of 0, the U3 charges the C2, the voltage across the C2 cannot change suddenly, the input ends of the U4 are all 1, the output of the U4 is 0, the output of the U5 is 1, and the output is a direct current pulse positive voltage 1.

4) When the AC is in the positive or negative half cycle, the U3 output is 0, at which point the C2 starts discharging, and when the discharge is complete, the input of U4 is 0, then the U4 output is 1, so the U5 output is 0, at which point it is at the 0 position of the dc pulse.

the application specifically describes that AC is 220V/50Hz, R1 is 360K omega, C1 is 10nF, Vcc is 5V, R2 is 220K omega, C2 is 0.1uF, and R3 is 5.1K omega:

1) when the AC alternating current passes through the 0 point, the output of the U3 is 5V, the C2 starts charging, the output of the U4 is 0, and the output of the U5 is 5V high level.

2) when the AC cross is in the positive or negative half cycle, the output of U3 is 0V, at which time C2 starts discharging for about 0.5ms at R3C 2, and when discharging is completed, the input of U4 is 0, the output is 5V, the output of U5 is 0V, low.

3) In this cycle, the output is a pulse voltage, the pulse width is related to the magnitude of R3 and C2, and can be adjusted as needed, and the number of output dc pulses is twice the frequency.

fig. 3 is a flowchart of a method for generating a pulse signal according to an embodiment of the present invention, and as shown in fig. 3, the method for generating a pulse signal according to the embodiment includes:

S11, the conversion unit receives the alternating current signal, and when the alternating current signal is in a positive half period or a negative half period, a first level is output to the pulse signal generation unit; when the alternating current signal is at the zero crossing point moment, outputting a second level to the pulse signal generating unit;

S12, the pulse signal generating unit outputs a pulse signal each time the second level is received.

in an alternative embodiment, the capacitance value of the second capacitor and/or the resistance value of the third resistor are adjusted to increase or decrease the width of the pulse signal generated by the pulse signal generating unit.

it will be understood by those skilled in the art that all or part of the steps of the above methods may be implemented by instructing the relevant hardware through a program, and the program may be stored in a computer readable storage medium, such as a read-only memory, a magnetic or optical disk, and the like. Alternatively, all or part of the steps of the above embodiments may be implemented using one or more integrated circuits. Accordingly, each module/unit in the above embodiments may be implemented in the form of hardware, and may also be implemented in the form of a software functional module. The present invention is not limited to any specific form of combination of hardware and software.

The foregoing is only a preferred embodiment of the present invention, and naturally there are many other embodiments of the present invention, and those skilled in the art can make various corresponding changes and modifications according to the present invention without departing from the spirit and the essence of the present invention, and these corresponding changes and modifications should fall within the scope of the appended claims.

9页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:一种提高PWM控制器精度的方法及装置

网友询问留言

已有0条留言

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

精彩留言,会给你点赞!

技术分类