Made by johnnywu · UNLISTED (SHOWN IN POOLS)

This device uses a reed switch, magnet, LED, and tilt sensor to remind homeowners to lock their doors when leaving the house, and allows them to view the times that the door was locked and unlocked remotely.

Created: February 4th, 2017


Problem Statement

The device that I am designing is intended for my housemates. I chose them because they live with me and it is more convenient than to design for a friend that lives elsewhere. A common problem for homeowners regards home security. Sometimes a housemate might forget to lock the door when leaving the house. An Internet of Things device could certainly help remind to lock the door. It would notify them immediately after closing the door to lock it. They could also check whether or not the door is locked remotely. This could definitely reduce instances of unlocked front doors, increasing the home security.


I want to create a device that will remind homeowners to lock their door after they close it. It will use a reed switch in conjunction with a magnet to sense if the door is closed. It will use a tilt sensor to determine if the door is locked or not. If the door is not locked, an LED will flash rapidly, notifying the homeowner that their door is unlocked. This way, whenever a homeowner leaves their house without locking it, the flashing will get their attention and remind them to lock the door.


Components Used:

1. Photon

2. Breadboard

3. Reed Switch and Magnet

4. Purple LED

5. Tilt Sensor

6. 1k Ohm Resistor

7. Various Wires



Initial wiring testing the Hall Effect Sensor


Replaced the Hall Effect sensor with reed switch and magnet


Board with both reed switch and tilt sensor


Close up of previous wiring


Board with reed switch, tilt sensor, and LED


Close up of previous wiring


  Picture of the code  



There were a few challenges I encountered through the building process. The first issue was with the Particle IDE. It would not flash code to the Photon, giving weird errors. I ended up using the online IDE as a workaround.

The first hardware issue was a finicky tilt sensor. It would not always change values when tilted, and had odd values over 1000. I had to use the internal pulldown resistor and used digital pins instead of analog pins, and the tile sensor started reading correct values.

The next issue involved a Hall Effect sensor, originally intended to be used with a magnet to tell if a door is closed. When I tried using a Hall Effect (both low and high) sensor, it seemed that the Hall Effect sensors were latching, not suitable for my project. A more feasible plan included the usage of a reed switch. I was able to find a reed switch in plastic casing with a matching magnet in plastic casing. This worked perfectly for my device.

I also was unable to connect to my home network, and tried various fixes and methods, including but not limited to using the Serial Monitor, ParticleDev, Particle CLI, disabling Wi-Fi authentication, etc. In the end I just worked on the project at school to use the school’s Wi-Fi.


The prototype is reasonably complete, although it is quite rough and messy looking. Although I was unable to test it at home due to the internet connection issues, the device works well for its purpose. The next steps in improving it would probably be to create a case for the electronics so they are not just dangling about. I can also set it up so that in addition to using Particle.publish, it could send an email when the door is unlocked. It could also include a speaker to emit a noise to better get the attention of the homeowner. I can perhaps add notifications for when the door is left open as well. Another large improvement would be to use an external power source, since currently it requires the connection to a laptop for energy.


I had some basic circuitry knowledge coming into this course, but this project was able to refresh my memory. I learned about the existence of latching vs non-latching Hall Effect sensors, as well as the reed switch. The internet connectivity aspect is also new to me, as my basic circuitry knowledge came with non-connected Arduinos. I learned how difficult and fickle internet connectivity can be with the Photon, as I was unable to get it to work on the home network.

If I were to do things differently, I would build a neater case to hold the electronic components. This would protect the wiring as well as improve the look of the device. I would also use softer wires so the tilt sensor can be turned more easily. I would also use an external power source so it would not need to be connected to the laptop.

Summary Description (<140 Characters):

Using a reed switch, LED, and tilt sensor, I made a device to alert a homeowner when they forget to lock their door after closing it. 

Share this Project

This project is only listed in this pool. Be considerate and think twice before sharing.


This device uses a reed switch, magnet, LED, and tilt sensor to remind homeowners to lock their doors when leaving the house, and allows them to view the times that the door was locked and unlocked remotely.