Skip to main content

Automated door system

·455 words·3 mins

Earlier this year we moved from Berlin to Lisbon and found a nice apartment not too far from the city center.

The door to our apartment building, like many in Lisbon, is old and often malfunctions. With numerous friends visiting this summer, I decided to automate the door, allowing us to open it using our mobile phones instead of struggling with the key for several minutes.

For this project, I am going to use a Photon board from Particle.io and a Relay module I got from eBay.

I am a huge fan of Particle, their products are super solid and easy to use. (this is not a sponsored post).

Particle Photon #

particle photon

Relay Module #

relay model


Hardware #

The hardware part of this project is very simple, I attached the relay to the intercom switch (this part may vary depending on your intercom system). As mine is very old, it was pretty straightforward to hack the wires from the switch to the relay.

door circuit

When you press the switch, pin-1 and pin-2 are connected together, opening the door, and this will be the role of the relay in our project.

Connection #

I am using a USB charger I had laying around the house to power the photon board. To control the relay you must connect three pins to the photon.

  • VCC to 3V3
  • GND to GND
  • IN to D7

On the relay side, you just need to connect the wires on the middle and left or right side depending on your module.

relay connection

relay model


Software #

On the software side, we need to find a way to send a signal to the photon board in order to close the circuit of the relay for a couple of seconds, opening the building door. When building this project, I came up with two possibilities, one faster that requires less coding and a more versatile version that requires a bit more coding.

Blynk method #

Blynk is a modular mobile app for IOT projects and it is pretty easy to integrate with the Particle boards.

You need to get the app for your phone, get the authentication key, and change the code below. You may need to fix the code to match your hardware configuration.

blynk

blynk

After connecting the Blynk app with the Particle board, you are ready to go!

POST method #

The second method is the one I am currently using because you can have more control of the system and also integrate it with different applications.

Below is the code to put in your Photon:

You can see on the setup() function, we are creating an external-call named “open”, which will trigger the function openCall().

To trigger the door-opening circuit, all you have to do is create a POST request to the following URL: