A kind of ambient light resistance circuit and its method
Technical field
The present invention relates to a kind of ambient light resistance circuit and its method.
Background technology
In traditional circuit, when luminous tube is not opened, due to the influence of ambient light etc., reception pipe can also produce photoelectric current,
By systematic sampling and identified after being changed, so as to substantially reduce useful signal composition, have a strong impact on system signal noise ratio;Even if ring
Border light it is under-effected so that useful signal is flooded completely, in ambient light cyclically-varying, ambient light is produced in reception pipe
Cyclically-varying is also presented in raw photoelectric current, is easily mistakenly identified as useful signal by system, further deteriorates signal to noise ratio, or even can
It can make system that the mechanical periodicity of ambient light is identified as into useful signal, and be noise by signal identification caused by luminous tube, produce
Serious system mistake.
The content of the invention
It is real it is an object of the invention to overcome the deficiencies of the prior art and provide a kind of ambient light resistance circuit and its method
The now suppression function to ambient light, effectively increase the scope of application of the present invention, and the ability of Antagonistic Environment interference.
The purpose of the present invention is achieved through the following technical solutions:A kind of ambient light resists circuit, and it includes luminous
Circuit, optical signal receiving circuit, photoelectric switching circuit, sampling hold circuit and subtracter;The input of described illuminating circuit
Receive external input signal, the first optical signal that illuminating circuit is sent to optical signal receiving circuit, described optical signal receives electricity
Road receives the first optical signal for carrying out self-luminescence circuit and the second optical signal from external ambient light, optical signal receiving circuit it is defeated
Go out end to be connected with photoelectric switching circuit, the first output end of photoelectric switching circuit and the inverting input of subtracter connect, photoelectricity
Second output end of change-over circuit is connected with sampling hold circuit, and the output end of sampling hold circuit passes through constant pressure source and subtracter
In-phase input end connection;The output end output result of subtracter.
Described illuminating circuit includes luminous tube;Described optical signal receiving circuit includes reception pipe.
Described sampling hold circuit includes a switch S being connected on a loop and ground capacity C.
A kind of method of ambient light resistance circuit, comprises the following steps:
S11:Optical signal receiving circuit and photoelectric switching circuit are opened, keeps illuminating circuit to close, sampling hold circuit is
Sample states;
S12:Optical signal receiving circuit receives the second optical signal from external ambient light, and is produced by photoelectric switching circuit
Raw phase induced current output;
S13:The signal that sampling hold circuit exports to photoelectric switching circuit samples, and obtained signal is sampled holding
Circuit stores and is sent into the in-phase input end of subtracter;
S14:Switch sampling holding circuit is hold mode, and now sampling hold circuit disconnects with photoelectric switching circuit, and
Open illuminating circuit;
S15:Optical signal receiving circuit receives the second optical signal from external ambient light and comes the of self-luminescence circuit
The superposed signal of one optical signal, and corresponding electric current is produced by photoelectric switching circuit and exported;
S16:The inverting input of subtracter receives the signal obtained from step S15;
S17:Subtracter carries out subtraction to the signal of inverting input and the signal of in-phase input end, and obtaining output is
There is no the signal of ambient light, the optical signal only sent comprising illuminating circuit.
Described sample states are switch S closures, input signal IN charges to electric capacity C, output signal OUT follows input to believe
Number IN state;Described hold mode for open the light S disconnect, sampling hold circuit also with the separated of prime, high-impedance state, electric capacity
Electric charge on C keeps constant, output signal OUT also keeps constant state.
The beneficial effects of the invention are as follows:The present invention adds sampling to suppress the influence of ambient light before subtracter
Holding circuit.Subtracter gathers the superposed signal for the optical signal that ambient light signal and ambient light are sent with luminous tube successively, and
Carry out subtraction is done, the composition of the obtained no ambient light of output, the optical signal only sent comprising luminous tube, so as to realize pair
The suppression function of ambient light, effectively increase the scope of application of the present invention, and the ability of Antagonistic Environment interference;And do not use
Digital analog converter and analog-digital converter, it is simple in construction.
Brief description of the drawings
Fig. 1 is block diagram of the present invention;
Fig. 2 is sampling hold circuit schematic diagram;
Fig. 3 is the inventive method flow chart.
Embodiment
Technical scheme is described in further detail below in conjunction with the accompanying drawings:A kind of as shown in figure 1, ambient light resistance electricity
Road, it includes illuminating circuit, optical signal receiving circuit, photoelectric switching circuit, sampling hold circuit and subtracter;Described is luminous
The input of circuit receives external input signal, and the first optical signal that illuminating circuit is sent to optical signal receiving circuit is described
Optical signal receiving circuit receives the first optical signal for carrying out self-luminescence circuit and the second optical signal from external ambient light, optical signal
The output end of receiving circuit is connected with photoelectric switching circuit, the first output end of photoelectric switching circuit and the anti-phase input of subtracter
End connection, the second output end of photoelectric switching circuit are connected with sampling hold circuit, and the output end of sampling hold circuit passes through perseverance
The in-phase input end of potential source and subtracter connects;The output end output result of subtracter.
Described illuminating circuit includes luminous tube;Described optical signal receiving circuit includes reception pipe.
As shown in Fig. 2 described sampling hold circuit includes a switch S being connected on loop and a ground capacity
C。
As shown in figure 3, a kind of method of ambient light resistance circuit, comprises the following steps:
S11:Optical signal receiving circuit and photoelectric switching circuit are opened, keeps illuminating circuit to close, sampling hold circuit is
Sample states;
S12:Optical signal receiving circuit receives the second optical signal from external ambient light, and is produced by photoelectric switching circuit
Raw phase induced current output;
S13:The signal that sampling hold circuit exports to photoelectric switching circuit samples, and obtained signal is sampled holding
Circuit stores and is sent into the in-phase input end of subtracter;
S14:Switch sampling holding circuit is hold mode, and now sampling hold circuit disconnects with photoelectric switching circuit, and
Open illuminating circuit;
S15:Optical signal receiving circuit receives the second optical signal from external ambient light and comes the of self-luminescence circuit
The superposed signal of one optical signal, and corresponding electric current is produced by photoelectric switching circuit and exported;
S16:The inverting input of subtracter receives the signal obtained from step S15;
S17:Subtracter carries out subtraction to the signal of inverting input and the signal of in-phase input end, and obtaining output is
There is no the signal of ambient light, the optical signal only sent comprising illuminating circuit.
Described sample states are switch S closures, input signal IN charges to electric capacity C, output signal OUT follows input to believe
Number IN state;Described hold mode for open the light S disconnect, sampling hold circuit also with the separated of prime, high-impedance state, electric capacity
Electric charge on C keeps constant, output signal OUT also keeps constant state.