Back to Parent

Outcome


Problem Statement

My parent's house has a mailbox that is pretty far from the front door. Because of this, they frequently have to walk out and check to see if there has been new mail delivered. It can be very hot in the summer months where I live, so walking out to the mailbox is not a fun occasion, especially when there is no new mail to be found. If only there was a way to be notified within the comfort of one's home that they have received mail.

Goal

The solution to this problem is to add a connected device to the mailbox that can detect when the mailbox is opened or closed. While there are several ways to do this, I opted for light detection, as that would be the easiest way to integrate with and existing mailbox. This device will need to be in range of a WI-FI connection, so that it will be able to relay the information to the user. Since we are dealing with mail, I thought sending an email to the user of the notification would be most appropriate. This device solves the problem because the user can be sent a notification from anywhere connected to the internet that new mail has been added to their mailbox.  

Process

I started by building only the circuit with the photo resistor to gauge what values I needed in my code to be able to determine when the box was opened or closed. Once I found the right balance, I hooked the code up to IFFT to send myself an email once the box was opened.

20180205 212214.thumb
Show Advanced Options
Code1.thumb
Show Advanced Options

I next added an LED to indicate the status of the box. The light will turn on when the box is opened and turn off when the box is closed. I updated the code to incorporate the LED.

20180205 212315.thumb
Show Advanced Options
Code2.thumb
Show Advanced Options

For the final touch, I added a three pronged switch. When the switch is off, the LED blinks rapidly and the photo resistor is no longer actively checking to see if the box is opened or closed. This is to avoid the situation when the user is going to collect the mail and obviously doesn't need the notification via email that the mailbox has been opened. To code this, I added a placed the previous code inside of a if  statement and gave and made an else statement for the flashing light.

20180205 212143.thumb
Show Advanced Options
Home hack code pic.thumb
Show Advanced Options
Show Advanced Options
Home hack circuit.thumb
Show Advanced Options

Parts

1 x Particle Photon

1 x Photo resistor

5 x Jumper Wires

6 x Jumper Cables

2 x 1KΩ  Resistor

1 x Switch

1 x LED


Video and Output Verification

Below is the video showcasing the device. The LED lights up when the box is opened and no notification is sent when the switch is flipped.  Also below are the console outputs in particle and the respective emails tied to the "Light Detected" published event.

Show Advanced Options
Console.thumb
Show Advanced Options
Email edited.thumb
Show Advanced Options

Reflection

If I were to do this project over again, I would move the switch to the box itself instead of being on the particle photon. Right now if my design were to be used with the whole system inside of the mailbox, the switch would only be able to be reached once the box was opened making its purpose useless. I could also change the switch to a different type of input method such as a button. Another way I could change this design is to split the functionality between two particle photons. On the device inside of the box it would house the photo resistor, and the second would have the LED and switch for notifications. I think I got to where I wanted to with this project, as I was proud to get the device working and have more features than I originally imagined.

Drop files here or click to select

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