For those of use fortunate enough to be able to work from home, we are probably finding that there are some major challenges when it comes to boundaries with others in the house.
To help with this, I created this really simple build that allows you to control the colour of LEDs using a web interface to let others in the house know that you are on a call or otherwise not to be disturbed.
The light also contains a magnet so it can easily be attached and removed from the door handle for ease of use and charging.
So if you area looking for a little more peace at home, maybe this is a guide for you!
Supplies:
√ Adafruit Feather Huzzah ESP8266 (Any ESP8266 could potentially work, but the Huzzah has lipo charging circuitry and also quite a beefy 3.3v regulator)
√ 8 piece Neopixel strip
√ Lipo battery - Any reasonable size should do (600mAH +) I don't have a good source for these
√ Project Case
√ Old Hard drive - Great source of really strong magnets!
This is a purposely simple build from a hardware point of view, making the project simple was more important to me than optimizing for battery, but it should last a work day on a single charge so I felt that was good enough.
Micrcontroller: ESP8266
For the micro controller we are using an ESP8266 programmed with the Arduino IDE.If you unfamiliar with the ESP8266, It is an amazing Arduino compatible device that has built in WiFi, I recommend checking out Becky Stern's IoT class for more information.
I specifically chose the Adafruit Feather Huzzah ESP8266 because it comes with circuitry for using a Lipo battery integrated. It also has a 500mA 3.3V regulator, which is a decent bit better than would be available on most of the cheaper Chinese ESP8266 boards. This allows us to power the Neopixels using 3.3V, which can help us avoid problems that sometimes occur when using Neopixles powered with 5v from a 3.3v logic level device like an ESP8266.
Lights: Neopixels
I chose neopxiels because they are a really simple way of adding RGB leds to your project. They only require power and a single data wire to connect, and they allow you to set them to any colour, even setting the colour of the LEDs individually.
The neopixels are wired as followed.
VCC -> 3V
GND -> GND
Data-in -> gpio 0
Battery: Any Lipo
Using the battery circuitry of the feather huzzah makes using a lipo really easy. You can either plug it straight into the JST connector of the feather huzzah (NOTE: please check the polarity of your battery, there is no standard for this so it maybe need to be swapped around) or you can connect to GND and BAT pins of the huzzah.To charge the battery you can just plug a micro USB cable into the huzzah.
You should check on the health of the battery. It is generally accepted that a lipo should not be allowed drop below 3V, so you should make sure that it is above that before using it in your project.
The code for this project is heavily based on the helloServer example available for the ESP8266 in the Arudino IDE.
There is an and point for changing the LEDs to Red, Green and then to turn them off, but more features could be added if needed.
You can download and install the code from my Github
There is one external library you will need to add from the library manager, and that's the Neopixel library from Adafruit.
To attach it to the door I used a really strong magnet from an old hard drive. Just remove all the screws from the outside of the hard drive and you should be able to fairly easily be able to pry out the magnet. I think it goes without saying that this should only be done on a hard drive you do not need anymore! This will ruin the drive!
These are really strong so I recommend being careful with them, especially when removing them as you could easily pinch a finger.
As this was just a rapid prototype build, and the force of the magnetic would be pulling towards the case anyways, I decided to just use blu-tack to attach it to the case.
To use the device, you can just visit "wfh.local" on your web browser. Please note that is based on Bonjour services, for more information check out this link.
After that you can just use the web interface to update the colour of the LED whenever you need!