HomeSpan / TempSensorI2C

Streams temperature readings from an I2C Analog Devices ADT7410 to HomeKit using HomeSpan

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

TempSensorI2C - A HomeSpan Project

TempSensorI2C is a working example of how to use the I2C protocol to capture temperature readings from an Analog Device ADT7410 high-resolution temperature sensor and stream them to HomeKit. Built using the HomeSpan HomeKit Library, TempSensorI2C is designed to run on an ESP32 device as an Arduino sketch.

Hardware used for this project:

Overview

This simple HomeSpan sketch illustrates how the standard Arduino I2C library Wire.h can be used to capture temperature readings from an ADT7410 temperature sensor and stream them to HomeKit. The sketch:

  • implements a single HomeKit Accessory containing a HomeKit TemperatureSensor Service;
  • captures samples from the ADT7410 every 5 seconds;
  • sends updates to HomeKit only if the temperature has changed by more than 0.5 Celsius; and
  • is easily modified to accomodate up to 4 ADT7410 sensors, each with their own unique I2C address.

Connections

The connections below provide for I2C communicaiton between the ESP32 and the ADT7410 using the 7410's default address of 0x48:

ADT7410 ESP32
VIN 3V
GND GND
SDA SDA
SCL SCL
A0 unused
A1 unused
INT unused
CT unused

Feedback or Questions?

Please consider adding to the Discussion Board, or email me directly at homespan@icloud.com.

About

Streams temperature readings from an I2C Analog Devices ADT7410 to HomeKit using HomeSpan

License:MIT License


Languages

Language:C 68.4%Language:C++ 31.6%