CN104122814A - Switching volume acquisition and conversion detection circuit and detection method thereof - Google Patents

Switching volume acquisition and conversion detection circuit and detection method thereof Download PDF

Info

Publication number
CN104122814A
CN104122814A CN201410203616.9A CN201410203616A CN104122814A CN 104122814 A CN104122814 A CN 104122814A CN 201410203616 A CN201410203616 A CN 201410203616A CN 104122814 A CN104122814 A CN 104122814A
Authority
CN
China
Prior art keywords
unit
resistance
input end
shaping
signal conversion
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.)
Granted
Application number
CN201410203616.9A
Other languages
Chinese (zh)
Other versions
CN104122814B (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

Landscapes

  • Electronic Switches (AREA)

Abstract

The invention relates to a switching volume acquisition and conversion detection circuit and a detection method thereof. The switching volume acquisition and conversion detection circuit comprises a first switching volume sampling unit, a second switching volume sampling unit, a first shaping unit, a second shaping unit, a signal conversion unit and a single chip microcomputer unit, wherein the first switching volume sampling unit and the second switching volume sampling unit are respectively connected with the first input end and the second input end of the signal conversion unit through the first shaping unit and the second shaping unit, and one output end of the signal conversion unit is connected with one input end of the single chip microcomputer unit. The detection method comprises the steps that the two switching volume sampling units respectively acquire two switching volume sensor signals, the signals are shaped by the shaping units, two shaped signals are converted into one signal by the signal conversion unit, and the single chip microcomputer unit judges switching states of two sensors according to the signal. The number of occupied single chip microcomputer ports can be decreased by half, accordingly a single chip microcomputer only provided with few I/O ports can be used, the using amount of lead wires can be small, wire connection can be simplified, and the cost can be reduced.

Description

Switch acquisition transition detection circuitry and detection method thereof
Technical field
The present invention relates to a kind of sensor detection circuit of pick-up transducers switching value signal, relate in particular to a kind of taking of single-chip processor i/o port several switch acquisition transition detection circuitry and detection method thereof of reducing.
Background technology
Along with the development of automation equipment and intelligent equipment, in order to realize on a lot of equipment of various functions, can use a plurality of sensors, to realize, gather and control.Take mahjong machine as example, the position detecting circuit of mahjong machine, main Hall element and the photoelectric sensor of adopting, every road sensor all will be linked respectively an I/O mouth of single-chip microcomputer, or by ports-Extending chip 8 bit parallel input string line output shift registers (as 74HC165 chip), realize external status is detected.Because the external position sensor of mahjong machine is numerous, therefore adopt current position detecting circuit need to use the single-chip microcomputer that possesses more I/O ports, cause complete machine cost to rise, even if use extended chip, cost is also still very high.And every road external sensor all needs to have a wire to link on the mainboard that single-chip microcomputer is installed, and causes wire consumption large, cost significantly increases, and line is complicated, installs and keep in repair all inconvenient.
Summary of the invention
The present invention mainly solves in original sensor detection circuit, and a sensor must take an I/O port of single-chip microcomputer, when having a lot of sensors, needs to use the single-chip microcomputer that possesses more I/O ports, the technical matters that causes complete machine cost significantly to rise; A kind of switch acquisition transition detection circuitry and detection method thereof are provided, and it can make the occupancy of one-chip machine port reduce half, can choice for use possesses the single-chip microcomputer of less I/O port, greatly reduces costs.
The present invention solves in original sensor detection circuit simultaneously, and every road sensor all needs to have a wire to link on the mainboard that single-chip microcomputer is installed, and wire consumption is large, and cost is high, and line is complicated, installs and keep in repair all inconvenient technical matters; A kind of switch acquisition transition detection circuitry and detection method thereof are provided, and it can make the wire being connected on the mainboard that single-chip microcomputer is installed reduce half, and wire consumption is few, reduces costs, and simplifies line, guarantees to install and keep in repair all very convenient.
Another object of the present invention is to provide a kind of detection method of switch acquisition transition detection circuitry, and it has good anti-interference, guarantees the stability of the sampled data of sensor and correctness.
Above-mentioned technical matters of the present invention is mainly solved by following technical proposals: switch acquisition transition detection circuitry of the present invention, comprise 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, the output terminal respectively with the first of second switch amount sampling unit, the input end of the second shaping unit is connected, first, the output terminal of the second shaping unit is connected with first input end and second input end of described signal conversion unit respectively, output terminal of signal conversion unit is connected with an input end of described single machine unit.The first switching value sampling unit, second switch amount sampling unit comprises respectively the first Boolean value output sensor, second switch quantity sensor, gather respectively the switching value signal of the first Boolean value output sensor and second switch quantity sensor, flow to respectively first again, the second shaping unit, first, the second shaping unit carries out respectively shaping to the received signal, 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 end of single machine unit, the last sampled value being received according to this input end by single machine unit is judged the on off state of two sensors, carry out again follow-up other processing and control.That is to say that the status signal of two Boolean value output sensors only need take an I/O port of single machine unit.Two switching value sampling units, two shaping units and a signal conversion unit are regarded one group as, so in the time need to gathering the switching value signal of ten sensors, there are five groups of above-mentioned such circuit, five signal conversion units are exported five road signals altogether, five road signals are connected respectively to five I/O ports of single machine unit, by single machine unit, according to five signals that receive, judged the on off state of ten Boolean value output sensors, that is to say, the status signal of ten Boolean value output sensors, only need take five I/O ports of single machine unit.Therefore, use switch acquisition transition detection circuitry of the present invention, can make the occupancy of one-chip machine port reduce half, so can choice for use possess the single-chip microcomputer of less I/O port, greatly reduce costs, and sensor is connected to be provided with the wire on the mainboard of single-chip microcomputer also to reduce half, wire consumption is few, simplify line, guarantee to install and keep in repair all very convenient.
As preferably, the first described switching value sampling unit comprises photoelectric sensor U1, resistance R 1, resistance R 2 and variable resistor W1, the positive pole of the input end of photoelectric sensor U1, the positive pole of output terminal all meet voltage VCC, the negative pole of the input end of photoelectric sensor U1 is through resistance R 1 ground connection, the negative pole of the output terminal of photoelectric sensor U1 is connected with one end of variable resistor W1 through resistance R 2, the other end of variable resistor W1 and its movable end also connect and ground connection, and the also contact of resistance R 2 and variable resistor W1 is connected with the input end of the first described shaping unit; Described second switch amount sampling unit comprises photoelectric sensor U2, resistance R 8, resistance R 9 and variable resistor W2, the positive pole of the input end of photoelectric sensor U2, the positive pole of output terminal all meet voltage VCC, the negative pole of the input end of photoelectric sensor U2 is through resistance R 9 ground connection, the negative pole of the output terminal of photoelectric sensor U2 is connected with one end of variable resistor W2 through resistance R 8, the other end of variable resistor W2 and its movable end also connect and ground connection, and the also contact of resistance R 8 and variable resistor W2 is connected with the input end of the second described shaping unit.In the technical program, Boolean value output sensor adopts photoelectric sensor, and the putting in place or signal not in place of associated components in collecting device, also can adopt other Boolean value output sensors such as Hall element to realize certainly.
As preferably, the first described shaping unit comprises resistance R 3, LED 1 and triode Q1, the output terminal of the first described switching value sampling unit is connected with the base stage of triode Q1, the grounded emitter of triode Q1, the collector of triode Q1 is connected with the negative pole of LED 1, the positive pole of LED 1 meets voltage VCC through resistance R 3, and the collector of triode Q1 is connected with the first input end of described signal conversion unit; The second described shaping unit comprises resistance R 7, LED 2 and triode Q2, the output terminal of described second switch amount sampling unit is connected with the base stage of triode Q2, the grounded emitter of triode Q2, the collector of triode Q2 is connected with the negative pole of LED 2, the positive pole of LED 2 meets voltage VCC through resistance R 7, and the second input end of the collector of triode Q2 and described signal conversion unit is connected.Shaping unit carries out shaping to the switching value waveform receiving, bright expression the first switching value sampling unit of LED 1 blocks without object, LED 1 does not work and represents that the first switching value sampling unit has object to block, the bright expression second switch of LED 2 amount sampling unit blocks without object, LED 2 does not work and represents that second switch amount sampling unit has object to block, prompting is directly perceived, is convenient to equipment debugging.
As preferably, described signal conversion unit comprises resistance R 4, resistance R 5, resistance R 6, capacitor C 1 and diode D1, diode D2, described first, the output terminal 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 R 4, the positive pole of diode D2 is connected with one end of resistance R 6, the other end of resistance R 4, one end of the other end of resistance R 6 and resistance R 5, one end of capacitor C 1 all and receive together and be connected with an input end of described single machine unit, another termination voltage VCC of resistance R 5, the other end ground connection of capacitor C 1.Diode D1 and diode D2 adopt cache switching diodes.By capacitor C 1, carry out interference filter, by diode D1 and diode D2, carry out the isolation of electric current, the allotment of the different resistances by resistance R 4, resistance R 5 and resistance R 6, make double switch signal be converted to a road signal output, and this road output signal can be along with five kinds of level signals of different conditions output of two-way input signal, thus corresponding with the on off state of two sensors.
As preferably, described single machine unit comprises the single-chip microcomputer U3 of built-in A/D change-over circuit, and an input end of output terminal of described signal conversion unit and the built-in A/D change-over circuit of single-chip microcomputer U3 is connected.Use the A/D thief hatch of single-chip microcomputer, carry the signal that simulates of coming to convert digital signal to signal conversion unit, then through analysis, processing and the computing of single-chip microcomputer, judge the on off state of two sensors.The single-chip microcomputer of built-in A/D change-over circuit, can adopt R5F212B8SNFA LQFP64 single-chip microcomputer (Rui Sa) or SH88F516F QFP-44 single-chip microcomputer (middle grain husk) etc.Certainly, also can adopt the single-chip microcomputer of not being with built-in A/D change-over circuit, need so to have an external A/D change-over circuit, by it, receive the output signal of signal conversion unit, after conversion, transmit signal to again single-chip microcomputer.But the circuit structure of the technical program is simpler.
The detection method of switch acquisition transition detection circuitry of the present invention, comprises the steps:
A. by the first described switching value sampling unit, gather first via switching value signal to the first described shaping unit, by described second switch amount sampling unit, gather the second way switch amount signal to the second described shaping unit, the first shaping unit and the second shaping unit carry out respectively shaping to the received signal, signal after shaping flows to respectively described signal conversion unit, and signal conversion unit is converted to by two paths of signals the input end that a road signal flows to described single machine unit;
B. in described single machine unit, prestore V1, V2, V3 and tetra-magnitudes of voltage of V4 that determine according to described signal conversion unit, and V1 < V2 < V3 < V4; Described single machine unit is carried out A/D conversion to the received signal, voltage sample value V corresponding to signal that obtains and receive;
C. described single machine unit is first by the voltage sample value V and the magnitude of voltage V4 comparison that obtain, if V > is V4, is judged as the first switching value sampling unit and second switch amount sampling unit is all closed; If V≤V4, by voltage sample value V and magnitude of voltage V3 comparison, if V > is V3, is judged as that the first switching value sampling unit is closed and second switch amount sampling unit is opened; If V≤V3, by voltage sample value V and magnitude of voltage V2 comparison, if V > is V2, is judged as that the first switching value sampling unit is opened and second switch amount sampling unit is closed; If V≤V2, by voltage sample value V and magnitude of voltage V1 comparison, if V > is V1, is judged as the first switching value sampling unit and second switch amount sampling unit is all opened; If V≤V1, is judged as switch acquisition transition detection circuitry and breaks down, single machine unit is controlled display unit and is shown failure message and/or control alarm unit startup and report to the police.
The circuit resistances different or resistance used of signal conversion unit are different, and V1, V2, V3 and tetra-magnitudes of voltage of V4 also can change.
As preferably, in described step b, voltage sample value V obtains through following steps:
B1. according to described signal conversion unit, produce four values S1, S2, S3 and S4, calculate (S4-S3) * 130%, (S3-S2) * 130%, (S2-S1) * 130% and (S1-0) * 130%, the maximal value of taking out in this four number is pre-stored in described single machine unit as standard value N; Described single machine unit is provided with DATA1, DATA2 and tri-data spatial caches of 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 the mean value X of X1 and X2, and X is left in the DATA1 of data buffer storage space;
B3. single machine unit reads the 3rd A/D data Y 1, and interval time, t, then read the 4th A/D data Y 2, then calculates the mean value Y of Y1 and Y2, and Y is left in the DATA2 of data buffer storage space;
B4. calculate | the difference of X-Y|, if | X-Y| > N, be considered as disturbing, get back to step b2; If | X-Y|≤N, enters 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 the mean value Z of Z1 and Z2, and Z is left in the DATA3 of data buffer storage space;
B6. calculate | the difference of Y-Z|, if | Y-Z| > N, be considered as disturbing, get back to step b2; If | Y-Z|≤N, enters step b7;
B7. calculate the mean value M of X, Y and Z, X, Y and Z are compared with mean value M respectively, remove in X, Y and Z that numerical value with mean value M deviation maximum, more remaining two numerical value are averaged, obtain voltage sample value V.
The method of sampling in the technical program, consider numerical error and the rise time of level conversion process and the sensitivity of fall time of electronic devices and components, carry out anti-shakely, effectively filter and disturb, guarantee stability and the correctness of sampled data, guarantee correctly to 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 to a road signal and flow to single-chip microcomputer, make the occupancy of one-chip machine port reduce half, thereby can choice for use possess the single-chip microcomputer of less I/O port, greatly reduce costs.The wire that can make sensor be connected on the mainboard that single-chip microcomputer is installed reduces half simultaneously, and wire consumption is few, reduces costs, and simplifies again line, guarantees to install and keep in repair all very convenient.
Accompanying drawing explanation
Fig. 1 is a kind of circuit theory syndeton 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 units 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.
Embodiment
Below by embodiment, and by reference to the accompanying drawings, technical scheme of the present invention is described in further detail.
Embodiment: the switch acquisition transition detection circuitry of the present embodiment, as shown in Figure 1, comprise the first switching value sampling unit 1, second switch amount sampling unit 2, the first shaping unit 3, the second shaping unit 4, signal conversion unit 5 and single machine unit 6, first, second switch amount sampling unit 1, 2 output terminal respectively with the first, the second shaping unit 3, 4 input end is connected, first, the second shaping unit 3, 4 output terminal is connected with first input end and second input end of signal conversion unit 5 respectively, output terminal of signal conversion unit 5 and an input end of single machine unit 6 are connected.
As shown in Figure 2, the first switching value sampling unit 1 comprises photoelectric sensor U1, resistance R 1, resistance R 2 and variable resistor W1; Second switch amount sampling unit 2 comprises photoelectric sensor U2, resistance R 8, resistance R 9 and variable resistor W2; The first shaping unit 3 comprises resistance R 3, LED 1 and triode Q1; The second shaping unit 4 comprises resistance R 7, LED 2 and triode Q2; Signal conversion unit 5 comprises resistance R 4, resistance R 5, resistance R 6, capacitor C 1 and diode D1, diode D2; Single machine unit 6 comprises the single-chip microcomputer U3 of built-in A/D change-over circuit, and in the present embodiment, single-chip microcomputer adopts R5F212B8SNFA LQFP64 single-chip microcomputer.The positive pole of the input end of photoelectric sensor U1, the positive pole of output terminal all meets voltage VCC, the negative pole of the input end of photoelectric sensor U1 is through resistance R 1 ground connection, the negative pole of the output terminal of photoelectric sensor U1 is connected with one end of variable resistor W1 through resistance R 2, the other end of variable resistor W1 and its movable end also connect and ground connection, resistance R 2 and variable resistor W1 and contact is connected with the base stage of triode Q1 in the first shaping unit 3, the grounded emitter of triode Q1, the collector of triode Q1 is connected with the negative pole of LED 1, the positive pole of LED 1 meets voltage VCC through resistance R 3, the negative pole of the collector of triode Q1 and diode D1 in signal conversion unit 5 is connected.The positive pole of the input end of photoelectric sensor U2, the positive pole of output terminal all meets voltage VCC, the negative pole of the input end of photoelectric sensor U2 is through resistance R 9 ground connection, the negative pole of the output terminal of photoelectric sensor U2 is connected with one end of variable resistor W2 through resistance R 8, the other end of variable resistor W2 and its movable end also connect and ground connection, resistance R 8 and variable resistor W2 and contact is connected with the base stage of triode Q2 in the second shaping unit 4, the grounded emitter of triode Q2, the collector of triode Q2 is connected with the negative pole of LED 2, the positive pole of LED 2 meets voltage VCC through resistance R 7, the collector of triode 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 R 4, the positive pole of diode D2 is connected with one end of resistance R 6, one end of one end of the other end of the other end of resistance R 4, resistance R 6 and resistance R 5, capacitor C 1 all and receive together and be connected with an input end of the built-in A/D change-over circuit of single-chip microcomputer U3, another termination voltage VCC of resistance R 5, the other end ground connection of capacitor C 1.
The detection method of above-mentioned switch acquisition transition detection circuitry, comprises the steps:
A. by the first switching value sampling unit 1, gather first via switching value signal to the first shaping unit 3, by second switch amount sampling unit 2, gather the second way switch amount signal to the second shaping unit 4, the first shaping unit 3 and the second shaping unit 4 carry out respectively shaping to the received signal, signal after shaping flows to respectively signal conversion unit 5, and signal conversion unit 5 is converted to by two paths of signals the input end that a road signal flows to the built-in A/D change-over circuit of single-chip microcomputer;
B. according to signal conversion unit 5, produce four values S1, S2, S3 and S4, calculate V4=(S4+S3)/2, V3=(S3+S2)/2, V2=(S2+S1)/2, V1=(S1+0)/2, and V1 < V2 < V3 < V4, is pre-stored in V1, V2, V3 and tetra-magnitudes of voltage of V4 in single machine unit; Calculate (S4-S3) * 130%, (S3-S2) * 130%, (S2-S1) * 130% and (S1-0) * 130%, the maximal value of taking out in this four number is pre-stored in single machine unit as standard value N;
B1. single-chip microcomputer is provided with DATA1, DATA2 and tri-data spatial caches of DATA3; Single-chip microcomputer carries out A/D conversion to the received signal;
B2. single-chip microcomputer reads first A/D data X1, interval 5ms, then read second A/D data X2, then calculate the mean value X of X1 and X2, and X is left in the DATA1 of data buffer storage space;
B3. single-chip microcomputer reads the 3rd A/D data Y 1, interval 5ms, then read the 4th A/D data Y 2, then calculate the mean value Y of Y1 and Y2, and Y is left in the DATA2 of data buffer storage space;
B4. calculate | the difference of X-Y|, if | X-Y| > N, be considered as disturbing, get back to step b2; If | X-Y|≤N, enters step b5;
B5. single-chip microcomputer reads the 5th A/D data Z1, interval 5ms, then read the 6th A/D data Z2, then calculate the mean value Z of Z1 and Z2, and Z is left in the DATA3 of data buffer storage space;
B6. calculate | the difference of Y-Z|, if | Y-Z| > N, be considered as disturbing, get back to step b2; If | Y-Z|≤N, enters step b7;
B7. calculate the mean value M of X, Y and Z, X, Y and Z are compared with mean value M respectively, remove in X, Y and Z that numerical value with mean value M deviation maximum, more remaining two numerical value are averaged, obtain voltage sample value V;
C. single-chip microcomputer is first by the voltage sample value V and the magnitude of voltage V4 comparison that obtain, if V > is V4, is judged as photoelectric sensor U1 and photoelectric sensor U2 all closes; If V≤V4, by voltage sample value V and magnitude of voltage V3 comparison, if V > is V3, is judged as that photoelectric sensor U1 closes and photoelectric sensor U2 opens; If V≤V3, by voltage sample value V and magnitude of voltage V2 comparison, if V > is V2, is judged as that photoelectric sensor U1 opens and photoelectric sensor U2 closes; If V≤V2, by voltage sample value V and magnitude of voltage V1 comparison, if V > is V1, is judged as photoelectric sensor U1 and photoelectric sensor U2 all opens; If V≤V1, is judged as switch acquisition transition detection circuitry and breaks down, single-chip microcomputer difference output signal is controlled display unit and alarm unit, by display unit, shows failure message, by alarm unit, starts warning.
S1, S2, S3 and tetra-values of S4 resistance R 4, resistance R 5 and resistance R 6 in signal conversion unit determine, the resistance of the resistance R 4 of even selecting, resistance R 5 and resistance R 6 changes, the value of S1, S2, S3 and S4 can change, and the value of four magnitude of voltage V1, V2, V3 and V4 also can change.Specific algorithm is: the operating voltage of supposition single-chip microcomputer is VDD, 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: the operating voltage of supposition single-chip microcomputer is VDD, resistance R 4=1K, resistance R 5=10K, resistance R 6=15K, S1=(15/175) VDD, S2=(15/25) VDD, S3=(1/11) VDD, S4=VDD, pass through again V4=(S4+S3)/2, V3=(S3+S2)/2, V2=(S2+S1)/2, V1=(S1+0)/2, calculate V1, V2, V3 and tetra-magnitudes of voltage of V4 and are pre-stored in single-chip microcomputer.
The present invention converts two-way sensor switching value signal to a road signal and flows to single-chip microcomputer, makes the occupancy of one-chip machine port reduce half, thereby can choice for use possesses the single-chip microcomputer of less I/O port, greatly reduces costs.The wire that can make sensor be connected on the mainboard that single-chip microcomputer is installed reduces half simultaneously, and wire consumption is few, reduces costs, and simplifies again line, guarantees to install and keep in repair all very convenient.And the data that sample have anti-trembling function, effectively filter and disturb, improve stability and the reliability of sampled data, guarantee correctly to draw the on off state of two-way sensor.

Claims (9)

1. a switch acquisition transition detection circuitry, it is characterized in that comprising the first switching value sampling unit (1), second switch amount sampling unit (2), the first shaping unit (3), the second shaping unit (4), signal conversion unit (5) and single machine unit (6), first, second switch amount sampling unit (1, 2) output terminal respectively with the first, the second shaping unit (3, 4) input end is connected, first, the second shaping unit (3, 4) output terminal is connected with first input end and second input end of described signal conversion unit (5) respectively, output terminal of signal conversion unit (5) is connected with an input end of described single machine unit (6).
2. switch acquisition transition detection circuitry according to claim 1, it is characterized in that the first described switching value sampling unit (1) comprises photoelectric sensor U1, resistance R 1, resistance R 2 and variable resistor W1, the positive pole of the input end of photoelectric sensor U1, the positive pole of output terminal all meets voltage VCC, the negative pole of the input end of photoelectric sensor U1 is through resistance R 1 ground connection, the negative pole of the output terminal of photoelectric sensor U1 is connected with one end of variable resistor W1 through resistance R 2, the other end of variable resistor W1 and its movable end also connect and ground connection, the also contact of resistance R 2 and variable resistor W1 is connected with the input end of described the first shaping unit (3), described second switch amount sampling unit (2) comprises photoelectric sensor U2, resistance R 8, resistance R 9 and variable resistor W2, the positive pole of the input end of photoelectric sensor U2, the positive pole of output terminal all meet voltage VCC, the negative pole of the input end of photoelectric sensor U2 is through resistance R 9 ground connection, the negative pole of the output terminal of photoelectric sensor U2 is connected with one end of variable resistor W2 through resistance R 8, the other end of variable resistor W2 and its movable end also connect and ground connection, and the also contact of resistance R 8 and variable resistor W2 is connected with the input end of described the second shaping unit (4).
3. switch acquisition transition detection circuitry according to claim 1 and 2, it is characterized in that described the first shaping unit (3) comprises resistance R 3, LED 1 and triode Q1, the output terminal of the first described switching value sampling unit (1) is connected with the base stage of triode Q1, the grounded emitter of triode Q1, the collector of triode Q1 is connected with the negative pole of LED 1, the positive pole of LED 1 meets voltage VCC through resistance R 3, and the collector of triode Q1 is connected with the first input end of described signal conversion unit (5); Described the second shaping unit (4) comprises resistance R 7, LED 2 and triode Q2, the output terminal of described second switch amount sampling unit (2) is connected with the base stage of triode Q2, the grounded emitter of triode Q2, the collector of triode Q2 is connected with the negative pole of LED 2, the positive pole of LED 2 meets voltage VCC through resistance R 7, and the collector of triode Q2 is connected with the second input end of described signal conversion unit (5).
4. switch acquisition transition detection circuitry according to claim 1 and 2, it is characterized in that described signal conversion unit (5) comprises resistance R 4, resistance R 5, resistance R 6, capacitor C 1 and diode D1, diode D2, described first, the second shaping unit (3, 4) output terminal 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 R 4, the positive pole of diode D2 is connected with one end of resistance R 6, the other end of resistance R 4, one end of the other end of resistance R 6 and resistance R 5, one end of capacitor C 1 all and receive together and be connected with an input end of described single machine unit (6), another termination voltage VCC of resistance R 5, the other end ground connection of capacitor C 1.
5. switch acquisition transition detection circuitry according to claim 3, it is characterized in that described signal conversion unit (5) comprises resistance R 4, resistance R 5, resistance R 6, capacitor C 1 and diode D1, diode D2, described first, the second shaping unit (3, 4) output terminal 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 R 4, the positive pole of diode D2 is connected with one end of resistance R 6, the other end of resistance R 4, one end of the other end of resistance R 6 and resistance R 5, one end of capacitor C 1 all and receive together and be connected with an input end of described single machine unit (6), another termination voltage VCC of resistance R 5, the other end ground connection of capacitor C 1.
6. switch acquisition transition detection circuitry according to claim 1 and 2, it is characterized in that described single machine unit (6) comprises the single-chip microcomputer U3 of built-in A/D change-over circuit, an input end of output terminal of described signal conversion unit (5) and the built-in A/D change-over circuit of single-chip microcomputer U3 is connected.
7. a detection method for switch acquisition transition detection circuitry as claimed in claim 1, is characterized in that comprising the steps:
A. by the first described switching value sampling unit (1), gather first via switching value signal to described the first shaping unit (3), by described second switch amount sampling unit (2), gather the second way switch amount signal to described the second shaping unit (4), the first shaping unit (3) and the second shaping unit (4) carry out respectively shaping to the received signal, signal after shaping flows to respectively described signal conversion unit (5), signal conversion unit (5) is converted to by two paths of signals the input end that a road signal flows to described single machine unit (6),
B. in described single machine unit (6), prestore V1, V2, V3 and tetra-magnitudes of voltage of V4 that determine according to described signal conversion unit (5), and V1 < V2 < V3 < V4; Described single machine unit (6) is carried out A/D conversion to the received signal, voltage sample value V corresponding to signal that obtains and receive;
C. described single machine unit (6) is first by the voltage sample value V and the magnitude of voltage V4 comparison that obtain, if V > is V4, is judged as the first switching value sampling unit and second switch amount sampling unit is all closed; If V≤V4, by voltage sample value V and magnitude of voltage V3 comparison, if V > is V3, is judged as that the first switching value sampling unit is closed and second switch amount sampling unit is opened; If V≤V3, by voltage sample value V and magnitude of voltage V2 comparison, if V > is V2, is judged as that the first switching value sampling unit is opened and second switch amount sampling unit is closed; If V≤V2, by voltage sample value V and magnitude of voltage V1 comparison, if V > is V1, is judged as the first switching value sampling unit and second switch amount sampling unit is all opened; If V≤V1, is judged as switch acquisition transition detection circuitry and breaks down, single machine unit (6) is controlled display unit and is shown failure message and/or control alarm unit startup and report to the police.
8. the detection method of switch acquisition transition detection circuitry according to claim 7, is characterized in that in described step b, and voltage sample value V process following steps obtain:
B1. according to described signal conversion unit (5), produce four values S1, S2, S3 and S4, calculate (S4-S3) * 130%, (S3-S2) * 130%, (S2-S1) * 130% and (S1-0) * 130%, the maximal value of taking 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 DATA1, DATA2 and tri-data spatial caches of 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 the mean value X of X1 and X2, and X is left in the DATA1 of data buffer storage space;
B3. single machine unit (6) reads the 3rd A/D data Y 1, and interval time, t, then read the 4th A/D data Y 2, then calculates the mean value Y of Y1 and Y2, and Y is left in the DATA2 of data buffer storage space;
B4. calculate | the difference of X-Y|, if | X-Y| > N, be considered as disturbing, get back to step b2; If | X-Y|≤N, enters 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 the mean value Z of Z1 and Z2, and Z is left in the DATA3 of data buffer storage space;
B6. calculate | the difference of Y-Z|, if | Y-Z| > N, be considered as disturbing, get back to step b2; If | Y-Z|≤N, enters step b7;
B7. calculate the mean value M of X, Y and Z, X, Y and Z are compared with mean value M respectively, remove in X, Y and Z that numerical value with mean value M deviation maximum, more remaining two numerical value are averaged, obtain voltage sample value V.
9. the detection method of switch acquisition transition detection circuitry according to claim 8, is characterized 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 true CN104122814A (en) 2014-10-29
CN104122814B 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)

Cited By (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
WO2017114319A1 (en) * 2015-12-30 2017-07-06 青岛歌尔声学科技有限公司 Dual-sensor signal collection circuit
CN111341712A (en) * 2018-12-19 2020-06-26 北京北方华创微电子装备有限公司 Wafer position calibration device and method
CN112669616A (en) * 2020-12-25 2021-04-16 中津沛科建设股份有限公司 Vehicle detection method and device

Family Cites Families (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

Cited By (8)

* 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
WO2017114319A1 (en) * 2015-12-30 2017-07-06 青岛歌尔声学科技有限公司 Dual-sensor signal collection circuit
US10177777B2 (en) 2015-12-30 2019-01-08 Qingdao Goertek Technology Co., Ltd. Dual-sensor signal collecting circuit
CN111341712A (en) * 2018-12-19 2020-06-26 北京北方华创微电子装备有限公司 Wafer position calibration device and method
CN111341712B (en) * 2018-12-19 2023-05-16 北京北方华创微电子装备有限公司 Wafer position calibration device and method
CN112669616A (en) * 2020-12-25 2021-04-16 中津沛科建设股份有限公司 Vehicle detection method and device
CN112669616B (en) * 2020-12-25 2022-04-08 中津沛科建设股份有限公司 Vehicle detection method and device

Also Published As

Publication number Publication date
CN104122814B (en) 2017-01-04

Similar Documents

Publication Publication Date Title
CN104122814A (en) Switching volume acquisition and conversion detection circuit and detection method thereof
CN101477166A (en) Wire harness test control panel and wire harness test control method
CN101561509A (en) Tri-component digital geophone and acquisition method thereof
CN102819021A (en) Multifunctional ultrasonic ranging data acquisition system and method thereof
CN106020031A (en) Split-type mini multifunctional concrete temperature intelligent on-line monitoring system
CN204215209U (en) For the signal conditioning circuit of data collector in drawout cubicle
CN114124071A (en) Open circuit detection method, circuit, device, electronic equipment and storage medium
CN209543097U (en) Data collection system
CN104914376A (en) Digital circuit state detection circuit and digital circuit state detection method
CN203930411U (en) A kind of switch acquisition change-over circuit
CN202750222U (en) Audio frequency input circuit and electronic equipment with audio frequency input
CN209342800U (en) A kind of current detecting instrument
CN203965551U (en) A kind of multichannel transmitters sense device
CN103529353B (en) Winding displacement detection method and winding displacement detection system
CN203414503U (en) Self-checking adapter of automatic detection system based on PXI bus
CN200979479Y (en) A sulfur hexafluoride leakage monitor
CN106335452B (en) A kind of general mobile unit collection of simulant signal processing system
CN205176576U (en) Multi -functional network environment monitoring system
CN104991198A (en) Battery tour inspection processing circuit based on ARM platform multichannel switching
CN108173544A (en) A kind of compatible input or the I/O port circuit of output control
CN201255731Y (en) Road tunnel carbon monoxide concentration detection device having network interface
CN203965633U (en) Intelligent probe system
CN202974475U (en) Storage battery temperature measuring equipment
CN201698554U (en) Electric fire hazard microcomputer protection device
CN202814450U (en) A device for real-time monitoring of temperature and humidity of electronic power modules

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