Native Apple HomeKit via an ESP32 for the NeoPixel LED Strip or any 5V LED Strip
Software is based on HomeSpan library. Supports RGB or RGBW Neopixel strips and optionally can act like a switch for any 5V electronics (Switch accessory in HomeKit can be shown as a Bulb, Socket or Fan).
As usual, don't expect any warranties. I am just a hobbyist, not a professional. It works for me, but you take your own risk using it. I am not liable for any damage to your devices.
Custom PCB is designed for the project. Currently for regular ESP32 board, however there are plans to do for ESP32-C3, which has smaller footprint.
Device has three modes, which can be switched via the Eve app. As they are custim characteristics, they are not visible in the Home app:
- Manual Control (manually set one single color)
- Rainbow (the whole strip is changing colors)
- Color Wheel (strip has different colors "running" along)
Also in the Eve app you can set the number of LEDs in your strip (default is 90). After changing this characteristic, you need to restart the controller for changes to take effect.
Characteristics values are saved to NVS, so they will be restored if device looses power.
At the moment you can enable the Switch device in the sketch by defining the RELAY
variable, but in the future this will implemented via custom characteristic as well to be able to enable it when device is running.
Here you can see, which pins are used and pre-defined in the firmware:
* ESP-WROOM-32 Utilized pins
* ╔═════════════════════════════╗
* ║┌─┬─┐ ┌──┐ ┌─┐ ║
* ║│ | └──┘ └──┘ | ║
* ║│ | | ║
* ╠═════════════════════════════╣
* +++ ║GND GND║ +++
* +++ ║3.3V IO23║ USED_FOR_NOTHING
* ║ IO22║
* ║IO36 IO1║ TX
* ║IO39 IO3║ RX
* ║IO34 IO21║
* ║IO35 ║ NC
* RED_LED ║IO32 IO19║
* ║IO33 IO18║ RELAY
* ║IO25 IO5║
* ║IO26 IO17║ NEOPIXEL
* ║IO27 IO16║
* ║IO14 IO4║
* ║IO12 IO0║ +++, BUTTON
* ╚═════════════════════════════╝
The firmware can be built and flashed using the Arduino IDE.
For this, you will need to add ESP32 support to it.
Furthermore, you will also need to install the following libraries using the Library Manager:
- HomeSpan
And some libraries manually:
- Go to this GitHub repo and download it as a ZIP - AsyncElegantOTA
- In Arduino IDE select "Sketch" -> "Include Library" and "Add .ZIP Library..." and select downloaded ZIP
- Do previous steps to the following libraries:
- Download and open this repository in Arduino IDE (or VSCode with Arduino extension)
- Set the upload speed to 115200
- Build, flash, and you're done
Instead of Arduino IDE OTA, the webserver update was implemented. You can flash binary at http://[DEVICE IP]/update
.
There is a reboot link. Opening http://[DEVICE IP]/reboot
will force the device to reboot.
The device can also be controlled by the FLASH button on the board. More on HomeSpan docs
- Plug your LED Controller to power.
- Press the FLASH button until the LED starts blinking rapidly and release it. Now it is in the configuration mode (More on HomeSpan docs). Press it two more times until the LED starts blinking 3 times in a row. This means mode 3 is chosen. Hold the button for 3-4 seconds once again and the WiFi AP will be started.
- Go to WiFi settings on your iPhone/iPad and connect to the "HomeSpan-Setup" WiFi network.
- You will choose your WiFi network and set the setup code for the accessory.
- Go to your Home app and select "Add Accessory"
- Select "More Options" and you should see your LED Controller there.
- @HomeSpan for ESP32 HomeKit firmware GitHub link