Smartec SMT172 temperature sensor library

thanks Edwin, for your good work !

Do you know if this library works on the 32U4 based boards (Leonardo / micro) as well without changes ?

Dirk67:
thanks Edwin, for your good work !

Do you know if this library works on the 32U4 based boards (Leonardo / micro) as well without changes ?

Thank you :slight_smile:

I got a couple of these sensors working with this library on a Micro Pro clone which is a 32U4 based board :slight_smile:

The SMT172 library can now be found at Github.
Added support for Timer4 and Timer5 for the Arduino/Genuino Mega2560.

Dear EdwinCroissant,

I'm would like to use your library for My project with Arduino Due but I get errors . It looks like TCCRx are procesor specific. Can you be so kind to give some suggestions what I have to do to make it work with Due?

Arduino: 1.7.11 (Windows Server 2012), Board: "Arduino Due (Programming Port)"

WARNING: library SMT172 claims to run on [avr] architecture(s) and may be incompatible with your current board which runs on [sam] architecture(s).
SMT172_demo.pde: In function 'void setup()':
SMT172_demo.pde:35:2: error: 'TCCR2A' was not declared in this scope
SMT172_demo.pde:35:15: error: 'COM2A1' was not declared in this scope
SMT172_demo.pde:35:21: error: '_BV' was not declared in this scope
SMT172_demo.pde:35:29: error: 'COM2B1' was not declared in this scope
SMT172_demo.pde:35:43: error: 'WGM20' was not declared in this scope
SMT172_demo.pde:37:2: error: 'TCCR2B' was not declared in this scope
SMT172_demo.pde:37:15: error: 'CS21' was not declared in this scope
SMT172_demo.pde:38:2: error: 'OCR2A' was not declared in this scope
SMT172_demo.pde:39:2: error: 'OCR2B' was not declared in this scope
Error compiling.

Hi avitos,

The code uses the timers to measure the duty cycle and is only for the 8 bit AVR micro-controllers as used in the Uno, Micro and Mega. The Due use a 32 bit processor at 80 MHz. There are three 32 bit timers in the Due so measuring the duty cycle should be possible. As the timers are 32 bit and the processor runs at 80 MHz the code should be a lot simpler.

So the compiling warning and errors are as they should.

I have no Due and I have no intension to write a library for the Due at the moment , I noticed however that Smartec now supplies a SMT172 to I2C interface. Maybe you can use that.

I hope this is useful.

Hello,

is it right to connect the output of smt172 (hec version) to pin 8 on an arduino pro mini? thats it? Im using EdwinCroissants example code.
Im asking because Im getting temperaturevalues of 2°C. furthermore the reactionspead of the sensor seems to be pretty low since it takes the sensor alot of time to reach the new temperaturevalue.

Pin 8 of the Pro Mini is indeed the ICP1 pin.
To be sure you can connect pin 8 to the pins 3 and 11 as mentioned in the example sketch.

The SM172 needs some filtering on the power-lines:

See: SMT172/extras at master · EdwinCroissantArduinoLibraries/SMT172 · GitHub

The 100 nF capacitor near the SMT172 should be present on the HEC version.

I have no experience with the HEC version but the TO18 version can sense the heat of you hand from a short distance :slight_smile:

Hi,

i have a huge problem: I have to implement a SMT172 in a project using a ATMega664P-MU. The main problem is that I cant solder the output pin of SMT172 with the ICP1 of the ATMega since the ATMega is soldered to a printed board and there is no way to reach ICP1. Is there a solution to use a different pin?

Pins of ATMega 644p which would be available for soldering:
PD2-3 (no connection)
PC0 (SCL, specific sensors)
PC1 (SDA, specific sensors)
PB5-7(MISO,SCK,MOSI, used for Wifi)
PA0,PA1 (used for dropout regulation)

Sorry to hear that, but the ICP1 and the 16 bit timer are required to make this work.

how can i use two smt 172 sensors with this final library

AminLeon:
how can i use two smt 172 sensors with this final library

The Uno got only one 16 bit timer available, so you need to use a multiplexer like the 4051. If you use a 5052 you can use the second channel to switch the power to the SMT172 as well. This prevents internal heating. Success!

1 Like

JoE1205:
Hi,

i have a huge problem: I have to implement a SMT172 in a project using a ATMega664P-MU. The main problem is that I cant solder the output pin of SMT172 with the ICP1 of the ATMega since the ATMega is soldered to a printed board and there is no way to reach ICP1. Is there a solution to use a different pin?

Pins of ATMega 644p which would be available for soldering:
PD2-3 (no connection)
PC0 (SCL, specific sensors)
PC1 (SDA, specific sensors)
PB5-7(MISO,SCK,MOSI, used for Wifi)
PA0,PA1 (used for dropout regulation)

JoE1205:
Hello,

is it right to connect the output of smt172 (hec version) to pin 8 on an arduino pro mini? thats it? Im using EdwinCroissants example code.
Im asking because Im getting temperaturevalues of 2°C. furthermore the reactionspead of the sensor seems to be pretty low since it takes the sensor alot of time to reach the new temperaturevalue.

Someone solved this value problem?