# IoT Temperature Logger with Analog Devices ADT7410, Raspberry Pi, and Adafruit IO

## Overview

![](https://cdn-learn.adafruit.com/assets/assets/000/071/034/medium800thumb/raspberry_pi_ezgif.com-video-to-gif_%282%29.jpg?1549919143)

Analog Devices, known for their reliable and well-documented sensor chips - has a high precision and high resolution temperature sensor on the market, and we've got a breakout to make it easy to use! The&nbsp; **Analog Devices ADT7410** &nbsp;gets straight to the point - it's an I2C temperature sensor, with 16-bit 0.0078°C temperature resolution and 0.5°C temperature tolerance. Wire it up to your microcontroller or single-board computer to get reliable temperature readings with ease

![](https://cdn-learn.adafruit.com/assets/assets/000/071/024/medium800/raspberry_pi_adi_dash.png?1549910302)

 **This sensor can be put**** &nbsp;_online_ using a Raspberry Pi, Python, and Adafruit IO**.&nbsp;You'll be up and running in under 15 minutes!

If you're looking for a way to precisely monitor and log temperature data to the cloud, follow along!

[Thanks to Digi-Key](https://www.digikey.com/) and [Analog Devices](https://www.analog.com/en/index.html) for sponsoring the development of this guide - Adafruit has made the ADT7410 PCB "[Digi-Key red](https://www.digikey.com/)" in their honor!

## Parts
### ADT7410 High Accuracy I2C Temperature Sensor Breakout Board

[ADT7410 High Accuracy I2C Temperature Sensor Breakout Board](https://www.adafruit.com/product/4089)
Analog Devices, known for their reliable and well-documented sensor chips - has a high precision and high resolution temperature sensor on the market, and we've got a breakout to make it easy to use! The&nbsp; **Analog Devices ADT7410** &nbsp;gets straight to the point -...

In Stock
[Buy Now](https://www.adafruit.com/product/4089)
[Related Guides to the Product](https://learn.adafruit.com/products/4089/guides)
![Angled shot of red, rectangle-shaped temperature sensor breakout with two tan JST-SH connectors.](https://cdn-shop.adafruit.com/640x480/4089-05.jpg)

### Raspberry Pi 3 - Model B+ - 1.4GHz Cortex-A53 with 1GB RAM

[Raspberry Pi 3 - Model B+ - 1.4GHz Cortex-A53 with 1GB RAM](https://www.adafruit.com/product/3775)
The Raspberry Pi 3 Model B is the most popular Raspberry Pi computer made, and the Pi Foundation knows you can always make a good thing _better_! And what could make the Pi 3 better? How about a&nbsp;_faster_ processor, 5 GHz WiFi, and updated Ethernet chip with PoE capability?...

In Stock
[Buy Now](https://www.adafruit.com/product/3775)
[Related Guides to the Product](https://learn.adafruit.com/products/3775/guides)
![Angled shot of Raspberry Pi 3 - Model B+](https://cdn-shop.adafruit.com/640x480/3775-11.jpg)

### Assembled Pi T-Cobbler Plus - GPIO Breakout

[Assembled Pi T-Cobbler Plus - GPIO Breakout](https://www.adafruit.com/product/2028)
 **This is the assembled version of the Pi T-Cobbler Plus. &nbsp;It only works with the Raspberry Pi Model Zero, A+, B+, Pi 2, Pi 3 & Pi 4!** (Any Pi with 2x20 connector)  
  
The Raspberry Pi has landed on the Maker World like a 40-GPIO pinned, quad-USB ported, credit...

In Stock
[Buy Now](https://www.adafruit.com/product/2028)
[Related Guides to the Product](https://learn.adafruit.com/products/2028/guides)
![Angled shot of Assembled Pi T-Cobbler Plus next to GPIO ribbon cable](https://cdn-shop.adafruit.com/640x480/2028-07.jpg)

## Materials

You'll need the materials below to complete this project. If you do not have them, pick them up from the Adafruit Store.

### Part: Breadboard
quantity: 1
Half-size breadboard
[Breadboard](https://www.adafruit.com/product/64)

### Part: Adafruit Pi Dish
quantity: 1
Adafruit Pi Dish for Raspberry Pi - Includes Breadboard
[Adafruit Pi Dish](https://www.adafruit.com/product/942)

### Part: Wire Bundle
quantity: 1
Breadboarding wire bundle
[Wire Bundle](https://www.adafruit.com/product/153)

### Part: 16GB MicroSD Card
quantity: 1
16GB Card with NOOBS 2.9
[16GB MicroSD Card](https://www.adafruit.com/product/1583)

### Part: MicroUSB 5V 2.5A Power Supply
quantity: 1
5V 2.5A Switching Power Supply with 20AWG MicroUSB Cable
[MicroUSB 5V 2.5A Power Supply](https://www.adafruit.com/product/1995)

# IoT Temperature Logger with Analog Devices ADT7410, Raspberry Pi, and Adafruit IO

## Adafruit IO Setup

## Feed Setup
If you do not already have an Adafruit IO account set up, head over to [io.adafruit.com](http://io.adafruit.com/) to link your Adafruit.com account to Adafruit IO.

The first step is to create a new Adafruit IO feed to hold the AD7410's temperature. Navigate to the [feeds page](https://io.adafruit.com/feeds) on Adafruit IO. Then click **Actions&nbsp;-\> Create New Feed** , and name this feed **temperature**.&nbsp;

- If you do not already know how to create a feed, head over to [Adafruit IO Basics: Feeds](https://learn.adafruit.com/adafruit-io-basics-feeds).

![](https://cdn-learn.adafruit.com/assets/assets/000/071/021/medium800/weather_tmp_Feed.png?1549906906)

## Dashboard Setup&nbsp;
Next, step is to create a dashboard to display the value read by the ADT7410 sensor.

- If you do not know how to create or use Dashboards in Adafruit IO, head over to the [Adafruit IO Basics: Dashboards](https://learn.adafruit.com/adafruit-io-basics-dashboards) guide.

 **Select the Gauge block.&nbsp;**

![weather_IO_-_Feather_Huzzah___ADT7410_Gauge.png](https://cdn-learn.adafruit.com/assets/assets/000/070/951/medium640/weather_IO_-_Feather_Huzzah___ADT7410_Gauge.png?1549640799)

 **Select the _temperature_ feed** &nbsp;created earlier.

![weather_temperature.png](https://cdn-learn.adafruit.com/assets/assets/000/071/022/medium640/weather_temperature.png?1549906963)

In the Block Settings step,&nbsp; **set the Block Title to Temperature** , **set the Gauge Min/Max Values to the upper and lower temperature thresholds** &nbsp;you want to measure.

You can label the gauge by setting the Gauge Label - this example assumes temperature is to be measured in Degrees C.

_Uncomfortably hot/cold?&nbsp;_You can optionally set the gauge change color to warn you if the temperature goes above (or below) a certain value.

![weather_IO_-_Feather_Huzzah___ADT7410.png](https://cdn-learn.adafruit.com/assets/assets/000/070/949/medium640/weather_IO_-_Feather_Huzzah___ADT7410.png?1549640961)

After adding the gauge element, your dashboard will look like the following:

![](https://cdn-learn.adafruit.com/assets/assets/000/070/950/medium800/weather_IO_-_Feather_Huzzah___ADT7410_dash.png?1549640507)

You are also going to need your Adafruit IO username and secret API key.

Navigate to your profile and click the **View AIO Key** button to retrieve them. Write them down in a safe place, you'll need them for later.

![](https://cdn-learn.adafruit.com/assets/assets/000/070/894/medium800thumb/weather_3d_printing_adafruit_io_username_and_password.jpg?1549578887)

# IoT Temperature Logger with Analog Devices ADT7410, Raspberry Pi, and Adafruit IO

## Wiring

Need a way to connect your Raspberry Pi to a breadboard? Check out the T-Cobbler Plus - this add-on prototyping board lets you easily connect a Raspberry Pi (Raspberry Pi Model Zero, A+, B+, Pi 2,Pi 3) to a solderless breadboard:

### Assembled Pi T-Cobbler Plus - GPIO Breakout

[Assembled Pi T-Cobbler Plus - GPIO Breakout](https://www.adafruit.com/product/2028)
 **This is the assembled version of the Pi T-Cobbler Plus. &nbsp;It only works with the Raspberry Pi Model Zero, A+, B+, Pi 2, Pi 3 & Pi 4!** (Any Pi with 2x20 connector)  
  
The Raspberry Pi has landed on the Maker World like a 40-GPIO pinned, quad-USB ported, credit...

In Stock
[Buy Now](https://www.adafruit.com/product/2028)
[Related Guides to the Product](https://learn.adafruit.com/products/2028/guides)
![Angled shot of Assembled Pi T-Cobbler Plus next to GPIO ribbon cable](https://cdn-shop.adafruit.com/640x480/2028-07.jpg)

![](https://cdn-learn.adafruit.com/assets/assets/000/070/969/medium800/raspberry_pi_pi_wiring.png?1549656940)

The ADT7410 and the 128x32 OLED each have a unique address and can be connected together as i2c devices, using the Raspberry Pi as a i2c controller ([For more information about i2c addressing, check out the guide here...](https://learn.adafruit.com/i2c-addresses))

Make the following connections **between the Pi and the ADT7410** :

- **Pi 3.3V** to **ADT7410 VIN**
- **Pi GND** to **ADT7410 GND**
- **Pi SCL** to **ADT7410 SCL**
- **Pi SDA** to **ADT7410 SDA**

Make the following connections **between the Pi and the OLED Display** :

- **Pi SCL** to **Display SCL**
- **Pi SDA** to&nbsp; **Display**** &nbsp;SDA**
- **Pi GPIO**  **#21** to&nbsp; **Display**** &nbsp;RST**
- **Pi 3.3V** to&nbsp; **Display**** &nbsp;VIN**
- **Pi GND** to&nbsp; **Display**** &nbsp;GND**

# IoT Temperature Logger with Analog Devices ADT7410, Raspberry Pi, and Adafruit IO

## Python Code

This guide assumes that you've gotten your Raspberry Pi up and running, and have CircuitPython installed.

- [If you have not done this yet, visit the installation guide&nbsp; **here** &nbsp;and come back when you're set up.](https://learn.adafruit.com/circuitpython-on-raspberrypi-linux/installing-circuitpython-on-raspberry-pi)

## Installing Fonts

This project uses a Microsoft TrueType Font. To install it, **enter the following into the terminal on your Raspberry Pi** :

`sudo apt-get install ttf-mscorefonts-installer`

## Installing CircuitPython Libraries

Since CircuitPython is running on the Raspberry Pi - installing the libraries for this guide is quick and easy.

To&nbsp;[**install the library for the display**](https://github.com/adafruit/Adafruit_CircuitPython_SSD1306),&nbsp; **enter the following into the terminal**

**`sudo pip3 install adafruit-circuitpython-ssd1306`**

You'll also need to [install the CircuitPython library to read data from the Analog Devices ADT7410](https://github.com/adafruit/Adafruit_CircuitPython_ADT7410):&nbsp;

**`sudo pip3 install adafruit-circuitpython-adt7410`**

The code for this project is below. **Save it to the Raspberry Pi** as **`adafruit_io_adt7410.py`**

https://github.com/adafruit/Adafruit_Learning_System_Guides/blob/main/adafruitio-adt7410/adafruit_io_adt7410.py

Before running the code, you'll need to **set the `ADAFRUIT_IO_KEY` to the Adafruit IO Key** we saved earlier and **set the `ADAFRUIT_IO_USERNAME` to your Adafruit IO Username**.

When both of these variables are changed, save the file. You can **run the program by entering the following in your terminal** :

**`python adafruit_io_adt7410.py`**

**and Press the Enter Key**.

You should see the following print out in your terminal

```
Sending temperature 22.26 C to Adafruit IO
Sending temperature 22.27 C to Adafruit IO
Sending temperature 22.25 C to Adafruit IO
Sending temperature 22.27 C to Adafruit IO
Sending temperature 22.28 C to Adafruit IO
```

The display should display the temperature read from the ADT7410 along with the status of the data being sent to Adafruit IO.

![raspberry_pi_ezgif.com-video-to-gif_(2).gif](https://cdn-learn.adafruit.com/assets/assets/000/071/027/medium640thumb/raspberry_pi_ezgif.com-video-to-gif_%282%29.jpg?1549912793)

Next, we're going to check that the data has been received by Adafruit IO. We can do this&nbsp;[by visiting the Adafruit IO Monitor page](https://io.adafruit.com/monitor). Every 30 seconds, the page will refresh with the latest values from the ADT7410.

&nbsp;

If you want to change the delay, change the variable&nbsp;`DELAY_SECONDS`&nbsp;to the desired delay between sensor reads.&nbsp;

![raspberry_pi_live_feed.png](https://cdn-learn.adafruit.com/assets/assets/000/071/023/medium640/raspberry_pi_live_feed.png?1549913257)

Navigate to the dashboard you created earlier to view the temperature gauge we added. Every 30 seconds, it'll update and display a new value.

![raspberry_pi_adi_dash.png](https://cdn-learn.adafruit.com/assets/assets/000/071/026/medium640/raspberry_pi_adi_dash.png?1549911616)

For more information about the ADT7410 CircuitPython library, [check out the latest docs!](https://circuitpython.readthedocs.io/projects/adt7410/en/latest/)


## Featured Products

### Raspberry Pi 3 - Model B+ - 1.4GHz Cortex-A53 with 1GB RAM

[Raspberry Pi 3 - Model B+ - 1.4GHz Cortex-A53 with 1GB RAM](https://www.adafruit.com/product/3775)
The Raspberry Pi 3 Model B is the most popular Raspberry Pi computer made, and the Pi Foundation knows you can always make a good thing _better_! And what could make the Pi 3 better? How about a&nbsp;_faster_ processor, 5 GHz WiFi, and updated Ethernet chip with PoE capability?...

In Stock
[Buy Now](https://www.adafruit.com/product/3775)
[Related Guides to the Product](https://learn.adafruit.com/products/3775/guides)
### ADT7410 High Accuracy I2C Temperature Sensor Breakout Board

[ADT7410 High Accuracy I2C Temperature Sensor Breakout Board](https://www.adafruit.com/product/4089)
Analog Devices, known for their reliable and well-documented sensor chips - has a high precision and high resolution temperature sensor on the market, and we've got a breakout to make it easy to use! The&nbsp; **Analog Devices ADT7410** &nbsp;gets straight to the point -...

In Stock
[Buy Now](https://www.adafruit.com/product/4089)
[Related Guides to the Product](https://learn.adafruit.com/products/4089/guides)
### Monochrome 128x32 I2C OLED graphic display

[Monochrome 128x32 I2C OLED graphic display](https://www.adafruit.com/product/931)
These displays are small, only about 1" diagonal, but very readable due to the high contrast of an OLED display. This display is made of 128x32 individual white OLED pixels, each one is turned on or off by the controller chip. Because the display makes its own light, no backlight is...

No Longer Stocked
[Buy Now](https://www.adafruit.com/product/931)
[Related Guides to the Product](https://learn.adafruit.com/products/931/guides)
### Assembled Pi T-Cobbler Plus - GPIO Breakout

[Assembled Pi T-Cobbler Plus - GPIO Breakout](https://www.adafruit.com/product/2028)
 **This is the assembled version of the Pi T-Cobbler Plus. &nbsp;It only works with the Raspberry Pi Model Zero, A+, B+, Pi 2, Pi 3 & Pi 4!** (Any Pi with 2x20 connector)  
  
The Raspberry Pi has landed on the Maker World like a 40-GPIO pinned, quad-USB ported, credit...

In Stock
[Buy Now](https://www.adafruit.com/product/2028)
[Related Guides to the Product](https://learn.adafruit.com/products/2028/guides)
### Adafruit Pi Dish for Raspberry Pi - Includes Breadboard

[Adafruit Pi Dish for Raspberry Pi - Includes Breadboard](https://www.adafruit.com/product/942)
By popular demand! We now have a way to attach a Raspberry Pi computer to a plastic 'dish' with a full-sized breadboard. We designed it carefully to make it as easy as possible to attach and detach the Pi. There are two ways to mount the Pi onto the plate, so you can flip it around for...

No Longer Stocked
[Buy Now](https://www.adafruit.com/product/942)
[Related Guides to the Product](https://learn.adafruit.com/products/942/guides)
### Breadboarding wire bundle

[Breadboarding wire bundle](https://www.adafruit.com/product/153)
75 flexible stranded core wires with stiff ends molded on in red, orange, yellow, green, blue, brown, black and white. These are a major improvement over the "box of bent wires" that are sometimes sold with breadboards, and faster than stripping your own solid core wires. Makes...

In Stock
[Buy Now](https://www.adafruit.com/product/153)
[Related Guides to the Product](https://learn.adafruit.com/products/153/guides)
### 16GB Card with NOOBS 3.0

[16GB Card with NOOBS 3.0](https://www.adafruit.com/product/1583)
NooBs 3.0 is the fastest way to have a variety of operating systems on your Pi. Available on a 16G card, you can now boot multiple OS's such as Raspbian, Pidora, RaspBMC, Snappy Ubuntu, etc. There's a boot up menu for selecting which one you like. **This card has NooBs 3.0 on it,...**

No Longer Stocked
[Buy Now](https://www.adafruit.com/product/1583)
[Related Guides to the Product](https://learn.adafruit.com/products/1583/guides)
### 5V 2.5A Switching Power Supply with 20AWG MicroUSB Cable

[5V 2.5A Switching Power Supply with 20AWG MicroUSB Cable](https://www.adafruit.com/product/1995)
Our all-in-one 5V 2.5 Amp + MicroUSB cable power adapter is the perfect choice for powering single-board computers like Raspberry Pi, BeagleBone, or anything else that's power-hungry!

This adapter was specifically designed to provide 5.25V, not 5V, but we still call it a 5V USB...

In Stock
[Buy Now](https://www.adafruit.com/product/1995)
[Related Guides to the Product](https://learn.adafruit.com/products/1995/guides)

## Related Guides

- [Analog Devices ADT7410 Breakout](https://learn.adafruit.com/adt7410-breakout.md)
- [LoRa and LoRaWAN Radio for Raspberry Pi](https://learn.adafruit.com/lora-and-lorawan-radio-for-raspberry-pi.md)
- [IoT Temperature Logger with Analog Devices ADT7410, Feather and Adafruit IO](https://learn.adafruit.com/iot-temperature-logger-with-arduino-and-adafruit-io.md)
- [Single Channel LoRaWAN Gateway for Raspberry Pi](https://learn.adafruit.com/raspberry-pi-single-channel-lorawan-gateway.md)
- [Capacitive Touch Sensors on the Raspberry Pi](https://learn.adafruit.com/capacitive-touch-sensors-on-the-raspberry-pi.md)
- [Adafruit's Raspberry Pi Lesson 13. Power Control](https://learn.adafruit.com/adafruits-raspberry-pi-lesson-13-power-control.md)
- [Large Pi-based Thermometer and Clock](https://learn.adafruit.com/large-pi-based-thermometer-and-clock.md)
- [Adafruit's Raspberry Pi Lesson 10. Stepper Motors](https://learn.adafruit.com/adafruits-raspberry-pi-lesson-10-stepper-motors.md)
- [Analog Inputs for Raspberry Pi Using the MCP3008](https://learn.adafruit.com/reading-a-analog-in-and-controlling-audio-volume-with-the-raspberry-pi.md)
- [Adding Basic Audio Ouput to Raspberry Pi Zero](https://learn.adafruit.com/adding-basic-audio-ouput-to-raspberry-pi-zero.md)
- [Windows IoT Core Application Development: Headed Blinky](https://learn.adafruit.com/windows-iot-application-development-headed-blinky.md)
- [Node.js Embedded Development on the Raspberry Pi](https://learn.adafruit.com/node-embedded-development.md)
- [All the Internet of Things - Episode Four: Adafruit IO](https://learn.adafruit.com/all-the-internet-of-things-episode-four-adafruit-io.md)
- [Adafruit's Raspberry Pi Lesson 11. DS18B20 Temperature Sensing](https://learn.adafruit.com/adafruits-raspberry-pi-lesson-11-ds18b20-temperature-sensing.md)
- [Adafruit's Raspberry Pi Lesson 12. Sensing Movement](https://learn.adafruit.com/adafruits-raspberry-pi-lesson-12-sensing-movement.md)
