CN104122814B - Switch acquisition transition detection circuitry and detection method thereof - Google Patents

Switch acquisition transition detection circuitry and detection method thereof Download PDF

Info

Publication number
CN104122814B
CN104122814B CN201410203616.9A CN201410203616A CN104122814B CN 104122814 B CN104122814 B CN 104122814B CN 201410203616 A CN201410203616 A CN 201410203616A CN 104122814 B CN104122814 B CN 104122814B
Authority
CN
China
Prior art keywords
unit
resistance
input
shaping
single machine
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.)
Active
Application number
CN201410203616.9A
Other languages
Chinese (zh)
Other versions
CN104122814A (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.)
Huangshan Guangyuan Photoelectric Technology Co Ltd
HUANGSHAN LONGCHENG ENERGY TECHNOLOGY Co Ltd
HUANGSHAN BEICHUAN ELECTRONIC TECHNOLOGY CO LTD
Original Assignee
Huangshan Guangyuan Photoelectric Technology Co Ltd
HUANGSHAN LONGCHENG ENERGY TECHNOLOGY Co Ltd
HUANGSHAN BEICHUAN ELECTRONIC TECHNOLOGY CO LTD
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 Huangshan Guangyuan Photoelectric Technology Co Ltd, HUANGSHAN LONGCHENG ENERGY TECHNOLOGY Co Ltd, HUANGSHAN BEICHUAN ELECTRONIC TECHNOLOGY CO LTD filed Critical Huangshan Guangyuan Photoelectric Technology Co Ltd
Priority to CN201410203616.9A priority Critical patent/CN104122814B/en
Publication of CN104122814A publication Critical patent/CN104122814A/en
Application granted granted Critical
Publication of CN104122814B publication Critical patent/CN104122814B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Abstract

The present invention relates to a kind of switch acquisition transition detection circuitry and detection method thereof.Switch acquisition transition detection circuitry includes the first switching value sampling unit, second switch amount sampling unit, the first shaping unit, the second shaping unit, signal conversion unit and single machine unit, first, second switching value sampling unit is connected with first, second input of signal conversion unit through first, second shaping unit respectively, and an outfan of signal conversion unit is connected with an input of single machine unit.Detection method is, two switching value sampling units gather double switch quantity sensor signal respectively, shaped unit shaping, is converted to a road signal by signal conversion unit by two-way reshaping signal, single machine unit judges the on off state of two sensors according to this road signal.The present invention makes the occupancy of one-chip machine port reduce half, such that it is able to use the single-chip microcomputer only possessing less I/O port, wire consumption is few, simplifies line, reduces cost.

Description

Switch acquisition transition detection circuitry and detection method thereof
Technical field
The present invention relates to a kind of sensor detection circuit gathering sensor switching value signal, particularly relate to a kind of reduce single-chip processor i/o port take several switch acquisition transition detection circuitry and detection method thereof.
Background technology
Along with automation equipment and the development of intelligent equipment, in order to realize using multiple sensor on a lot of equipment of various function, to realize gathering and controlling.As a example by mahjong machine, the position detecting circuit of mahjong machine, main employing Hall element and photoelectric sensor, every road sensor will be respectively coupled to an I/O mouth of single-chip microcomputer, or by ports-Extending chip 8 parallel-by-bit incoming serial Output Shift Register (such as 74HC165 chip), it is achieved external status is detected.Owing to the external position sensor of mahjong machine is numerous, therefore using current position detecting circuit to need to use the single-chip microcomputer possessing more I/O port, cause complete machine cost increase, even if using extended chip, cost is the highest.And, every road external sensor is required for a wire and links on the mainboard being provided with single-chip microcomputer, causes wire consumption big, and cost is significantly increased, and line is complicated, installs and keep in repair all inconvenient.
Summary of the invention
Present invention mainly solves in original sensor detection circuit, a sensor must take an I/O port of single-chip microcomputer, when there being a lot of sensors, needs to use the single-chip microcomputer possessing more I/O port, causes the technical problem that complete machine cost is substantially increased;Thering is provided a kind of switch acquisition transition detection circuitry and detection method thereof, it can make the occupancy of one-chip machine port reduce half, can select to use the single-chip microcomputer possessing less I/O port, be substantially reduced cost.
The present invention solves in original sensor detection circuit simultaneously, and every road sensor is required for a wire and links on the mainboard being provided with single-chip microcomputer, and wire consumption is big, and cost is high, and line is complicated, installs and keep in repair all inconvenient technical problem;Thering is provided a kind of switch acquisition transition detection circuitry and detection method thereof, it can make the wire being connected to be provided with on the mainboard of single-chip microcomputer reduce half, and wire consumption is few, reduces cost, and simplifies line, it is ensured that installs and keep in repair the most very convenient.
Another object of the present invention is to provide the detection method of a kind of switch acquisition transition detection circuitry, and it has good anti-interference, it is ensured that stability and the correctness to the sampled data of sensor.
The above-mentioned technical problem of the present invention is mainly addressed by following technical proposals: the switch acquisition transition detection circuitry of the present invention, including the first switching value sampling unit, second switch amount sampling unit, first shaping unit, second shaping unit, signal conversion unit and single machine unit, first, the outfan respectively with the first of second switch amount sampling unit, the input of the second shaping unit is connected, first, the outfan of the second shaping unit is connected with first input end and second input of described signal conversion unit respectively, one outfan of signal conversion unit is connected with an input of described single machine unit.First switching value sampling unit, second switch amount sampling unit includes the first Boolean value output sensor respectively, second switch quantity sensor, gather the first Boolean value output sensor and the on-off model of second switch quantity sensor respectively, flow to first the most respectively, second shaping unit, first, second shaping unit carries out shaping to the signal received respectively, signal after shaping all flows to signal conversion unit, signal conversion unit is through processing, two paths of signals is converted to a road signal and flows to an input of single machine unit, the last on off state being judged two sensors by single machine unit according to the sampled value that this input receives, carry out other follow-up process again and control.It is to say, the status signal of two Boolean value output sensors, an I/O port of single machine unit only need to be taken.Two switching value sampling units, two shaping units and a signal conversion unit regard one group as, so when needing the on-off model of ten sensors is acquired, there are five groups of above-mentioned such circuit, five signal conversion units export five road signals altogether, five road signals are connected respectively to five I/O ports of single machine unit, judge the on off state of ten Boolean value output sensors according to five signals received by single machine unit, that is, the status signal of ten Boolean value output sensors, only need to take five I/O ports of single machine unit.Therefore, use the switch acquisition transition detection circuitry of the present invention, the occupancy that can make one-chip machine port reduces half, so can select to use the single-chip microcomputer possessing less I/O port, being substantially reduced cost, and the wire making sensor be connected to be provided with on the mainboard of single-chip microcomputer also reduces half, wire consumption is few, simplify line, it is ensured that install and keep in repair the most very convenient.
As preferably, the first described switching value sampling unit includes photoelectric sensor U1, resistance R1, resistance R2 and variable resistance W1, the positive pole of the input of photoelectric sensor U1, the positive pole of outfan all meet voltage VCC, the negative pole of the input of photoelectric sensor U1 is through resistance R1 ground connection, the negative pole of the outfan of photoelectric sensor U1 is connected through one end of resistance R2 with variable resistance W1, the other end of variable resistance W1 and its movable end also connect and ground connection, resistance R2 and variable resistance W1's and contact be connected with the input of the first described shaping unit;Described second switch amount sampling unit includes photoelectric sensor U2, resistance R8, resistance R9 and variable resistance W2, the positive pole of the input of photoelectric sensor U2, the positive pole of outfan all meet voltage VCC, the negative pole of the input of photoelectric sensor U2 is through resistance R9 ground connection, the negative pole of the outfan of photoelectric sensor U2 is connected through one end of resistance R8 with variable resistance W2, the other end of variable resistance W2 and its movable end also connect and ground connection, resistance R8 and variable resistance W2's and contact be connected with the input of the second described shaping unit.The technical program breaker in middle quantity sensor uses photoelectric sensor, the putting in place or signal not in place of associated components in collecting device, certainly may be used without other Boolean value output sensors such as Hall element and realizes.
As preferably, the first described shaping unit includes resistance R3, LED 1 and audion Q1, the described outfan of the first switching value sampling unit is connected with the base stage of audion Q1, the grounded emitter of audion Q1, the colelctor electrode of audion Q1 is connected with the negative pole of LED 1, the positive pole of LED 1 meets voltage VCC through resistance R3, and the colelctor electrode of audion Q1 is connected with the first input end of described signal conversion unit;The second described shaping unit includes resistance R7, LED 2 and audion Q2, the described outfan of second switch amount sampling unit is connected with the base stage of audion Q2, the grounded emitter of audion Q2, the colelctor electrode of audion Q2 is connected with the negative pole of LED 2, the second input that the positive pole of LED 2 connects voltage VCC, the colelctor electrode of audion Q2 and described signal conversion unit through resistance R7 is connected.Shaping unit carries out shaping to the switching value waveform received, LED 1 bright expression the first switching value sampling unit blocks without object, LED 1 does not works and represents that the first switching value sampling unit has object to block, LED 2 bright expression second switch amount sampling unit blocks without object, LED 2 does not works and represents that second switch amount sampling unit has object to block, prompting is directly perceived, it is simple to equipment debugging.
As preferably, described signal conversion unit includes resistance R4, resistance R5, resistance R6, electric capacity C1 and diode D1, diode D2, described first, the outfan of the second shaping unit respectively with the negative pole of diode D1, the negative pole of diode D2 is connected, the positive pole of diode D1 is connected with one end of resistance R4, the positive pole of diode D2 is connected with one end of resistance R6, the other end of resistance R4, the other end of resistance R6 and one end of resistance R5, one end of electric capacity C1 all and is received together and is connected with an input of described single machine unit, another termination voltage VCC of resistance R5, the other end ground connection of electric capacity C1.Diode D1 and diode D2 uses cache switching diodes.Interference filter is carried out by electric capacity C1, the isolation of electric current is carried out by diode D1 and diode D2, by resistance R4, resistance R5 and the allotment of the different resistances of resistance R6, double switch signal is made to be converted to a road signal output, and this road output signal can export five kinds of level signals along with the different conditions of two-way input signal, thus corresponding with the on off state of two sensors.
As preferably, described single machine unit includes the single-chip microcomputer U3 of built-in A/D change-over circuit, and an outfan of described signal conversion unit is connected with an input of the built-in A/D change-over circuit of single-chip microcomputer U3.Use the A/D thief hatch of single-chip microcomputer, the analog signals that signal conversion unit conveying comes is converted into digital signal, then analysis, process and the computing through single-chip microcomputer, it is judged that the on off state of two sensors.The single-chip microcomputer of built-in A/D change-over circuit, can use R5F212B8SNFA LQFP64 single-chip microcomputer (Rui Sa) or SH88F516F QFP-44 single-chip microcomputer (middle grain husk) etc..Certainly, it is possible to use without the single-chip microcomputer of built-in A/D change-over circuit, then need an external A/D change-over circuit, be received by the output signal of signal conversion unit, converted after transmit signal to single-chip microcomputer again.But the circuit structure of the technical program is simpler.
The detection method of the switch acquisition transition detection circuitry of the present invention, comprises the steps:
A. first via on-off model is gathered to the first described shaping unit by the first described switching value sampling unit, the second way switch amount signal is gathered to the second described shaping unit by described second switch amount sampling unit, first shaping unit and the second shaping unit carry out shaping to the signal received respectively, signal after shaping flows to described signal conversion unit respectively, and two paths of signals is converted to a road signal and flows to an input of described single machine unit by signal conversion unit;
B. tetra-magnitudes of voltage of V1, V2, V3 and V4 determined according to described signal conversion unit, and V1 < V2 < V3 < V4 are prestored in described single machine unit;The described single machine unit signal to receiving carries out A/D conversion, it is thus achieved that voltage sample value V corresponding with the signal received;
First voltage sample value V and the magnitude of voltage V4 of acquisition are compared by c. described single machine unit, if V is > V4, are then judged as that the first switching value sampling unit and second switch amount sampling unit are turned off;If V≤V4, then voltage sample value V and magnitude of voltage V3 are compared, if V is > V3, be then judged as that the first switching value sampling unit is closed and second switch amount sampling unit is opened;If V≤V3, then voltage sample value V and magnitude of voltage V2 are compared, if V is > V2, be then judged as that the first switching value sampling unit is opened and second switch amount sampling unit is closed;If V≤V2, then voltage sample value V and magnitude of voltage V1 are compared, if V is > V1, be then judged as that the first switching value sampling unit and second switch amount sampling unit are all opened;If V≤V1, being then judged as that switch acquisition transition detection circuitry breaks down, single machine unit controls display unit display fault message and/or controls alarm unit startup warning.
Different or the resistance used resistance of the circuit of signal conversion unit is different, and tetra-magnitudes of voltage of V1, V2, V3 and V4 also can change.
As preferably, in described step b, voltage sample value V obtains through following steps:
B1. four values S1, S2, S3 and S4 are produced according to described signal conversion unit, calculating (S4-S3) × 130%, (S3-S2) × 130%, (S2-S1) × 130% and (S1-0) × 130%, the maximum taken out in this four number is pre-stored in described single machine unit as standard value N;Described single machine unit is provided with tri-data spatial caches of DATA1, DATA2 and DATA3;
B2. described single machine unit reads first A/D data X1, and interval time, t, then read second A/D data X2, then calculates meansigma methods X of X1 and X2, and is left in by X in the DATA1 of data buffer storage space;
B3. single machine unit reads the 3rd A/D data Y1, and interval time, t, then read the 4th A/D data Y2, then calculates meansigma methods Y of Y1 and Y2, and is left in by Y in the DATA2 of data buffer storage space;
B4. calculate the difference of | X-Y |, if | X-Y | is > N, is then considered as interference, returns to step b2;If | X-Y |≤N, then enter step b5;
B5. single machine unit reads the 5th A/D data Z1, and interval time, t, then read the 6th A/D data Z2, then calculates meansigma methods Z of Z1 and Z2, and is left in by Z in the DATA3 of data buffer storage space;
B6. calculate the difference of | Y-Z |, if | Y-Z | is > N, is then considered as interference, returns to step b2;If | Y-Z |≤N, then enter step b7;
B7. calculate meansigma methods M of X, Y and Z, X, Y and Z are compared with meansigma methods M respectively, remove that numerical value maximum with meansigma methods M deviation in X, Y and Z, more remaining two numerical value are averaged, it is thus achieved that voltage sample value V.
The method of sampling in the technical program, in view of the numerical error of electronic devices and components and the rise time of level conversion process and the sensitivity of fall time, carry out stabilization, effectively filter interference, ensure stability and the correctness of sampled data, it is ensured that correctly draw the on off state of two-way sensor.
As preferably, described t interval time is 5ms.
The invention has the beneficial effects as follows: two-way sensor switching value signal can be converted into a road signal and flow to single-chip microcomputer, make the occupancy of one-chip machine port reduce half, such that it is able to select to use the single-chip microcomputer possessing less I/O port, be substantially reduced cost.The wire that sensor simultaneously can be made to be connected to be provided with on the mainboard of single-chip microcomputer reduces half, and wire consumption is few, i.e. reduces cost, simplifies again line, it is ensured that installs and keep in repair the most very convenient.
Accompanying drawing explanation
Fig. 1 is a kind of circuit theory attachment structure block diagram of switch acquisition transition detection circuitry of the present invention.
Fig. 2 is a kind of circuit theory diagrams of switch acquisition transition detection circuitry of the present invention.
1. first switching value sampling unit in figure, 2. second switch amount sampling unit, 3. the first shaping unit, 4. the second shaping unit, 5. signal conversion unit, 6. single machine unit.
Detailed description of the invention
Below by embodiment, and combine accompanying drawing, technical scheme is described in further detail.
Embodiment: the switch acquisition transition detection circuitry of the present embodiment, as shown in Figure 1, including the first switching value sampling unit 1, second switch amount sampling unit 2, first shaping unit 3, second shaping unit 4, signal conversion unit 5 and single machine unit 6, first, second switch amount sampling unit 1, the outfan respectively with the first of 2, second shaping unit 3, the input of 4 is connected, first, second shaping unit 3, the outfan of 4 is connected with first input end and second input of signal conversion unit 5 respectively, one outfan of signal conversion unit 5 is connected with an input of single machine unit 6.
As in figure 2 it is shown, the first switching value sampling unit 1 includes photoelectric sensor U1, resistance R1, resistance R2 and variable resistance W1;Second switch amount sampling unit 2 includes photoelectric sensor U2, resistance R8, resistance R9 and variable resistance W2;First shaping unit 3 includes resistance R3, LED 1 and audion Q1;Second shaping unit 4 includes resistance R7, LED 2 and audion Q2;Signal conversion unit 5 includes resistance R4, resistance R5, resistance R6, electric capacity C1 and diode D1, diode D2;Single machine unit 6 includes the single-chip microcomputer U3 of built-in A/D change-over circuit, and in the present embodiment, single-chip microcomputer uses R5F212B8SNFA LQFP64 single-chip microcomputer.The positive pole of the input of photoelectric sensor U1, the positive pole of outfan all meets voltage VCC, the negative pole of the input of photoelectric sensor U1 is through resistance R1 ground connection, the negative pole of the outfan of photoelectric sensor U1 is connected through one end of resistance R2 with variable resistance W1, the other end of variable resistance W1 and its movable end also connect and ground connection, in the also contact of resistance R2 and variable resistance W1 and the first shaping unit 3, the base stage of audion Q1 is connected, the grounded emitter of audion Q1, the colelctor electrode of audion Q1 is connected with the negative pole of LED 1, the positive pole of LED 1 meets voltage VCC through resistance R3, the colelctor electrode of audion Q1 is connected with the negative pole of the diode D1 in signal conversion unit 5.The positive pole of the input of photoelectric sensor U2, the positive pole of outfan all meets voltage VCC, the negative pole of the input of photoelectric sensor U2 is through resistance R9 ground connection, the negative pole of the outfan of photoelectric sensor U2 is connected through one end of resistance R8 with variable resistance W2, the other end of variable resistance W2 and its movable end also connect and ground connection, in the also contact of resistance R8 and variable resistance W2 and the second shaping unit 4, the base stage of audion Q2 is connected, the grounded emitter of audion Q2, the colelctor electrode of audion Q2 is connected with the negative pole of LED 2, the positive pole of LED 2 meets voltage VCC through resistance R7, the colelctor electrode of audion Q2 is connected with the negative pole of diode D2 in signal conversion unit 5.The positive pole of diode D1 is connected with one end of resistance R4, the positive pole of diode D2 is connected with one end of resistance R6, the other end of resistance R4, the other end of resistance R6 and one end of resistance R5, one end of electric capacity C1 all and are received together and are connected with an input of the built-in A/D change-over circuit of single-chip microcomputer U3, the other end ground connection of another termination voltage VCC, electric capacity C1 of resistance R5.
The detection method of above-mentioned switch acquisition transition detection circuitry, comprises the steps:
A. first via on-off model is gathered to the first shaping unit 3 by the first switching value sampling unit 1, the second way switch amount signal is gathered to the second shaping unit 4 by second switch amount sampling unit 2, first shaping unit 3 and the second shaping unit 4 carry out shaping to the signal received respectively, signal after shaping flows to signal conversion unit 5 respectively, and two paths of signals is converted to the input that a road signal flows to the built-in A/D change-over circuit of single-chip microcomputer by signal conversion unit 5;
B. four values S1, S2, S3 and S4 are produced according to signal conversion unit 5, calculate V4=(S4+S3)/2, V3=(S3+S2)/2, V2=(S2+S1)/2, V1=(S1+0)/2, and tetra-magnitudes of voltage of V1, V2, V3 and V4 are pre-stored in single machine unit by V1 < V2 < V3 < V4;Calculating (S4-S3) × 130%, (S3-S2) × 130%, (S2-S1) × 130% and (S1-0) × 130%, the maximum taken out in this four number is pre-stored in single machine unit as standard value N;
B1. single-chip microcomputer is provided with tri-data spatial caches of DATA1, DATA2 and DATA3;The single-chip microcomputer signal to receiving carries out A/D conversion;
B2. single-chip microcomputer reads first A/D data X1, is spaced 5ms, then reads second A/D data X2, then calculates meansigma methods X of X1 and X2, and left in by X in the DATA1 of data buffer storage space;
B3. single-chip microcomputer reads the 3rd A/D data Y1, is spaced 5ms, then reads the 4th A/D data Y2, then calculates meansigma methods Y of Y1 and Y2, and left in by Y in the DATA2 of data buffer storage space;
B4. calculate the difference of | X-Y |, if | X-Y | is > N, is then considered as interference, returns to step b2;If | X-Y |≤N, then enter step b5;
B5. single-chip microcomputer reads the 5th A/D data Z1, is spaced 5ms, then reads the 6th A/D data Z2, then calculates meansigma methods Z of Z1 and Z2, and left in by Z in the DATA3 of data buffer storage space;
B6. calculate the difference of | Y-Z |, if | Y-Z | is > N, is then considered as interference, returns to step b2;If | Y-Z |≤N, then enter step b7;
B7. calculate meansigma methods M of X, Y and Z, X, Y and Z are compared with meansigma methods M respectively, remove that numerical value maximum with meansigma methods M deviation in X, Y and Z, more remaining two numerical value are averaged, it is thus achieved that voltage sample value V;
C. first voltage sample value V and the magnitude of voltage V4 of acquisition are compared by single-chip microcomputer, if V is > V4, are then judged as that photoelectric sensor U1 and photoelectric sensor U2 is turned off;If V≤V4, then voltage sample value V and magnitude of voltage V3 are compared, if V is > V3, be then judged as that photoelectric sensor U1 closes and photoelectric sensor U2 opens;If V≤V3, then voltage sample value V and magnitude of voltage V2 are compared, if V is > V2, be then judged as that photoelectric sensor U1 opens and photoelectric sensor U2 closes;If V≤V2, then voltage sample value V and magnitude of voltage V1 are compared, if V is > V1, be then judged as that photoelectric sensor U1 and photoelectric sensor U2 all opens;If V≤V1, be then judged as that switch acquisition transition detection circuitry breaks down, then single-chip microcomputer output signal respectively controls display unit and alarm unit, shows fault message by display unit, is started by alarm unit and reports to the police.
S1, S2, S3 and S4 tetra-value is determined by resistance R4, resistance R5 in signal conversion unit and resistance R6, the resistance of the resistance R4, resistance R5 and the resistance R6 that even select changes, then the value of S1, S2, S3 and S4 can change, then the value of four magnitudes of voltage V1, V2, V3 and V4 also can change.Specific algorithm is: assuming that the running voltage of single-chip microcomputer is VDD, then S1=((R4 × R6)/(R4 × R5+R6 × R5+R4 × R6)) × VDD, S2=(R6/ (R6+R5)) × VDD, S3=(R4/ (R4+R5)) × VDD, S4=VDD, and V4=(S4+S3)/2, V3=(S3+S2)/2, V2=(S2+S1)/2, V1=(S1+0)/2.Illustrate: assuming that the running voltage of single-chip microcomputer is VDD, resistance R4=1K, resistance R5=10K, resistance R6=15K, then S1=(15/175) VDD, S2=(15/25) VDD, S3=(1/11) VDD, S4=VDD, pass through V4=(S4+S3 again)/2, V3=(S3+S2)/2, V2=(S2+S1)/2, V1=(S1+0)/2, calculate tetra-magnitudes of voltage of V1, V2, V3 and V4 and be pre-stored in single-chip microcomputer.
Two-way sensor switching value signal is converted into a road signal and flows to single-chip microcomputer by the present invention, makes the occupancy of one-chip machine port reduce half, such that it is able to select to use the single-chip microcomputer possessing less I/O port, is substantially reduced cost.The wire that sensor simultaneously can be made to be connected to be provided with on the mainboard of single-chip microcomputer reduces half, and wire consumption is few, i.e. reduces cost, simplifies again line, it is ensured that installs and keep in repair the most very convenient.And the data sampled have stabilization function, effectively filter interference, improve stability and the reliability of sampled data, it is ensured that correctly draw the on off state of two-way sensor.

Claims (9)

1. a switch acquisition transition detection circuitry, it is characterized in that including the first switching value sampling unit (1), second switch amount sampling unit (2), first shaping unit (3), second shaping unit (4), signal conversion unit (5) and single machine unit (6), first, second switch amount sampling unit (1, 2) outfan respectively with the first, second shaping unit (3, 4) input is connected, first, second shaping unit (3, 4) outfan is connected with first input end and second input of described signal conversion unit (5) respectively, one outfan of signal conversion unit (5) is connected with an input of described single machine unit (6).
Switch acquisition transition detection circuitry the most according to claim 1, it is characterized in that the first described switching value sampling unit (1) includes photoelectric sensor U1, resistance R1, resistance R2 and variable resistance W1, the positive pole of the input of photoelectric sensor U1, the positive pole of outfan all meets voltage VCC, the negative pole of the input of photoelectric sensor U1 is through resistance R1 ground connection, the negative pole of the outfan of photoelectric sensor U1 is connected through one end of resistance R2 with variable resistance W1, the other end of variable resistance W1 and its movable end also connect and ground connection, the also contact of resistance R2 and variable resistance W1 is connected with the input of described the first shaping unit (3);Described second switch amount sampling unit (2) includes photoelectric sensor U2, resistance R8, resistance R9 and variable resistance W2, the positive pole of the input of photoelectric sensor U2, the positive pole of outfan all meet voltage VCC, the negative pole of the input of photoelectric sensor U2 is through resistance R9 ground connection, the negative pole of the outfan of photoelectric sensor U2 is connected through one end of resistance R8 with variable resistance W2, the other end of variable resistance W2 and its movable end also connect and ground connection, resistance R8 and variable resistance W2's and contact be connected with the input of described the second shaping unit (4).
Switch acquisition transition detection circuitry the most according to claim 1 and 2, it is characterized in that described the first shaping unit (3) includes resistance R3, LED 1 and audion Q1, the outfan of the first described switching value sampling unit (1) is connected with the base stage of audion Q1, the grounded emitter of audion Q1, the colelctor electrode of audion Q1 is connected with the negative pole of LED 1, the positive pole of LED 1 meets voltage VCC through resistance R3, and the colelctor electrode of audion Q1 is connected with the first input end of described signal conversion unit (5);Described the second shaping unit (4) includes resistance R7, LED 2 and audion Q2, the described outfan of second switch amount sampling unit (2) is connected with the base stage of audion Q2, the grounded emitter of audion Q2, the colelctor electrode of audion Q2 is connected with the negative pole of LED 2, the positive pole of LED 2 meets voltage VCC through resistance R7, and the colelctor electrode of audion Q2 is connected with the second input of described signal conversion unit (5).
Switch acquisition transition detection circuitry the most according to claim 1 and 2, it is characterized in that described signal conversion unit (5) includes resistance R4, resistance R5, resistance R6, electric capacity C1 and diode D1, diode D2, described first, second shaping unit (3, 4) outfan respectively with the negative pole of diode D1, the negative pole of diode D2 is connected, the positive pole of diode D1 is connected with one end of resistance R4, the positive pole of diode D2 is connected with one end of resistance R6, the other end of resistance R4, the other end of resistance R6 and one end of resistance R5, one end of electric capacity C1 all and is received together and is connected with an input of described single machine unit (6), another termination voltage VCC of resistance R5, the other end ground connection of electric capacity C1.
Switch acquisition transition detection circuitry the most according to claim 3, it is characterized in that described signal conversion unit (5) includes resistance R4, resistance R5, resistance R6, electric capacity C1 and diode D1, diode D2, described first, second shaping unit (3, 4) outfan respectively with the negative pole of diode D1, the negative pole of diode D2 is connected, the positive pole of diode D1 is connected with one end of resistance R4, the positive pole of diode D2 is connected with one end of resistance R6, the other end of resistance R4, the other end of resistance R6 and one end of resistance R5, one end of electric capacity C1 all and is received together and is connected with an input of described single machine unit (6), another termination voltage VCC of resistance R5, the other end ground connection of electric capacity C1.
Switch acquisition transition detection circuitry the most according to claim 1 and 2, it is characterized in that described single machine unit (6) includes that the single-chip microcomputer U3 of built-in A/D change-over circuit, an outfan of described signal conversion unit (5) are connected with an input of the built-in A/D change-over circuit of single-chip microcomputer U3.
7. the detection method of a switch acquisition transition detection circuitry as claimed in claim 1, it is characterised in that comprise the steps:
A. first via on-off model is gathered to described the first shaping unit (3) by the first described switching value sampling unit (1), the second way switch amount signal is gathered to described the second shaping unit (4) by described second switch amount sampling unit (2), first shaping unit (3) and the second shaping unit (4) carry out shaping to the signal received respectively, signal after shaping flows to described signal conversion unit (5) respectively, and two paths of signals is converted to a road signal and flows to an input of described single machine unit (6) by signal conversion unit (5);
b. Tetra-magnitudes of voltage of V1, V2, V3 and V4 determined according to described signal conversion unit (5), and V1 < V2 < V3 < V4 is prestored in described single machine unit (6);The described single machine unit (6) signal to receiving carries out A/D conversion, it is thus achieved that voltage sample value V corresponding with the signal received;
First voltage sample value V and the magnitude of voltage V4 of acquisition are compared by c. described single machine unit (6), if V is > V4, are then judged as that the first switching value sampling unit and second switch amount sampling unit are turned off;If V≤V4, then voltage sample value V and magnitude of voltage V3 are compared, if V is > V3, be then judged as that the first switching value sampling unit is closed and second switch amount sampling unit is opened;If V≤V3, then voltage sample value V and magnitude of voltage V2 are compared, if V is > V2, be then judged as that the first switching value sampling unit is opened and second switch amount sampling unit is closed;If V≤V2, then voltage sample value V and magnitude of voltage V1 are compared, if V is > V1, be then judged as that the first switching value sampling unit and second switch amount sampling unit are all opened;If V≤V1, being then judged as that switch acquisition transition detection circuitry breaks down, single machine unit (6) controls display unit display fault message and/or controls alarm unit startup warning.
The detection method of switch acquisition transition detection circuitry the most according to claim 7, it is characterised in that in described step b, voltage sample value V obtains through following steps:
B1. four values S1, S2, S3 and S4 are produced according to described signal conversion unit (5), calculating (S4-S3) × 130%, (S3-S2) × 130%, (S2-S1) × 130% and (S1-0) × 130%, the maximum taken out in this four number is pre-stored in described single machine unit (6) as standard value N;Described single machine unit (6) is provided with tri-data spatial caches of DATA1, DATA2 and DATA3;
B2. described single machine unit (6) reads first A/D data X1, and interval time, t, then read second A/D data X2, then calculates meansigma methods X of X1 and X2, and is left in by X in the DATA1 of data buffer storage space;
B3. single machine unit (6) reads the 3rd A/D data Y1, and interval time, t, then read the 4th A/D data Y2, then calculates meansigma methods Y of Y1 and Y2, and is left in by Y in the DATA2 of data buffer storage space;
B4. calculate the difference of | X-Y |, if | X-Y | is > N, is then considered as interference, returns to step b2;If | X-Y |≤N, then enter step b5;
B5. single machine unit (6) reads the 5th A/D data Z1, and interval time, t, then read the 6th A/D data Z2, then calculates meansigma methods Z of Z1 and Z2, and is left in by Z in the DATA3 of data buffer storage space;
B6. calculate the difference of | Y-Z |, if | Y-Z | is > N, is then considered as interference, returns to step b2;If | Y-Z |≤N, then enter step b7;
B7. calculate meansigma methods M of X, Y and Z, X, Y and Z are compared with meansigma methods M respectively, remove that numerical value maximum with meansigma methods M deviation in X, Y and Z, more remaining two numerical value are averaged, it is thus achieved that voltage sample value V.
The detection method of switch acquisition transition detection circuitry the most according to claim 8, it is characterised in that described t interval time is 5ms.
CN201410203616.9A 2014-05-14 2014-05-14 Switch acquisition transition detection circuitry and detection method thereof Active CN104122814B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410203616.9A CN104122814B (en) 2014-05-14 2014-05-14 Switch acquisition transition detection circuitry and detection method thereof

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410203616.9A CN104122814B (en) 2014-05-14 2014-05-14 Switch acquisition transition detection circuitry and detection method thereof

Publications (2)

Publication Number Publication Date
CN104122814A CN104122814A (en) 2014-10-29
CN104122814B true CN104122814B (en) 2017-01-04

Family

ID=51768270

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410203616.9A Active CN104122814B (en) 2014-05-14 2014-05-14 Switch acquisition transition detection circuitry and detection method thereof

Country Status (1)

Country Link
CN (1) CN104122814B (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104901340A (en) * 2015-05-18 2015-09-09 北京四方继保自动化股份有限公司 Sample machine-based photovoltaic power adjusting method
CN105203146A (en) * 2015-09-23 2015-12-30 浪潮集团有限公司 Sensor interconnection device and sensor detection system and method
CN105425685B (en) * 2015-12-30 2018-02-09 青岛歌尔声学科技有限公司 A kind of dual sensor signal acquisition circuit
CN111341712B (en) * 2018-12-19 2023-05-16 北京北方华创微电子装备有限公司 Wafer position calibration device and method
CN112669616B (en) * 2020-12-25 2022-04-08 中津沛科建设股份有限公司 Vehicle detection method and device

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN201247401Y (en) * 2008-08-25 2009-05-27 中国矿业大学 Apparatus for collecting and processing signal of subway stray current optical fiber sensing system
CN201773173U (en) * 2010-06-24 2011-03-23 贠国保 Multi-way switching value detection circuit
CN203930411U (en) * 2014-05-14 2014-11-05 黄山市北川电子科技有限公司 A kind of switch acquisition change-over circuit

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN201247401Y (en) * 2008-08-25 2009-05-27 中国矿业大学 Apparatus for collecting and processing signal of subway stray current optical fiber sensing system
CN201773173U (en) * 2010-06-24 2011-03-23 贠国保 Multi-way switching value detection circuit
CN203930411U (en) * 2014-05-14 2014-11-05 黄山市北川电子科技有限公司 A kind of switch acquisition change-over circuit

Also Published As

Publication number Publication date
CN104122814A (en) 2014-10-29

Similar Documents

Publication Publication Date Title
CN104122814B (en) Switch acquisition transition detection circuitry and detection method thereof
CN101477166B (en) Wire harness test control panel and wire harness test control method
CN103916116A (en) Interface level switch device
CN204215209U (en) For the signal conditioning circuit of data collector in drawout cubicle
CN102353477A (en) Temperature sensor detection device
CN103176418A (en) Address coding method for intelligent feeder switch module in power system
CN203930411U (en) A kind of switch acquisition change-over circuit
CN109324553A (en) A kind of standardization detection module interface
CN203965551U (en) A kind of multichannel transmitters sense device
CN103529353B (en) Winding displacement detection method and winding displacement detection system
CN104991198A (en) Battery tour inspection processing circuit based on ARM platform multichannel switching
CN203274875U (en) CAN bus based automobile axle weight detecting instrument
CN101294990B (en) Current/voltage inbreak testing apparatus
CN210863962U (en) Hall switch valve detection circuitry that targets in place
CN209055644U (en) A kind of device of multi-mode battery capacity indication
CN202974475U (en) Storage battery temperature measuring equipment
CN106335452B (en) A kind of general mobile unit collection of simulant signal processing system
CN102722158A (en) Distributed vegetable planting greenhouse monitoring system based on CAN (Controller Area Network) bus
CN2762070Y (en) Vibrating string sensor capable of directly reading pressure
CN205679962U (en) Split-type mini multifunctional concrete temperature intelligent online monitoring system
CN205384725U (en) Motormeter alarm signal's detection control apparatus
CN205910534U (en) Polymorphic type sensor signal self -adaptation data acquisition device
CN110618380A (en) Hall switch valve detection circuitry that targets in place
CN204498108U (en) Port status Acquisition Circuit
CN202101800U (en) Automobile chassis dynamometer

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant