CN106768459B - A kind of Temperature and Humidity circuit and control method - Google Patents

A kind of Temperature and Humidity circuit and control method Download PDF

Info

Publication number
CN106768459B
CN106768459B CN201611150388.9A CN201611150388A CN106768459B CN 106768459 B CN106768459 B CN 106768459B CN 201611150388 A CN201611150388 A CN 201611150388A CN 106768459 B CN106768459 B CN 106768459B
Authority
CN
China
Prior art keywords
interface
timing
resistance
signal
time
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
CN201611150388.9A
Other languages
Chinese (zh)
Other versions
CN106768459A (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.)
Shenzhen Topband Co Ltd
Original Assignee
Shenzhen Topband 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 Shenzhen Topband Co Ltd filed Critical Shenzhen Topband Co Ltd
Priority to CN201611150388.9A priority Critical patent/CN106768459B/en
Publication of CN106768459A publication Critical patent/CN106768459A/en
Application granted granted Critical
Publication of CN106768459B publication Critical patent/CN106768459B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G01MEASURING; TESTING
    • G01KMEASURING TEMPERATURE; MEASURING QUANTITY OF HEAT; THERMALLY-SENSITIVE ELEMENTS NOT OTHERWISE PROVIDED FOR
    • G01K7/00Measuring temperature based on the use of electric or magnetic elements directly sensitive to heat ; Power supply therefor, e.g. using thermoelectric elements
    • G01K7/16Measuring temperature based on the use of electric or magnetic elements directly sensitive to heat ; Power supply therefor, e.g. using thermoelectric elements using resistive elements
    • G01K7/22Measuring temperature based on the use of electric or magnetic elements directly sensitive to heat ; Power supply therefor, e.g. using thermoelectric elements using resistive elements the element being a non-linear resistance, e.g. thermistor
    • G01K7/24Measuring temperature based on the use of electric or magnetic elements directly sensitive to heat ; Power supply therefor, e.g. using thermoelectric elements using resistive elements the element being a non-linear resistance, e.g. thermistor in a specially-adapted circuit, e.g. bridge circuit
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01NINVESTIGATING OR ANALYSING MATERIALS BY DETERMINING THEIR CHEMICAL OR PHYSICAL PROPERTIES
    • G01N27/00Investigating or analysing materials by the use of electric, electrochemical, or magnetic means
    • G01N27/02Investigating or analysing materials by the use of electric, electrochemical, or magnetic means by investigating impedance
    • G01N27/04Investigating or analysing materials by the use of electric, electrochemical, or magnetic means by investigating impedance by investigating resistance
    • G01N27/045Circuits
    • GPHYSICS
    • G05CONTROLLING; REGULATING
    • G05DSYSTEMS FOR CONTROLLING OR REGULATING NON-ELECTRIC VARIABLES
    • G05D27/00Simultaneous control of variables covered by two or more of main groups G05D1/00 - G05D25/00
    • G05D27/02Simultaneous control of variables covered by two or more of main groups G05D1/00 - G05D25/00 characterised by the use of electric means

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Chemical & Material Sciences (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Biochemistry (AREA)
  • Chemical Kinetics & Catalysis (AREA)
  • Electrochemistry (AREA)
  • Health & Medical Sciences (AREA)
  • Engineering & Computer Science (AREA)
  • Analytical Chemistry (AREA)
  • Automation & Control Theory (AREA)
  • General Health & Medical Sciences (AREA)
  • Immunology (AREA)
  • Pathology (AREA)
  • Nonlinear Science (AREA)
  • Investigating Or Analyzing Materials By The Use Of Electric Means (AREA)
  • Measuring Temperature Or Quantity Of Heat (AREA)

Abstract

The present invention discloses a kind of Temperature and Humidity circuit, including with the first I/O interface, the 2nd I/O interface, the 3rd I/O interface and the single-chip microcontroller for interrupting control interface;Charging circuit with the integration module comprising charge and discharge capacitance and comparison module;The humistor being connected with the first I/O interface, the thermistor being connected with the 2nd I/O interface and the fixed value resistance being connected with the 3rd I/O interface;Integration module is also connected with humistor, thermistor and fixed value resistance respectively, single-chip microcontroller is connected by the interruption control interface with the comparison module, for completing the timing to the charge and discharge capacitance charging time by comparing module, and the resistance value of thermistor and humistor is calculated according to timing time and corresponding temperature and humidity information are obtained according to resistance value.This programme avoids the problem that single-chip microcontroller is using A D interface acquisition signal and bring is at high cost, effectively increases measurement accuracy of the program within the scope of entire relative humiture.

Description

A kind of Temperature and Humidity circuit and control method
Technical field
The invention belongs to Temperature and Humidity technical field more particularly to a kind of Temperature and Humidity circuit and control methods
Background technique
In conventional Temperature and Humidity circuit, for the relative humidity in air, there are many kinds of measurement method, wet and dry bulb measurements Method, dewpoint humidity mensuration, coulometric hygrometer, chemical substance electrical characteristics method etc..As shown in Figure 1, being existing one kind to temperature The circuit that humidity is detected.Wherein, P1.1 interface is humidity AD thief hatch, and P1.5 interface and P1.4 interface generate phase respectively Opposite 1KHz square wave.By the partial pressure of humistor RH and fixed value resistance R1, P1.1 interface generates rectangular wave, when P1.1 interface When for high level, humidity sampling, sampled point 100us after high level are carried out.P1.1 interface is AD thief hatch, for the inspection of temperature Survey is also to pass through AD detection mouth.Meanwhile the humidity range of the different targeted measurements of fixed value resistance R1 is different.Therefore only in given zone Between high-precision moisture measurement may be implemented, and except the specific sections then its measurement accurate precision it is lower.
Summary of the invention
The embodiment of the present invention provides a kind of Temperature and Humidity circuit, it is intended to single-chip microcontroller be kept not have the premise of AD thief hatch The lower detection for realizing temperature and humidity, while effectively improving the accuracy of moisture measurement.
The embodiments of the present invention are implemented as follows, a kind of Temperature and Humidity circuit, and the Temperature and Humidity circuit includes: tool There are the first I/O interface, the 2nd I/O interface, the 3rd I/O interface and the single-chip microcontroller for interrupting control interface;
Charging circuit with integration module and comparison module, the integration module include a charge and discharge capacitance;
The humistor being connected with the first I/O interface, the thermistor being connected with the 2nd I/O interface and with the 3rd I/ The fixed value resistance that O Interface is connected;
The integration module is also connected with humistor, thermistor and fixed value resistance respectively, for receiving it In I/O interface output high level signal when, using the single-chip microcontroller by the resistance that is correspondingly connected with the interface to described Charge and discharge capacitance charging;
The single-chip microcontroller is connected by the interruption control interface with the comparison module, for passing through the relatively mould Block completes the timing to the corresponding charge and discharge capacitance charging time, and calculates the thermistor and humistor according to timing time Resistance value and corresponding temperature and humidity information are obtained according to resistance value;
Wherein, the comparison module input terminal is also connected with the integration module output end, and comparison module is also used to root The timing to the charge and discharge capacitance charging time is interrupted according to the output signal of the integration module.
Preferably, the integration module includes:
The DC power supply being sequentially connected in series, first resistor, second resistance and 3rd resistor;
Integrator, the positive input of the integrator are connected with one end that the first resistor connect second resistance, The negative input of the integrator by the humistor, thermistor and fixed value resistance with corresponding I/O respectively at being connect Mouth is connected, and the output end of the integrator is connected with the input terminal of the comparison module;
The integrator negative input and output end and connect the charge and discharge capacitance.
Preferably, the comparison module includes:
Comparator, the positive input of the comparator are connected with the output end of the integrator, the comparator Negative input is connected with one end that the second resistance connect 3rd resistor, and the output end of the comparator passes through a current limliting Resistance R is connected with the interruption control interface of the single-chip microcontroller.
Preferably, the resistance value of the first resistor is equal to the sum of second resistance and the resistance value of 3rd resistor, 3rd resistor Resistance value is four times of second resistance resistance value.
The embodiments of the present invention also provide a kind of Temperature and Humidity circuit, the Temperature and Humidity circuit includes having the The single-chip microcontroller of one I/O interface, the 2nd I/O interface and the 3rd I/O interface;
Charging circuit with charge-discharge modules, the charge-discharge modules include an electrolytic capacitor;
The humistor being connected with the first I/O interface, the thermistor being connected with the 2nd I/O interface and with the 3rd I/ The fixed value resistance that O Interface is connected;
The charge-discharge modules are also connected with humistor, thermistor and fixed value resistance respectively, for receiving When one of I/O interface output high level signal, using the single-chip microcontroller by the resistance that is correspondingly connected with the interface to institute State electrolytic capacitor charging;
The single-chip microcontroller is also used to carry out timing to the charging time of the electrolytic capacitor, and calculates institute according to timing time It states the resistance value of thermistor and humistor and corresponding temperature and humidity information is obtained according to resistance value;
Wherein, the single-chip microcontroller is also used to interruption when other two I/O interface is to a low level signal wherein Timing to the electrolytic capacitor charging time.Preferably, the humistor, thermistor and fixed value resistance also divide with it is described The anode of electrolytic capacitor is connected, the cathode ground connection of electrolytic capacitor.
The embodiments of the present invention also provide a kind of control methods of Temperature and Humidity circuit, comprising the following steps:
The 3rd I/O interface is set as signal output according to the first input signal, the first I/O interface and the 2nd I/O interface For signal input;
A high level signal is exported according to the 3rd I/O interface of first control signal control single chip computer, while controlling monolithic Machine starts timing, and when interrupting control interface and receiving a signal failing edge, triggering is interrupted, and single-chip microcontroller stops timing, and records Timing time is the first timing time T1, while the first I/O interface, the 2nd I/O interface and the 3rd I/O interface being reset to export Low level signal;
Control single chip computer carries out timing and when timing time reaches preset time T, according to the second input signal setting the Two I/O interfaces are signal output, and the first I/O interface and the 3rd I/O interface are signal input;
A high level signal is exported according to the 2nd I/O interface of second control signal control single chip computer, while controlling monolithic Machine starts timing, and when interrupting control interface and receiving a signal failing edge, triggering is interrupted, and single-chip microcontroller stops timing, and records Timing time is the second timing time T2, while the first I/O interface, the 2nd I/O interface and the 3rd I/O interface being reset to export Low level signal;
Control single chip computer carries out timing and when timing time reaches preset time T, according to third input signal setting the One I/O interface is signal output, and the 2nd I/O interface and the 3rd I/O interface are signal input;
A high level signal is exported according to the first I/O interface that third controls signal control single chip computer, while single-chip microcontroller is opened Beginning timing, when interrupting control interface and receiving a signal failing edge, triggering is interrupted, and single-chip microcontroller stops timing, and when recording gauge Time is third timing time T3, while being reset to the first I/O interface, the 2nd I/O interface and the 3rd I/O interface to export low electricity Ordinary mail number;
Control single chip computer carries out timing and when timing time reaches preset time T, repeats the above steps;
Single-chip microcontroller is according to the first timing time T1 of record, the second timing time T2 and third timing time T3 calculating The resistance value of thermistor and humistor, and corresponding temperature information and humidity information are obtained according to resistance value.
Preferably, single-chip microcontroller is according to the first timing time T1, the second timing time T2 and third timing time T3 of record Calculate the resistance value of the thermistor and humistor, and the step of corresponding temperature information and humidity information are obtained according to resistance value It specifically includes:
Single-chip microcontroller is calculated the resistance value of thermistor according to formula T2/T1*R ', and automatically by table look-up obtain it is corresponding Temperature value;
Single-chip microcontroller is calculated the resistance value of humistor according to formula T3/T1*R ', and automatically by table look-up obtain it is corresponding Humidity value;
Wherein, R ' is the resistance value of fixed value resistance.
The embodiments of the present invention also provide a kind of control methods of Temperature and Humidity circuit, comprising the following steps:
The 3rd I/O interface is set as signal output according to the first input signal, the first I/O interface and the 2nd I/O interface For signal input;
A high level signal is exported according to the 3rd I/O interface of first control signal control single chip computer, while controlling monolithic Machine starts timing, and when the first I/O interface and the 2nd I/O interface are to a low level signal, triggering is interrupted, and single-chip microcontroller stops Only timing, and recording timing time is the first timing time T1, while by the first I/O interface, the 2nd I/O interface and the 3rd I/O Interface is reset to output low level signal;
Control single chip computer carries out timing and when timing time reaches preset time T, according to the second input signal setting the Two I/O interfaces are signal output, and the first I/O interface and the 3rd I/O interface are signal input;
A high level signal is exported according to the 2nd I/O interface of second control signal control single chip computer, while controlling monolithic Machine starts timing, and when the first I/O interface and the 3rd I/O interface are to a low level signal, triggering is interrupted, and single-chip microcontroller stops Only timing, and recording timing time is the second timing time T2, while by the first I/O interface, the 2nd I/O interface and the 3rd I/O Interface is reset to output low level signal;
Control single chip computer carries out timing and when timing time reaches preset time T, according to third input signal setting the One I/O interface is signal output, and the 2nd I/O interface and the 3rd I/O interface are signal input;
A high level signal is exported according to the first I/O interface that third controls signal control single chip computer, while single-chip microcontroller is opened Beginning timing, when the 2nd I/O interface and the 3rd I/O interface are to a low level signal, triggering is interrupted, and single-chip microcontroller stops meter When, and recording timing time is third timing time T3, while by the first I/O interface, the 2nd I/O interface and the 3rd I/O interface It is reset to output low level signal;
Control single chip computer carries out timing and again when timing time reaches preset time T, repeats the above steps;
Single-chip microcontroller is according to the first timing time T1 of record, the second timing time T2 and third timing time T3 calculating The resistance value of thermistor and humistor, and corresponding temperature information and humidity information are obtained according to resistance value.
Preferably, single-chip microcontroller is according to the first timing time T1, the second timing time T2 and third timing time T3 of record Calculate the resistance value of the thermistor and humistor, and the step of corresponding temperature information and humidity information are obtained according to resistance value It specifically includes:
Single-chip microcontroller is calculated the resistance value of thermistor according to formula T2/T1*R ', and automatically by table look-up obtain it is corresponding Temperature value;
Single-chip microcontroller is calculated the resistance value of humistor according to formula T3/T1*R ', and automatically by table look-up obtain it is corresponding Humidity value;
Wherein, R ' is the resistance value of fixed value resistance.
A kind of Temperature and Humidity circuit provided in an embodiment of the present invention and control method, by the I/O interface of single-chip microcontroller, simultaneously By charging circuit to the charging of humistor, thermistor and fixed value resistance and timing charging time, by the charging time and determine It is worth the resistance value of the available corresponding resistance of resistance value of resistance, and obtains temperature and humidity information, avoids single-chip microcontroller and connect using AD Mouthful acquisition signal and bring problem at high cost, effectively increase measurement essence of the program within the scope of entire relative humiture Degree, reduces measurement error.
Detailed description of the invention
Fig. 1 is a kind of structural schematic diagram of existing Temperature and Humidity circuit;
Fig. 2 is the structural schematic diagram for the Temperature and Humidity circuit that an embodiment of the present invention provides;
The structural schematic diagram for the Temperature and Humidity circuit that present invention another kind embodiment provides when Fig. 3;
Fig. 4 is the control method flow chart for the Temperature and Humidity circuit that an embodiment of the present invention provides;
Fig. 5 is the control method flow chart for the Temperature and Humidity circuit that another embodiment of the invention provides.
Specific embodiment
In order to make the objectives, technical solutions, and advantages of the present invention clearer, with reference to the accompanying drawings and embodiments, right The present invention is further elaborated.It should be appreciated that the specific embodiments described herein are merely illustrative of the present invention, and It is not used in the restriction present invention.
The embodiment of the present invention provides a kind of Temperature and Humidity circuit, as shown in Fig. 2, the Temperature and Humidity circuit includes With the first I/O interface P1.0, the 2nd I/O interface P1.1, the 3rd I/O interface P1.2 and the single-chip microcontroller for interrupting control interface P1.3 MCU;
Charging circuit with integration module and comparison module, the integration module include a charge and discharge capacitance C;
The humistor RH being connected with the first I/O interface P1.0, the thermistor being connected with the 2nd I/O interface P1.1 The RT and fixed value resistance R0 being connected with the 3rd I/O interface P1.2;
The integration module is also connected with humistor RH, thermistor RT and fixed value resistance R0 respectively, integration module For when receiving I/O interface output high level signal, using the single-chip microcontroller by being correspondingly connected with the interface Resistance charges to the charge and discharge capacitance;
The single-chip microprocessor MCU is connected by the interruption control interface P1.3 with the comparison module, for passing through It states comparison module and completes timing to the charge and discharge capacitance charging time, and the thermistor RT and wet is calculated according to timing time The resistance value of quick resistance RH simultaneously obtains corresponding temperature and humidity information according to resistance value;
Wherein, the comparison module input terminal is also connected with the integration module output end, and comparison module is also used to root The timing in the charge and discharge capacitance charging time is interrupted according to the output signal of the integration module.
Further, the integration module includes the DC power supply Vcc being sequentially connected in series, first resistor R1, the second electricity R2 and 3rd resistor R3 is hindered, further includes an integrator A, the positive input of the integrator A and the first resistor R1 connect The one end for meeting second resistance R2 is connected, and the negative input of the integrator A is respectively at passing through the humistor RH, temperature-sensitive Resistance RT and fixed value resistance R0 is connected with corresponding I/O interface, and the output end of the integrator is defeated with the comparison module Enter end to be connected.I.e. the negative input of integrator A passes through the first I/O interface of humistor RH and the single-chip microprocessor MCU P1.0 is connected, and the negative input of integrator A passes through the 2nd I/O interface P1.1 of thermistor RT and the single-chip microprocessor MCU It is connected, the negative input of integrator A is connected by fixed value resistance R0 with the 3rd I/O interface P1.2 of the single-chip microprocessor MCU It connects.Wherein, also and charge and discharge capacitance C is connected in the negative input and output end of the integrator A.
Further, the comparison module includes comparator B, the positive input of the comparator B and the integrator A Output end be connected, the negative input of the comparator B connect one end phase of 3rd resistor R3 with the second resistance R2 The output end of connection, the comparator B is connected by a current-limiting resistance R with the interruption control interface P1.2 of the single-chip microprocessor MCU It connects.
As shown in connection with fig. 2, in order to further increase control precision of the invention, the resistance value of the first resistor R1 is equal to the The sum of the resistance value of two resistance R2 and 3rd resistor R3, the resistance value of 3rd resistor R3 are four times of second resistance R2 resistance value.
The embodiment of the present invention also provides a kind of control method of above-mentioned Temperature and Humidity circuit, and the control method includes Following steps:
Step S100 sets the 3rd I/O interface P1.2 as signal output according to the first input signal, the first I/O interface P1.0 and the 2nd I/O interface P1.1 is signal input.
Step S200 exports a high level signal according to the 3rd I/O interface of first control signal control single chip computer MCU, Control single chip computer MCU starts timing simultaneously, and when interrupting control interface P1.3 and receiving a signal failing edge, triggering is interrupted, single Piece machine MCU stops timing, and recording timing time is the first timing time T1, while by the first I/O interface P1.0, the 2nd I/O Interface P1.1 and the 3rd I/O interface P1.2 is reset to output low level signal;
As shown in connection with fig. 2, when exporting without level signal when the 3rd I/O interface or export low level signal, integrator is positive The voltage of input terminal and negative input is phase isoequilibrium, as Vcc/2.The voltage of the output end of integrator is also at this time The voltage of Vcc/2, comparator B positive input are also Vcc/2, and the output voltage of comparator negative input is less than Vcc/ 2, therefore, the interruption control interface P1.3 of single-chip microprocessor MCU receives a high level signal of comparator B output at this time;When When three I/O interfaces export a high level signal, at this moment it will break between integrator A positive input and negative input Balance, will be charged at this time by fixed value resistance R0 to the charge and discharge capacitance C, the voltage of integrator A output end is just Can slowly it become smaller, when being less than the voltage of comparator B negative input, the output end of comparator B will export a low level The interruption control interface P1.3 of signal, such single-chip microprocessor MCU just will receive a failing edge.That is the first timing time T1 is logical Fixed value resistance R0 is crossed to the charging time of the charge and discharge capacitance C.
Step S300, control single chip computer carry out timing and when timing time reaches preset time T, similarly, according to the Two input signals set the 2nd I/O interface P1.1 as signal output, and the first I/O interface P1.0 and the 3rd I/O interface P1.2 are Signal input;
Step S400 exports high level letter according to the 2nd I/O interface P1.1 of second control signal control single chip computer MCU Number, while control single chip computer starts timing, when interrupting control interface and receiving a signal failing edge, triggering is interrupted, single-chip microcontroller Stop timing, and recording timing time is the second timing time T2, while by the first I/O interface P1.0, the 2nd I/O interface P1.1 And the 3rd I/O interface P1.2 be reset to output low level signal;First timing time T2 is to pass through thermistor RT to described The charging time of charge and discharge capacitance C.
Step S500, control single chip computer MCU carry out timing and when timing time reach preset time T, defeated according to third Enter signal and set the first I/O interface P1.0 as signal output, the 2nd I/O interface P1.1 and the 3rd I/O interface are signal input Mouth P1.2;
Step S600 exports a high level signal according to the first I/O interface P1.0 that third controls signal control single chip computer, Single-chip microcontroller starts timing simultaneously, and when interrupting control interface P1.3 and receiving a signal failing edge, triggering is interrupted, and single-chip microcontroller stops Only timing, and recording timing time is third timing time T3, at the same by the first I/O interface P1.0, the 2nd I/O interface P1.1 and 3rd I/O interface P1.2 is reset to output low level signal;Third timing time T3 is to pass through humistor RH to fill to described The charging time of discharge capacity C.
Step S700, control single chip computer carry out timing and when timing time reach preset time T, repeat the above steps;
Wherein, the single-chip microprocessor MCU is according to the first timing time T1, the second timing time T2 and third meter recorded every time When time T3 calculate the resistance value of the thermistor RT and humistor RH, and corresponding temperature information and wet is obtained according to resistance value Spend information.
Further, when single-chip microprocessor MCU is according to the first timing time T1, the second timing time T2 and third timing of record Between T3 calculate the resistance value of the thermistor RT and humistor RH, and corresponding temperature information is obtained according to resistance value and humidity is believed The step of breath, specifically includes:
The resistance value of thermistor RT is calculated according to formula T2/T1*R ' for single-chip microprocessor MCU, and obtains automatically by tabling look-up Corresponding temperature value;Single-chip microprocessor MCU is calculated the resistance value of humistor RH according to formula T3/T1*R ', and automatically by tabling look-up Obtain corresponding humidity value;Wherein, R ' is the resistance value of fixed value resistance R0.
In the present embodiment, the resistance value R ' of the fixed value resistance R0 is preferably 10K ' Ω, and the preset time is preferably 250 millis Second.
As shown in figure 3, the present invention provides the Temperature and Humidity circuits of another embodiment, including there is the first I/O The single-chip microcontroller of interface P1.0, the 2nd I/O interface P1.1 and the 3rd I/O interface P1.2;
Charging circuit with charge-discharge modules, the charge-discharge modules include an electrolytic capacitor EC;
The humistor RH being connected with the first I/O interface P1.0, the thermistor being connected with the 2nd I/O interface P1.1 The RT and fixed value resistance R0 being connected with the 3rd I/O interface P1.2;
The charge-discharge modules are also connected with humistor RH, thermistor RT and fixed value resistance RO respectively, are used for When receiving one of I/O interface output high level signal, using the single-chip microprocessor MCU by being correspondingly connected with the interface Resistance charges to the electrolytic capacitor EC;
The single-chip microcontroller is also used to carry out timing to the charging time of the electrolytic capacitor EC, and is calculated according to timing time The resistance value of the thermistor RT and humistor RH simultaneously obtains corresponding temperature and humidity information according to resistance value;
Wherein, the single-chip microcontroller is also used to interruption when other two I/O interface is to a low level signal wherein Timing to the electrolytic capacitor charging time.
Further, the humistor RH, thermistor RT and fixed value resistance R0 are respectively with the electrolytic capacitor EC's Anode is connected, the cathode ground connection of electrolytic capacitor EC.
As shown in figure 5, the present invention also provides the control method of the Temperature and Humidity circuit of above-described embodiment, including following step It is rapid:
Step S000 sets the 3rd I/O interface P1.2 as signal output according to the first input signal, the first I/O interface P1.0 and the 2nd I/O interface P1.1 is signal input;
Step S001 exports high level letter according to the 3rd I/O interface P1.2 of first control signal control single chip computer MCU Number, while control single chip computer MCU starts timing, when the first I/O interface P1.0 and the 2nd I/O interface P1.1 receive a low electricity It triggers and interrupts when ordinary mail, single-chip microprocessor MCU stops timing, and recording timing time is the first timing time T1, while by first I/O interface P1.0, the 2nd I/O interface P1.1 and the 3rd I/O interface P1.2 are reset to output low level signal.
Step S002, control single chip computer MCU carry out timing and when timing time reach preset time T, defeated according to second Enter signal and set the 2nd I/O interface P1.1 as signal output, the first I/O interface P1.0 and the 3rd I/O interface P1.2 are signal Input port;
Step S003 exports high level letter according to the 2nd I/O interface P1.1 of second control signal control single chip computer MCU Number, while control single chip computer starts timing, when the first I/O interface P1.0 and the 3rd I/O interface P1.2 receive a low level It triggers and interrupts when signal, single-chip microprocessor MCU stops timing, and recording timing time is the second timing time T2, while by the first I/O Interface P1.0, the 2nd I/O interface P1.1 and the 3rd I/O interface P1.2 are reset to output low level signal;
Step S004, control single chip computer MCU carry out timing and when timing time reach preset time T, defeated according to third Enter signal and set the first I/O interface P1.0 as signal output, the 2nd I/O interface P1.1 and the 3rd I/O interface P1.2 are signal Input port;
Step S005 exports high level letter according to the first I/O interface P1.0 that third controls signal control single chip computer MCU Number, while single-chip microprocessor MCU starts timing, when the 2nd I/O interface P1.1 and the 3rd I/O interface P1.2 receives a low level letter Number when triggering interrupt, single-chip microprocessor MCU stops timing, and recording timing time is third timing time T3, while the first I/O being connect Mouth P1.0, the 2nd I/O interface P1.1 and the 3rd I/O interface P1.2 are reset to output low level signal;
Step S006, control single chip computer MCU carry out timing and again when timing time reach preset time T, in repetition State step;
Wherein, single-chip microprocessor MCU can be according to the first timing time T1, the second timing time T2 and the third timing recorded every time Time T3 calculates the resistance value of the thermistor RT and humistor RH, and obtains corresponding temperature information and humidity according to resistance value Information.
In the present embodiment, single-chip microprocessor MCU is according to the first timing time T1, the second timing time T2 and third timing of record Time T3 calculates the resistance value of the thermistor RT and humistor RH, and obtains corresponding temperature information and humidity according to resistance value The step of information, specifically includes:
The resistance value of thermistor is calculated according to formula T2/T1*R ' for single-chip microprocessor MCU, and automatically by acquisition pair of tabling look-up The resistance value of humistor is calculated according to formula T3/T1*R ' for the temperature value answered, single-chip microcontroller, and automatically by acquisition pair of tabling look-up The humidity value answered;Wherein, R ' is the resistance value of fixed value resistance R0.
To sum up, the technical solution in the embodiment of the present invention, which does not need single-chip microprocessor MCU, has the function of AD.The interface of single-chip microcontroller P1.0, P1.1, P1.2 are common I/O mouthfuls, and certain interruption control interface may be I/O interface, can be according to reality Border situation flexible Application, while technical solution of the present invention can measure, consistency in humidity measuring circuit measurable range Higher, error is smaller.
The foregoing is merely illustrative of the preferred embodiments of the present invention, is not intended to limit the invention, all in essence of the invention Made any modifications, equivalent replacements, and improvements etc., should all be included in the protection scope of the present invention within mind and principle.

Claims (5)

1. a kind of Temperature and Humidity circuit, which is characterized in that the Temperature and Humidity circuit includes: with the first I/O interface, Two I/O interfaces, the 3rd I/O interface and the single-chip microcontroller for interrupting control interface;
Charging circuit with integration module and comparison module, the integration module include a charge and discharge capacitance;
The humistor being connected with the first I/O interface, the thermistor being connected with the 2nd I/O interface and connects with the 3rd I/O The fixed value resistance that mouth is connected;
The integration module is also connected with humistor, thermistor and fixed value resistance respectively, for receiving wherein one When a I/O interface output high level signal, using the single-chip microcontroller by the resistance that is correspondingly connected with the interface to the charge and discharge Electric capacitor charging;
The single-chip microcontroller is connected by the interruption control interface with the comparison module, for complete by the comparison module The timing in corresponding charge and discharge capacitance charging time in pairs, and calculate according to timing time the resistance of the thermistor and humistor It is worth and corresponding temperature and humidity information is obtained according to resistance value;
Wherein, the comparison module input terminal is also connected with the integration module output end, and comparison module is also used to according to institute The output signal for stating integration module interrupts the timing to the charge and discharge capacitance charging time;
The integration module includes: the DC power supply being sequentially connected in series, first resistor, second resistance, 3rd resistor, and integral Device;
The comparison module includes: comparator, and the positive input of the comparator is connected with the output end of the integrator, The negative input of the comparator is connected with one end that the second resistance connect 3rd resistor, the output of the comparator End is connected by a current-limiting resistance with the interruption control interface of the single-chip microcontroller;
The integrator negative input and output end and connect the charge and discharge capacitance.
2. Temperature and Humidity circuit according to claim 1, which is characterized in that the positive input of the integrator and institute The one end for stating first resistor connection second resistance is connected, and the negative input of the integrator is electric respectively at passing through the wet sensitive Resistance, thermistor and fixed value resistance are connected with corresponding I/O interface, the output end of the integrator and the comparison module Input terminal is connected.
3. Temperature and Humidity circuit according to claim 1, which is characterized in that the resistance value of the first resistor is equal to second The sum of resistance and the resistance value of 3rd resistor, the resistance value of 3rd resistor are four times of second resistance resistance value.
4. a kind of control method of Temperature and Humidity circuit as described in claim 1, which comprises the following steps:
The 3rd I/O interface is set as signal output according to the first input signal, and the first I/O interface and the 2nd I/O interface are letter Number input port;
A high level signal is exported according to the 3rd I/O interface of first control signal control single chip computer, while control single chip computer is opened Beginning timing, when interrupting control interface and receiving a signal failing edge, triggering is interrupted, and single-chip microcontroller stops timing, and when recording gauge Time is the first timing time T1, while being reset to the first I/O interface, the 2nd I/O interface and the 3rd I/O interface to export low electricity Ordinary mail number;
Control single chip computer carries out timing and when timing time reaches preset time T, sets the 2nd I/O according to the second input signal Interface is signal output, and the first I/O interface and the 3rd I/O interface are signal input;
A high level signal is exported according to the 2nd I/O interface of second control signal control single chip computer, while control single chip computer is opened Beginning timing, when interrupting control interface and receiving a signal failing edge, triggering is interrupted, and single-chip microcontroller stops timing, and when recording gauge Time is the second timing time T2, while being reset to the first I/O interface, the 2nd I/O interface and the 3rd I/O interface to export low electricity Ordinary mail number;
Control single chip computer carries out timing and when timing time reaches preset time T, sets the first I/O according to third input signal Interface is signal output, and the 2nd I/O interface and the 3rd I/O interface are signal input;
A high level signal is exported according to the first I/O interface that third controls signal control single chip computer, while single-chip microcontroller starts to count When, when interrupting control interface and receiving a signal failing edge, triggering is interrupted, and single-chip microcontroller stops timing, and records timing time For third timing time T3, while the first I/O interface, the 2nd I/O interface and the 3rd I/O interface are reset to output low level letter Number;
Control single chip computer carries out timing and when timing time reaches preset time T, repeats the above steps;
Wherein, single-chip microcontroller is counted according to the first timing time T1, the second timing time T2 and third timing time T3 recorded every time The resistance value of the thermistor and humistor is calculated, and corresponding temperature information and humidity information are obtained according to resistance value.
5. control method according to claim 4, which is characterized in that single-chip microcontroller is according to the first timing time recorded every time T1, the second timing time T2 and third timing time T3 calculate the resistance value of the thermistor and humistor, and according to resistance value The step of obtaining corresponding temperature information and humidity information specifically includes:
The resistance value of thermistor is calculated according to formula T2/T1*R ' for single-chip microcontroller, and obtains corresponding temperature automatically by tabling look-up Value;
The resistance value of humistor is calculated according to formula T3/T1*R ' for single-chip microcontroller, and obtains corresponding humidity automatically by tabling look-up Value;
Wherein, R ' is the resistance value of fixed value resistance.
CN201611150388.9A 2016-12-14 2016-12-14 A kind of Temperature and Humidity circuit and control method Active CN106768459B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201611150388.9A CN106768459B (en) 2016-12-14 2016-12-14 A kind of Temperature and Humidity circuit and control method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201611150388.9A CN106768459B (en) 2016-12-14 2016-12-14 A kind of Temperature and Humidity circuit and control method

Publications (2)

Publication Number Publication Date
CN106768459A CN106768459A (en) 2017-05-31
CN106768459B true CN106768459B (en) 2019-11-12

Family

ID=58876911

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201611150388.9A Active CN106768459B (en) 2016-12-14 2016-12-14 A kind of Temperature and Humidity circuit and control method

Country Status (1)

Country Link
CN (1) CN106768459B (en)

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110095155B (en) * 2019-05-21 2021-08-10 深圳洲斯移动物联网技术有限公司 Control method, temperature and humidity detection device and temperature and humidity detection system
CN110398519B (en) * 2019-08-26 2022-03-11 广西玉柴机器集团有限公司 Three-array NOx sensor measuring circuit
CN111679598B (en) * 2020-05-18 2023-12-29 惠州拓邦电气技术有限公司 Method and device for acquiring detection information of sensor
CN111912461B (en) * 2020-08-09 2024-08-27 广东尚研电子科技有限公司 Humidity detection device and fault detection method thereof
CN114353865B (en) * 2021-12-13 2024-04-16 广东盈科电子有限公司 Temperature and humidity detection circuit and temperature and humidity detection method
CN114441607B (en) * 2021-12-31 2024-04-16 深圳市壹号能源科技有限公司 Humidity monitoring system and method of back-up energy storage system
CN118054688B (en) * 2024-04-12 2024-07-02 深圳力高新能技术有限公司 Circuit and method for regulating and balancing positive and negative bus voltage

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
GB2206211A (en) * 1987-06-12 1988-12-29 Turnright Controls Sensor circuit
CN105547514A (en) * 2016-01-25 2016-05-04 四川长虹电器股份有限公司 Temperature measurement circuit and method
CN105698957A (en) * 2016-03-21 2016-06-22 四川长虹电器股份有限公司 Temperature measuring circuit and method

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
GB2206211A (en) * 1987-06-12 1988-12-29 Turnright Controls Sensor circuit
CN105547514A (en) * 2016-01-25 2016-05-04 四川长虹电器股份有限公司 Temperature measurement circuit and method
CN105698957A (en) * 2016-03-21 2016-06-22 四川长虹电器股份有限公司 Temperature measuring circuit and method

Also Published As

Publication number Publication date
CN106768459A (en) 2017-05-31

Similar Documents

Publication Publication Date Title
CN106768459B (en) A kind of Temperature and Humidity circuit and control method
US10355321B2 (en) Method and device for detecting states of battery and battery pack
WO2018196121A1 (en) Method and device for use in determining internal short circuit of battery
JP6406825B2 (en) System and method for detecting battery capacity
US9891285B2 (en) Battery fuel gauge
TWI491901B (en) Battery metering method, metering device and battery-powered equipment
CN106461732A (en) Method for estimating the state of health of a battery
TW201834348A (en) Method and apparatus for calibrating coulomb counting based state-of-charge estimation
WO2019140956A1 (en) Electricity quantity metering accuracy detection method, device and computer storage medium
BR112012026599B1 (en) skin contact detector and personal care device
WO2016101661A1 (en) Battery capacity calculation system and method
JP3752888B2 (en) Battery state detection device
WO2019057006A1 (en) Battery detection method
CN106932726A (en) A kind of battery core method for detecting health status
WO2020125407A1 (en) Method and device for detecting internal resistance of battery and method and device for detecting ageing of battery
CN104898737A (en) Temperature acquisition fault self-diagnosis system
CN108732502A (en) The acquisition methods and device of residual time length workable for equipment
CN116953360B (en) Insulation resistance rapid detection method of energy storage equipment
CN110133528B (en) Internal resistance measuring device and method for online self-learning lithium battery
CN107656140A (en) A kind of method and circuit that resistance is measured using embeded processor digital port
CN110133506B (en) Device and method for calculating remaining service time of lithium battery
CN109633451A (en) Energy-storage system is from trajectory parameters scaling method and SOC estimation method
CN113514771B (en) Battery impedance life estimation method and system
CN108983109A (en) Electric current estimation chip, evaluation method and remaining capacity metering system for battery
CN206331094U (en) A kind of battery data detection means and terminal

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