door entry system buzzer

tl;dr: I built a device that allows you to let yourself in to your building using the Internet. All you need is some old speaker wire, a relay, and a mini-computer.The outside door to my building is operated by an RFID key fob. You touch it to the door, and it unlocks, allowing you access.I was faced with a little problem: my building management company would only give me one key fob. I have kids, but there’s only one adult on the lease, so only one key fob. So — without giving my only set of keys to my guests— how could I let them in to my apartment when I wasn’t there.There were a few solutions: I could clone the RFID card through various online services. wanted $20, but the drawback was that it would mean sending away my keys and struggling to access the building in the meantime. Despite extensive searches, and Reddit questions, I was unable to find a similar service in NYC.So the obvious solution was to engineer a solution using electronics. With my handy Phillips screwdriver, I whipped the front of my door buzzer in my apartment.
It was just a simple handset with a buzzer, and a button to release the catch on the door downstairs.manual garage door locking mechanismThe metal flap on right-hand side was under the button I pressed to release the front door. bathroom door lock lowesOnce I closed that circuit with my bare finger, I could hear the door buzzing downstairs over the intercom.screen door repair port chester nyUsing my trusty multi-meter, I set about measuring the levels across each pin. shower screen door shatteredNote to self: check voltages before touching it with your bare hands next time.solid wood interior doors phoenix
The system ran at 25VAC, at just a few milliamps. But, the most useful thing I found was that joining pins 5 and 7 completed the circuit to the lobby, and open the door went.phantom screen door removalThere was a simple solution: I could connect the button downstairs that makes my intercom buzz (using the black solenoid at the top left) straight to the door opening circuit. windshield chip repair cost edmontonInstead of causing the solenoid to buzz in my apartment, someone pressing the button downstairs would immediately open the door with no involvement from me. Simple, but not at all safe, and not really the elegant solution I was looking for.Instead, I looked for a more sophisticated solution— using an Arduino electronic prototyper sitting unused in my draw — and started building. My aim was to have a simple web page, where you could tap a button, and cause the door to buzz for a set number of seconds.
This would allow anyone with a particular web address to be able to open the door themselves when coming to visit.Your first thought might be that this isn’t secure either — and it isn’t really — but at this stage this is about building a proof of concept that’s extensible. I can add a layer of security second once I prove that it can be done.The Arduino itself is able to handle low voltage DC electricity. However, since the door buzzer circuit was higher voltage, and alternating current, I needed to find a way to indirectly bridge the connection between the pins on the door buzzer’s circuit board. The solution is simple: a relay.Borrowed from the Internet, this is the circuit I built. The relay breaks the live wire from the AC power source (the buzzer system) heading to the destination (the outside door’s lock). When the relay is actuated by the Arduino—and the computer code within — the circuit completes and the door opens.In the end, I used some old speaker wire to connect the pins from inside the intercom handset to the relay, and back again.
But before I got closed to connecting it to a live circuit, I worked on my solution using the computer. A relay makes an audible “click” when it’s turned on, so I was able to test my code without connecting to the real-world intercom system.My Arduino circuit board is paired with a WiFi module, which allows me to create a simple web server, and share it on the Internet all in one matchbox-sized unit.Follow along if you can.)The code does a few simple things:Here’s how I connect to the WiFi:There’s a lot going on here, but essentially this is identical to the sample code from the Arduino themselves. What’s different in my example is how I handle the loop() method when someone connects to the server.In this example, I’m listening for a connection, and then processing a request from the user. The intention here being to turn ON pin number 2.Right now, this code does nothing in particular, except receive the request, and then figure out what is being asked of it:First, this borrows heavily from the Simple Web Server WiFi sample code.
Read that first, and you’ll get the idea of what we’re trying to achieve. I’m less concerned with interacting with the Arduino’s pins at stage, but instead trying to understand what the user is requesting.The key part is where I read the request from the user. I wait until I’ve reached the end of a line (where we detect a newline with ). At this point, if the line begins with “GET” — the line with the request to the web server — we stash it in the getRequest variable. We’ll use it later. This is how we do it:Once we have this, we can break it apart to see what the components are. We do this by tokenizing (breaking up) the string like this:Two things are happening here. I’m getting the first bit of the string after the first slash — the bit that says ON in our example. I’ve called that the “action” in this example. Second, I’m extracting the string after the second slash— the bit that says 2 in our example. That’s the pin I want to take action on in the example.
With these two key pieces of information, I can now make something happen in response to the user request. I can make the door buzzer turn on and off!So, now the code to make that action happen:You also need some variables at the top of the code to capture your choices and list the valid pins:What I’m doing here is:Once we have both of those, we actuate the pin and set the voltage to high or low, or in a special case we “buzz” it for a few seconds. Then we build a response as a JSON object.JSON is short for JavaScript Object Notation (if you’ve made it this far, you probably knew that already), but is essentially a way for one piece of code on one computer to get data from another. The intention in the long term is to create a well-designed interface that interacts with my door buzzer.You might notice that I’m handling the buzzing by turning on the pin, but not turning it off. I need this final step to happen after we return a result to the user, otherwise they will have to sit for several seconds waiting for a response.