-
Connect Vdd to the power supply, 3V or 5V is fine. Use the same
voltage that the microcontroller logic is based off of. For most
Arduinos, that is 5V
- Connect GND to common power/data ground
- Connect the SCL pin to the I2C clock SCL pin on your Arduino. On an UNO & '328 based Arduino, this is also known as A5, on a Mega it is also known as digital 21 and on a Leonardo/Micro, digital 3
- Connect the SDA pin to the I2C data SDA pin on your Arduino. On an UNO & '328 based Arduino, this is also known as A4, on a Mega it is also known as digital 20 and on a Leonardo/Micro, digital 2
Download Adafruit_TMP007
To begin reading sensor data, you will need to download the Adafruit TMP007 library from the Arduino library manager.
Open up the Arduino library manager:
Search for the Adafruit TMP007 library and install it
We also have a great tutorial on Arduino library installation at:
http://learn.adafruit.com/adafruit-all-about-arduino-libraries-install-use
Load Demo
Open up File->Examples->Adafruit_TMP007->tmp007 and upload to your Arduino wired up to the sensor
Thats it! Now open up the serial terminal window at 9600 speed to see
the temperature in real time. You can try putting your hand or a cold glass of water over the sensor (not touching) to see the thermopile sensor adjust!
Library Reference
The TMP007 library is pretty straight forward! Start by creating the Adafruit_TMP007 object with:
The TMP007 library is pretty straight forward! Start by creating the Adafruit_TMP007 object with:
Adafruit_TMP007 tmp007;
Or with an i2c address assigned
Adafruit_TMP007 tmp007(0x41); // start with a diferent i2c address!
Then you can initialize & configure
tmp007.begin()
or, to set the samples/reading with:
tmp007.begin(TMP007_CFG_1SAMPLE)
We suggest the default, 16 samples for best accuracy. begin() will return true or false based on whether it found the sensor, check it using an if statment like so:
if (! tmp007.begin()) { Serial.println("No sensor found"); while (1); }
Now you can read the Die temperature (the temperature of the physical sensor itself) and Object temperature (the temperature of the stuff in front of the sensor)
tmp007.readObjTempC(); tmp007.readDieTempC();
The readings are floating point values, in degrees C.
Then wait 4 seconds between readings to get a new reading!
Then wait 4 seconds between readings to get a new reading!
delay(4000); // 4 seconds per reading for 16 samples per reading
Page last edited March 08, 2024
Text editor powered by tinymce.