CN105006142B - A kind of program-controlled duty ratio roll adjustment method of reflective infrared photoelectric sensor - Google Patents

A kind of program-controlled duty ratio roll adjustment method of reflective infrared photoelectric sensor Download PDF

Info

Publication number
CN105006142B
CN105006142B CN201510388203.7A CN201510388203A CN105006142B CN 105006142 B CN105006142 B CN 105006142B CN 201510388203 A CN201510388203 A CN 201510388203A CN 105006142 B CN105006142 B CN 105006142B
Authority
CN
China
Prior art keywords
microcontroller
infrared
circuit
roll adjustment
output
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
CN201510388203.7A
Other languages
Chinese (zh)
Other versions
CN105006142A (en
Inventor
邱召运
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Weifang Medical University
Original Assignee
Weifang Medical University
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Weifang Medical University filed Critical Weifang Medical University
Priority to CN201510388203.7A priority Critical patent/CN105006142B/en
Publication of CN105006142A publication Critical patent/CN105006142A/en
Application granted granted Critical
Publication of CN105006142B publication Critical patent/CN105006142B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Geophysics And Detection Of Objects (AREA)

Abstract

The present invention relates to a kind of program-controlled duty ratio roll adjustment methods of reflective infrared photoelectric sensor, sensor includes infrared transmitting circuit, infrared receiving circuit, microcontroller, output interface circuit and setting circuit, and infrared transmitting circuit is by MCU driving and can emit modulating frequency as f0, duty ratio be δ infrared pulse light;Infrared receiving circuit includes that center receives frequency is f0Infrared remote control receiving module;Circuit is set and sends setting request signal to microcontroller;Microcontroller can control the duty cycle, delta for increasing infrared pulse light to adjust the valid analysing range of sensor after receiving roll adjustment request signal.The photoelectric sensor and roll adjustment method of the present invention realizes program-controlled duty ratio roll adjustment, take full advantage of software resource, simplify circuit structure, also achieve intelligentized control simultaneously, whole settings can be completed merely with a button, it is convenient and practical, in addition the way of output of output interface is also allow to switch, using more flexible and convenient, the scope of application of sensor is increased.

Description

A kind of program-controlled duty ratio roll adjustment method of reflective infrared photoelectric sensor
Technical field
The invention belongs to photoelectric sensor technology field, specifically a kind of reflective infrared photoelectric sensor it is program-controlled Duty ratio roll adjustment method.
Background technology
The operation principle of reflective infrared photoelectric sensor is:Emit certain modulating frequency and duty by infrared transmitting tube The infrared light of ratio, reflected light are detected by photosensitive tube and through amplifying, demodulating, it is determined whether and there is checking matter to enter valid analysing range, Then output switching signal, the purpose using modulation light are to improve jamproof ability.Usually, emit the modulation frequency of light Rate is equal to the center receives frequency of receiving circuit.
Common reflective infrared photoelectric sensor is divided into two kinds, i.e., fixed test is apart from type and adjustable detecting distance type (hereinafter referred to as roll adjustment type), roll adjustment type photoelectric sensor generally use adjustable resistance adjust detecting distance, and roll adjustment mode has two Kind:One is roll adjustment is realized by adjusting emitted luminescence intensity, secondly realizing roll adjustment by the parameter for adjusting amplifying circuit.
For the first roll adjustment mode, research has shown that the emitted luminescence intensity of transmitting tube is related to operating current:When work electricity When stream is less than 10mA, the minor change that electric current generates can cause the large change of emitted luminescence intensity;When operating current is more than When 20mA, the emitted luminescence intensity of transmitting tube is larger and relatively stablizes, and changing emission current influences less emitted luminescence intensity.Obviously, Transmitting tube is operated under low current, and emitted luminescence intensity is more easily adjusted, however, under low current, current strength is easy by environment Temperature interference, variation of ambient temperature causes the minor change of operating current to also result in the change of emitted luminescence intensity, to influence The stability of emitted luminescence intensity.As it can be seen that when transmitting tube is operated under low current, emitted luminescence intensity can easily be accommodated, but stability Difference, when transmitting tube is operated under high current, emitted luminescence intensity is relatively stablized but is not easy to adjust, and there are contradictions for the two.Reflective In infrared photoelectric sensor, the rated operational current of transmitting tube is generally 20mA or so, from the foregoing it will be appreciated that emitting light by adjusting The method of intensity realization roll adjustment is simultaneously undesirable.
Roll adjustment type photoelectric sensor mostly uses second of roll adjustment mode, the i.e. method by adjusting amplifying circuit parameter at present Realize roll adjustment.But this method equally exists defect:First, though sensitivity can be improved by improving gain amplifier, reduce anti-dry Disturb ability;It is easily affected by environment and change its intrinsic parameter second, adjustable resistance is there are Mechanical Contact, and then influence sensor Stability.For these reasons, the roll adjustment method of reflective infrared photoelectric sensor needs to innovate.
Applicant once existed《The sensor world》In delivered one entitled " intelligent opto-electrical based on infrared receiver module opened The article of pass design ", discusses in literary and improves the stability problem of detection by intelligent dynamic intensity control, but in text It is not directed to roll adjustment technology.In addition, since infrared remote control receiving module is by receiving circuit, amplifying circuit and demodulator circuit one Change design, gain is simultaneously non-adjustable.Therefore, to using technology maturation, the infrared remote control reception mould that performance is stable, cheap Group design novel sensor, needs to be improved the roll adjustment mode of reflective photoelectric sensor.
For infrared receiver module, when the frequency of input signal is close to its centre frequency, receiving module has maximum Sensitivity.It is demonstrated experimentally that when frequency is fixed, the sensitivity of receiving module is also related to the duty ratio of infrared pulse signal.It accounts for Then sensitivity is higher when empty smaller, and then sensitivity falls to zero when duty is bigger.This is to say, accounting for pulse signal Than increasing, sensitivity can be gradually reduced sky, this can to adjust that the sensitivity of sensor provides in a manner of changing duty ratio Energy.
Based on aforementioned, for the reflective photoelectric sensor in the application, change of sensitivity is equivalent to measurement distance Variation, this kind of roll adjustment mode be referred to as " variable duty cycle roll adjustment " in this application.Wherein, changing duty ratio can be real manually It is existing, such as rotational potentiometer, it can also realize automatically, such as program control.The application mainly for the latter, for ease of description, This application involves roll adjustment mode be referred to as " program-controlled duty ratio roll adjustment ".
Invention content
The invention solves first technical problem be to provide a kind of reflective infrared photoelectric sensor, the sensor Circuit structure is simple, setting convenience, using flexible, program-controlled duty ratio roll adjustment can be achieved.
The invention solves second technical problem be to provide a kind of program-controlled duty ratio roll adjustment method of sensor, the party The duty ratio that method changes transmitting light using microcontroller can make full use of software to change effective detecting distance of sensor Resource simplifies circuit structure, improves the stability of sensor.
In order to solve the first technical problem mentioned above, reflective infrared photoelectric sensor of the invention be structurally characterized in that including Infrared transmitting circuit, infrared receiving circuit, microcontroller, output interface circuit and setting circuit, the center of infrared receiving circuit connects Receipts frequency is f0, wherein:
Infrared transmitting circuit includes infrared transmitting tube, and the infrared transmitting tube is by MCU driving and can emit modulating frequency and is f0, duty ratio be δ infrared pulse light;
Infrared receiving circuit includes that center receives frequency is f0Infrared remote control receiving module, the infrared remote control receiving module Reflected light is detected, and tentatively judges whether there is checking matter and enters the detection range d that sensor has been set, then will determine that result exports To microcontroller;
It includes a button that circuit, which is arranged, which sends setting request signal to microcontroller;
Output interface circuit sends switching signal as output from MCU driving and to out connector;
Core, the built-in non-volatile memory cells for being useful for storage parameter and program have microcontroller in order to control Multiple I/O interfaces being connect with above-mentioned each circuit, one of I/O interfaces output frequency are f0, the adjustable waveform of duty ratio The signal and waveform signal is sent to drive signal of the infrared transmitting tube as infrared transmitting tube, another I/O interface is red The signal and microcontroller of outer remote control reception module by from the interface signal carry out anti-noise processing with finally determine whether by It examines object to exist, to by another I/O interface driver output interface circuit output switching signal, microcontroller also have that there are one special I/O interfaces for receiving setting request signal, setting request signal include changing waveform signal for starting microcontroller control Duty ratio is to adjust the roll adjustment request signal of sensor detection range.
The infrared photoelectric sensor further includes the reserved connector for microcontroller download online program;The setting is asked It further includes the way of output switching request signal for changing the output interface circuit way of output for starting microcontroller, output to seek signal Mode switching request signal and roll adjustment request signal are persistently pressed the length of time according to button and are divided.
The button persistently presses the time, and request signal was then arranged less than 10 seconds is roll adjustment request signal, and button persistently presses It is way of output switching request signal that time, request signal was then arranged more than 10 seconds.
The infrared remote control receiving module includes optical detector, preamplifier and detecting circuit.
The output interface circuit includes the NPN type triode being connected between microcontroller and out connector, the NPN type The emitter ground connection of triode, the I/O interfaces connection of base stage and microcontroller, collector and out connector connection.
To solve above-mentioned second technical problem, the program-controlled duty ratio roll adjustment method of sensor of the invention includes following step Suddenly:
Checking matter is placed in the front of sensor optical path by step 1), ensures that checking matter is with the air line distance before sensor Effective detecting distance d to be set;
Step 2) presses the button of setting circuit and sends roll adjustment request signal to microcontroller;
Step 3) microcontroller receive roll adjustment request signal and to infrared transmitting tube transmission frequency be f0, duty cycle, delta 30% Waveform signal is f to drive infrared transmitting tube tranmitting frequency0, duty cycle, delta be 30% pulsed light;f0It is received for infrared remote control The center receives frequency of module;
Step 4) detects reflected light by infrared receiving circuit and determines whether checking matter by microcontroller, if can't detect Checking matter, then microcontroller preserve original parameter exit, illustrate effective detecting distance d to be set beyond sensor itself maximum Journey;If checking matter can be detected, microcontroller control gradually increases the duty cycle, delta of waveform signal, while constantly being connect by infrared It receives circuit detection reflected light and checking matter is simultaneously determined whether by microcontroller, until checking matter cannot be detected, record at this time Waveform signal duty cycle, delta, the corresponding detecting distance of waveform signal duty cycle, delta are effective detecting distance d to be set;
Step 5) microcontroller stores parameter corresponding with waveform signal duty cycle, delta recorded in step 4 to non-volatile In property storage unit, called when for normally detecting;
Step 6) roll adjustment is completed, and normal detecting state is returned to.
Button in step 2) can also send way of output switching request signal, way of output switching request letter to microcontroller Number and roll adjustment request signal persistently press the length of time according to button and divide.Microcontroller receives way of output switching request letter Number when, if the way of output of output interface circuit be normally open output, be switched to normally off output, if output connect The way of output of mouth circuit is that normally off exports, then is switched to normally open output;Modified output state is stored in non- In volatile memory cell.
As it can be seen that the invention has the advantages that:1) program-controlled duty ratio roll adjustment is realized, software resource is taken full advantage of, letter Circuit structure is changed;2) intelligentized control is realized, whole settings can be completed merely with a button, it is convenient and practical;3) defeated The way of output of outgoing interface can switch, and use is more flexible and convenient, sensor can normally opened output normally closed can also export, increase The scope of application of sensor is added.
Description of the drawings
Invention is further described in detail with reference to the accompanying drawings and detailed description:
Fig. 1 is the overall structure block diagram of the present invention;
Fig. 2 is the experimental principle figure for emitting relationship between light duty ratio and sensor detecting distance;
Fig. 3 is the photoelectric sensor circuit principle schematic of the present invention;
Fig. 4 is the software systems flow chart of the present invention.
Specific implementation mode
With reference to attached drawing, reflective infrared photoelectric sensor of the invention include infrared transmitting circuit 1, infrared receiving circuit 2, Microcontroller U2, output interface circuit 3 and setting circuit 4.The center receives frequency of infrared receiving circuit is f0, the placement of checking matter 5 In front of light path, the infrared light reflection that infrared transmitting circuit 1 is emitted is to infrared receiving circuit 2.
With reference to attached drawing, infrared transmitting circuit 1 includes infrared transmitting tube L1, and infrared transmitting tube L1 is driven simultaneously by microcontroller U2 It is f that modulating frequency, which can be emitted,0, duty ratio be δ infrared pulse light.
With reference to attached drawing, infrared receiving circuit 2 includes that center receives frequency is f0Infrared remote control receiving module U1.Wherein, Optical detector, preamplifier and detecting circuit are packaged together by infrared remote control receiving module U1, with realize signal reception, Amplification and detection, without peripheral cell, output can directly be connect with the I/O interfaces of microcontroller, and IRM- specifically can be used 3638 type infrared remote control receiving modules.Infrared remote control receiving module U1 detects reflected light, and tentatively judge whether there is checking matter into Enter the detection range d that sensor has been set, then will determine that result exports and give microcontroller U2.
With reference to attached drawing, setting circuit 4 includes a button K1, and button K1 sends setting request signal to microcontroller U2, Request signal is set and is divided into two kinds according to by the length of key pressing time, one is roll adjustment request signal, secondly being the way of output Switching request signal, behind can further illustrate.
With reference to attached drawing, output interface circuit 3 is driven from microcontroller U2 and sends switching signal conduct to out connector J1 Output.Output interface circuit 3 includes the NPN type triode T1 being connected between microcontroller U2 and out connector J1, the NPN type The connection of I/O interfaces, collector and the out connector J1 connections of the emitter ground connection, base stage and microcontroller U2 of triode T1.
With reference to attached drawing, infrared photoelectric sensor of the invention further includes pre- the lingering on for microcontroller U2 download online programs Meet device J2.It further includes the way of output for changing 3 way of output of output interface circuit for starting microcontroller U2 that request signal, which is arranged, The length that switching request signal, way of output switching request signal and roll adjustment request signal persistently press the time according to button K1 is drawn Point.In the present invention, button K1 persistently presses the time request signal was then arranged less than 10 seconds is roll adjustment request signal, and button K1 holds It is continuous to press the time request signal was then set more than 10 seconds for way of output switching request signal.
With reference to attached drawing, microcontroller U2 cores in order to control, the built-in non-volatile memories for being useful for storage parameter and program Unit, with multiple I/O interfaces being connect with above-mentioned each circuit, one of I/O interfaces output frequency is f0, duty ratio Adjustable waveform signal and the waveform signal are sent to drive signals of the infrared transmitting tube L1 as infrared transmitting tube L1, another The signal and microcontroller U2 of I/O interface infrared remote control receiving modules U1 by from the interface signal carry out anti-noise processing with It is final to determine whether that checking matter exists, thus by another 3 output switching signal of I/O interface drivers output interface circuit, Microcontroller U2 also has there are one the I/O interfaces for being exclusively used in reception setting request signal, and it includes for starting list that request signal, which is arranged, The U2 controls of piece machine change waveform signal duty ratio to adjust the roll adjustment request signal of sensor detection range.
Fig. 3 is the circuit theory schematic diagram of photoelectric sensor, microcontroller U2, resistance R4, capacitance C1, capacitance C2, luminous two Pole pipe L2 constitutes single chip circuit, and microcontroller U2 includes 8 pins, has 5 I/0 interfaces, be can be selected in actual production built-in The STC15F100E series monolithics of EEPROM.C1, C2 are power supply coupling capacitor.Light emitting diode L2 is used for state instruction, limit The resistance value of leakage resistance R3 is 1K Ω, and light emitting diode L2 is driven by the P3.0 mouths of microcontroller U2.Infrared transmitting tube L1 and current limliting electricity It hinders R1 and constitutes infrared transmitting circuit, driven by the P3.3 mouths of microcontroller U2, the resistance value of R1 is determined by maximum detecting distance, circuit work The wavelength for emitting infrared light when making is 940nm, and the duty ratio of infrared pulse light is determined by microcontroller U2.Infrared remote control receiving module U1, resistance R2, electrolytic capacitor C3 constitute infrared circuit, and it is 10 μ F-22 μ F that wherein the resistance value of R2, which is 47-100 Ω, C3 capacity, Electrolytic capacitor, effect is power decoupling for U1, reduces the influence of other circuits.The reception of infrared remote control receiving module U1 Window connects the P3.2 mouths of microcontroller U2 towards reflection light direction, output.NPN type triode T1, current-limiting resistance R4, connector J1 structures At output interface circuit, the wherein base stage of T1 is connect by R4 and the P3.4 of microcontroller the U2 mouth that resistance value is 10K Ω, the output of T1 State is controlled by microcontroller U2, and the collector of T1 is directly connected to J1, and other two pin of J1 is that sensor circuit is supplied to 5V Power supply.Normally opened button K1 constitutes setting circuit, and one terminates power ground, and one end connects the P3.1 mouths of microcontroller U2, to list when connection The P3.1 mouth input low levels of piece machine U2 propose setting request.Connector J2 is reserved by U2 download online programs, is not influenced The work of sensor.
Wherein, NPN type triode T1 is exported using open collector, when sensor is set as the normally opened way of output, nothing Microcontroller U2 exports low level when detectable substance, and NPN type triode T1 is in cut-off state, and microcontroller U2 outputs are high when having detectable substance Level, T1 are in saturation conduction state;When being set as the normally closed way of output, microcontroller U2 exports high level when no detectable substance, NPN type triode T1 is in saturation conduction state, and microcontroller U2 exports low level when having detectable substance, and NPN type triode T1 is in Cut-off state.
Fig. 4 is the software systems program flow chart of the present invention, and character meaning is as follows in figure:50 be " program starts ", 51 It is " initializing sensor " for " reading arrange parameter ", 52,53 be " whether to detect reflected light", 54 are " set output connects Mouthful ", 55 be " resetting output interface ", and whether 56 be " to have setting to ask", 57 for " be roll adjustment setting", 58 are " programming is defeated Go out mode ", 59 be " depositing way of output parameter ", and 5A is " program-controlled duty ratio roll adjustment ", and 5B is " whether to have checking matter", 5C is " to change Variable duty cycle continues to detect ", 5D is that " whether roll adjustment is completed", 5E is " conversion duty cycle parameter ", and 5F is " to deposit duty ratio ginseng Number ".Y is the simplification of YES in figure, and N is the simplification of NO, and arrow representation program executes flow direction.Wherein, it 51,52 constitutes initially Change program, 53,54,55,56 constitute main program, and 58,59 constitute programming interface way of output program, 5A, 5B, 5C, 5D, 5E, 5F Constitute program-controlled duty ratio roll adjustment program.Start to execute program after sensor electrification reset, first from the parameter that has been set of reading, Then initializing sensor enters main program working condition by the parameter of setting.Main program has detected whether reflected light successively, is It is no to there is setting button to press, main program cycle execution is returned if being N (negative) state.If having detected reflected light, explanation There is detectable substance to enter detection range, then presses programming way of output set output interface state, otherwise reset output interface state, so After continue to execute main program.If having detected setting request, after 57 judge or programming interface way of output program is executed, or It executes program-controlled duty ratio roll adjustment program and returns to initialization program after setting completed, reinitialize sensor, subsequently into Main program cycle.
For the present invention under normal detecting state, it is f that the software systems of microcontroller, which generate frequency,0, duty ratio be δ rectangular wave Signal is transported to infrared transmitting circuit, and it is f to drive infrared transmitting tube to send out modulating frequency0, duty ratio be δ infrared pulse Light, it is the checking matter at d which, which encounters in distance, infrared pulse light is reflected to infrared receiving circuit, through infrared receiver Processing of circuit obtains checking matter information that may be present, and it is further true by software systems which will feed back to single chip circuit Recognize, microcontroller is confirmed whether to have checking matter to enter in the valid analysing range of its setting, and will be sent with no logical consequence it is defeated Outgoing interface circuit output.
Fig. 2 is the experimental principle figure for emitting relationship between light duty ratio and sensor detecting distance, and abscissa is modulation light Duty cycle, delta is defined as pulse width W and frequency f0Product;Because detecting distance is also related to transmitting light intensity, therefore ordinate is opposite Detecting distance is defined as d/dm× 100%, i.e. measured distance d and maximum detecting distance dmThe ratio between.Curve shows duty in figure The range of ratio effectively, wherein 30% or so effective detecting distance is maximum, in the range of 60%, has between 30%-60% Effect detecting distance is gradually reduced with the increase of duty ratio, this is the theoretical foundation of the present invention.In the present invention, infrared remote control The center receives frequency of receiving module U1 is f0, duty cycle, delta is defined as pulse width W and frequency f0Product.When infrared pulsed light frequency Rate is f0, duty ratio is when being 30% or so, corresponding maximum detecting distance dm.From Figure 2 it can be seen that when duty ratio is in the model of 30%-60% When being gradually increased in enclosing, effective detecting distance d is gradually reduced, i.e.,:In the case where pulse light frequency is constant, increased by programming The adjusting of effective detecting distance d may be implemented in the duty cycle, delta of pulsed light.This kind of roll adjustment mode calls its " program-controlled duty ratio roll adjustment ", The mode of traditional adjustable resistance roll adjustment is abandoned.
When producing and processing sensor, it is defaulted as maximum detecting distance, if wanting to adjust effective detecting distance, will be detected first Object is placed in front of sensor optical path, then set key of short-press, i.e., persistently key press time is less than 10 seconds, and circuit is arranged to monolithic Machine sends roll adjustment request signal, and sensor enters program-controlled roll adjustment working condition, and specific roll adjustment process is:The software systems of microcontroller First control infrared transmitting circuit output frequency is f0, duty ratio be 30% pulsed light, be confirmed whether to be able to detect that checking matter, If can't detect checking matter, illustrates that checking matter is too weak beyond its detection range or checking matter reflection, at this moment original parameter will be maintained to move back Go out;If checking matter can be detected, software systems will control radiating circuit transmitting and gradually increase the duty cycle, delta of infrared pulse light not Whether disconnected detection reflected light, which meets reception, requires, until checking matter cannot be detected, the detection corresponding to duty cycle, delta this moment Distance, the effective detecting distance d as set are returned to just after software systems complete storage to the revised parameter of duty cycle, delta Normal detecting state.
Based on reflective infrared photoelectric sensor above-mentioned, the program-controlled duty ratio roll adjustment method of sensor of the invention is summed up Include the following steps:
Checking matter 5 is placed in the front of sensor optical path by step 1), ensures checking matter 5 and the air line distance before sensor For effective detecting distance d to be set;
Step 2) presses the button K1 of setting circuit 4 and sends roll adjustment request signal to microcontroller U2;
Step 3) microcontroller U2 receive roll adjustment request signal and to infrared transmitting tube L1 transmission frequency be f0, duty cycle, delta be 30% waveform signal is f to drive infrared transmitting tube L1 tranmitting frequencies0, duty cycle, delta be 30% pulsed light;f0It is infrared The center receives frequency of remote control reception module U1;Duty cycle, delta is defined as pulse width W and frequency f0Product;
Step 4) detects reflected light by infrared receiving circuit 2 and determines whether checking matter 5 by microcontroller U2, if detection Less than checking matter 5, then microcontroller U2 preserves original parameter and exits, and illustrate effective detecting distance d to be set beyond sensor itself Maximum range;If checking matter 5 can be detected, microcontroller U2 controls gradually increase the duty cycle, delta of waveform signal, duty ratio Adjusting range constantly detects reflected light by infrared receiving circuit 2 and is determined by microcontroller U2 and be between 30%-60% It is no to have checking matter, until checking matter 5 cannot be detected, waveform signal duty cycle, delta at this time is recorded, the waveform signal duty ratio The corresponding detecting distances of δ are effective detecting distance d to be set;
Step 5) microcontroller U2 stores parameter corresponding with waveform signal duty cycle, delta recorded in step 4) to non-easy In the property lost storage unit, called when for normally detecting;
Step 6) roll adjustment is completed, and normal detecting state is returned to.
Wherein, the button K1 in step 2) can also send way of output switching request signal, the way of output to microcontroller U2 Switching request signal and roll adjustment request signal are persistently pressed the length of time according to button and are divided.
When microcontroller U2 receives way of output switching request signal, if the way of output of output interface circuit 3 is Normally open exports, then is switched to normally off output;If the way of output of output interface circuit 3 exports for normally off, Then it is switched to normally open output.Modified output state is stored in non-volatile memory cells.In the present invention, it senses The interface of device is exported using open collector, and when producing and processing sensor, output interface gives tacit consent to the normally opened way of output, if wanting to convert For the normally closed way of output, can set key (being more than 10 seconds as continued key press time) under long-press, at this moment software systems are by automated programming Output interface is normally closed output, and button preserves arrange parameter after unclamping, and sensor reinitializes setting state, into normal inspection Survey state.The method that this programmable setting sensor interface exports, i.e., normally opened output and the normally closed way of output can mutually turn The method changed facilitates the popularization and application of the sensor.
In conclusion the present invention is not limited to above-mentioned specific implementation modes.Those skilled in the art are not departing from the present invention's Under the premise of spirit and scope, several change and modification can be done.Protection scope of the present invention should be with the claim of the present invention Subject to.

Claims (7)

1. a kind of program-controlled duty ratio roll adjustment method of reflective infrared photoelectric sensor, sensor include infrared transmitting circuit (1), Infrared receiving circuit (2), microcontroller (U2), output interface circuit (3) and setting circuit (4), the center of infrared receiving circuit (2) Receives frequency is f0;Infrared transmitting circuit (1) includes infrared transmitting tube (L1), which is driven by microcontroller (U2) It is f to move and can emit modulating frequency0, duty ratio be δ infrared pulse light;Infrared receiving circuit (2) includes center receives frequency For f0Infrared remote control receiving module (U1), which detects reflected light, and tentatively judges whether there is Checking matter enters effective detecting distance d that sensor has been set, then will determine that result exports and give microcontroller (U2);Output interface electricity Road (3) is driven from microcontroller (U2) and sends switching signal as output to out connector (J1), it is characterized in that including as follows Step:
Checking matter (5) is placed in the front of sensor optical path by step 1), ensures checking matter (5) and the air line distance before sensor For effective detecting distance d to be set;
It includes a button (K1) that circuit (4), which is arranged, in step 2), which sends setting request signal to microcontroller (U2); It presses the button (K1) of setting circuit (4) and sends roll adjustment request signal to microcontroller (U2);
Step 3) microcontroller (U2) receive roll adjustment request signal and to infrared transmitting tube (L1) transmission frequency be f0, duty cycle, delta be 30% waveform signal is f to drive infrared transmitting tube (L1) tranmitting frequency0, duty ratio be 30% pulsed light;f0It is red The center receives frequency of outer remote control reception module (U1);
Step 4) detects reflected light by infrared receiving circuit (2) and determines whether checking matter (5) by microcontroller (U2), if inspection Checking matter (5) is not detected, then microcontroller preserves original parameter and exits, and illustrates effective detecting distance d to be set beyond sensor certainly The maximum range of body;If checking matter (5) can be detected, microcontroller (U2) control gradually increases the duty cycle, delta of waveform signal, together When constantly detected by infrared receiving circuit (2) and reflected light and checking matter determined whether by microcontroller (U2), until checking matter (5) it cannot be detected, record waveform signal duty cycle, delta at this time, which is Effective detecting distance d to be set;
Step 5) microcontroller (U2) stores parameter corresponding with waveform signal duty cycle, delta recorded in step 4 to non-volatile In property storage unit, called when for normally detecting;
Step 6) roll adjustment is completed, and normal detecting state is returned to;
Button (K1) in the step 2) can also send way of output switching request signal to microcontroller (U2), and the way of output is cut Change the length division that request signal and roll adjustment request signal persistently press the time according to button.
2. the program-controlled duty ratio roll adjustment method of reflective infrared photoelectric sensor as described in claim 1, it is characterized in that described Microcontroller (U2) core in order to control, the built-in non-volatile memory cells for being useful for storage parameter and program, with multiple The I/O interfaces being connect with above-mentioned each circuit, one of I/O interfaces output modulating frequency are equal to center receives frequency f0, account for Sky is sent to infrared transmitting tube (L1) than adjustable waveform signal and the waveform signal to be believed as the driving of infrared transmitting tube (L1) Number, the signal and microcontroller (U2) of another I/O interface infrared remote control receiving module (U1) are by the signal from the interface Anti-noise processing is carried out finally to determine whether that checking matter exists, to pass through another I/O interface driver output interface circuit (3) output switching signal, microcontroller (U2) also have there are one the I/O interfaces for being exclusively used in reception setting request signal, and setting is asked Signal includes changing waveform signal duty ratio for starting microcontroller (U2) control to adjust the tune of the effective detecting distance of sensor Away from request signal.
3. the program-controlled duty ratio roll adjustment method of reflective infrared photoelectric sensor as described in claim 1, it is characterized in that described Infrared photoelectric sensor further includes the reserved connector (J2) for microcontroller (U2) download online program;The setting request letter Number further include the way of output switching request signal for changing output interface circuit (3) way of output for starting microcontroller (U2), Way of output switching request signal and roll adjustment request signal are persistently pressed the length of time according to button (K1) and are divided.
4. the program-controlled duty ratio roll adjustment method of reflective infrared photoelectric sensor as claimed in claim 3, it is characterized in that described Button (K1) persistently presses the time, and request signal was then arranged less than 10 seconds is roll adjustment request signal, and button (K1) persistently presses the time It is way of output switching request signal that request signal was then arranged more than 10 seconds.
5. the program-controlled duty ratio roll adjustment method device of reflective infrared photoelectric sensor as described in claim 1, it is characterized in that institute It includes optical detector, preamplifier and detecting circuit to state infrared remote control receiving module (U1).
6. the program-controlled duty ratio roll adjustment method of reflective infrared photoelectric sensor as described in claim 1, it is characterized in that described Output interface circuit (3) includes the NPN type triode (T1) being connected between microcontroller (U2) and out connector (J1), should The emitter ground connection of NPN type triode (T1), the connection of I/O interfaces, collector and the out connector of base stage and microcontroller (U2) (J1) it connects.
7. program-controlled duty ratio roll adjustment method as described in claim 1, it is characterized in that the microcontroller (U2) receives output side When formula switching request signal, if the way of output of output interface circuit (3) exports for normally open, it is switched to normally off Output is switched to normally open output if the way of output of output interface circuit (3) exports for normally off;After modification Output state be stored in non-volatile memory cells.
CN201510388203.7A 2015-07-04 2015-07-04 A kind of program-controlled duty ratio roll adjustment method of reflective infrared photoelectric sensor Expired - Fee Related CN105006142B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510388203.7A CN105006142B (en) 2015-07-04 2015-07-04 A kind of program-controlled duty ratio roll adjustment method of reflective infrared photoelectric sensor

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510388203.7A CN105006142B (en) 2015-07-04 2015-07-04 A kind of program-controlled duty ratio roll adjustment method of reflective infrared photoelectric sensor

Publications (2)

Publication Number Publication Date
CN105006142A CN105006142A (en) 2015-10-28
CN105006142B true CN105006142B (en) 2018-10-02

Family

ID=54378796

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510388203.7A Expired - Fee Related CN105006142B (en) 2015-07-04 2015-07-04 A kind of program-controlled duty ratio roll adjustment method of reflective infrared photoelectric sensor

Country Status (1)

Country Link
CN (1) CN105006142B (en)

Families Citing this family (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105844209B (en) * 2016-01-26 2019-12-06 孙海金 visitor identification based on infrared radiation detection
CN108490445B (en) * 2018-03-06 2022-08-02 重庆理工大学 Infrared distance measurement method and device based on pulse width detection
CN110361041B (en) * 2018-03-26 2023-03-07 欧姆龙(上海)有限公司 Light quantity calibration method, device and system
CN108679289A (en) * 2018-06-01 2018-10-19 恒洁卫浴集团有限公司 Tap infrared induction is apart from adjusting method, system and induction tap
CN109270400B (en) * 2018-11-01 2021-12-10 深圳创维数字技术有限公司 Test circuit of infrared receiving head
CN110853196A (en) * 2019-11-26 2020-02-28 广东科徕尼智能科技有限公司 Fingerprint lock, control method and control system
CN111207782A (en) * 2020-01-06 2020-05-29 厦门狄耐克智能科技股份有限公司 Environment self-adaption method based on infrared distance induction device
CN112762966A (en) * 2020-12-11 2021-05-07 湖州师范学院求真学院 Displacement sensor
CN114440943B (en) * 2022-01-27 2023-11-24 智恒(厦门)微电子有限公司 Programmable photoelectric sensor and application circuit

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN201796151U (en) * 2010-09-08 2011-04-13 无锡中星微电子有限公司 Active infrared detection device
CN202190444U (en) * 2011-08-04 2012-04-11 英飞特电子(杭州)有限公司 Non-contact type light regulating signal generating device
CN103744123B (en) * 2013-12-17 2016-09-14 上海兰宝传感科技股份有限公司 Multi-functional diffuse-reflectance formula photoelectric sensor
CN203811189U (en) * 2013-12-24 2014-09-03 上海兰宝传感科技股份有限公司 High-reliability opposite type photoelectric sensor
GB2542811A (en) * 2015-09-30 2017-04-05 Stmicroelectronics (Research & Development) Ltd Sensing apparatus having a light sensitive detector

Also Published As

Publication number Publication date
CN105006142A (en) 2015-10-28

Similar Documents

Publication Publication Date Title
CN105006142B (en) A kind of program-controlled duty ratio roll adjustment method of reflective infrared photoelectric sensor
CN105005094B (en) A kind of programmed control frequency roll adjustment method of reflective infrared photoelectric sensor
CN203661025U (en) Infrared emission tube regulating circuit and touch screen device
CN201277951Y (en) Novel quality detection apparatus for cigarette
CN207268710U (en) A kind of photovoltaic glass positive and negative detection device
CN102917473A (en) Wireless illuminometer
CN201583673U (en) Photoelectric transducer
CN205081787U (en) Light module parameter testing arrangement
CN204536833U (en) A kind of increasingly automated intelligent repelling device
CN106442252A (en) Method and system for detecting filth blockage in dust filtration mesh for filtering ambient light and household appliances
CN203632636U (en) Anti-interference photoelectric switch circuit
CN201364390Y (en) Combination type detection sensor
CN201331750Y (en) A infrared touch screen control detection system
CN203135890U (en) Light receiver
CN206788225U (en) A kind of anti-remote control electricity filching device of the intelligence with self-learning function
CN112584268B (en) Earphone light sensation calibration device and method
CN201166858Y (en) Photo-electric laser automatic counter
CN205120534U (en) Dust detection device
CN106713703B (en) A kind of radio-frequency power probe video output signals amplification system and amplification method
CN209728162U (en) A kind of ultrasonic sensor
CN203366148U (en) Humidity automatic control system
CN220543132U (en) Infrared geminate transistor induction control system with adjustable induction distance
CN218238934U (en) Infrared communication circuit and chip for ultrasonic flowmeter
CN201368993Y (en) Constant-temperature intelligent controller
CN208585169U (en) A kind of car clothing remote control system

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
CF01 Termination of patent right due to non-payment of annual fee
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20181002

Termination date: 20190704