Emily Charles
  • Home
  • Work
  • About
  • Resume/CV
  • Contact

Desktop Doorbell

 ​​Origins

This project was inspired by a problem I was having at work: when I was really focusing on something, I wouldn't notice that someone had come up behind me and was trying to get my attention. I would jump about three feet in the air when I finally did notice that someone was standing there. This desktop doorbell is an attempt to avoid that adrenaline rush and introduce a gentler way to get my attention. 
​
What does it do?

The desktop doorbell sends a (nice, gentle) alert to my computer when someone presses the button. It comes in three parts:
  • The physical button assembly, which uses an Arduino Feather for the button and light logic
  • A Python app that runs on a PC, to pop up an alert when the button is pressed
  • A tiny, cloud-based database to act as the bridge between the button and the PC

The structure is pretty simple: when the Arduino detects a button press and release, it writes a value to the database. The Python app polls the database every n seconds, and if it sees that there are new values, it triggers a system popup with a message that someone pressed the button. 
Here's a demonstration of the functionality. The only thing that's different in the final version is that I added an icon of a little person to the Windows popup message.

Photos


Build Process

Documentation of the build and development process follows. 

Materials

 Electronics

Components
​

Most of these components come from Adafruit. I've noted the ones that didn't.
  • ​Adafruit Feather HUZZAH with ESP8266
  • FeatherWing Proto board
  • 0.1" short female header blocks
  • Short Feather Male Headers
  • Silicone Cover Stranded-Core Wire - 25ft 26AWG (Multiple colors. Any stranded-core wire of approximately the same gauge will work)
  • Two 560 Ohm resistors (or one of appx. 1K Ohms)
  • NeoPixel strip (or other form factor)
  • USB LiIon/LiPoly charger - v1.2 
  • Lithium Ion Polymer Battery - 3.7v
  • ​Female spade terminals - 22-16AWG - I picked these up at a local electronics store
  • 0.1" screw terminal blocks - 3-pin preferred
  • Momentary push button, unlit. I used something similar to this
  • ​3-pin JST connectors 
  • ​USB A to USB Micro cable (for programming the Feather - What you use to charge your phone will probably work.)
  • ​USB A to USB Mini cable (for connecting battery charger)



​
​

Fabrication

Tools

Links are just for reference. Use what you've got or what you can find easily.
  • Soldering iron​​
  • Solder
  • Wire strippers
  • Wire snips​
  • Helping hand for soldering
  • Needle-nose pliers
  • Multimeter 


















​
Materials
  • (2) 4"x4"x3" blocks of hardwood - I used padauk
  • Clear casting resin
  • Wood finish of your choice - I used  EEE-UltraShine followed by Shellawax friction polish
  • Clear packing tape
  • Sandpaper - 220 - ~800 grit 
  • Hot glue

If you are trying to cure the resin in a cold environment, you may need the following:
  • Clear plastic aquarium tank
  • Reptile heat lamp
  • Standalone thermometer
​Tools
  • Mini lathe + chisels
  • 4-jaw chuck
  • Drill press
  • 5/8" Forstner bit
  • A chop saw is helpful, but not necessary

Making the Container

The container took a while to build since I was figuring things out as I went along. My first plan was to make the whole thing out of wood, but decided that I wanted some LEDs to provide some feedback when you pressed the button. I didn't like the aesthetics of putting them on the outside, so that meant building a window into the container to let light out. 

The structure I decided on was to put a layer of epoxy resin sandwiched in between two chunks of wood and turn the piece so that the LED ring could sit just below the layer of LEDs. The decision to add resin to the blank added a good chunk of time and cost to the project, but I'm very happy with the results. 

​To make the blank, I lined up the large faces of the two chunks of wood next to each other, leaving a quarter inch of space between them. I wrapped packing tape around the gap to create a reservoir for the resin and cut a small hole in the tape to pour the resin through. In retrospect, I didn't use nearly enough packing tape. As I filled the reservoir, most of the resin came leaking out the bottom, so there was a bit of a mad dash to put more tape on and refill the gap - it got messy. You can see a little bit of the leak in the photo below, before it got out of hand.
The resin I used had to cure at a temperature range of 75-85F. That wasn't happening in my apartment in midwinter in Massachusetts, so I bought a reptile tank and heat lamp to put the blank in while it set. I let it sit for 72 hours before unwrapping the tape. Despite all the hassle in the beginning, the reservoir stayed about 95% filled through the curing process, and only a few millimeters at the edge went to waste when I started turning.

Picture
After the resin cured, I moved on to turning the blank. I used a chop saw to cut off all of the corners at about 45 degrees to make getting to round a little quicker, then mounted the blank between centers on the lathe.
Picture
Pretty much round. The difference in density between the acrylic and the hardwood gave me some trouble.
After the piece was round, I parted off a section to use as the lid. 
Picture
I flipped the main body of the piece around and mounted it in a 4-jaw chuck for hollowing out. This took approximately forever and I still have red sawdust embedded in my arms.
Picture
One more flip around, and I finished off the top of the container. I gave it a bit of a dome, which I think looks nice in the final piece. It's partly finished in the picture below - I used one coat of EEE-Triple Shine and four of Shellawax. This finish dulls down to a satin appearance after a while. It's very glossy when it first comes off the lathe, though.
Picture
The last thing to turn was the lid. This turned out *very* thin, and I think I would go thicker if I had to do it again. For now, it looks very delicate and intentional. The other problem that I made for myself was that I turned the mortise just about a millimeter too far, so it wouldn't friction-fit nicely into the body of the container. I went through a few different ways to thicken it back up (different types of epoxy) but in the end I ended up just gluing a small piece of foam to the edge to absorb the extra space. It doesn't look great, and to be honest it's the only thing making me consider turning another lid, but at least it's out of sight unless I'm changing the battery. 
Picture
Mounted in the chuck, before any turning. This got a lot smaller before I was done!
The last fabrication piece, which I unfortunately don't have any pictures of, was to drill a hole through the top of the container to accept the brass button. I used a 5/8" Forstner bit, which matches the diameter of the threads on the button exactly. It wasn't quite tight enough to friction fit, so I glued it in place using some gel CA glue. Part of me wishes I had found a fitting to screw the button into, but I'm pretty happy with how the piece looks, so I doubt I'm ever going to want to replace it with another button. 
Picture
The completed container

Wiring and Electronics

Wiring Diagram

Picture
My first non-Illustrator wiring diagram
I don't have any photos of the wiring process since it was pretty run-of-the-mill. I set everything up on a breadboard to make sure it all worked with the code, then created the same circuit on the Feather proto-board. 
Picture
 With just a few LEDs, it's fine to run the strip off of the 3V pin. If you have any more than 10 or so, you'll want to get a level shifter to bring it up to 5V. 
​
​The screw terminals were kind of an impulse add on that I really like in terms of maintenance...but they added just enough height to the assembly that it wouldn't clear the curve of the inside of the container. I had to take a Dremel and sand out another few millimeters of the interior diameter, which completely ruined the nice finish I had in there. Like the addition of the foam piece on the lid, I'm willing to live with it since it doesn't see the light of day. If I had to go back and do it again, I would definitely plan for the screw terminals ahead of time!

The last step was to add a 3-pin JST connector to the LED strip and glue the strip to the inside of the container. For this I used hot glue, since CA glue didn't want to bond to the surface of the NeoPixel strip. It was a very fiddly process. I ended up using plain old clothes pins to clip the strip in place while I semi-blindly gobbed hot glue into the container and hoped I didn't get any on the acrylic. It looks fine from the outside, a bit messy on the inside.
Picture


Writing the Code

This project has two custom applications: one that runs on the Feather, and one that runs on a PC. They communicate through AdafruitIO, Adafruit's free* cloud database/server: every time the button is pressed on the device, it writes to a named data feed in the cloud. The PC app polls the feed at a constant interval, and when it detects new data, it pops up a Windows notification. It pretty severely underutilizes the strength of AdafruitIO, but I do like that it lets me get away from Bluetooth. Using a cloud-based database as the intermediary between the Arduino and the PC means that I could detect a press of the button from anywhere, as long as both apps had internet access. 

*there are limits to the data rate and number of feeds you can have on the free plan, but this project is so small that it never comes close to hitting them.

Setting up this project comes in three parts: creating the AdafruitIO feed, writing the Arduino code, and writing the PC app code. I'll go over each of them briefly.

Setting up the data feed

Adafruit has a great tutorial on getting started with AdafruitIO here: https://learn.adafruit.com/mqtt-adafruit-io-and-you/getting-started-on-adafruit-io. You can follow that to go through creating an account, generating a key, and setting up your first dashboard.

The configuration for this project is very simple: you need to set up one feed:
Picture
For the code below to work out-of-the-box, give this the key "desktop-doorbell". Otherwise, just change the code to reflect the name of your feed.

The dashboard is really just for testing purposes, so you have real-time feedback on whether your data is getting to the cloud. The dashboard should have one widget on it:
Picture
This can be any widget that you want, but the gauge works well for this purpose. Add the widget to the dashboard and select the feed you just created as the source. Set the minimum value to 0 and the maximum value to 1. Now when data is written to the feed, the gauge widget will show the most recent value.

Arduino Code

There is really very little original code here. It's a mix of three of Adafruit's tutorial scripts: one for connecting to a network with the Feather HUZZAH, one for running the NeoPixels, and one for writing data to AdafruitIO feeds.  
DesktopDoorbell.ino

    
config.h

    

Monitor App

The app that runs on the PC monitors the server for new data and pops up a toast message when one is received using a module called win10toast (installable with pip install win10toast). Here's the main script:
Main.py

    
That's it for the code - to run the whole setup, power up the doorbell assembly and look for a solid green light from the LED strip (that means it's completed its setup process successfully) and then run the desktop application on a computer in the same network. You're now interruptable at work!
Thanks for reading! If you build something similar, I'd love to see it!
Proudly powered by Weebly