The TMP175 and TMP75 are two-wire, serial output temperature sensors available in SO-8 and MSOP-8 packages. Requiring no external components, the TMP175 and TMP75 are capable of reading temperatures with a resolution of 0.0625°C.
The TMP175 and TMP75 are specified for operation over a temperature range of –40°C to +125°C.
Features
#include "mbed.h"
#include "TMP175.h"
DigitalOut myled(LED1);
TMP175 mySensor(p9,p10);// sda,scl
LocalFileSystem local("mbedMemory");
int main(){
char Fmt[100];
float Temp;
mySensor.vSetConfigurationTMP175(SHUTDOWN_MODE_OFF|COMPARATOR_MODE|POLARITY_0|FAULT_QUEUE_6|RESOLUTION_12,0x48); // Address -> A0,A1,A2=0
mySensor.vSetTemperatureLowTMP175(25.0);
mySensor.vSetTemperatureHighTMP175(35.0);
FILE *fp = fopen("/mbedMemory/TMP175Debug.txt", "w");
fprintf(fp, "TMP175/75 mbed NXP:\r\n");
for(int k=0;k<100;k++){
Temp=mySensor;
sprintf(&Fmt[0],"Temperature: %f ºC\r\n",Temp);
fprintf(fp,&Fmt[0]);
myled = 1;
wait(0.5);
myled = 0;
wait(0.5);
}
fclose(fp);
while(1);
}
Example TMP175 Temperature Sensor
Library:
TMP175 Temperature Sensor
Please login to post comments.
hi guys,
I want to read temperature range from 0C to 30C. I have got a thermistor (type 2Kohm) in series with 2k2 resistance half bridge circuit output (Voltage divider ) connected to the mbed p20.
It looks simple but because I am not very experience on this, I seem to be confused.
Does anybody there how to do this? Please
Any help will be greatful!!
Thank you
A. Jay