If you’ve been to an apartment complex with a locked front door, you’ve seen the buzzer systems. You press the corresponding button for the apartment you want and can talk to the resident. They can press a button to unlock the door briefly, and then you go up to their apartment and they don’t have to come down to let you in. But what if you’re the resident and you want to go for a run without your keys jingling in your pocket? What if you want to open it using just your smartphone?
I knew this was a silly problem, and everyone I told about it thought that for the amount of time and effort it might save, it was hardly worth it.
How fast can I put this together using only parts I have around the apartment? Turns out about 2 hours.
The most critical step was hacking into the buzzer system. Two screws and a razor blade later and the plate was separated from the wall. Markings on the PCB made it easy to find on the Internet. Looking at the PCB and online schematic, there was no DC power to use, but I did know that the switch connected two wires which resulted in a buzzed door. This was a job for a low voltage relay, the normal solution when you want to press a button but don’t know what the two wires do and want to interfere with the electronics as little as possible.
Next was the wireless component. I had a Particle Photon lying around in my box of dev boards, which was super convenient. I got that set up with the Particle app from the Play store. Then I installed IFTTT, which would let me control it eventually. Then I set up a Particle account and an IFTTT account. I plugged in the Photon, connected to it from my phone, and told it how to connect to my wireless. A few seconds later it had rebooted and was showing up online. Now I could write code in the Particle web app, flash it to my Photon over WiFi, and I was good to go.
I started with an example blink app (web-connected-led.ino) and flashed it to my Photon to make sure it worked. Then I just needed to make it turn on for a second, then turn off, so I created a function to do that specifically. Done. The entire code portion took only a few minutes.
I found a relay. Relays take a lot of power to switch, and this one switches at 5V, but the Photon GPIO is at 3.3V. I wouldn’t be able to drive the relay straight from the output pin. No problem, this is a job for an N-Channel MOSFET. I only had a surface mount one, but I also have mad soldering iron skills.
I hooked up the MOSFET and relay, and I threw in a pull-down resistor so that when powered on there wouldn’t be any weirdness and the MOSFET will stay low and not switch unintentionally. Finally, I put in a 1/8″ audio connector so that I can easily attach it to the wire from the wall plate(which was a repurposed audio cable).
Dinner and Internet Outage
For some reason my Internet went out for an hour, and it was the perfect time to get some dinner.
Back to work, in IFTTT, I connected it to the Particle channel. I created a recipe that would call the function I had written on my Photon whenever I texted myself the word “opensesame”. It’s really amazing how well the Particle channel interacts with my code on my Photon. I could flash the firmware and the IFTTT recipe creation would immediately know what functions were available.
Then I noticed Do, which is part of IFTTT but drops off the IF part. After a quick download I had the ability to have a shortcut button on my home screen which when pressed would call the function on my Photon. No more text messages, just a shortcut.
A quick test and the process worked. I could hear the relay click on then off. I was confident that this solution would work when I plugged it into the buzzer.
Unfortunately, there wasn’t power near my wall buzzer, and I didn’t want to change batteries regularly. I spent an unnecessarily long period of time figuring out how to fish the wire through the drywall and down and to the other side of the wall, where it went into another room that had close access to an outlet. I ended up making a hole in the drywall about 1/2″ in diameter at the bottom of a closet. This was the only damage to the apartment, and it is easily fixed.
The wire fished, I just had to screw it into the terminals on the wall plate. It was the PT and T terminals, and you can clearly see that these two terminals have traces to either side of the switch helpfully marked “DOOR”.
I brought my phone (and keys just in case) out to the front door, pressed the button, and after about 5 seconds, there was the buzz that let me in. The next morning, I went for my run without my jingling keys.
I’m not concerned about security. The Photon is connected to my home router via encrypted WiFi, and the IFTTT and Particle integration uses OAuth.
There is some delay between when I press the button and when the Photon gets the message and buzzes the door. It turns out it would probably be faster for me to just use the key to open it.
Yes, this relies on the Internet being up, so it’s a little worrying that I had an outage while I was working on the project. I won’t rely on this all the time, but it’s a good gimmick.
I’ve never used IFTTT before, so I’m really happy with how quickly this hack came together and how easy it was to do, especially with the Particle channel.
We’ve had other buzzer hacks over the years, like the morse code buzzer, but this one was an exercise in speedy implementation and integration with existing services, showing how easy it has become to make IoT out of anything.