The TCN75A digital sensor is manufactured by Microchip. It provides digital temp conversion in the range -40°C - 125°C (-40°F - 257°F) and has maximum resolution 0.0625°C. This is sufficient to display temperatures with one decimal digit.
The thermometer is assembled in the same framework as the one with DS1822 sensor. Since the I2C interface requires two communication lines, both of which must be input/output, I used PIC's RA6 and RA7 pins. A slight inconvenience for assembling the circuit on a prototyping board is that this sensor is intended for on-surface mounting and comes in SOIC case with 1.27mm pins spacing. So, I had to assemble a small PCB with long enough pins and holes pitch of 2.54mm for experimenting. This PCB with the sensor on it is shown on the right image below. The thermometer has the same functionality as the one with DS1822 sensor, and I only showed it in action by displaying a temperature in Celsius.
Schematic | Temp in °C | Sensor | ||
Most of the code is also borrowed from the DS1822 project. I just modified the read/write and initialization procedures, which are, of course, different for the 1-Wire and I2C interfaces. The later one is much faster (up to 400kbit/sec). The sensor converts temperatures with four fractional bits in about 250msec. I gave it about a second to complete the conversion, as I have almost the entire 4-sec time slot available for it. The temperature on display appears for the first time 5 sec after turning the circuit on and is updated on 4 sec intervals after that. The initialization procedure in the main code sets up sensor's resolution of 0.0625°C and puts it into shutdown mode. The temperature conversion is accomplished in the one-shot mode only. Check sensor's datasheet linked above for more information on these terms and the instructions set.
Download the complete source code here.
What digital sensor is better: DS1822 or TCN75A? Well, it depends. Each of them consumes about 0.7μA of current in standby mode. Each sensor is available in SOIC case, but only DS1822 is also available in TO-92 which is more convenient for prototype development and gluing to a flat surface. TCN75A is about 5 times cheaper than DS1822 and performs TEMP conversion in 250msec (12-bit resolution) vs. 750msec for DS1822. However, on my opinion, TCN75A is less accurate and stable than DS1822, as the temperature reading fluctuate more often and in a wider range of up to ±0.5°C vs. 0.1°C for DS1822. I believe that TCN75 is intended for thermostat applications rather than for high-precision digital thermometers. Microchip recommends to take several temp readings before making a decision on turning on heater/cooler in order to make the temp measurement more reliable. The consistency can be probably smoothen by introducing the sliding averaging technique as in the experiments with analog sensors. Anyway, both sensors work great and are well suitable for amateur thermometers.
The MCP9803 digital sensor is also manufactured by Microchip and provides digital temp conversion in the range -40°C - 125°C (-40°F - 257°F) with a maximum resolution 0.0625°C. It has the same pinout as TCN75A, same register addresses and instruction set, and the same interface requirements. This allows to use the same prototyping circuit and software for testing both devices. That is what I did - just mounted MCP9803 on a small PCB as above and replaced TCN75A with it in the above prototype design. It worked right away with the same embedded code.
Although typical accuracy of both TCN75A and MCP9803 is ±0.5°C, the maximum accuracy of MCP9803 is ±1°C vs. ±2°C for TCN75A. This made a huge difference for me. The temp reading of two consecutive conversions are much more consistent now and fluctuate in the range ±0.1 - 0.2 °C. In this sense MCP9803 is similar in functionality to DS1822.
The ADT75 digital sensor is manufactured by Analog Devices. It measures temperatures in the range -55°C - 125°C with a fixed resolution of 0.0625°C and has the same pinout as the two sensors above. However, the registers are slightly different. It has a one-shoot register, writing to which puts the device into stand-by mode and at the same time also in one-shot mode. This sensor is much faster than the both two ones above, the conversion is ready 60msec after sending a request to the one-shot reg. The temperature in one-shot mode can be read as from the temp register as well as from the one-shot register. I find this interface more logical than the two ones above. However, the device is always in automatic reset mode. That is, no activity on the data bus for 75 - 100 msec resets the device. This means that the temp must be read after 60 msec as soon as it is ready. This implied slight changes in the code: setup part in main(), getTemp2(), and timing in the ISR for reading temp 60 msec after the request.
Download the complete source code here.
This sensor is more consistent than TCN75A but a bit less consistent than MCP9803. The temperature reading of two consecutive shots fluctuate on ±0.2 - 0.3°C. Analog Devices also manufacture a more accurate version of this sensor, ADT75B, which could probably reduce the fluctuation range down to a minimum. But I do not have it handy to test.
Sensors tested |
A tough question... Among the I2C devices I personally like MCP9803 best of all for my Digital Thermometer application and can hardly decide between it and DS1822. Dallas Semiconductor manufactures an even more accurate sensor than DS1822, namely DS18B20, and also with 1-Wire interface. I am really motivated to give it a try somewhere in the future.
Last modified:Mon, Jan 23, 2023.