Another DIY led controller with esp8266 and arduino connected via WiFi and driven with mqtt (details in image description)

This is a software-driven 12v led controller, using as input hardware buttons and mqtt. The esp8266 has a blocking wifi connection check so the user experience would degrade if wifi/mqtt are down completely. The micro handles the pwm and hardware buttons and replicates what user would expect from a normal on/off button (but also has long-press support for setting dimmer level). This means that no matter how busy the esp is with handling wifi/mqtt/data, the normal buttons will always be responsive when pressed. This has started as an experiment but has become something useful in the end. Based on what I've learned here I'll build better toys in the future. Hardware components: - esp8266 huzzah (3.3v) - pololu a-star 32u4 micro (5v) - pololu logic level shifter, 4-channel, bidirectional - pololu 3.3v, 500ma, step down voltage regulator d24v5f3 - tip122 npn darlington The micro and the esp are connected via a softare serial connection. Code has been written using the Arduino IDE (chosen for compatibility reasons for both boards and because it has excelent support for mqtt) esp8266 handles - wifi connection - mqtt connection - proxy-ing buffered data between arduino and mqtt micro handles - pwm controll - support for 1 hardware button (or multiple in paralel) to controll on/off/dim mqtt features - listens to commands and filters what is being sent to micro - publishes status updates - last will that sets status on disconnected - set status to unknown if micro crashes or is not powered in the future i'll probably add: - motion sensor - temperature sensor API available: - status - current state of light - target - target set by user - delay - delay beween two pwm changes - step - maximum pwm change between two pwm changes Tested for a couple of hours with a script that listens for device status on mqtt, publishes a target, waits for status to match target then publishes another target. Average rate is over 100 changes / second.

/r/homeautomation Thread Link - imgur.com