Detection circuit and detection method for voltage and current of light source

文档序号:613565 发布日期:2021-05-07 浏览:3次 中文

阅读说明:本技术 一种光源电压电流的检测电路和检测方法 (Detection circuit and detection method for voltage and current of light source ) 是由 李志荣 于 2020-12-31 设计创作,主要内容包括:本发明属于半导体集成电路的技术领域,具体涉及一种光源电压电流的检测电路,包括光源控制器、光源和三芯线,光源控制器设置有主控模块、参数电阻识别模块和光源驱动模块,光源包括参数电阻和LED模块,三芯线设置有RES端、LED+端和LED-端,参数电阻的一端和参数电阻识别模块均与RES端连接,参数电阻的另一端、参数电阻识别模块、光源驱动模块和LED模块均与LED+端连接,光源驱动模块和LED模块均与LED-端连接。本发明可以地准确检测出光源的电压电流,并能够准确地根据检测出来的电压电流输出相应的电压电流,其不仅能够有效地减小光源的体积,还能够有效地提高布线的效率。此外,本发明还提供了一种光源电压电流的检测方法。(The invention belongs to the technical field of semiconductor integrated circuits, and particularly relates to a light source voltage and current detection circuit which comprises a light source controller, a light source and a three-core wire, wherein the light source controller is provided with a main control module, a parameter resistance identification module and a light source driving module, the light source comprises a parameter resistance and an LED module, the three-core wire is provided with an RES end, an LED + end and an LED-end, one end of the parameter resistance and the parameter resistance identification module are connected with the RES end, the other end of the parameter resistance, the parameter resistance identification module, the light source driving module and the LED module are connected with the LED + end, and the light source driving module and the LED module are connected with the LED-end. The invention can accurately detect the voltage and current of the light source and output corresponding voltage and current according to the detected voltage and current, thereby not only effectively reducing the volume of the light source, but also effectively improving the wiring efficiency. In addition, the invention also provides a detection method of the voltage and the current of the light source.)

1. A detection circuit for voltage and current of a light source is characterized in that: the device comprises a light source controller (1), a light source (2) and a three-core wire (3);

the light source controller (1) is provided with a main control module (11), a parameter resistance identification module (12) and a light source driving module (13);

the parameter resistance recognition module (12) and the light source driving module (13) are electrically connected to the main control module (11);

the light source (2) comprises a parameter resistor (21) and an LED module (22), wherein the parameter resistor (21) is electrically connected with the LED module (22);

the three-core wire (3) is provided with an RES end, an LED + end and an LED-end;

one end of the parameter resistor (21) and the parameter resistor identification module (12) are both connected with the RES end;

the other end of the parameter resistor (21), the parameter resistor identification module (12), the light source driving module (13) and the LED module (22) are all connected with the LED + end;

the light source driving module (13) and the LED module (22) are both connected to the LED terminals.

2. A method for detecting voltage and current of a light source is characterized by comprising the following steps:

s1, the main control module (11) reads the output voltage of the parameter resistance identification module (12) at regular time, and whether the light source (2) is connected with the light source controller (1) or not is judged;

s2, the main control module (11) calculates the resistance value R of the parameter resistor (21) and the current I of the light source (2), and controls the output current of the light source driving module (13) to be I according to the current I of the light source (2);

s3, the main control module (11) reads the output voltage Vout of the light source driving module (13), calculates the voltage V of the light source (2), and the main control module (11) enables the light source (2) to work in safe voltage and current to obtain a detection result.

3. The light source voltage current detection circuit according to claim 1, wherein:

the main control module (11) is provided with a control unit;

the parameter resistance identification module (12) and the light source driving module (13) are electrically connected to the control unit.

4. The light source voltage current detection circuit according to claim 3, wherein:

the parameter resistance identification module (12) comprises a resistance voltage detection module and a constant current source module;

the resistance voltage detection module is respectively and electrically connected with the control unit and the constant current source module;

one end of the parameter resistor (21), the resistor voltage detection module and the constant current source module are all connected with the RES end;

the other end of the parameter resistor (21) and the resistor voltage detection module are both connected with the LED + end.

5. The light source voltage current detection circuit according to claim 4, wherein:

the resistance voltage detection module is provided with a first differential amplification unit;

the first differential amplification unit is electrically connected to the control unit and the parameter resistor (21), respectively.

6. The light source voltage current detection circuit according to claim 3, wherein:

the light source driving module (13) comprises a voltage regulating module, a current regulating module and a light source voltage detecting module;

the voltage regulation module, the current regulation module and the light source voltage detection module are electrically connected to the control unit and the LED module (22);

the voltage adjusting module, the light source voltage detecting module and the LED module (22) are all connected with the LED + end;

the current regulation module, the light source voltage detection module and the LED module (22) are all connected with the LED-end.

7. The light source voltage current detection circuit according to claim 6, wherein:

the voltage regulating module is provided with a normal phase amplifying unit;

the positive phase amplification unit is respectively and electrically connected with the control unit and the LED module (22).

8. The light source voltage current detection circuit according to claim 6, wherein:

the current regulation module is provided with a negative feedback constant current circuit;

the control unit and the LED module (22) are respectively and electrically connected with the negative feedback constant current circuit.

9. The light source voltage current detection circuit according to claim 6, wherein:

the light source voltage detection module is provided with a second differential amplification unit;

the second differential amplifying unit is electrically connected to the control unit and the LED module (22), respectively.

10. The method for detecting voltage and current of a light source according to claim 2, wherein said S3 further comprises: after the detection is finished, when the main control module (11) reads that the output voltage of the parameter resistance identification module (12) is zero at regular time, the main control module (11) controls the light source driving module (13) to output a constant standby voltage Vsb and a constant standby current Isb.

Technical Field

The invention belongs to the technical field of semiconductor integrated circuits, and particularly relates to a detection circuit and a detection method for voltage and current of a light source.

Background

The light source is a core component of the machine vision industry, and along with the development of the machine vision industry, the requirements of people on the light source in the machine vision equipment become higher and higher, and meanwhile, the voltage and the current of the light source also become diversified, so that the types of the light source controller are increased due to the diversity of the voltage and the current of the light source, and the light sources with various different voltage and current can meet the requirements only by needing a plurality of light source controllers.

The inventor finds that in the prior art, in order to automatically identify the voltage and the current of the light source at the same time, a plurality of sensing devices are required to be placed on the light source by using a multi-core wire rod for realization many times, so that the diameter of the light source wire is increased, the outlet of the light source is increased, the volume of the light source is affected, and the difficulty of field wiring is increased.

Therefore, a novel detection circuit and a detection method are needed to solve the above problems.

Disclosure of Invention

One of the objects of the present invention is: aiming at the defects of the prior art, the light source voltage and current detection circuit is provided, the voltage and current of a light source can be accurately detected, the corresponding voltage and current can be accurately output according to the detected voltage and current, the size of the light source can be effectively reduced, the wiring efficiency can be effectively improved, and the light source voltage and current detection circuit has the advantages of simplifying light source wires and expanding the application range of a light source controller.

In order to achieve the purpose, the invention adopts the following technical scheme:

a detection circuit for voltage and current of a light source comprises a light source controller, a light source and a three-core wire, wherein the light source controller is provided with a main control module, a parameter resistance identification module and a light source driving module, the parameter resistance identification module and the light source driving module are electrically connected with the main control module, the light source comprises a parameter resistance and an LED module, the parameter resistance is electrically connected with the LED module, the three-core wire is provided with an RES end, an LED + end and an LED-end, the LED + end is used for providing an anode of electric energy for the LED module, the LED-end is used for providing a cathode of electric energy for the LED module, one end of the parameter resistance and the parameter resistance identification module are connected with the RES end, the other end of the parameter resistance, the parameter resistance identification module, the light source driving module and the LED module are connected with the LED + end, the light source driving module and the LED module are both connected with the LED-end.

Furthermore, the main control module is provided with a control unit, the control unit is provided with a control chip and a control circuit connected to the control chip, and the parameter resistance identification module and the light source driving module are electrically connected to the control unit.

Further, the parameter resistance identification module comprises a resistance voltage detection module and a constant current source module, the resistance voltage detection module is electrically connected to the control unit and the constant current source module respectively, one end of the parameter resistance, the resistance voltage detection module and the constant current source module are all connected with the RES end, and the other end of the parameter resistance and the resistance voltage detection module are all connected with the LED + end.

Further, the resistance voltage detection module is provided with a first differential amplification unit, the first differential amplification unit is provided with an operational amplifier and a differential amplification circuit connected to the operational amplifier, and the first differential amplification unit is electrically connected to the control unit and the parameter resistor respectively.

Furthermore, the light source driving module comprises a voltage adjusting module, a current adjusting module and a light source voltage detecting module, wherein the voltage adjusting module, the current adjusting module and the light source voltage detecting module are electrically connected to the control unit and the LED module, the voltage adjusting module, the light source voltage detecting module and the LED module are connected to the LED + end, and the current adjusting module, the light source voltage detecting module and the LED module are connected to the LED-end.

Further, the voltage regulation module is provided with a normal phase amplification unit, the normal phase amplification unit is provided with an operational amplifier and a normal phase amplification circuit connected to the operational amplifier, and the normal phase amplification unit is respectively and electrically connected to the control unit and the LED module.

Furthermore, the current regulation module is provided with a negative feedback constant current circuit, and the control unit and the LED module are respectively and electrically connected to the negative feedback constant current circuit.

Further, the light source voltage detection module is provided with a second differential amplification unit, and the second differential amplification unit is electrically connected to the control unit and the LED module respectively.

Further, the resistance value of the parameter resistor is 0.8K Ω -1.2K Ω, and the resistance values include, but are not limited to, 0.9K Ω, 1K Ω and 1.1K Ω.

The second purpose of the invention is: the method for detecting the voltage and the current of the light source comprises the following steps:

s1, the main control module reads the output voltage of the parameter resistance identification module at regular time and judges whether the light source is connected with the light source controller;

s2, the main control module calculates the resistance value R of the parameter resistor and the current I of the light source, and controls the output current of the light source driving module to be I according to the current I of the light source;

and S3, the main control module reads the output voltage Vout of the light source driving module and calculates the voltage V of the light source, and the main control module enables the light source to work in safe voltage and current to obtain a detection result.

Further, S3 further includes that, after the detection is completed, when the main control module periodically reads that the output voltage of the parametric resistance identification module is zero, the main control module controls the light source driving module to output a constant standby voltage Vsb and output a constant standby current Isb.

The invention has the advantages that; 1) the light source controller is connected with the light source through the three-core wire, so that the voltage and the current of the light source can be accurately detected, and the corresponding voltage and current can be accurately output according to the detected voltage and current, so that the application range of the controller is remarkably enlarged; 2) the parameter resistance identification module and the light source driving module are electrically connected to the main control module, the parameter resistors are respectively electrically connected to the parameter resistance identification module and the LED module, the LED module is electrically connected to the light source driving module, and the parameter resistance identification module can detect and identify the voltage value of the parameter resistor of the light source under the control of the main control module, so that the connection condition of the light source is effectively judged; 5) the light source driving module is used for detecting and adjusting the voltage and the current of the light source, can ensure the normal and efficient operation of the LED module, and enables the detection circuit to have the advantages of high controllability and high safety.

Drawings

FIG. 1 is a schematic diagram of a detection circuit of the present invention.

Fig. 2 is a circuit diagram of the main control module according to the present invention.

FIG. 3 is a circuit diagram of the parametric resistance identification module according to the present invention.

Fig. 4 is a circuit diagram of a light source driving module according to the invention.

FIG. 5 is a circuit diagram of the voltage regulation module of the present invention.

Fig. 6 is a circuit diagram of the current regulation module of the present invention.

Fig. 7 is a circuit diagram of the light source voltage detection module according to the present invention.

FIG. 8 is a flow chart of the detection method of the present invention.

Wherein: 1-a light source controller; 2-a light source; 3-three core wire; 11-a main control module; 12-a parametric resistance identification module; 13-a light source driving module; 21-parameter resistance; 22-LED module.

Detailed Description

As used in this specification and the appended claims, certain terms are used to refer to particular components, and it will be appreciated by those skilled in the art that a manufacturer may refer to a component by different names. This specification and claims do not intend to distinguish between components that differ in name but not function. In the following description and in the claims, the terms "include" and "comprise" are used in an open-ended fashion, and thus should be interpreted to mean "include, but not limited to. "substantially" means within an acceptable error range, and a person skilled in the art can solve the technical problem within a certain error range to substantially achieve the technical effect.

In the description of the present invention, it is to be understood that the terms "upper", "lower", "front", "rear", "left", "right", horizontal ", and the like indicate orientations or positional relationships based on those shown in the drawings, and are only for convenience in describing the present invention and simplifying the description, but do not indicate or imply that the referred device or element must have a specific orientation, be constructed in a specific orientation, and be operated, and thus, should not be construed as limiting the present invention.

In the present invention, unless otherwise expressly specified or limited, the terms "mounted," "connected," "secured," and the like are to be construed broadly and can, for example, be fixedly connected, detachably connected, or integrally connected; can be mechanically or electrically connected; they may be connected directly or indirectly through intervening media, or they may be interconnected between two elements. The specific meanings of the above terms in the present invention can be understood by those skilled in the art according to specific situations.

The present invention will be described in further detail with reference to the accompanying drawings 1 to 8 and specific examples, but the present invention is not limited thereto.

Example 1

A detection circuit for voltage and current of a light source is disclosed, as shown in figure 1, and comprises a light source controller 1, a light source 2 and a three-core wire 3, wherein the light source controller 1 is provided with a main control module 11, a parameter resistance identification module 12 and a light source driving module 13, the parameter resistance identification module 12 and the light source driving module 13 are both electrically connected to the main control module 11, the light source 2 comprises a parameter resistance 21 and an LED module 22, the parameter resistance 21 is electrically connected to the LED module 22, the three-core wire 3 is provided with an RES end, an LED + end and an LED-end, both ends of the RES wire of the three-core wire 3 are RES ends, both ends of the LED + wire of the three-core wire 3 are LED + ends, both ends of the LED-wire of the three-core wire 3 are LED-ends, the LED + end is used for providing a positive pole of electric energy to the LED module 22, the LED-end is used for providing a negative pole of electric energy to the LED module 22, the other end of the parameter resistor 21, the parameter resistor identification module 12, the light source driving module 13 and the LED module 22 are all connected with the LED + end, and the light source driving module 13 and the LED module 22 are all connected with the LED-end, so that the light source wire is effectively simplified, and the application range of the light source controller 1 is expanded.

In the light source controller 1, the main control module 11 is provided with a control unit, the control unit has an STM32F103 control chip and a control circuit connected to the control chip, as shown in fig. 2, the control chip is driven by a voltage of 3.3V, the parameter resistance identification module 12 is electrically connected to the RES Volat signal terminal of the control unit, and the light source driving module 13 is electrically connected to the Volat DAC signal terminal, the Curr DAC signal terminal, and the LED Volat signal terminal of the control unit.

Furthermore, as shown in fig. 3, the parameter resistance identification module 12 includes a resistance voltage detection module and a constant current source module, the resistance voltage detection module is electrically connected to the control unit and the constant current source module, the resistance voltage detection module is connected to the ADC channel 1 of the STM32F103 control chip, one end of the parameter resistance 21, the resistance voltage detection module and the constant current source module are all connected to the RES end, the other end of the parameter resistance 21 and the resistance voltage detection module are all connected to the LED + end, and the resistance voltage detection module is configured to detect and identify the voltage value of the parameter resistance 21 of the light source 2.

The resistance voltage detection module is provided with a first differential amplification unit, the first differential amplification unit is provided with an LM258 operational amplifier, a resistor R49 of 20K omega and a C67 with the capacitance value of 1nF, the amplification coefficient K1 of the first differential amplification unit is 0.5, the ratio of the output to the input of the resistance voltage detection module is K1, and the first differential amplification unit is electrically connected with the control unit and the parameter resistor 21 respectively.

Meanwhile, the constant current source module is provided with an NPN triode S9014 and a potentiometer WR1, and the WR1 is adjusted to enable the constant current source module to constantly output 1mA current.

As shown in fig. 4 to 7, in the light source controller 1, the light source driving module 13 includes a voltage regulation module, a current regulation module and a light source voltage detection module, the voltage regulation module, the current regulation module and the light source voltage detection module are all electrically connected to the control unit and the LED module 22, the voltage regulation module, the light source voltage detection module and the LED module 22 are all connected to the LED + terminal, and the current regulation module, the light source voltage detection module and the LED module 22 are all connected to the LED-terminal.

The voltage regulation module is connected with a DAC channel 1 of the STSTSTTM 32F103 control chip, the voltage regulation module is provided with a normal phase amplification unit, the normal phase amplification unit is provided with an LM258 operational amplifier, a triode S9014 and a triode BU406, the amplification factor of the normal phase amplification unit is 10, and the normal phase amplification unit is electrically connected with a Volat DAC signal end of the control unit and an LED + signal end of the LED module 22 respectively.

In the light source driving module 13, the current regulation module is connected to the DAC channel 2 of the STSTM32F103 control chip, the current regulation module is provided with a negative feedback constant current circuit, the negative feedback constant current circuit is provided with an LM258 operational amplifier and an MOS transistor 50N06, and a Curr DAC signal end of the control unit and an LED-signal end of the LED module 22 are electrically connected to the negative feedback constant current circuit, respectively.

In addition, in the light source driving module 13, the light source voltage detection module is connected to the ADC channel 2 of the STM32F103 control chip, the light source voltage detection module is provided with a second differential amplification unit, the second differential amplification unit is provided with an LM258 operational amplifier, a 100K Ω resistor R69, and a C74 with a capacitance of 1nF, an amplification factor K3 of the second differential amplification unit is 0.1, a ratio of output to input of the light source voltage detection module is K3, and the second differential amplification unit is electrically connected to an LED Volat signal terminal of the control unit, an LED + signal terminal of the LED module 22, and an LED-signal terminal, respectively.

After the detection circuit is connected, the detection operation process is as follows:

(1) when the light source controller 1 is powered on, the constant current source module of the parameter resistance identification module 12 outputs a constant current Ires of 1mAs, the main control module 11 outputs 1.2V through the DAC1, so that the voltage regulation module in the light source driving module 13 outputs a constant standby voltage Vsb of 12V, and the main control module 11 outputs 5mV through the DAC2, so that the current regulation module outputs a constant standby current Isb of 10 mA.

(2) The main control module 11 of the light source controller 1 reads the output voltage of the resistance voltage detection module of the parameter resistance identification module 12 at regular time, when the read voltage is zero, it indicates that the light source 2 is not inserted, and when the read voltage is greater than zero, it indicates that the light source 2 is inserted.

(3) When the light source 2 is detected to be inserted, the main control module 11 of the light source controller 1 reads the output voltage Vres of the resistance voltage detection module of the parameter resistance identification module 12 to be 0.5V. The main control module 11 calculates the resistance value of the parameter resistor in the light source to be 1K Ω by Vres ÷ (K1 × Ires), i.e., 0.5 ÷ (0.5 × 0.001). The ratio K2 of the current of the light source 2 to the parameter resistor 21 is specified to be 1 in the main control module 11, the light source current Iled calculated by the main control module 11 through K2 × R, i.e. 1 × 1000, is 1000mA, the current of the light source 2 calculated by the main control module 11 is 1000mA, and 0.5V is output through the DAC2, so that the current regulating module in the light source driving module 13 outputs the current of 1000 mA. At this time, the main control module 11 outputs 2.5V through the DAC1, so that the maximum voltage Vmax output by the voltage adjustment module in the light source driving module 13 is 25V, at this time, the main control module 11 reads the output voltage Vout of the light source voltage detection module in the light source driving module 13 to be 1.2V, and the main control module 11 calculates the voltage Vled of the light source to be 12V through Vout ÷ K3, i.e., 1.2 ÷ 0.1. The current regulation module in the light source driving module 13 outputs 1000mA, and requires that the voltage difference of VDS of the MOS transistor 50N06 be maintained above 0.2V, and the minimum voltage difference Δ V required is (Iled × R67) + VDS, that is, (1 × 0.5) +0.2 is equal to 0.7V. Finally, the main control module 11 calculates the required output voltage of the voltage regulation module in the light source driving module 13 as (Vled + Δ V), i.e., 12.7V, according to the light source voltage Vled as 12V and the minimum voltage difference Δ V required by the current regulation module in the light source driving module 13 as 0.7V, and outputs 1.27V through the DAC1 to enable the voltage regulation module in the light source driving module 13 to output 12.7 voltage, so that the light source 2 operates in safe voltage and current.

(4) After the third step is executed, the main control module 11 of the light source controller 1 reads the output voltage of the resistance voltage detection module of the parameter resistance identification module 12 at regular time, and when the read voltage is zero, it indicates that the light source 2 is not inserted. At this time, the main control module 11 outputs 1.2V through the DAC1 so that the voltage regulation module in the light source driving module 13 outputs a constant standby voltage Vsb of 12V, and the main control module 11 outputs 5mV through the DAC2 so that the current regulation module outputs a constant standby current Isb of 10 mA. And (4) continuing to execute the step (2).

Example 2

A method for detecting voltage and current of a light source, as shown in fig. 8, includes the following steps:

s1, the main control module 11 reads the output voltage of the parameter resistance identification module 12 at regular time and judges whether the light source 2 is connected to the light source controller 1;

s2, the main control module 11 calculates the resistance R of the parameter resistor 21 and the current I of the light source 2, and controls the output current of the light source driving module 13 to be I according to the current I of the light source 2;

s3, the main control module 11 reads the output voltage Vout of the light source driving module 13 and calculates the voltage V of the light source 2, the main control module 11 makes the light source 2 work in a safe voltage and current to obtain a detection result, and after the detection is completed, when the main control module 11 reads the output voltage of the parameter resistance identification module 12 at regular time and is zero, the main control module 11 controls the light source driving module 13 to output a constant standby voltage Vsb and a constant standby current Isb.

Obviously, the light source controller of the invention is connected with the light source only through the three-core wire, the controller can accurately detect the voltage and the current of the light source and output the corresponding voltage and current according to the detected voltage and current, thereby not only effectively enlarging the application range of the controller, but also effectively reducing the volume of the light source and improving the wiring efficiency.

Variations and modifications to the above-described embodiments may also occur to those skilled in the art, which fall within the scope of the invention as disclosed and taught herein. Therefore, the present invention is not limited to the above-mentioned embodiments, and any obvious improvement, replacement or modification made by those skilled in the art based on the present invention is within the protection scope of the present invention. Furthermore, although specific terms are employed herein, they are used in a generic and descriptive sense only and not for purposes of limitation.

12页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:一种工业计算机电压稳定性测试方法

网友询问留言

已有0条留言

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

精彩留言,会给你点赞!