Skip to main content

Alexa Voice Control Lights with NodeMCU

It's a super-simple circuit. Missing: the light(s).

The past few weeks have seen me hacking together a number of small projects from Conway's Game of Life on an OLED screen to an informational bot giving real-time radar information for Amazon Alexa. Today I'm sharing a project I recently put some finishing touches on: Alexa voice-control for lights using nothing more than a NodeMCU. The firmware code is based largely off of someone else's project aimed at getting an Arduino board to do the exact same thing, but I made a few key modifications:
  • Major refactor because the original code was both messy and slow (sorry it's true!)
  • The GPIO pin is set to voltage up by default (for offline use without WiFi / Alexa)
  • Implemented a WiFi Manager, negating the use for hard-coded WiFi credentials
The finished prototype was connected to a single LED, as you can see in the demo video here:


I wasn't entirely sure how I wanted to make a more permanent implementation, but then I noticed I had not one, not two, but five NodeMCUs sitting around in a bin. It thus didn't take long before I'd committed one of them permanently to this project. I also decided to hardwire the end result directly to the end of some string-light LEDs.

The finished prototype.

Similar to some of my prior projects, I sandwiched the solder connections and wiring between two prototyping boards. This enabled me to wind the cord running to the LED lights around the pins and thus hopefully alleviate stress and prevent the connections from breaking loose.

It's a sandwich!

While I'm not entirely happy with the result- mostly because it would be far too easy for something to short pins on the NodeMCU- it's at the point where any additional work put into it will only result in minimal improvements.

And what would project documentation be without a link to the code repo? You can find it here: https://github.com/ckuzma/nodemcu-as-arduino/tree/master/Sketches/Alexa/AlexaWemoSwitch

Comments