Logging temperature meter (ltm) v1 – prototype Vin calibration

Logging temperature meter (ltm) is a ESP8266 based temperature measurement and logging device.

ESP32

The project is based on port of an existing ESP8266 Arduino project, and consideration was given to migration to the ESP32 hardware platform, but there are large differences to the WiFi related libraries… so for now, ESP8266 looks ok.

A bigger issue is that the ESP32 ADC is renowned for non-linearity, worse in some modes than others.

One poster offered the following graph of an ESP32 measurement to a discussion.

Some developers have worked on a per device look up table to implement a linearisation scheme. That means each individual device needs to have its input characteristic mapped and then used by the compensation code running on that device.

There remain development options for multi channel logging if needed. My own view is that using a separate I2C ADC with attention to low noise is a better solution for multichannel ltm.

I did manage to port the single channel code to ESP32, and it worked, but the linearity problem is a killer.

ESP8266 prototype

The prototype is based on a port of RF Power Meter 2 (RFPM2). Since advice is that SPIFFS is deprecated on ESP8266, it has been replaced by LittleFS.

Above, a breadboard prototype of ltm. The time is obtained from the Internet (if possible, so you see UTC displayed, and the clock is used to timestamp observations. The bar chart is 3°/div, fsd=120°.

Configuration selection

The concept is that the ESP8266 contains a mini file system (LittleFS) populated with configuration files that can be selected from a web interface.

Above is a screenshot of the configuration file selection menu.

Calibration

The code is organised as a cascade of a simple conversion of input signal to voltage, then calculation of the temperature from the input voltage using a selectable algorithm (Steinhart-Hart or B equation).

Calibration of the first step captures error in offset and slope of the ADC, the ESP8266 is renowned for non-zero offset. This is done with a config file that selects algorithm v to display mV.

Above is a calculation of slope and intercept from observations of input voltage and displayed value near (but not at) high and low end of the expected input range. The slope and intercept coefficients can then be used in the temperature sensor config files.

This calibration captures the effects (including error) of the 3:1 input divider on the module, ie error in the two resistors and loading, as well as reference errors and offset in the ESP8266 itself.

Note the 14.6mV input offset at the 3V dev board input, 5mV at the chip pin, not very good.

{
"name":"vcal",
"hostname":"ltm01",
"algorithm":'v',
"slope":0.0030535,
"intercept":-0.014645,
"vcc":3.256,
"avg":10,
"unit":"mV",
"lcdfsd":0
}

Above is a config file with the calculated coefficient for checking, ltm should now display the module input voltage (in mV)… and it does.

With the input voltage calibrated, the code can then calculate temperature using either the Steinhart-Hart or B equation coefficients.

A work in progress…