HomeKit connected smart thermostat based on Arduino using HomeSpan.

Overview

HomeSpan Thermostat

HomeKit connected smart thermostat based on Arduino using HomeSpan.

Background and Motivation

I have a 24 V Heat-only system with a 2-wire system (No C wire, only R and W). It used a manual Honeywell single-point thermostat. I wanted to get the functionalities of a HomeKit compatible smart thermostat without the hassle of installing a C wire myself and/or having to buy an expensive smart thermostat. So I created my own with a Wi-Fi capable microcontroller.

Hardware

I used a Adafruit ESP32-S2 Feather board, along with a TMP36 analog temperature sensor, and a simple non-latching relay.

I wired up the TMP36 to an analog input pin (A5 i.e 8) and the relay to a digital pin (10), and connected the relay to the R and W wires in my heating panel in the NO mode i.e when the relay is off, the heater is also off. The circuit diagram is given below.

This image shows how the components are wired to the microcontroller board.

Flashing the Code on the Microcontroller

Use the Arduino IDE to flash the code to the microcontroller. You could also do it using arduino-cli in either serial mode or OTA mode.

cd path/to/homespan_thermostat
arduino-cli compile -b esp32:esp32:adafruit_feather_esp32s2 --port PORT_PATH --protocol serial --upload

Or

cd path/to/homespan_thermostat
arduino-cli compile -b esp32:esp32:adafruit_feather_esp32s2 --port BOARD_IP --protocol network --upload

The latter will promt you for the OTA password. The default OTA password for HomeSpan is homespan-ota. It is recommended that you change it in the source code (see below) or using the O command of the HomeSpan CLI.

Configuration and Usage

There are a few parameters that need to be configured.

  • The Wi-Fi credentials can be defined in the source code as the macros WIFI_SSDI and WIFI_PASSWORD or can be set using the W command of the HomeSpan CLI.
  • The HomeKit pairing code can be defined in the source code as the macro HOMEKIT_PAIRING_CODE. Otherwise the default code 466-37-726 is used or it can be set using the S command of the HomeSpan CLI.
  • The HomeKit QR Setup ID can be defined in the source code as the macro HOMEKIT_PAIRING_QR_ID. Otherwise the default QR Setup ID HSPN is used or it can be set using the Q command of the HomeSpan CLI.
  • The OTA Password can be defined in the source code as the macro DEFAULT_OTA_PASSWORD. Otherwise the default password homespan-ota is used or it can be set using the O command of the HomeSpan CLI.

Pair the accessory to HomeKit. The general instructions are given here. That's pretty much it.

For my particular heating setup, I have enabled two heating modes: Heating, and Auto. Heating mode allows you to set a single Target Temperature which the thermostat will try to maintain. However, depending on how well insulated your home is, and how cold it is outside, it can lead to the heater turning on and off frequently consuming a lot of energy. Auto mode fixes that by allowing you to set two temperatures, a Heating Threshold and a Cooling Threshold. In this mode, the thermostat will only turn on if the temperature reaches below the Heating Threshold, and will provide heat until the Cooling Threshold is reached. This allows the heater to be on for a longer period of time, but also be turned off for a longer periods of time, which is more energy efficient than being turned on in bursts.

If you're connected to HomeKit, you should be able to control your heater using Siri.

This image shows how the this thermostat looks in the Home app.

Owner
Shubham Chaudhary
PhD student at the Department of Computer Science at Cornell University.
Shubham Chaudhary
Physical Tic-Tac-Toe smart board with PvP mode and two levels of AI. Built atop a custom PCB connected to an Arduino Mega 2560.

TicTacToe_SmartBoard The files in TicTacToe_SmartBoard are based on the files in https://wiki.illinois.edu/wiki/display/ECE110HLSF15/Tic-Tac-Toe+Smart

Hyrum Dickinson 2 Jan 26, 2022
Dummy code for using an ESP32 as a lightbulb in Apples HomeKit.

ESP32 HomeKit Lightbulb A dummy implementation of a HomeKit lightbulb using the ESP HomeKit SDK by Espressif for the ESP32. Prerequisites PlatformIO U

Louis Meyer 2 Apr 27, 2022
Let any device connect to HomeKit.

homekit-bridge Introduction A HomeKit gateway specially designed for embedded devices, it allows you to connect non-HomeKit devices to HomeKit through

Zebin Wu 79 Apr 27, 2022
Control your older LG TV via HomeKit

LG TV Controller for HomeKit Flash to an M5Atom RS232 Kit, and add your LG TV to your HomeKit home. Should work with most other ESP32 kits as well. Qu

null 5 Nov 7, 2021
Connected Santa Claus hat based on an ESP32, 8x8 matrices and LEDs stripped communicating over the internet with MQTT.

Protobonnet What is it? A connected Santa Claus hat! What is it called? Le ProtoBonnet! Why? This hat has been created entirely for the Noël des proto

Audrey Cigolotti 2 Dec 27, 2021
Smart door lock system using Arduino

Smart door lock system using Arduino จำลองระบบรักษาความปลอดภัยของบ้าน โดยการใส่รหัสผ่าน Keypad เมื่อใส่รหัสถูกจะผ่านประตูเข้ามาได้ ซึ่งใส่รหัสผิดได้ไม

null 1 Nov 6, 2021
If the button pressed esp will reset and App mode will on. App mode will on then led will on, network is connected led will off.

DHT22-to-Google-sheet-Reset-Using-ESP8266-LED-Switch If button pressed esp will reset and App mode will on. App mode will on then led will on, network

Md. Harun-Or-Rashid 4 Oct 5, 2021
sc-ble-bridge is a utility that for every connected Steam Controller creates a virtual one acting as a bridge between SC and Steam

sc-ble-bridge The main goal of this utility is to provide workaround for steam-for-linux issue which makes Valve's Steam Controller unusable in BLE mo

null 5 Apr 19, 2022
Ramp is a HID attack program that steals all connected WiFi passwords within 13 seconds.

Ramp Ramp is a HID attack program that steals all connected WiFi passwords within 13 seconds. Tested Windows 10 Warning Ramp has been created for the

Md. Ridwanul Islam Muntakim 15 May 10, 2022
Anotter USB temperature logger that can record up to four channels with thermocouple or NTCs connected via CDC directly or SCPI to USB.

temperature-logger Anotter USB temperature logger that can record up to four channels with thermocouple or NTCs connected via CDC directly or SCPI to

Jana Marie Hemsing 47 Apr 6, 2022
FFF is a decentralized blockchain based on IPFS/RIPPLE, which integrates lua virtual machine-based smart contracts.

FFF is a decentralized blockchain based on IPFS/RIPPLE, which integrates lua virtual machine-based smart contracts. It is also a software platform designed to help coordinate voluntary free market operations amongst a set of social actors.

gen2600 4 Mar 28, 2022
A smart automatic pet feeder based on OM2M

?? A Smart Automatic Pet Feeder Based on OM2M WEB ?? Pet ?? Core functions At present, the system can automatically generate text boxes, drop-down box

newdragon 2 Nov 12, 2021
A Fingerprint Door Lock using a microprocessor named Arduino UNO and programming through Arduino IDE

INSTRUCTIONS - The codes for the Fingerprint Door lock are present in the Code For Fingerprint Door Lock folder The instructions of how to operate the

Akhil Sahukaru 15 Mar 3, 2022
Internet of things created using arduino IoT cloud, consisting of esp and arduino boards

Internet of things created using arduino IoT cloud, consisting of esp and arduino boards. Goal of the project is to create a 3D printed RFID protected (with PIN) lock, including surveillance.

null 2 May 11, 2022
AnalogWrite for ESP32 and ESP32-S2 with LEDC PWM. Includes PWM Phase Control, DAC and Smart GPIO resource management.

analogWrite() ESP32 Installation Instructions This library was tested using using the ESP32 Arduino IDE Boards Manager installation method. Stable rel

null 21 Apr 30, 2022
Info & tools for reverse engineering the M6 smart fitness band

m6-reveng This repo contains information and tools for reverse engineering the $7 M6 smart fitness band. Hardware The SoC (system-on-a-chip) is a Teli

null 35 Apr 20, 2022
PNPASSIST: A “SMART” BUILD PLATFORM FOR MANUAL PCB ASSEMBLY

PnPAssist Description The PnPAssist is an open source innovative CNC table that position the next SMT component with a proper orientation for you to m

MakerStorage 34 Apr 14, 2022
DIY Smart Blinds controller for ESP8266

Window blinds to home assistant DIY window blinds controller software for ESP8266 (Wemos D1) to control existing window blinds using servos. The full

Toni Korhonen 15 Apr 12, 2022
Smart Robot that avoids obstacles and finds a way to move

ObstacleAvoider Obstacle Avoider is an intelligent device which can automatically sense the obstacle in front of it and avoid them by turning itself.

IEEE VIT Student Chapter 13 Mar 7, 2022