Building a night light using an ESP8266 and an Ardafruit NeoPixel Ring

- an ESP8266 (or ESP32)
- an Ardafruit NeoPixel Ring (any version will do, I have the one with 13 LED’s)
- some box (I just used a tupperbox)

Wiring

The wiring couldn’t be simpler.

ESP 5V  -> NeoPixel 5V
ESP Gnd -> NeoPixel Gnd
ESP D4 -> NeoPixel Data Input
Wiring
ESP 8266 -> NeoPixel Wiring

Code

I’ve decided to run the whole thing using a powerbank. If one presses the button to enable the powerbank, the light goes on, if one shuts down the power bank, the light goes off. Simple as that. Only thing you have to keep in mind when doing this is to add a tiny delay after initializing the pixel. Otherwise some led’s will not turn red.

Boxing the components
Putting everything in the box
And this is how it works

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store