Back to Parent

Outcome


Doorlock iot diagram
Show Advanced Options

Proposal:

A frustrating experience I have identified for my housemates (and myself) is that sometimes we stayed at the school library/studio or hung out with friends until late in the midnight and forgot to tell others in advance, which sometimes resulted in one of us got accidentally locked outside when we went back. (We have the habit of locking the house gate from the inner side using a knob before going to bed for safety concerns, in which way the door could not be opened with a key from outside.) 

To solve this problem, I plan to develop an IoT device that can send a text message notification to everyone once someone locks the gate from the inner side, therefore we can react to it quickly.  To realize this function, I plan to put a tilt sensor on the lock (knob) and connect it to a Photon. The Phonton will then integrate with Twilio API to text messages.

Show Advanced Options

Process:

The making process of this project can be divided into 3 steps: 

1. Design a simple circuit that contains an LED as a status indicator, a tilt sensor as an input for triggering events, and a resistor to protect electric components. 

2. Develop code on Particle IDE for controlling the circuit to work as we intended:

- Turn on the LED light when the tilt sensor is tilted, and turn off the LED light when the sensor goes back to the default vertical position.    

- Make sure the tilt sensor functions properly.

- Enable a cloud variable (the status of the tilt sensor) to be inspected.

- Add proper delay to avoid the loop going overwhelmingly frequent.

3.  Integrate Twilio API by adding a webhook on Particle console. Add lines of code to enable Photon to publish events and get responses from Twilio properly. Finally, ensure that messages should be sent to the user under the correct condition.

Doorlock circuit diagram
Show Advanced Options
Show Advanced Options
Particle console
Show Advanced Options
Process 05
Show Advanced Options

Parts:

  • Particle Photon x 1
  • Breadboard x 1
  • Tilt Sensor x 1
  • LED x 1
  • 1kΩ Resistor x 1
  • Jumper Wires 


Webhook:

  • Twilio API
Drop files here or click to select

You can upload files of up to 20MB using this form.