CN109828147A - It is a kind of based on voltage values be time span data acquisition device and method - Google Patents

It is a kind of based on voltage values be time span data acquisition device and method Download PDF

Info

Publication number
CN109828147A
CN109828147A CN201910219953.XA CN201910219953A CN109828147A CN 109828147 A CN109828147 A CN 109828147A CN 201910219953 A CN201910219953 A CN 201910219953A CN 109828147 A CN109828147 A CN 109828147A
Authority
CN
China
Prior art keywords
foot
switch
resistance
pin
microprocessor
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
CN201910219953.XA
Other languages
Chinese (zh)
Other versions
CN109828147B (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.)
CHONGQING HEALTH CENTER FOR WOMEN AND CHILDREN
Original Assignee
CHONGQING HEALTH CENTER FOR WOMEN AND CHILDREN
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 CHONGQING HEALTH CENTER FOR WOMEN AND CHILDREN filed Critical CHONGQING HEALTH CENTER FOR WOMEN AND CHILDREN
Priority to CN201910219953.XA priority Critical patent/CN109828147B/en
Publication of CN109828147A publication Critical patent/CN109828147A/en
Application granted granted Critical
Publication of CN109828147B publication Critical patent/CN109828147B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Arrangements For Transmission Of Measured Signals (AREA)
  • Measurement Of Current Or Voltage (AREA)

Abstract

It is the data acquisition device and method of time span that the invention discloses a kind of based on voltage values.The composition of hardware circuit includes IC chip LM324, and LM324 has 4 operational amplifiers A1, A2, A3, A4;A1 is used to amplify input voltage signal, and A2, A3, C4, R5, switch K2, STC15F2K60S2 form signal conversion circuit;The P3.2 pin of STC15F2K60S2 is as external interrupt signal input, the through and off of P1.0 pin control switch K2.The present invention makes the circuit of the data acquisition device of voltage values time span become simple, the device number that device circuit uses is reduced, and is improved the reliability and precision of data acquisition device, is reduced data acquisition device error, cost performance is improved, the cost of device is reduced.

Description

It is a kind of based on voltage values be time span data acquisition device and method
Technical field
The invention belongs to electronic surveying fields.Technical solution is related to input voltage amplitude and exports the transformation side of time value Method realizes that input analog voltage value is converted to the digital quantity of time.Especially data acquisition device of the voltage transformation for the time, master It applies in the data collecting field changed at a slow speed, especially hospital's computer room safety equipment.
Background technique
Data acquisition device is also known as measuring device, abbreviation device, and data acquisition device is usually that measurand is converted At analog electrical energy, analog quantity is then converted into digital quantity, then human-computer interaction is carried out by man-machine interface.Conversion method is generally adopted With gradually comparison A/D C, ∑-△ type ADC or biproduct parting ADC etc., it is currently used for also having in the single-chip microcontroller internal circuit of observing and controlling ADC resource, but the ADC digit in single-chip microcontroller is fewer, resolution ratio is low, and the data that voltage values are time span acquire Device has the function of that count value is settable, with super strength to inhibit high-frequency noise and fixed low-frequency disturbance ability, device The course of work is generally divided into three phases: the first stage is by charging to capacitor C4 timing in Fig. 1;When second stage discharges to C4 Between count, to be time value by voltage values, complete measurement to input analog voltage value;Phase III is device school 0 Stage.
Document by retrieving domestic and international electronic surveying field shows that current existing voltage values are time span The Key Circuit structure of data acquisition device, is summarized as circuit shown in FIG. 1: by amplifier A2, resistance R5, capacitor C4, A3, clock G, FF0-FFn-1 JK flip-flop compositions of pulse control door.(1) input end switch S1 is controlled by timing signal Qn.When Qn is height Or when low two varying levels, opposite polarity input voltage V2 and reference voltage Vref are added separately to the input terminal of S1, to Fig. 1 Middle C4 carries out charging and discharging process contrary twice;(2) A3 is used to determine the comparison result of Uo and Un.As Uo > Un, It is low level that A3, which exports Um, and as Uo < Un, Um is high level;A3 output Um be connected to clock control door G, as G shutdown and Opening signal;(3) n+1 JK flip-flop FF0-FFn-1 is composed in series counter, due to being the clock pulses to fixed cycle Tc CP is counted, so also using as timer.When counter counts count to 2nWhen a CP, FF0-FFn-1 returns to 0 state, and FFn is overturn To 1 state, Qn=1 control switch S1 is switched to Vref from V2;(4) the clock source period of G is Tc, the mark as time of measuring Quasi- interval, as Um=1, door G is opened, and clock pulses is added to the input terminal of FF0 by G.
The course of work of circuit is: (1) first stage is 0-t1, and the time is T1: being touched by each JK in setting dotted line frame The original state for sending out device FF0-FFn-1, the initial value that timer is arranged is N;When t=0, switch S1 connects input voltage V2, positive Input voltage V2 is added to the input terminal of C4, starts the charging process to C4, and C4 is started to charge from 0V;To t1 moment, trigger FF0-FFn-1 is turned to 0 state after 2n-N clock pulses, and Qn=1, K are the control terminals of S1, the end K control switch S1 it is defeated Enter voltage and Vref value is switched to by V2 value, the charging stage terminates, and in the 0-t1 stage, waveform is filled as shown in 0-VT sections of Fig. 3 bend The electric time is T1=(2n-N) * Tc;It is high level that Uo < Un in 0-t1, A3, which export Um,;The output voltage of t1 moment A2 is Fig. 3 In Uo=Vp;(2) discharge regime is t1-t2, and the discharge time of C4 is T2: the initial value that JK flip-flop is arranged is 0, works as t=t1 When, clock control door G is opened;Counter starts counting under CP effect from 0, and S1 is switched to reference voltage-Vref, is added to C4 Input terminal;C4 begins through R5 electric discharge;The voltage of Uo gradually rises, and as t=t2, Uo > Un, Um point become low from high level Level, C4 discharge regime terminate, and clock pulses control door G is closed, and count and stop, the count value of read-out counter, as adopting With value;It is cyz in the clock pulses number that T2 time period counter counts, input voltage V2's is averaged in the size and T1 of cyz value It is worth directly proportional;(3) phase III is t2-t3: preparing and school zeroth order section, first control circuit offer control signal keep counter clear Zero, while control switch S2 is closed, and after C4 discharge off, then disconnects S2.
Know from the circuit that traditional voltage values are time span data acquisition device is analyzed above, to complete to simulate Signal is to the necessary condition that digital signal is converted: (1) needing external clock CP, surveyed using N+1 JK flip-flop deadline Amount and N countings;(2) needing core circuit is the circuit of A2, R5, C4, A3 composition;(3) need gate circuit G, control signal K, The control circuit of the compositions such as switch S1 and S2;(4) way of thinking of the control circuit course of work is needed;Fig. 1 circuit composition compared with For complexity, the device number used is more, and there are discrete feature, circuit reliabilities to reduce for device, and counting error increases, resolution ratio Low, cost performance is low.
Summary of the invention
In order to overcome, existing circuit structure is complicated, functional reliability is poor, it is low not to be able to satisfy detection, cost performance in high precision Deficiency, having invented voltage values is time span data acquisition device, the way of thinking of device by Fig. 2 circuit and Fig. 5 Software composition;On circuit structure, replaced using the counter-timer T/C of microprocessor STC15F2K60S2 shown in FIG. 1 The circuits such as counter, gate G that originally JK flip-flop forms in circuit, simplify circuit structure, meanwhile, newly increase Fig. 5 institute The software shown, the control circuit course of work realize that analog voltage is converted to time figure amount with circuit and software jointly, improve Functional reliability and detection resolution, improve cost performance.
Circuit structure in device is circuit shown in Fig. 2, and V2 is measured voltage, and Vref is reference voltage, this case selection Ground as the reference voltage, Vref=0;Circuit includes domestic microprocessor STC15F2K60S2, integrated chip LM324, electronic die Quasi- switch CMOS4016;There are 4 operational amplifiers A1, A2, A3, A4 in LM324, is used in this case using wherein A1, A2, A3, A1 Amplify in applied signal voltage, A3 compares device use;It is made of inside chip CMOS4016 shown in Fig. 4 K1-K4, wherein In1-in4, out1-out4, control1-control4 are the input, output end of K1-K4, control terminal respectively;A2,C4, R5, K2 constitute signal conversion circuit;As external interrupt signal input pin, P1.0 passes through the P3.2 pin of STC15F2K60S2 The charging and discharging process of K2 control C4.
In Fig. 2,4 feet of LM324 meet+V=5V, 11 feet connect the power supply of-V=-5V;The signal of sensor output send the end ui+ It is connect with a foot chain of the end ui-, the out1 foot of K1, resistance R1;The foot connection of the in1 foot of K1, a foot of resistance R2, R4;K1's Control1 foot meets P1.1;The 2 feet connection of another foot of R1, a foot of Rf, A1;The 3 feet connection of another foot, A1 of R2.
The foot connection of another foot of Rf, 1 foot of A1, R3, the foot company of another foot of R3, the in2 foot of switch K2, R5 It connects, the out2 foot of K2 is grounded gnd, the control pin control2 of K2 connects the P1.0 foot of STC15F2K60S2, another foot of R5, A2 The pin connection of 6 feet, C4, the 9 feet connection of another pin of C4,7 feet of A2, A3.
The 10 feet connection of another pin of R4, a foot of R9, a foot of R6, A3, another foot of R9 meet+5V power supply, R6 Another foot, a foot of C3, a foot of R7,5 feet of A2, K3 the connection of in3 foot, another foot ground connection of R7, another foot of C3 connects Ground.
The foot connection of 8 feet, R8 of A3, the in4 foot connection of another foot of R8, the out3 foot of K3, K4, the control pin of K3 Control3 connects the P1.2 foot of STC15F2K60S2, and the out4 foot of K4 connects the P3.2 pin connection of STC15F2K60S2, K4's Control4 foot connects the P1.3 foot of STC15F2K60S2.
The P2 pin supervisory keyboard of microprocessor STC15F2K60S2, P0 pin manage segmentation by display driver chip LCD, keyboard, the input-output equipment that section-type LCD is data acquisition device.
STC15F2K60S2 is the core component for executing software control Fig. 2 circuit work of Fig. 5, in Fig. 2 circuit shown in Fig. 3 V2, Uo, Un, Um point voltage waveform are the key that tune-up data acquisition device normal works, so, this case designer must pass through The method of design software realizes that v2, Uo, Un, Um point export voltage waveform shown in Fig. 3 in Fig. 2 circuit, and T1, T2, T3 are software Three steps of control circuit work.Module (1)-(7) are the numbers of 7 nucleus modules, and wherein module (3) has invoked module (5), if ij >=3 and ij/3 remainder is zero, to cyz data filtering, calling module (3+) carries out data processing, every calling One secondary module (3) acquires a data;Module (5)-(6)-(7) are in interrupting using the T/C0 of STC15F2K60S2 and is external What disconnected automatic calling executed.
The first step, calling module (1) are closed device school 0:K1, K2, K3, and K4 is disconnected, P1.1=1;P1.0=1;P1.2 =1;P1.3=0;Calling module (2) initializes STC15F2K60S2: initialization P3.2 external interrupt, IT0=1;EA=1;ET0 =1;EX0=1;Initialize internal C/T0, C/T1:TR0=0;TR1=0;
Second step, calling module (3) data acquisition: ij=0;Calling module (5):
Step 1,0-t1:C4 charging time are T1, and when t=0, calling module (5): K4 closure, K1, K2, K3 are disconnected, P1.1 =0;P1.0=0;P1.2=0;P1.3=1;It is T1, TR0=1 that C/T0 timing initial value, which is arranged,;ET0=1;EX=0; STC15F2K60S2 control switch K2 connects input voltage V2, and voltage V2 is added to the input terminal of C4, starts to charge to C4.
V0 is the initial voltage value at the both ends C4;Voltage value when Vmax is full of for C4;Vt is the both ends C4 t moment during T1 Voltage value;So:In order to make the variation of C4 both end voltage be approximately it is linear i.e. The variation of Uo point voltage linear, R5 × C4 selection is sufficiently large, and T1 selection is sufficiently small.
C4 charge waveforms are as shown in 0-VT sections of Fig. 3 bend during 0-t1, and the output voltage of A2 is Uo=VT, Uo < Un, Um point is high level;To the t1 moment, the T/C0 timing T1 time is arrived, and T/C0 generates interruption, and the charging stage terminates;ij++;Into the 2nd Step.
Step 2, t1-t2:C4 discharge time are T2, and when t=t1, T/C0 interrupts automatic calling module (6), executes The C/T0 interrupt service routine of STC15F2K60S2: TR0=0;K2, K4 closure, K1, K3 are disconnected;P1.1=0;P1.0=1; P1.2=0;P1.3=1;Setting C/T0 is counting mode, initial value 0;TH=0;TL=0;TR0=1;ET0=0;EX0=1;
STC15F2K60S2 control switch K2 is switched to ground from input voltage V2 value, and 0v voltage is added to the input terminal of C4;C4 Start to discharge over the ground by R5;During t1-t2, the count value of T/C0 is cyz, and T2=cyz*Tc, Tc are counted clock cycles, During electric discharge,Uo is voltage on the preceding capacitor of electric discharge in formula.ij++;
The voltage of Uo point gradually rises in Fig. 2 during t1-t2 electric discharge, and at the t2 moment, Uo > Un, Um are become from high level Low level, A3 export a failing edge to the P3.2 foot of STC15F2K60S2, generate P3.2 foot external interrupt, execute outside P3.2 foot Portion's interrupt service routine, that is, automatic calling module (7): external interrupt EX=0 is closed;Stop C/T0 and counts TR0=0;T/C0 value is read to make For this sampled value, cyz is sent;P3.2=0 is waited to stablize;T2 time period counter count value be cyz, the size of cyz value with The average value of voltage V2 is directly proportional in T1;ij++;
Third step, if ij > 3 and when ij/3 remainder is zero, to cyz data filtering;Calling module (3+) carries out at data Reason.
4th step, calling module (4), carry out human-computer interaction, display cyz treated value, data communication etc..
5th step, T3 stage, calling module 1 device school 0:K1, K2, K3 closure, K4 are disconnected, P1.1=1;P1.0= 1;P1.2=1;P1.3=0.
Benefit of the invention is: so that the circuit of the data acquisition device of voltage values time span is become simple, fills The device number that circuits use is reduced, and is improved the reliability and precision of data acquisition device, is reduced data acquisition device Error improves cost performance, reduces the cost of device.
Detailed description of the invention
Fig. 1 is the circuit that conventional voltage value is transformed to time span data acquisition device.
Fig. 2 is that the voltage transformation of invention is the circuit of time span data acquisition device.
Fig. 3 is the timing diagram that voltage values are time span data acquisition device.
Fig. 4 is CMOS4016 internal circuit configuration figure.
Fig. 5 is the software kernels module and flow chart that voltage values are time span data acquisition device.
Specifically, circuit structure shown in FIG. 1 is the circuit that traditional voltage values are time span, v2 in Fig. 1, The voltage waveform of Uo, Un, Um point is as shown in Figure 3;This case designer designs software shown in fig. 5 and replaces timer/meter in Fig. 1 Number device and control circuit, while circuit shown in Fig. 2 is devised, software control circuit work shown in Fig. 2 shown in fig. 5 makes V2, Uo, Un, Um point also export waveform shown in Fig. 3 in Fig. 2 circuit, not only simplify the circuit structure of Fig. 1, complete voltage value and become Be changed to time span, at the same can also human-computer interaction, be made that data acquisition device using above-mentioned circuit and software.
Specific embodiment
The present invention will be further described with reference to the accompanying drawing.
Circuit structure in device is circuit shown in Fig. 2, and V2 is measured voltage, and Vref is reference voltage, this case selection Ground as the reference voltage, Vref=0;Circuit includes domestic microprocessor STC15F2K60S2, integrated chip LM324, electronic die Quasi- switch CMOS4016;There are 4 operational amplifiers A1, A2, A3, A4 in LM324, is used in this case using wherein A1, A2, A3, A1 Amplify in applied signal voltage, A3 compares device use;It is made of inside chip CMOS4016 shown in Fig. 4 K1-K4, wherein In1-in4, out1-out4, control1-control4 are the input, output end of K1-K4, control terminal respectively;A2,C4, R5, K2 constitute signal conversion circuit;As external interrupt signal input pin, P1.0 passes through the P3.2 pin of STC15F2K60S2 The charging and discharging process of K2 control C4.
In Fig. 2,4 feet of LM324 meet+V=5V, 11 feet connect the power supply of-V=-5V;The signal of sensor output send the end ui+ It is connect with a foot chain of the end ui-, the out1 foot of K1, resistance R1;The foot connection of the in1 foot of K1, a foot of resistance R2, R4;K1's Control1 foot meets P1.1;The 2 feet connection of another foot of R1, a foot of Rf, A1;The 3 feet connection of another foot, A1 of R2.
The foot connection of another foot of Rf, 1 foot of A1, R3, the foot company of another foot of R3, the in2 foot of switch K2, R5 It connects, the out2 foot of K2 is grounded gnd, the control pin control2 of K2 connects the P1.0 foot of STC15F2K60S2, another foot of R5, A2 The pin connection of 6 feet, C4, the 9 feet connection of another pin of C4,7 feet of A2, A3.
The 10 feet connection of another pin of R4, a foot of R9, a foot of R6, A3, another foot of R9 meet+5V power supply, R6 Another foot, a foot of C3, a foot of R7,5 feet of A2, K3 the connection of in3 foot, another foot ground connection of R7, another foot of C3 connects Ground.
The foot connection of 8 feet, R8 of A3, the in4 foot connection of another foot of R8, the out3 foot of K3, K4, the control pin of K3 Control3 connects the P1.2 foot of STC15F2K60S2, and the out4 foot of K4 connects the P3.2 pin connection of STC15F2K60S2, K4's Control4 foot connects the P1.3 foot of STC15F2K60S2.
The P2 pin supervisory keyboard of microprocessor STC15F2K60S2, P0 pin manage segmentation by display driver chip LCD, keyboard, the input-output equipment that section-type LCD is data acquisition device.
The quiescent point of debug circuit: after K1 closure, K2 closure, C4 short circuit, Uc=Ub, in the practical debugging process of circuit In, Uc ratio Ub high 0.01 or so;It is required that Uo=Un, still, in circuit debugging practice, Uo ratio Un is higher by 0.01 ± 0.01, A3 8 foot output voltages less than 0.01 ± 0.01V.
STC15F2K60S2 is the core component for executing software control Fig. 2 circuit work of Fig. 5, in Fig. 2 circuit shown in Fig. 3 V2, Uo, Un, Um point voltage waveform are the key that tune-up data acquisition device normal works, so, this case designer must pass through The method of design software realizes that v2, Uo, Un, Um point export voltage waveform shown in Fig. 3 in Fig. 2 circuit, and T1, T2, T3 are software Three steps of control circuit work.Module (1)-(7) are the numbers of 7 nucleus modules, and wherein module (3) has invoked module (5), if ij >=3 and ij/3 remainder is zero, to cyz data filtering, calling module (3+) carries out data processing, every calling One secondary module (3) acquires a data;Module (5)-(6)-(7) are in interrupting using the T/C0 of STC15F2K60S2 and is external What disconnected automatic calling executed.
The first step, calling module (1) are closed device school 0:K1, K2, K3, and K4 is disconnected, P1.1=1;P1.0=1;P1.2 =1;P1.3=0;Calling module (2) initializes STC15F2K60S2: initialization P3.2 external interrupt, IT0=1;EA=1;ET0 =1;EX0=1;Initialize internal C/T0, C/T1:TR0=0;TR1=0;
Second step, calling module (3) data acquisition: ij=0;Calling module (5):
Step 1,0-t1:C4 charging time are T1, and when t=0, calling module (5): K4 closure, K1, K2, K3 are disconnected, P1.1 =0;P1.0=0;P1.2=0;P1.3=1;It is T1, TR0=1 that C/T0 timing initial value, which is arranged,;ET0=1;EX=0; STC15F2K60S2 control switch K2 connects input voltage V2, and voltage V2 is added to the input terminal of C4, starts to charge to C4.
It is in order to make the variation of C4 both end voltage be approximately linear i.e. Uo point voltage linear variation, R5 × C4 selection is sufficiently large, And T1 selection is sufficiently small.
C4 charge waveforms are as shown in 0-VT sections of Fig. 3 bend during 0-t1, and the output voltage of A2 is Uo=VT, Uo < Un, Um point is high level;To the t1 moment, the T/C0 timing T1 time is arrived, and T/C0 generates interruption, and the charging stage terminates;ij++;Into the 2nd Step.
Step 2, t1-t2:C4 discharge time are T2, and when t=t1, T/C0 interrupts automatic calling module (6), executes The C/T0 interrupt service routine of STC15F2K60S2: TR0=0;K2, K4 closure, K1, K3 are disconnected;P1.1=0;P1.0=1; P1.2=0;P1.3=1;Setting C/T0 is counting mode, initial value 0;TH=0;TL=0;TR0=1;ET0=0;EX0=1;
STC15F2K60S2 control switch K2 is switched to ground from input voltage V2 value, and 0v voltage is added to the input terminal of C4;C4 Start to discharge over the ground by R5;ij++;
The voltage of Uo point gradually rises in Fig. 2 during t1-t2 electric discharge, and at the t2 moment, Uo > Un, Um are become from high level Low level, A3 export a failing edge to the P3.2 foot of STC15F2K60S2, generate P3.2 foot external interrupt, execute outside P3.2 foot Portion's interrupt service routine, that is, automatic calling module (7): external interrupt EX=0 is closed;Stop C/T0 counting, TR0=0;Read T/C0 value As this sampled value, cyz is sent;P3.2=0 is waited to stablize;It is cyz, the size of cyz value in the count value of T2 time period counter It is directly proportional to the average value of voltage V2 in T1;ij++;
Third step, if ij > 3 and when ij/3 remainder is zero, to cyz data filtering;Calling module (3+) carries out at data Reason.
4th step, calling module (4), carry out human-computer interaction, display cyz treated value, data communication etc..
5th step, T3 stage, calling module 1 device school 0:K1, K2, K3 closure, K4 are disconnected, P1.1=1;P1.0= 1;P1.2=1;P1.3=0.
The above is only a preferred embodiment of the present invention, protection scope of the present invention is not limited merely to above-mentioned implementation Example, all technical solutions belonged under thinking of the present invention all belong to the scope of protection of the present invention.It should be pointed out that for the art Those of ordinary skill for, several improvements and modifications without departing from the principles of the present invention, these improvements and modifications It should be regarded as protection scope of the present invention.

Claims (2)

1. it is a kind of based on voltage values be time span data acquisition device, it is characterised in that: including microprocessor STC15F2K60S2, integrated chip LM324, electronic analog swtich CMOS4016;There are 4 operation amplifiers in integrated chip LM324 Device A1, A2, A3, A4, wherein A1 is used to amplify applied signal voltage, and A3 compares device use;Electronic analog swtich It is made of inside CMOS4016 switch K1-K4, wherein in1-in4, out1-out4, control1-control4 are switch respectively The input, output end of K1-K4, control terminal;Operational amplifier A2, capacitor C4, resistance R5, switch K2 constitute signal transformation electricity Road;The P3.2 pin of microprocessor STC15F2K60S2 passes through switch K2 as external interrupt signal input pin, P1.0 pin Control the charging and discharging process of capacitor C4;
4 feet of integrated chip LM324 connect+5V power supply, 11 feet connect -5V power supply, and the signal of sensor output is sent to the end ui+ and ui- End, the out1 foot of switch K1, a foot of resistance R1 are connected, a foot of the in1 foot of switch K1, a foot of resistance R2 and resistance R4 It is connected, the control1 foot of switch K1 connects the P1.1 pin of microprocessor STC15F2K60S2, another foot, the resistance of resistance R1 A foot of Rf, 2 feet of operational amplifier A1 are connected, and another foot of resistance R2 is connected with 3 feet of operational amplifier A1;
One foot of another foot of resistance Rf, 1 foot of operational amplifier A1 and resistance R3 is connected, another foot, the switch of resistance R3 The foot connection of the in2 foot, resistance R5 of K2, the out2 foot ground connection of switch K2, the control pin control2 of switch K2 meet micro- place Manage the P1.0 foot of device STC15F2K60S2, a pin phase of another foot of resistance R5,6 feet of operational amplifier A2, capacitor C4 Connection, 9 feet of another pin of capacitor C4,7 feet of operational amplifier A2 and operational amplifier A3 are connected;
Another pin of resistance R4, a foot of resistance R9, a foot of resistance R6, operational amplifier A3 10 feet be connected, electricity Another foot of resistance R9 connects+5V power supply, another foot of resistance R6, a foot of capacitor C3, a foot of resistance R7, operational amplifier A2 5 feet, switch K3 in3 foot be connected, another foot of resistance R7 ground connection, another foot ground connection of C3;
8 feet of operational amplifier A3 are connected with a foot of resistance R8, another foot of resistance R8, the out3 foot of switch K3 and switch The in4 foot of K4 is connected, and the control pin control3 of switch K3 meets the P1.2 foot of microprocessor STC15F2K60S2, switch K4 Out4 foot connect the P3.2 pin of microprocessor STC15F2K60S2, the control4 foot of switch K4 connects microprocessor The P1.3 pin of STC15F2K60S2;
P2 pin supervisory keyboard, the P0 pin of microprocessor STC15F2K60S2 passes through display driver chip management section-type LCD, key Disk, the input-output equipment that section-type LCD is data acquisition device.
2. it is a kind of based on voltage values be time span collecting method, which comprises the following steps:
The first step, calling module (1) is to device school 0: switch K1, K2, K3 closure, switch K4 are disconnected, microprocessor The pin P1.1=1 of STC15F2K60S2;P1.0=1;P1.2=1;P1.3=0;Calling module (2) initializes microprocessor STC15F2K60S2: initialization pin P3.2 external interrupt, IT0=1;EA=1;ET0=1;EX0=1;Initialize internal C/ T0, C/T1:TR0=0;TR1=0;
Second step, calling module (3) data acquisition: ij=0;Calling module (5):
Step 1,0-t1:C4 charging time are T1, when t=0, calling module (5): and switch K4 closure, switch K1, K2, K3 disconnection, The pin P1.1=0 of microprocessor STC15F2K60S2;P1.0=0;P1.2=0;P1.3=1;C/T0 timing initial value, which is arranged, is T1, TR0=1;ET0=1;EX=0;Microprocessor STC15F2K60S2 control switch K2 connects input voltage V2, and voltage V2 adds To the input terminal of capacitor C4, start to charge to capacitor C4;
C4 charges during 0-t1, and the output voltage of operational amplifier A2 is Uo=VT, and Uo < Un, Um point are high level;When to t1 It carves, the T/C0 timing T1 time arrives, and T/C0 generates interruption, and the charging stage terminates;ij++;Into step 2;
Step 2, t1-t2: capacitor C4 discharge time is T2, and when t=t1, T/C0 interrupts automatic calling module (6), executes micro process The C/T0 interrupt service routine of device STC15F2K60S2: TR0=0;Switch K2, K4 closure, switch K1, K3 are disconnected;Microprocessor The pin P1.1=0 of STC15F2K60S2;P1.0=1;P1.2=0;P1.3=1;Setting C/T0 is counting mode, initial value 0; TH=0;TL=0;TR0=1;ET0=0;EX0=1;
Microprocessor STC15F2K60S2 control switch K2 is switched to ground from input voltage V2 value, and 0v voltage is added to the defeated of capacitor C4 Enter end;Capacitor C4 starts to discharge over the ground by resistance R5;ij++;
During t1-t2 electric discharge, the voltage of Uo point is gradually risen, and at the t2 moment, Uo > Un, Um become low level from high level, fortune It calculates amplifier A3 and exports a failing edge to the P3.2 foot of microprocessor STC15F2K60S2, generate P3.2 foot external interrupt, hold Row P3.2 foot external interrupt service routine, that is, automatic calling module (7): external interrupt EX=0 is closed;Stop C/T0 and counts TR0=0; T/C0 value is read as this sampled value, send cyz;P3.2=0 is waited to stablize;The count value of C/T0 is cyz, cyz value during T2 Size it is directly proportional to the average value of voltage V2 in T1;ij++;
Third step, if ij > 3 and when ij/3 remainder is zero, to cyz data filtering;Calling module (3+) carries out data processing;
4th step, calling module (4), carry out human-computer interaction, display cyz treated value;
5th step, in the T3 stage, 1 device school 0 of calling module: switch K1, K2, K3 closure, switch K4 are disconnected, microprocessor The pin P1.1=1 of STC15F2K60S2;P1.0=1;P1.2=1;P1.3=0.
CN201910219953.XA 2019-03-22 2019-03-22 Data acquisition device and method based on conversion of voltage value into time length Active CN109828147B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910219953.XA CN109828147B (en) 2019-03-22 2019-03-22 Data acquisition device and method based on conversion of voltage value into time length

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910219953.XA CN109828147B (en) 2019-03-22 2019-03-22 Data acquisition device and method based on conversion of voltage value into time length

Publications (2)

Publication Number Publication Date
CN109828147A true CN109828147A (en) 2019-05-31
CN109828147B CN109828147B (en) 2024-01-30

Family

ID=66870912

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910219953.XA Active CN109828147B (en) 2019-03-22 2019-03-22 Data acquisition device and method based on conversion of voltage value into time length

Country Status (1)

Country Link
CN (1) CN109828147B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN204192372U (en) * 2014-11-13 2015-03-11 胡钢 Possesses the water dispenser of water management
CN205507382U (en) * 2016-02-29 2016-08-24 张瑞增 Multifunctional timer
CN106301370A (en) * 2016-08-16 2017-01-04 江苏师范大学 A kind of direct-type intelligence adc circuit
CN209673886U (en) * 2019-03-22 2019-11-22 重庆市妇幼保健院 It is the data acquisition device of time span based on voltage values

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN204192372U (en) * 2014-11-13 2015-03-11 胡钢 Possesses the water dispenser of water management
CN205507382U (en) * 2016-02-29 2016-08-24 张瑞增 Multifunctional timer
CN106301370A (en) * 2016-08-16 2017-01-04 江苏师范大学 A kind of direct-type intelligence adc circuit
CN209673886U (en) * 2019-03-22 2019-11-22 重庆市妇幼保健院 It is the data acquisition device of time span based on voltage values

Also Published As

Publication number Publication date
CN109828147B (en) 2024-01-30

Similar Documents

Publication Publication Date Title
CN101477152B (en) Capacitance detection apparatus and method
CN102200869B (en) Capacitance type touch control device and sensing device thereof
CN206117612U (en) Digital signal anti interference filtration circuit
CN105379120A (en) Capacitive proximity detection using delta-sigma conversion
CN101644754A (en) Calibration console for electric energy meter
CN102147426B (en) Broadband triggering circuit of digital oscilloscope
CN208190614U (en) A kind of single-shot trigger circuit of the Precision Pulse width based on programmable logic chip
CN102375625A (en) Sensing circuit and method for capacitance type touch control panel
CN209673886U (en) It is the data acquisition device of time span based on voltage values
CN205679749U (en) Power on/off observation circuit
CN103499733B (en) High-precision voltage detection circuit and method
CN104160385B (en) Input capture peripheral device with gate control logic
CN201382977Y (en) Capacitor measuring device
CN101135720B (en) System for detecting battery electric quantity and mobile phone thereof
CN109828147A (en) It is a kind of based on voltage values be time span data acquisition device and method
CN112039512B (en) Capacitive touch key system and key detection method thereof
CN106452087A (en) Rectification method of synchronous rectification control circuit
CN102394651B (en) Programmable double integral type 32-bit ADC (analog-to-digital converter)
CN108614161A (en) A kind of capacitance measurement system
CN107092300B (en) A kind of MPPT circuits of counting, stored digital and comparing function multiplexing
CN207281176U (en) One kind measurement capacitor system
CN208707546U (en) Constant current output control circuit
CN203387166U (en) Over/Under-voltage detection protection circuit of series supercapacitor bank
CN106774016A (en) A kind of SCM Based intelligent material control device
CN209250604U (en) The sub key system of capacitance type touch key

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant