Neopixel Stoplight

3D Printed Neopixel Stoplight

I had been looking for a STL of a stoplight to print for about a year now. I wanted to use the colors of the stoplight to signal to my younger kids when it was ok to wake up in the morning, and when it was time to go back to sleep. My ideal was that I could use Node-Red running on the home server via MQTT to regulate when the stoplight changed colors. Thingiverse’s search is horrible and you could spend days there and not actually get what you are looking for so I never found one that would work. The other day I was searching for some reference STLs of something and accidentally came across a STL for a stoplight. Not one, but three (two remixed from the other).

The first one looked great, good size and decent design. Except it was designed for LEDs and an ATTiny to drive its sequence. The second was a remix of the first. The third was another remix that extended the back casing. The remixes made things easier to print but still relied on LEDs and an ATTiny of sorts. This was a great starting point for me. I have no problems modifying STLs for my purposes. I like to use Tinkercad, not very good with Fusion 360. I downloaded the files and started my own remix. I took elements from all three versions of the stoplight.

I modified the back case to allow a Lolin v3 to be able to mount to it. Then I had to create a cover for the Lolin. I took the front from the original thing, I preferred its one piece to the remixes four piece but I filled in the slot for the little switch. I used the LED panes/covers from the original, unmodified. This was great, I had a front and back a cover, LED panes and the inlay to hold the LEDs. So I printed it all out and went to work. First things first, I tested the LEDs. Like I thought, the LEDs I have are not the super bright ones and running off of the Lolins 3v they just didn’t have enough brightness to shine through very well. No super bright LEDs but I do have some WS2812 neopixels. I hooked one up to test and yes they were perfect. So I modified the LED inlay to hold three neopixels.

I wanted to be able to control the stoplight via MQTT from my server running Node-Red. I used the neopixel example from Adafruit and the default Pubsubclient example for an ESP8266. Mashed the two together and I was able to change the colors on the fly with no problems. I showed off the stoplight to a friend of mine and he loved it. He wanted one for himself, but he doesn’t have a server or anything that runs MQTT. No problem, the Lolin can handle web GUIs. A quick google for a web server on an ESP turned up a nice little tutorial on how to turn on and off GPIO pins from a web GUI. BAM! I took that code and mashed it up with the neopixel code I already had an I was able to get a nice little web page displayed to change the colors of the stoplight. This is awesome.

View Post

Neopixel Notifier

Neopixel Notifier

I was looking for solutions to make a notifier to for various projects. I while back I made something similar with a small OLED screen but this time I wanted something more “wife friendly” so I set out. I had a few neopixel WS2812 RGB LEDs laying around and some NodeMCU ESPs. I went with a NodeMCU board for simplicity of micro USB power already onboard but you could use any ESP for this project and it should work.

So I started searching how to cobble them together and I found https://www.reddit.com/r/esp8266/comments/5f8x8t/mqtt_and_neopixels_with_the_arduino_ide/

Which led me to https://github.com/joshhodgson/ESPNeopixelMQTTDriver… which led me to here https://goo.gl/KdtWUz.

This was perfect. I took the ESP8266 and connected it via MQTT to subscribe to a topic for changing the colors of a WS2812 (neopixel). All you do is send RBGW code (255000000000 is red for example) via the topic.

The code works great, after changing the topics and such. But its not up to my liking. So here is my re-coded version. I basically made it easily editable, add all the variables to the top.

Now I can slap an ESP and the neopixel in something for notification. I just have to remember what each color means and I will let Node-Red send the changes when needed. Fucking awesome. I can use this for temperature, rain, mail delivery, change the color if someone has ever pressed the doorbell that day…its endless. Only downfall is one alert overrides the previous color (is that really a downfall?) so the alert is “over-written”. So if you are going to use it for say timing on something or modes of the day or what have you, single project use, then it should fit the bill.

I happened to have to have a 3D printer and came across a really nice model of a lamp (Bioh Lamp) that I decided would work perfect as a notifier. After I made some modifications and added NodeMCU standoffs it worked perfectly. Don’t get me wrong it took a few tries to get the spacing right and I tried a few approaches before using the NodeMCU so the older standoff for centering the WS2812 is still there. Unfortunately the author has is locked up pretty tight and used the Creative Commons – Attribution – Non-Commercial – No Derivatives license so I cannot share it.

I used an old Apple iPod USB cable and chopped it up wired it to the boards. Also repurposed an old iPhone charger to use as the power supply. Perfect!

 

Code below.

View Post