Data determination method and device of temperature sensor and temperature sensor
By querying the temperature compensation table and calculating the temperature measurement value, the complex problem of existing temperature sensor hardware compensation methods is solved, and high-precision temperature measurement is achieved, reducing costs.
Patent Information
- Application Number
- CN202411889905.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-20
- Publication Date
- 2025-03-25
AI Technical Summary
The measurement accuracy of existing temperature sensors is limited by hardware compensation methods, resulting in complex circuit structure, high component accuracy requirements and high correction costs.
By obtaining the voltage sampling value of the target to be measured, querying the temperature compensation table based on the voltage sampling value, determining the temperature setting value, sampling voltage interval and temperature compensation value, and then calculating the temperature measurement value. This method does not rely on complex hardware structures and performs accuracy correction through pre-set temperature compensation tables.
It realizes that the measurement parameters of the temperature sensor are corrected without the need for complex hardware structures, improves the measurement accuracy of the temperature sensor and reduces the R&D time and cost.
Smart Images

Figure CN119688119A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present invention relate to the technical field of temperature sensors, and in particular to a method and device for determining data of a temperature sensor, and a temperature sensor. Background Art
[0002] With the development of science and technology, temperature sensors are used in more and more occasions. However, due to reasons such as material, thermoelectric effect, drift, etc., there is a large difference between the sampled temperature value and the actual value during use, which often cannot meet the occasions with high accuracy requirements.
[0003] The existing temperature compensation methods mainly use hardware compensation methods such as thermocouples and bridges. As a result, the hardware circuit is complex, and the circuit often needs to be modified repeatedly to achieve the best temperature compensation effect for temperature changes. In addition, for occasions with high precision requirements, high-precision components are often required, which undoubtedly increases R&D time and cost. Summary of the invention
[0004] The embodiments of the present invention provide a method, device and temperature sensor for determining data of a temperature sensor, which solve the technical problems of complex circuit structure, high component accuracy requirements and high correction cost in the prior art of correcting the measurement accuracy of the temperature sensor by relying on hardware compensation methods.
[0005] An embodiment of the present invention provides a method for determining data of a temperature sensor, the method comprising:
[0006] Obtaining the voltage sampling value of the target to be tested;
[0007] Based on the voltage sampling value, query the temperature compensation table to determine the temperature setting value, sampling voltage interval and temperature compensation value corresponding to the voltage sampling value, wherein the sampling voltage interval is determined based on the voltage sampling value collected in advance at a preset sampling period;
[0008] Determining a first temperature value based on the voltage sampling value and the sampling voltage interval, wherein the first temperature value is used to represent a decimal part of a temperature measurement value of the target to be measured;
[0009] The temperature measurement value of the target to be measured is determined based on the temperature setting value, the first temperature value and the temperature compensation value.
[0010] Further, determining the first temperature value based on the voltage sampling value and the sampling voltage interval includes:
[0011] Using the formula T 小数 =(V 采 -V min )*((V 采 -Vmin ) / (V max -V min ))*100% determines the first temperature value, wherein T 小数 is the first temperature value, V 采 is the voltage sampling value, V max is the maximum value of the sampling voltage interval, V min is the minimum value of the sampling voltage interval.
[0012] Further, determining the temperature measurement value of the target to be measured based on the temperature setting value, the first temperature value and the temperature compensation value includes:
[0013] Using the formula T 测量 =T 采 +T 小数 +T 补偿 Determine the temperature measurement value, where T 测量 is the temperature measurement value, T 采 is the temperature setting value, T 小数 is the first temperature value, T 补偿 is the temperature compensation value.
[0014] Further, obtaining a voltage sampling value of the target to be measured includes:
[0015] Obtaining the current voltage value of the target to be measured;
[0016] The current voltage value is converted into a digital quantity to obtain the voltage sampling value.
[0017] Furthermore, the method for determining the sampling voltage interval includes:
[0018] Acquire a voltage sampling value of a test sample based on a preset sampling period;
[0019] The sampling voltage interval corresponding to each of the voltage sampling values is determined by using the difference between two adjacent voltage sampling values, wherein the maximum value of the sampling voltage interval corresponding to the previous voltage sampling value is the minimum value of the sampling voltage interval corresponding to the next voltage sampling value.
[0020] Further, determining the sampling voltage interval corresponding to each of the voltage sampling values by using the difference between two adjacent voltage sampling values includes:
[0021] Subtract two adjacent voltage sampling values, and average the obtained differences;
[0022] The average value obtained by adding the previous voltage sampling value is taken as the maximum value of the corresponding sampling voltage interval;
[0023] The average value obtained by subtracting the previous voltage sampling value is taken as the minimum value of the corresponding sampling voltage interval.
[0024] Furthermore, the temperature setting value is a temperature value corresponding to each of the voltage sampling values of the test sample, which is determined based on the characteristics of the thermistor in the temperature sensor.
[0025] Furthermore, the temperature compensation value is a temperature compensation amount determined by step compensation based on measurement experience of the temperature sensor or a preset measurement calibration.
[0026] An embodiment of the present invention further provides a temperature display device of a temperature sensor, the temperature display device comprising:
[0027] A voltage acquisition unit, used to acquire a voltage sampling value of a target to be tested;
[0028] A data query unit, configured to query a temperature compensation table based on the voltage sampling value, and determine a temperature setting value, a sampling voltage interval, and a temperature compensation value corresponding to the voltage sampling value, wherein the sampling voltage interval is determined based on the voltage sampling value collected in advance at a preset sampling period;
[0029] A first calculation unit, configured to determine a first temperature value based on the voltage sampling value and the sampling voltage interval, wherein the first temperature value is used to represent a decimal part of a temperature measurement value of the target to be measured;
[0030] The second calculation unit is used to determine the temperature measurement value of the target to be measured based on the temperature setting value, the first temperature value and the temperature compensation value.
[0031] An embodiment of the present invention further provides a temperature sensor, which includes the temperature display device of the temperature sensor described in any of the above embodiments.
[0032] The embodiment of the present invention discloses a method, device and temperature sensor for determining data of a temperature sensor, the method comprising: obtaining a voltage sampling value of a target to be measured; querying a temperature compensation table based on the voltage sampling value to determine a temperature setting value, a sampling voltage interval and a temperature compensation value corresponding to the voltage sampling value; determining a first temperature value based on the voltage sampling value and the sampling voltage interval, wherein the first temperature value is used to characterize the decimal part of the temperature measurement value of the target to be measured; and determining the temperature measurement value of the target to be measured based on the temperature setting value, the first temperature value and the temperature compensation value. The present application uses a pre-set temperature compensation table to calculate the decimal part and the sum of the temperature measurement value of the target to be measured respectively using each temperature data set in the table, thereby solving the technical problems of complex circuit structure, high component accuracy requirements and high correction cost in the prior art of correcting the measurement accuracy of the temperature sensor by relying on the hardware compensation method, and achieving the technical effect of correcting the measurement parameters of the temperature sensor without complex hardware structure, thereby improving the measurement accuracy of the temperature sensor. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] Figure 1 is a flow chart of a method for determining data of a temperature sensor provided by an embodiment of the present invention;
[0034] Figure 2 It is a structural diagram of a temperature display device of a temperature sensor provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0035] The present invention will be further described in detail below in conjunction with the accompanying drawings and embodiments. It is to be understood that the specific embodiments described herein are only used to explain the present invention, rather than to limit the present invention. It should also be noted that, for ease of description, only parts related to the present invention, rather than all structures, are shown in the accompanying drawings.
[0036] It should be noted that the terms "first", "second", etc. in the specification, claims and drawings of the present invention are used to distinguish different objects, rather than to limit a specific order. The following embodiments of the present invention can be implemented separately, or in combination with each other, and the embodiments of the present invention do not specifically limit this.
[0037] Figure 1 The present invention provides a flow chart of a method for determining temperature sensor data.
[0038] like Figure 1 As shown, the data determination method of the temperature sensor specifically includes the following steps:
[0039] S101, obtaining a voltage sampling value of a target to be measured.
[0040] Specifically, a thermistor is provided in the temperature sensor, and the voltage condition of the target to be measured is monitored through the thermal effect of the thermistor, thereby obtaining a voltage sampling value of the target to be measured.
[0041] Optionally, S101 acquiring the voltage sampling value of the target to be measured includes: acquiring the current voltage value of the target to be measured; and performing digital quantity conversion on the current voltage value to obtain the voltage sampling value.
[0042] Specifically, the current voltage value V of the target to be measured obtained by the temperature sensor 测量 For analog quantity, we need to use the formula V 采 =V 测量 *3300 / 4096 for the current voltage value V 测量 Perform digital conversion to obtain the voltage sampling value V 采 , where 3300 means the full scale of the analog quantity with 3.3V power supply is 3300mV, and 4096 means a 12-bit AD converter is used, and the full scale of the digital quantity is 4096.
[0043] S102, querying a temperature compensation table based on the voltage sampling value to determine a temperature setting value, a sampling voltage interval, and a temperature compensation value corresponding to the voltage sampling value, wherein the sampling voltage interval is determined based on the voltage sampling value collected in advance at a preset sampling period.
[0044] Specifically, the temperature compensation table includes the temperature setting value corresponding to the voltage sampling value, the sampling voltage interval and the temperature compensation value, wherein the temperature setting value is the temperature value corresponding to the temperature sampling value determined based on the temperature characteristics of the thermistor, the sampling voltage interval is the voltage range determined based on the difference between two adjacent voltage sampling values, and the temperature compensation value is the temperature compensation amount determined by the step compensation method based on the change characteristics of the temperature sensor within the specified temperature range. By way of example, Table 1 shows the temperature compensation table of a certain temperature sensor.
[0045] Table 1. Temperature compensation table for a temperature sensor
[0046]
[0047]
[0048]
[0049]
[0050] It should be noted that, according to measurement experience or preset measurement calibration, the temperature sensor will have a large temperature compensation value difference at extreme temperatures, such as less than -20°C, while the temperature compensation value of the temperature sensor in the range of -20°C to 60°C is small or does not need to be compensated. Therefore, referring to Table 1, in the embodiment of the present invention, the measurable range of the temperature sensor is -40°C to 85°C, and the temperature compensation values of different intervals are determined according to the test samples as shown in Table 1. In addition, when the temperature value obtained by the temperature sensor is greater than 85°C or less than -40°C, the temperature sensor directly prompts an alarm.
[0051] S103, determining a first temperature value based on the voltage sampling value and the sampling voltage interval, wherein the first temperature value is used to represent a decimal part of a temperature measurement value of the target to be measured.
[0052] Optionally, S103, determining the first temperature value based on the voltage sampling value and the sampling voltage interval specifically includes:
[0053] Using the formula T 小数 =(V 采 -V min )*((V 采 -V min ) / (V max -V min ))*100% determines the first temperature value, where T 小数 is the first temperature value, V 采 is the voltage sampling value, V max is the maximum value of the sampling voltage interval, V min is the minimum value of the sampling voltage interval.
[0054] Specifically, in order to improve the accuracy of the temperature sensor, the first temperature value is retained with at least two decimal places.
[0055] S104: Determine a temperature measurement value of the target to be measured based on the temperature setting value, the first temperature value, and the temperature compensation value.
[0056] Optionally, S104, determining a temperature measurement value of the target to be measured based on the temperature setting value, the first temperature value and the temperature compensation value specifically includes:
[0057] Using the formula T 测量 =T 采 +T 小数 +T 补偿 Determine the temperature measurement, where T 测量 is the temperature measurement value, T 采 is the temperature setting value, T 小数 is the first temperature value, T 补偿 is the temperature compensation value.
[0058] The present application uses a pre-set temperature compensation table to calculate the decimal part and the total of the temperature measurement value of the target to be measured, using the temperature data set in the table. This solves the technical problems of complex circuit structure, high component accuracy requirements and high correction cost in the prior art that relies on hardware compensation methods to correct the measurement accuracy of the temperature sensor. This achieves the technical effect of correcting the measurement parameters of the temperature sensor without a complex hardware structure, thereby improving the measurement accuracy of the temperature sensor.
[0059] Based on the above technical solutions, the method for determining the sampling voltage interval includes:
[0060] The voltage sampling value of the test sample is obtained based on a preset sampling period; the sampling voltage interval corresponding to each voltage sampling value is determined using the difference between two adjacent voltage sampling values, wherein the maximum value of the sampling voltage interval corresponding to the previous voltage sampling value is the minimum value of the sampling voltage interval corresponding to the next voltage sampling value.
[0061] Specifically, firstly, the current voltage value of the test sample is obtained through a preset sampling period, and then the formula V is used. 采 =V 测量 *3300 / 4096 for the current voltage value V 测量 Perform digital conversion to obtain the voltage sampling value V 采 Referring to Table 1, the maximum and minimum values of the sampling values, ie, the sampling voltage interval, are determined by using the difference between two adjacent voltage sampling values.
[0062] Optionally, determining the sampling voltage interval corresponding to each voltage sampling value by using the difference between two adjacent voltage sampling values includes:
[0063] The difference between two adjacent voltage sampling values is calculated, and the average value of the difference is taken; the average value obtained by adding the previous voltage sampling value is taken as the maximum value of the corresponding sampling voltage interval; the average value obtained by subtracting the previous voltage sampling value is taken as the minimum value of the corresponding sampling voltage interval.
[0064] For example, referring to Table 1, the voltage sampling value corresponding to -39°C is 0.090, and the voltage sampling value corresponding to -38°C is 0.096, ((0.096-0.090) / 2)+0.090=0.093 is the maximum value of the sampling voltage interval corresponding to -39°C, and it is also the minimum value of the sampling voltage interval corresponding to -38°C, 0.090-((0.096-0.090) / 2)=0.087 is the minimum value of the sampling voltage interval corresponding to -39°C, and so on, the maximum and minimum temperature values corresponding to other temperature points can be determined.
[0065] Optionally, the temperature setting value is a temperature value corresponding to each voltage sampling value of the test sample determined based on the characteristics of the thermistor in the temperature sensor.
[0066] Optionally, the temperature compensation value is a temperature compensation amount determined by step compensation based on measurement experience of the temperature sensor or a preset measurement calibration.
[0067] Specifically, according to measurement experience or preset measurement calibration, the temperature compensation value difference of the temperature sensor at extreme temperatures, such as below -20°C, will be large, while the temperature compensation value of the temperature sensor in the range of -20°C to 60°C is small or does not require compensation. Therefore, different temperature compensation amounts can be determined using a step compensation method, see Table 1. In the range of -9°C to 19°C, the temperature compensation value is 0, that is, no compensation is required. At other temperature values, different temperature compensation values are added accordingly.
[0068] It should be noted that during the testing of the test sample, if the voltage sampling value at a certain temperature value deviates greatly from the actual value, the temperature compensation value can be appropriately adjusted without strictly following the principle of step compensation, so that the voltage sampling value is closer to the actual value, thereby improving the accuracy of the temperature sensor.
[0069] Figure 2 It is a structural diagram of a temperature display device of a temperature sensor provided by an embodiment of the present invention.
[0070] like Figure 2 As shown, the temperature display device of the temperature sensor specifically includes:
[0071] The voltage acquisition unit 21 is used to acquire the voltage sampling value of the target to be measured;
[0072] A data query unit 22 is used to query the temperature compensation table based on the voltage sampling value to determine the temperature setting value, the sampling voltage interval and the temperature compensation value corresponding to the voltage sampling value, wherein the sampling voltage interval is determined based on the voltage sampling value collected in advance at a preset sampling period;
[0073] A first calculation unit 23, used to determine a first temperature value based on the voltage sampling value and the sampling voltage interval, wherein the first temperature value is used to represent a decimal part of a temperature measurement value of a target to be measured;
[0074] The second calculation unit 24 is used to determine a temperature measurement value of the target to be measured based on the temperature setting value, the first temperature value and the temperature compensation value.
[0075] Optionally, the first calculating unit 23 is specifically configured to:
[0076] Using the formula T 小数 =(V采 -V min )*((V 采 -V min ) / (V max -V min ))*100% determines the first temperature value, where T 小数 is the first temperature value, V 采 is the voltage sampling value, V max is the maximum value of the sampling voltage interval, V min is the minimum value of the sampling voltage interval.
[0077] Optionally, the second calculating unit 24 is specifically configured to:
[0078] Using the formula T 测量 =T 采 +T 小数 +T 补偿 Determine the temperature measurement, where T 测量 is the temperature measurement value, T 采 is the temperature setting value, T 小数 is the first temperature value, T 补偿 is the temperature compensation value.
[0079] Optionally, the voltage acquisition unit 21 includes:
[0080] The voltage acquisition subunit is used to obtain the current voltage value of the target to be tested;
[0081] The voltage conversion subunit is used to perform digital quantity conversion on the current voltage value to obtain a voltage sampling value.
[0082] The temperature display device of the temperature sensor provided in the embodiment of the present invention has the same technical features as the temperature display method of the temperature sensor provided in the above embodiment, and therefore can solve the same technical problems and achieve the same technical effects.
[0083] An embodiment of the present invention further provides a temperature sensor, which includes the temperature display device of the temperature sensor in any of the above embodiments.
[0084] The temperature sensor provided in the embodiment of the present invention includes the temperature display device of the temperature sensor in the above embodiment. Therefore, the temperature sensor provided in the embodiment of the present invention also has the beneficial effects described in the above embodiment, which will not be described in detail here.
[0085] In the description of the embodiments of the present invention, unless otherwise clearly specified and limited, the terms "installed", "connected", and "connected" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection or an indirect connection through an intermediate medium, or it can be the internal communication of two components. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.
[0086] Finally, it should be noted that the above are only preferred embodiments of the present invention and the technical principles used. Those skilled in the art will understand that the present invention is not limited to the specific embodiments described herein, and that various obvious changes, readjustments and substitutions can be made by those skilled in the art without departing from the scope of protection of the present invention. Therefore, although the present invention has been described in more detail through the above embodiments, the present invention is not limited to the above embodiments, and may include more other equivalent embodiments without departing from the concept of the present invention, and the scope of the present invention is determined by the scope of the appended claims.
Claims
1. A method for determining data of a temperature sensor, characterized in that: The data determination method comprises: Obtaining the voltage sampling value of the target to be tested; Based on the voltage sampling value, query the temperature compensation table to determine the temperature setting value, sampling voltage interval and temperature compensation value corresponding to the voltage sampling value, wherein the sampling voltage interval is determined based on the voltage sampling value collected in advance at a preset sampling period; Determining a first temperature value based on the voltage sampling value and the sampling voltage interval, wherein the first temperature value is used to represent a decimal part of a temperature measurement value of the target to be measured; The temperature measurement value of the target to be measured is determined based on the temperature setting value, the first temperature value and the temperature compensation value.
2. The method for determining temperature sensor data according to claim 1, characterized in that: Determining a first temperature value based on the voltage sampling value and the sampling voltage interval includes: Using the formula T 小数 =(V 采 -V min )*((V 采 -V min ) / (V max -V min ))*100% determines the first temperature value, wherein T 小数 is the first temperature value, V 采 is the voltage sampling value, V max is the maximum value of the sampling voltage interval, V min is the minimum value of the sampling voltage interval.
3. The method for determining temperature sensor data according to claim 2, characterized in that: Determining the temperature measurement value of the target to be measured based on the temperature setting value, the first temperature value, and the temperature compensation value includes: Using the formula T 测量 =T 采 +T 小数 +T 补偿 Determine the temperature measurement value, where T 测量 is the temperature measurement value, T 采 is the temperature setting value, T 小数 is the first temperature value, T 补偿 is the temperature compensation value.
4. The method for determining temperature sensor data according to claim 1, characterized in that: Obtaining the voltage sampling value of the target to be tested includes: Obtaining the current voltage value of the target to be measured; The current voltage value is converted into a digital quantity to obtain the voltage sampling value.
5. The method for determining temperature sensor data according to claim 1, characterized in that: The method for determining the sampling voltage interval includes: Acquire a voltage sampling value of a test sample based on a preset sampling period; The sampling voltage interval corresponding to each of the voltage sampling values is determined by using the difference between two adjacent voltage sampling values, wherein the maximum value of the sampling voltage interval corresponding to the previous voltage sampling value is the minimum value of the sampling voltage interval corresponding to the next voltage sampling value.
6. The method for determining data of a temperature sensor according to claim 5, characterized in that: Determining the sampling voltage interval corresponding to each of the voltage sampling values by using the difference between two adjacent voltage sampling values includes: Subtract two adjacent voltage sampling values, and average the obtained differences; The average value obtained by adding the previous voltage sampling value is taken as the maximum value of the corresponding sampling voltage interval; The average value obtained by subtracting the previous voltage sampling value is taken as the minimum value of the corresponding sampling voltage interval.
7. The method for determining temperature sensor data according to claim 5, characterized in that: The temperature setting value is a temperature value corresponding to each of the voltage sampling values of the test sample and determined based on the characteristics of the thermistor in the temperature sensor.
8. The method for determining temperature sensor data according to claim 5, characterized in that: The temperature compensation value is a temperature compensation amount determined by step compensation based on measurement experience or preset measurement calibration of the temperature sensor.
9. A temperature display device of a temperature sensor, characterized in that: The temperature display device comprises: A voltage acquisition unit, used to acquire a voltage sampling value of a target to be tested; A data query unit, configured to query a temperature compensation table based on the voltage sampling value, and determine a temperature setting value, a sampling voltage interval, and a temperature compensation value corresponding to the voltage sampling value, wherein the sampling voltage interval is determined based on the voltage sampling value collected in advance at a preset sampling period; A first calculation unit, configured to determine a first temperature value based on the voltage sampling value and the sampling voltage interval, wherein the first temperature value is used to represent a decimal part of a temperature measurement value of the target to be measured; The second calculation unit is used to determine the temperature measurement value of the target to be measured based on the temperature setting value, the first temperature value and the temperature compensation value.
10. A temperature sensor, characterized in that: The temperature sensor comprises the temperature display device of the temperature sensor according to claim 9 above.