https://github.com/homespan/tempsensori2c
Streams temperature readings from an I2C Analog Devices ADT7410 to HomeKit using HomeSpan
https://github.com/homespan/tempsensori2c
arduino-sketch esp32 home-automation homekit homespan temperature-sensor
Last synced: over 1 year ago
JSON representation
Streams temperature readings from an I2C Analog Devices ADT7410 to HomeKit using HomeSpan
- Host: GitHub
- URL: https://github.com/homespan/tempsensori2c
- Owner: HomeSpan
- License: mit
- Created: 2021-07-11T16:29:28.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2022-01-03T14:57:58.000Z (over 4 years ago)
- Last Synced: 2025-03-17T08:45:41.406Z (over 1 year ago)
- Topics: arduino-sketch, esp32, home-automation, homekit, homespan, temperature-sensor
- Language: C
- Homepage:
- Size: 17.6 KB
- Stars: 17
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: docs/README.md
- License: LICENSE
Awesome Lists containing this project
README
# 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](https://github.com/HomeSpan/HomeSpan) HomeKit Library, TempSensorI2C is designed to run on an ESP32 device as an Arduino sketch.
Hardware used for this project:
* An ESP32 board, such as the [Adafruit HUZZAH32 – ESP32 Feather Board](https://www.adafruit.com/product/3405)
* An Analog Device ADT7410 Temperature Sensor, such as the [Adafruit ADT7410 Breakout Board](https://www.adafruit.com/product/4089)
## 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](https://github.com/HomeSpan/HomeSpan/discussions), or email me directly at [homespan@icloud.com](mailto:homespan@icloud.com).