HomeKit ready air quality monitor based on a Heltec HTIT-W8266 (WiFi Kit 8) development board with built-in OLED display and a Plantower PMS7003 sensor via Arduino. Outputs data via http/json and on OLED screen. HomeKit support includes "Air Quality", as well as PM 2.5/10 Densities.
After flashing, on first boot, the device will start in Access Point mode to allow you to setup your WiFi.
Connect to the access point named ESPP8266-<uniqueid>
and it will redirect you to a webpage that will allow you to select your SSID and enter your password.
Once this is configured, it will restart into WiFi client mode and connect to your local network.
WiFi configuration stored locally and will not reset across power cycles/reboots.
Device will come up and broadcast multicast dns for ESPP-<uniqueid>.local
and _http._tcp.80
.
You can discover the uniqueid by running dns-sd -B _http._tcp
on MacOS.
$ dns-sd -B _http._tcp
Browsing for _http._tcp
DATE: ---Sat 12 Sep 2020---
14:55:28.605 ...STARTING...
Timestamp A/R Flags if Domain Service Type Instance Name
14:55:28.607 Add 3 4 local. _http._tcp. ESP8266-4a9f
...
Device will also output data via http/json. You can run curl http://ESP8266-<uniqueid>.local
to view. Use to pull data, consume, graph, etc
$ curl http://ESP8266-4a9f.local
{ "Hostname": "ESP8266-4a9f", "Data": { "PM1.0": "14", "PM2.5": "24", "PM10": "30"}}
Device will be accessible to pair with HomeKit.
To pair from Home app, click +
, Add Accessory
, I Don't Have a Code or Cannot Scan
. It will show up under Nearby Accessories
.
By default, pairing code is 867-53-069
and can be modified in my_accessory.c
Due to the nature of HomeKit, reporting is done as levels 0-5, where 0-5 = Unknown, Excellent, Good, Fair, Inferior, Poor
Thresholds are currently set as: (still tweaking to reflect reality/cross referenced from Temtop 1000S)
PM2.5 | HomeKit | Description |
NA | 0 | Unknown |
0-12 | 1 | Excellent |
13-35 | 2 | Good |
36-55 | 3 | Fair |
56-150 | 4 | Inferior |
151+ | 5 | Poor |
__usb__ _____
-| |- GND ----------------- GND -| |
-| |- 5V ------------------ VCC -| |
-| |- |- RX -| |
-| |- |---|-- TX -|_____|
-| |- | | PMS7003
-| |- | |
-| |- | |
-| |- TX (GPIO1/TXD0)- |
-| |- RX (GPIO3/RXD0)----|
-| |-
-| |-
-|_______|-
HTIT-W8266
You can find parts pretty easily on Amazon, but they are cheaper from overseas/AliExpress (Non sponsored links)
HTIT-W8266
- AliExpress ~$4.50
- Amazon ~$10
PMS7003
- AliExpress ~$17
- Amazon ~$22 without cables
- eBay ~$20