First, the problem show
This electrician doing a warehouse, cold chain medical use temperature recorder products, hardware solutions are not complicated, reflect the following:
STM8L + LCD + KEY + FLASH + NTC, power supply of 3V coin battery powered directly.
As the demand for low power consumption, NTC MCU IO port directly powered, in order to sleep, NTC power off.
Very stable product shipments, recently encountered a specialty pharmaceutical company customers, to test my product in time, after less than minus 20 ℃, the product began to have problems, inaccurate temperature than the actual temperature is higher than 4 ℃, which is the question the entire program.
Second, the solution process and methods
Thought it was a button battery problem, so try to use a voltage regulator power supply, then as for low temperature test results or incorrect temperature, power-related reasons ruled out.
Next, look NTC resistance table, and I dichotomy fast lookup table is correct, the ADC value is assigned several fixed value (this value is the sample value of minus 20 ℃), the result of several cesium, look-up table is not problem, exclude this factor.
Based on years of experience in product temperature, ideas focus on the supply IO port, wake after sleep, before ADC sampling, NTC IO power supply to give a high level, after this action in order to sample, I do, yes.
but! ! ! The problem lies in this, and before delay10ms, at room temperature, or even more than minus 10 ℃, is no problem, very low temperatures to die, I constantly increase the delay time, to about 1s, problem solving, and temperature error in the range of 1 ℃.
CONCLUSIONS
In the low-power temperature products, NTC with IO power supply scheme, wake after sleep, NTC IO power supply to the high level of time must be adequate, ultra-low temperature, IO level for a long time to stabilize, 10ms for microcontrollers very long, but not enough experience in this product BUG is more than 1S.
Friends hope to do electrical products similar point reference value.