CN111679598B - Method and device for acquiring detection information of sensor - Google Patents

Method and device for acquiring detection information of sensor Download PDF

Info

Publication number
CN111679598B
CN111679598B CN202010418368.5A CN202010418368A CN111679598B CN 111679598 B CN111679598 B CN 111679598B CN 202010418368 A CN202010418368 A CN 202010418368A CN 111679598 B CN111679598 B CN 111679598B
Authority
CN
China
Prior art keywords
time
detection information
discharging
acquiring
sensor
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
CN202010418368.5A
Other languages
Chinese (zh)
Other versions
CN111679598A (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.)
Huizhou Topband Electronic Technology Co Ltd
Original Assignee
Huizhou Topband 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 Huizhou Topband Electronic Technology Co Ltd filed Critical Huizhou Topband Electronic Technology Co Ltd
Priority to CN202010418368.5A priority Critical patent/CN111679598B/en
Publication of CN111679598A publication Critical patent/CN111679598A/en
Application granted granted Critical
Publication of CN111679598B publication Critical patent/CN111679598B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G05CONTROLLING; REGULATING
    • G05BCONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
    • G05B19/00Programme-control systems
    • G05B19/02Programme-control systems electric
    • G05B19/04Programme control other than numerical control, i.e. in sequence controllers or logic controllers
    • G05B19/042Programme control other than numerical control, i.e. in sequence controllers or logic controllers using digital processors
    • G05B19/0423Input/output
    • GPHYSICS
    • G05CONTROLLING; REGULATING
    • G05BCONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
    • G05B2219/00Program-control systems
    • G05B2219/20Pc systems
    • G05B2219/24Pc safety
    • G05B2219/24215Scada supervisory control and data acquisition

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Automation & Control Theory (AREA)
  • Recording Measured Values (AREA)

Abstract

The invention is suitable for the technical field of sensor detection, and provides a method and a device for acquiring sensor detection information. A method for acquiring detection information of a sensor comprises the following steps: setting a timing period of a timer, wherein the timing period comprises charging time and discharging time in the period; in each timing period, controlling the capacitor to charge according to the charging time, controlling the capacitor to discharge to the resistance of the sensor according to the discharging time, starting a timer, and recording the recording time of the timer when the capacitor reaches the preset discharging degree; and acquiring the resistance value of the sensor according to the recording time, and acquiring the detection information of the sensor according to the resistance value of the resistor. According to the invention, the acquisition of the detection information of the sensor can be realized by utilizing the self timer function of the MCU without adopting a high-cost ADC module, so that the cost is saved, and the information acquisition mode is simple and efficient.

Description

Method and device for acquiring detection information of sensor
Technical Field
The invention belongs to the technical field of sensor detection, and particularly relates to a method and a device for acquiring sensor detection information.
Background
In the prior art, most of the sensors are analog sensors, that is, the signals output by the sensors are not digital signals, but analog voltage signals, so that ADC (Analog to Digital Converter) modules are generally required to collect the analog signals output by the sensors.
In order to ensure accuracy of the data processing results and to accommodate the need for fast process control and detection, the ADC module must have a sufficiently high conversion accuracy and a sufficiently fast conversion speed. Therefore, the conversion accuracy and the conversion speed are main marks for measuring the performance of the ADC module.
However, the higher the conversion accuracy and the faster the conversion speed, the higher the cost of the ADC module, and how to reduce the cost to obtain the sensor detection information is a technical problem that needs to be solved in the field.
Disclosure of Invention
The invention provides a method and a device for acquiring sensor detection information, which aim to solve the problem of acquiring the sensor detection information by reducing the cost.
The invention is realized in such a way, and provides a method for acquiring detection information of a sensor, which comprises the following steps:
setting a timing period of a timer, wherein the timing period comprises charging time and discharging time in the period;
in each timing period, controlling the capacitor to charge according to the charging time, controlling the capacitor to discharge to the resistance of the sensor according to the discharging time, starting a timer, and recording the recording time of the timer when the capacitor reaches the preset discharging degree; and
and acquiring the resistance value of the sensor according to the recording time, and acquiring the detection information of the sensor according to the resistance value of the resistor.
Further, the step of obtaining the resistance value of the sensor according to the recording time and obtaining the detection information of the sensor according to the resistance value of the resistor specifically includes:
obtaining and storing a mapping table, wherein the mapping table comprises the corresponding relation among the recording time, the resistance value and the sensor detection information;
and inquiring the mapping table, acquiring the resistance value of the sensor according to the recording time, and acquiring the detection information of the sensor according to the resistance value of the resistor.
Further, the step of recording the recording time of the timer when the capacitor reaches the preset discharging degree specifically includes:
judging whether a level conversion signal is received or not;
if yes, judging that the capacitor reaches the preset discharging degree, and recording the recording time of the timer.
Further, the step of setting the timing period of the timer specifically includes:
acquiring the limit charging time and the limit discharging time of the capacitor, wherein the limit charging time is the time when the capacitor is fully charged when the resistance value of the analog set adjustable resistor is maximum, and the limit discharging time is the time when the capacitor is fully charged;
setting a timing period of a timer, wherein the charging time and the limit charging time meet a first preset multiple, and the discharging time and the limit discharging time meet a second preset multiple.
Further, the charging time is twice the limit charging time, and the discharging time is twice the limit discharging time.
The invention also provides a device for acquiring the detection information of the sensor, which comprises the following steps:
a timing period setting unit configured to set a timing period of a timer, the timing period including a charging time and a discharging time in the period;
the control unit is used for controlling the capacitor to charge according to the charging time in each timing period, controlling the resistor of the capacitor discharged to the sensor according to the discharging time, starting a timer, and recording the recording time of the timer when the capacitor reaches the preset discharging degree; and
and the information acquisition unit is used for acquiring the resistance value of the sensor according to the recording time and acquiring the detection information of the sensor according to the resistance value.
Still further, the information acquisition unit includes:
the table acquisition module is used for acquiring and storing a mapping table, wherein the mapping table comprises the corresponding relation among the recording time, the resistance value and the sensor detection information;
and the table query module is used for querying the mapping table, acquiring the resistance value of the sensor according to the recording time, and acquiring the detection information of the sensor according to the resistance value of the resistor.
Still further, the control unit includes:
the external interrupt module is used for judging whether a level conversion signal is received or not;
and the recording module is used for judging that the capacitor reaches the preset discharging degree and recording the recording time of the timer if the level conversion signal is judged to be received.
Still further, the timing period setting unit includes:
the time acquisition module is used for acquiring the limit charging time and the limit discharging time of the capacitor, wherein the limit charging time is the time when the capacitor is fully charged when the resistance value of the analog set adjustable resistor is maximum, and the limit discharging time is the time when the capacitor is fully charged;
the timing period setting module is used for setting the timing period of the timer, the charging time and the limit charging time meet a first preset multiple, and the discharging time and the limit discharging time meet a second preset multiple.
Further, the charging time is twice the limit charging time, and the discharging time is twice the limit discharging time.
The embodiment of the invention provides a method for acquiring sensor detection information, which comprises the steps of setting a timing period by utilizing a timing function of an MCU with a timer, controlling a capacitor to charge according to charging time in the set timing period, controlling the capacitor to discharge to a resistor of a sensor according to discharging time, starting the timer, and recording time of the timer when the capacitor reaches a preset discharging degree; and acquiring the resistance value of the sensor according to the recording time, and acquiring the detection information of the sensor according to the resistance value of the resistor. The acquisition of the sensor detection information can be realized by utilizing the self timer function of the MCU without adopting a high-cost ADC module, the cost is saved, and the information acquisition mode is simple and efficient.
Drawings
Fig. 1 is a circuit for acquiring sensor detection information according to a first embodiment of the present invention;
FIG. 2 is a flowchart of a method for acquiring sensor detection information according to an embodiment of the present invention;
fig. 3 is a flowchart of a method for acquiring sensor detection information according to a second embodiment of the present invention;
fig. 4 is a flowchart of a method for acquiring sensor detection information according to a fourth embodiment of the present invention;
fig. 5 is a block diagram of a device for acquiring sensor detection information according to a fifth embodiment of the present invention;
fig. 6 is a block diagram of a device for acquiring sensor detection information according to a sixth embodiment of the present invention;
fig. 7 is a block diagram of a device for acquiring sensor detection information according to a seventh embodiment of the present invention;
fig. 8 is a block diagram of a sensor detection information acquisition apparatus according to an eighth embodiment of the present invention.
Detailed Description
The present invention will be described in further detail with reference to the drawings and examples, in order to make the objects, technical solutions and advantages of the present invention more apparent. It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the invention.
The embodiment of the invention provides a method for acquiring sensor detection information, which comprises the steps of setting a timing period by utilizing a timing function of an MCU with a timer, controlling a capacitor to charge according to charging time in the set timing period, controlling the capacitor to discharge to a resistor of a sensor according to discharging time, starting the timer, and recording time of the timer when the capacitor reaches a preset discharging degree; and acquiring the resistance value of the sensor according to the recording time, and acquiring the detection information of the sensor according to the resistance value of the resistor. The acquisition of the sensor detection information can be realized by fully utilizing the self timer function of the MCU without adopting a high-cost ADC module, the cost is saved, and the information acquisition mode is simple and efficient.
Example 1
The present embodiment provides a method for acquiring sensor detection information, which is applied to a circuit for acquiring sensor detection information as shown in fig. 1, and includes:
an MCU; for example, the MCU may be a single chip microcomputer with a model of MC96F 8208D.
One end of the capacitor is grounded, and the other end of the capacitor is connected with the MCU port, for example, P15 of the singlechip MC96F 8208D; specifically, the capacitor may be an electrolytic capacitor, for example, an electrolytic capacitor of 2.2 μm f/400V (EC 4 in FIG. 1).
The port of the MCU is also connected with one end of a resistor of the sensor, and the other end of the resistor of the sensor is commonly grounded with the capacitor.
It will be appreciated that the MCU is provided with a timer and a timer. The sensor may be, but is not limited to, a temperature sensor.
Fig. 2 shows a flowchart of a method for acquiring sensor detection information, as shown in fig. 2, the method comprising the steps of:
step S1, setting a timing period of a timer, wherein the timing period comprises charging time and discharging time in the period;
step S2, in each timing period, controlling the capacitor to charge according to the charging time, controlling the capacitor to discharge to the resistor according to the discharging time, starting a timer, and recording the recording time of the timer when the capacitor reaches the preset discharging degree;
and S3, acquiring the resistance value of the sensor according to the recording time, and acquiring the detection information of the sensor according to the resistance value.
The principle of the method is as follows:
setting a timing period of an MCU timer; in each timing period, firstly switching an appointed IO port (for example, a P15 port of the MCU in fig. 1) of the MCU as an output port, at the moment, outputting a high level by the IO port, controlling the charging of a capacitor according to the charging time, switching the IO port of the MCU as an input port, simultaneously designating the IO port as an external falling edge triggering interrupt port, controlling the discharging of the capacitor through the resistor of a sensor according to the discharging time, switching a timer from the IO port to an input interrupt port to start timing, generating external interrupt by the MCU when the capacitor reaches a preset discharging degree, stopping the timer, and recording the recording time of the timer; according to the preset relation among the recording time, the resistance value of the sensor and the sensor detection information, the sensor detection information can be obtained.
In this embodiment, the timing period is set by using the timing function of the MCU with the timer, the charging and discharging of the capacitor are controlled according to the set timing period, and when the capacitor reaches the preset discharging degree, the recording time of the timer is recorded, so that the corresponding sensor detection information is directly obtained, the ADC module with high cost is not needed, the acquisition of the sensor detection information can be realized by using the MCU with the timer function, the cost is saved, and the information acquisition mode is simple and efficient.
Example two
The present embodiment provides a method for obtaining detection information of a sensor, as shown in fig. 3, based on the first embodiment, wherein step S3 specifically includes the following steps:
step S31, a mapping table is obtained and stored, wherein the mapping table comprises the corresponding relation among the recording time, the resistance value and the sensor detection information.
Different recording times correspond to the resistances of the sensors, so that the recording times and the resistances of the sensors have a corresponding relationship, and different resistance values of the sensors also correspond to different physical effects (namely detection information) of the sensors, so that the resistances of the sensors and the detection information of the sensors have a corresponding relationship. In this embodiment, the preset relationship of the recording time, the resistance value of the sensor, and the sensor detection information, which is the physical quantity detected by the sensor and may include, but is not limited to, temperature information, is pre-established by pre-establishing a mapping table.
Taking a temperature sensor as an example, the detection information of the sensor is known to be 1-25 ℃, and the recording time and the resistance value corresponding to each temperature information can be obtained through testing, so that the following mapping table can be established:
in the above table, the first column indicates the temperature (deg.c), the second column indicates the resistance value (k), the third column indicates the recording time (i.e., discharge time, ms), these data can be obtained through experimental measurement, and the mapping table is prestored in the MCU for subsequent use in acquiring sensor detection information according to the recording time.
And S32, inquiring a mapping table, acquiring the resistance value of the sensor according to the recording time, and acquiring the detection information of the sensor according to the resistance value.
Continuing with the above-described map, for example, the recording time is around 2.77ms, the resistance value of the sensor can be obtained as 12.491k, and the corresponding temperature is 20 ℃.
In this embodiment, through the mapping table preset in the MCU, when the capacitance reaches the preset discharging degree, the sensor detection information corresponding to the recording time is obtained in a table look-up manner according to the recording time of the timer, so that the sensor detection information can be obtained without using a high-cost ADC module.
Example III
The first embodiment provides a method for acquiring detection information of a sensor, and the step of recording a recording time of a timer when a capacitor reaches a preset discharging degree specifically includes:
step S21, judging whether a level conversion signal is received or not;
if yes, go to step S22;
step S22, judging that the capacitor reaches a preset discharging degree, and recording the recording time of the timer.
Specifically, the detection signal of the pin by the MCU is a high level or a low level signal, for example, in fig. 1, 5V supplies power to the MCU through the VDD pin, and the voltage signal of less than 1V may be set as a low level signal, and the voltage signal of more than 4V may be set as a high level signal. In each timing period, the P15 port of the MCU is switched to be an output port, at the moment, the P15 outputs a high level, and the capacitor is controlled to charge according to the charging time. After the charging time has elapsed, P15 is switched to the input port, and the external falling edge is designated to trigger the interrupt port, so that the capacitor is controlled to discharge through the resistor of the sensor according to the discharging time, and the timer starts to count. When the level conversion signal is received, the capacitor is judged to reach the preset discharging degree, the MCU generates external interruption, the timer is stopped, and the time is recorded. The preset discharging degree is the logic low level degree of the MCU and is set according to the actual power supply voltage.
In this embodiment, whether the capacitor reaches the preset discharging degree is determined by the level conversion signal. When the level conversion signal is received, the high level is switched to the low level at this time to indicate that the capacitor has reached a preset discharge degree, and the MCU records the recording time of the timer to obtain the discharge time capable of reflecting the physical effect of the sensor.
Example IV
The present embodiment provides a method for obtaining sensor detection information, as shown in fig. 4, based on any one of the embodiments, the resistor is an adjustable resistor VR1, the resistance value of the adjustable resistor VR1 is adjusted to be the maximum value, and the step of setting the timing period of the timer specifically includes:
step S11, acquiring the limit charging time and the limit discharging time of the capacitor, wherein the limit charging time is the time when the capacitor is fully charged when the resistance value of the analog set adjustable resistor is maximum, and the limit discharging time is the time when the capacitor is fully charged;
step S12, setting a timing period of a timer, wherein the charging time and the limit charging time meet a first preset multiple, and the discharging time and the limit discharging time meet a second preset multiple.
It is worth to say that, different resistance values and corresponding charge and discharge times are different. Setting an adjustable resistor VR1, and obtaining the limit charging time and the limit discharging time of the capacitor in a state that the resistance value of the adjustable resistor VR1 is adjusted to be the maximum value (the nominal value), wherein the charging time and the limit charging time meet the first preset multiple, and the discharging time and the limit discharging time meet the second preset multiple, so that the charging and discharging processes can reach enough time.
Wherein the adjustable resistor VR1 is a resistance range of the analog external sensor, and adjusting the adjustable resistor VR1 to a maximum value is a maximum value of the analog external sensor (e.g., a temperature sensor). When the value is maximum, the charge and discharge time is slowest, and the reliable completion of charge and discharge of any other resistance value is ensured by setting the timing period to be twice the slowest charge and discharge time.
In this embodiment, the first preset multiple and the second preset multiple may be equal or unequal, and preferably, the charging time is twice the limit charging time, and the discharging time is twice the limit discharging time, which can ensure that enough time is available for full charge and enough time is available for full discharge.
Example five
In accordance with an embodiment, the present embodiment provides an acquisition apparatus of sensor detection information, as shown in fig. 5, including:
a timing period setting unit 1 for setting a timing period of a timer, the timing period including a charging time and a discharging time in the period;
the control unit 2 is used for controlling the capacitor to charge according to the charging time in each timing period, controlling the capacitor to discharge to the resistor according to the discharging time, starting the timer, and recording the recording time of the timer when the capacitor reaches the preset discharging degree; and
and the information acquisition unit 3 is used for acquiring the resistance value of the sensor according to the recording time and acquiring the detection information of the sensor according to the resistance value.
In this embodiment, the timing period is set by using the timing function of the MCU with the timer, the charging and discharging of the capacitor are controlled according to the set timing period, and when the capacitor reaches the preset discharging degree, the recording time of the timer is recorded, so that the corresponding sensor detection information is directly obtained, the ADC module with high cost is not needed, the acquisition of the sensor detection information can be realized by using the MCU with the timer function, the cost is saved, and the information acquisition mode is simple and efficient.
Example six
In correspondence with the second embodiment, the present embodiment provides an acquisition apparatus of sensor detection information, as shown in fig. 6, and the information acquisition unit 3 includes, on the basis of the sixth embodiment:
the table obtaining module 31 is configured to obtain and store a mapping table, where the mapping table includes a corresponding relationship of a recording time, a resistance value, and sensor detection information;
the table query module 32 is configured to query the mapping table, obtain the resistance value of the sensor according to the recording time, and obtain the sensor detection information according to the resistance value.
In this embodiment, through the mapping table preset in the MCU, when the capacitance reaches the preset discharging degree, the sensor detection information corresponding to the recording time is obtained in a table look-up manner according to the recording time of the timer, so that the sensor detection information can be obtained without using a high-cost ADC module.
Example seven
In correspondence with the third embodiment, the present embodiment provides an acquisition apparatus of sensor detection information, as shown in fig. 7, on the basis of the fifth embodiment, the control unit 2 includes:
an external interrupt module 21 for judging whether the level shift signal is received;
the recording module 22 is configured to determine that the capacitor reaches the preset discharging degree and record the recording time of the timer if it is determined that the level shift signal is received.
In this embodiment, whether the capacitor reaches the preset discharging degree is determined by the level conversion signal. When the level conversion signal is received, the high level is switched to the low level at this time to indicate that the capacitor has reached a preset discharge degree, and the MCU records the recording time of the timer to obtain the discharge time capable of reflecting the physical effect of the sensor.
Example eight
In correspondence with the fourth embodiment, the present embodiment provides a device for acquiring sensor detection information, as shown in fig. 8, on the basis of any one of the fifth to seventh embodiments, the resistance is an adjustable resistance, and the resistance value of the adjustable resistance is adjusted to a maximum value, and the timing period setting unit 1 includes:
the time obtaining module 11 is configured to obtain a limit charging time and a limit discharging time of the capacitor, where the limit charging time is a time when the capacitor is fully charged when a resistance value of the adjustable resistor set by simulation is maximum, and the limit discharging time is a time when the capacitor is fully charged;
the timing period setting module 12 is configured to set a timing period of the timer, wherein the charging time and the limit charging time satisfy a first preset multiple, and the discharging time and the limit discharging time satisfy a second preset multiple.
In this embodiment, the first preset multiple and the second preset multiple may be equal or unequal, and preferably, the charging time is twice the limit charging time, and the discharging time is twice the limit discharging time, which can ensure that enough time is available for full charge and enough time is available for full discharge.
According to the acquisition method and device for the sensor detection information, the timing period is set by utilizing the timing function of the MCU with the timer, the capacitor is controlled to charge and discharge according to the set timing period, the recording time of the timer is recorded according to the preset discharging degree of the capacitor, the corresponding sensor detection information is further acquired directly, a high-cost ADC module is not needed, the acquisition of the sensor detection information can be realized by utilizing the function of the MCU with the timer, the cost is saved, and the information acquisition mode is simple and efficient.
Further, through the mapping table preset in the MCU, when the capacitance reaches the preset discharging degree, the sensor detection information corresponding to the recording time is obtained in a table look-up mode according to the recording time of the timer, so that the sensor detection information can be obtained without adopting a high-cost ADC module.
Further, whether the capacitor reaches the preset discharging degree is judged through the level conversion signal. When the level conversion signal is received, the high level is switched to the low level at this time to indicate that the capacitor has reached a preset discharge degree, and the MCU records the recording time of the timer to obtain the discharge time capable of reflecting the physical effect of the sensor.
Further, the first preset multiple and the second preset multiple may be equal or unequal, preferably, the charging time is twice the limit charging time, and the discharging time is twice the limit discharging time, which can ensure that enough time is available for full charge and enough time is available for complete discharge.
The foregoing description of the preferred embodiments of the invention is not intended to be limiting, but rather is intended to cover all modifications, equivalents, and alternatives falling within the spirit and principles of the invention.

Claims (8)

1. The method for acquiring the detection information of the sensor is characterized by comprising the following steps of:
setting a timing period of a timer, wherein the timing period comprises charging time and discharging time in the period;
in each timing period, controlling the capacitor to charge according to the charging time, controlling the capacitor to discharge to the resistance of the sensor according to the discharging time, starting a timer, and recording the recording time of the timer when the capacitor reaches the preset discharging degree, wherein the preset discharging degree is the logic low level degree of the MCU set according to the actual power supply voltage; and
acquiring the resistance value of the sensor according to the recording time, and acquiring sensor detection information according to the resistance value of the resistor;
the obtaining the resistance value of the sensor according to the recording time, and obtaining the sensor detection information according to the resistance value of the resistor specifically comprises:
establishing a mapping table according to the sensor detection information and the recording time and the resistance value which are obtained through testing and correspond to the sensor detection information;
obtaining and storing a mapping table, wherein the mapping table comprises the corresponding relation among the recording time, the resistance value and the sensor detection information;
and inquiring the mapping table, acquiring the resistance value of the sensor according to the recording time, and acquiring the detection information of the sensor according to the resistance value of the resistor.
2. The method for acquiring sensor detection information according to claim 1, wherein the step of recording the recording time of the timer when the capacitance reaches a preset discharge level comprises:
judging whether a level conversion signal is received or not;
if yes, judging that the capacitor reaches the preset discharging degree, and recording the recording time of the timer.
3. The method for acquiring sensor detection information according to any one of claims 1 to 2, wherein the step of setting a timing period of a timer specifically comprises:
acquiring the limit charging time and the limit discharging time of the capacitor, wherein the limit charging time is the time when the capacitor is fully charged when the resistance value of the analog set adjustable resistor is maximum, and the limit discharging time is the time when the capacitor is fully charged;
setting a timing period of a timer, wherein the charging time and the limit charging time meet a first preset multiple, and the discharging time and the limit discharging time meet a second preset multiple.
4. The method for acquiring sensor detection information according to claim 3, wherein the charging time is twice the limit charging time, and the discharging time is twice the limit discharging time.
5. An acquisition apparatus of sensor detection information, comprising:
a timing period setting unit configured to set a timing period of a timer, the timing period including a charging time and a discharging time in the period;
the control unit is used for controlling the capacitor to charge according to the charging time in each timing period, controlling the capacitor to discharge to the resistor of the sensor according to the discharging time, starting a timer, and recording the recording time of the timer when the capacitor reaches the preset discharging degree, wherein the preset discharging degree is the MCU logic low level degree set according to the actual power supply voltage; and
the information acquisition unit is used for acquiring the resistance value of the sensor according to the recording time, and acquiring the sensor detection information according to the resistance value, and comprises:
the table acquisition module is used for establishing a mapping table according to the sensor detection information and the record time and the resistance value which are obtained through testing and correspond to the sensor detection information;
the mapping table comprises the corresponding relation among the recording time, the resistance value and the sensor detection information;
and the table query module is used for querying the mapping table, acquiring the resistance value of the sensor according to the recording time, and acquiring the detection information of the sensor according to the resistance value of the resistor.
6. The apparatus for acquiring sensor detection information according to claim 5, wherein the control unit includes:
the external interrupt module is used for judging whether a level conversion signal is received or not;
and the recording module is used for judging that the capacitor reaches the preset discharging degree and recording the recording time of the timer if the level conversion signal is judged to be received.
7. The acquisition device of sensor detection information according to any one of claims 5 to 6, wherein the timing period setting unit includes:
the time acquisition module is used for acquiring the limit charging time and the limit discharging time of the capacitor, wherein the limit charging time is the time when the capacitor is fully charged when the resistance value of the analog set adjustable resistor is maximum, and the limit discharging time is the time when the capacitor is fully charged;
the timing period setting module is used for setting the timing period of the timer, the charging time and the limit charging time meet a first preset multiple, and the discharging time and the limit discharging time meet a second preset multiple.
8. The sensor detection information acquisition apparatus according to claim 7, wherein the charging time is twice the limit charging time, and the discharging time is twice the limit discharging time.
CN202010418368.5A 2020-05-18 2020-05-18 Method and device for acquiring detection information of sensor Active CN111679598B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010418368.5A CN111679598B (en) 2020-05-18 2020-05-18 Method and device for acquiring detection information of sensor

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010418368.5A CN111679598B (en) 2020-05-18 2020-05-18 Method and device for acquiring detection information of sensor

Publications (2)

Publication Number Publication Date
CN111679598A CN111679598A (en) 2020-09-18
CN111679598B true CN111679598B (en) 2023-12-29

Family

ID=72434035

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010418368.5A Active CN111679598B (en) 2020-05-18 2020-05-18 Method and device for acquiring detection information of sensor

Country Status (1)

Country Link
CN (1) CN111679598B (en)

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN2658864Y (en) * 2003-04-24 2004-11-24 上海复旦微电子股份有限公司 Remote controller circuit having temperature measuring function
CN200975924Y (en) * 2006-10-25 2007-11-14 郭青 Digital automatic temperature measuring equipment
CN101118190A (en) * 2007-06-15 2008-02-06 杨如祥 Temperature measurement device and process for measuring temperature with device
CN101789790A (en) * 2009-12-25 2010-07-28 深圳和而泰智能控制股份有限公司 Method and device for realizing A/D conversion by utilizing I/O port
WO2011075971A1 (en) * 2009-12-23 2011-06-30 北京宝力马传感技术有限公司 Humidity measurement device and method
CN102929184A (en) * 2012-11-23 2013-02-13 杭州士兰微电子股份有限公司 Voltage detection device for micro control unit
WO2016059940A1 (en) * 2014-10-17 2016-04-21 日本写真印刷株式会社 Pressure detection device, pressure detection device control method, and program
CN106768459A (en) * 2016-12-14 2017-05-31 深圳拓邦股份有限公司 A kind of Temperature and Humidity circuit and control method

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2009006556A1 (en) * 2007-07-03 2009-01-08 Cypress Semiconductor Corporation Normalizing capacitive sensor array signals
KR101500400B1 (en) * 2013-12-10 2015-03-09 현대자동차 주식회사 Apparatus for detecting capacitance

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN2658864Y (en) * 2003-04-24 2004-11-24 上海复旦微电子股份有限公司 Remote controller circuit having temperature measuring function
CN200975924Y (en) * 2006-10-25 2007-11-14 郭青 Digital automatic temperature measuring equipment
CN101118190A (en) * 2007-06-15 2008-02-06 杨如祥 Temperature measurement device and process for measuring temperature with device
WO2011075971A1 (en) * 2009-12-23 2011-06-30 北京宝力马传感技术有限公司 Humidity measurement device and method
CN101789790A (en) * 2009-12-25 2010-07-28 深圳和而泰智能控制股份有限公司 Method and device for realizing A/D conversion by utilizing I/O port
CN102929184A (en) * 2012-11-23 2013-02-13 杭州士兰微电子股份有限公司 Voltage detection device for micro control unit
WO2016059940A1 (en) * 2014-10-17 2016-04-21 日本写真印刷株式会社 Pressure detection device, pressure detection device control method, and program
CN106768459A (en) * 2016-12-14 2017-05-31 深圳拓邦股份有限公司 A kind of Temperature and Humidity circuit and control method

Also Published As

Publication number Publication date
CN111679598A (en) 2020-09-18

Similar Documents

Publication Publication Date Title
US8130000B2 (en) Methods and apparatus for battery monitoring
KR100303229B1 (en) Microcontroller with analog front-end for providing intelligent battery management
US5841996A (en) Serial communication interface system having programmable microcontroller for use in a battery pack
KR100272472B1 (en) Microcontroller wake-up function having digitally programmable threshhold
US8264231B2 (en) Switch circuit
US8125232B2 (en) Capacitive sensing device and method
KR100247184B1 (en) Digital trimming of on-chip analog components
WO1997012310A9 (en) Digital trimming of on-chip analog components
CN109374148A (en) A kind of temperature measuring device and measurement method
US7263431B2 (en) Analog input signal processing circuit
CN111679598B (en) Method and device for acquiring detection information of sensor
JP2001185233A (en) Detection circuit for battery voltage, battery pack and detection method of battery voltage
CN106017717B (en) Thermistor temperature sensor
CN109405993B (en) Temperature detection circuit
JPS59204729A (en) Method and device for converting measuring value of temperature
JP2000338159A (en) Analog input device, and method for detecting its disconnection
JPH07234979A (en) Heat sensor
CN112504413B (en) Full-digitalization conversion method and device for six-component balance bridge detection
JP2003032117A (en) Integral type analog to digital converter
JP2001034368A (en) Power supply voltage monitor and control device
CN2380925Y (en) Apparatus for measuring resistance of sensor
JPS625664Y2 (en)
US5144309A (en) Analog-to-digital converter to be used along with a resistive sensor
JPS61231472A (en) Circuit for detecting voltage of battery
JP3992999B2 (en) Charge current detection circuit

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