The door to my radio shack lives its own life. It occasionally pops open, even though it seems shut and locked. It's not just a door to another room, it's an exterior door. To the outside world. This is problematic for obvious reasons, so let's find a fix for it.
Now, before you ask, this is a massive door with a special lock, so it's not easily replaceable. Keep in mind this used to be a utility shed. I'll get around to fixing it properly one day, but until then I'll need some sort of knowing if it's open or not. And, hey, it's not like I needed an excuse to make something new.
I found the perfect case for this project as I was fixing the downlights in our kitchen hood. Turns out the power supply was bust, so I had to get a replacement. However, the old power supply's case was pretty neat so I decided to repurpose it.
I collected a few parts for this project: a 9V battery, 5v switch mode voltage regulator, a microswitch with a long arm, and an ESP8266 WiFi module. All parts in stock. The basic idea was to have it send me a notification on my mobile phone whenever the door is open. Experimenting with the case was a dream, and as you can see from the picture blow, all the parts fit quite nicely. The only modification I did was adding stick-on cable ties, which also mounts the ESP8266 module board.
The circuit is wired so that the ESP8266 only gets power when the microswitch is open. This means the 9V battery is disconnected most of the time, and could potentially last for years.
I wrote a simple program that connects to my wireless network and sends a push notification to my mobile phone. Now, if the door is open for more than 10 seconds (which is the time it takes to boot, connect to my wifi and send the push transaction) I get a notification, regardless of where I am in the world.
Here is the current placement of the device. I'm leaving it here while testing it out, but will find a better, more discrete location for it later.
Also, I should update this blog more often. My last post was written in August last year, holy shit.