Arduino Wireless Mailbox Detector Device

28K5919

Intro: Arduino Wireless Mailbox Detector Device

If you are anything like me, you look forward to the mailbox arriving like a kid nervously waiting for his presents on Christmas Eve. Since the time my mailbox arrives is not always consistent, I checked my mail multiple times a day. To solve this problem, I created a wireless sensor that tells you whether there is mail in the comfort of your own home.

Here's how it works:

The transmitter will sit under the mailbox and when the door is opened it will send a signal to the receiver telling it the door has opened ( indicating that the mailman has put the mail in). The receiver will then light up a LED indicating that the door has been opened and that's it!

STEP 1: Parts and Tools


Mailbox Detection Sensor:

- Arduino with 3.3v output

- nRF24L01+ Wireless Transceiver $6 (for two at Amazon)

- Breadboard and Cables

- Reed Switch $1.50 Sparkfun

- Magnet $1 Sparkfun

- Power Supplies ( I used 4 AA)

- Tape, Velcro or double side sticky tape to mount receiver

Receiver

- Arduino with 3.3v output

- nRF24L01+ Wireless Transceiver

- LED

- 330ohm resistor

- Power Supplies ( I used 6 AA)

STEP 2: Hooking Up the Arduino to the Wireless Module

First, we have to get the Arduinos to talk to each other. Start by hooking one nRF24L01 module to EACH arduino following the image above. Make sure you hook up VCC to 3.3v on the Arduino and not the 5v pin or else the module might burn up!

Once you have made the connection, we will then hook up the indicator LED and the door sensor!

STEP 3: Wiring the Door Sensor and Indicator LED

Transmitter:

We will detect when the mailbox door is opened by using a reed switch and a neodymium magnet. A reed switch is an electrical switch operated by an applied magnetic field. This switch is normal open when there is no connection and closes to make an electrical connection when a magnetic field is applied.

In our application, when the magnet gets close to the reed switch by the mailbox door opening, it will create a connection between pin four and ground. This will tell the Arduino that the door has been opened.

On one Arduino connect one side of the reed switch to GND the other side to pin 4. This will be your transmitter.

Receiver:

Now we will hook up the indicator light on the receiver. On the other Arduino (not the one you just connected the reed switch to), connect pin 4 to a the 330ohm resistor to the positive lead on the led(the longer one) and then the remaining pin of the led to ground like the diagram above.

This will be the LED that lights up when mail has been received.

Now on to uploading the code.

STEP 4: Uploading the Code

Now we will upload the code to both Arduinos.

Download the Arduino IDE if you haven't so already and download Mailbox_Reciver and Mailbox_Detector.

Upload Mailbox_Reciver to the Receiver ( the one with the LED)

and

Upload Mailbox_Detector to the Transmitter ( the one with the Reed Switch)

Grab the magnet, bring it close to the reed switch and see if the light on the other Arduino turns on. If it does, you did it! Woo hoo! If not, check your wiring and try again

STEP 5: Mounting the Transmitter

Now its time to mount the transmitter to the mailbox.

The reed switch and magnet activate when they are less than half an inch away from each other. So, when the magnet is more than half an inch away it will say the mailbox is on and when its less than half an inch away the sensor will say the door is open.

Mount your reed switch so that it is over half an inch away from the magnet when it is the mailbox is closed and less then that when the door is open. Refer to the pictures above, and yes I did remove my mailbox so I could take a picture for you gals and guys ;P

And that's it!

STEP 6: Future Upgrades

Since this is my first Instructable I wanted to keep it as short and simple as possible. This means that there is room to make improvements. So let me know what you guys think, your suggestions and I might include it in a future update ;)

18 Comments

Hello, I'm not sure if you're still active here, but I figure I'll ask anyways.

I have an issue in the provided receiver code where it won't compile due to an error "void value not ignored as it ought to be".

See the attached image for further info. Does anyone know how to fix this?

EDIT: It was because this uses the older ManiacBug RF24 library and I had a newer type.

So I have been pondering the idea of making something similar, except replacing the reed switch with an IR sensor. Drill a 1" hole in the back of the mailbox and install the sensor in the hole, seal it up good and wire it to the Arduino for the switch. SInce the receiver portion will be in the house, I plan to set it up to send me a text message when mail is delivered. It will also tell me if someone else opens the mailbox before me.

Enjoyed your instructable. I have been thinking about the same project for a while, but I was planning to put an LDR inside the mailbox so when the door opens there's light to trigger a signal which I could transmit to a receiver in my house. I'd also like to power my transmitter with a small solar cell. But I've been away from electronics for a while, and I'm not sure how to start. Seems like there are new products available every day! Any thoughts from anyone on my idea would be most welcome.

I tried making this project today, but i couldn't get it working. When i open the serial monitor for the receiver it just says unexpected data received. How do i fix this?

Hi, I have been trying to use your code, and I am getting a lot of compiling errors from the arduino IDE. Any ideas to whats wrong? Thanks.

I'm having a problem with the code as well. I installed the NRF24 library, but still receive (No such file or directory #include "nRF24L01.h") as an error. Can you help me out?

I recommend to use Arduino Nano 3.3V power version on both sides: transmitter and receiver. Very little power consumption, direct interface with nRF24L01+ and can be directly powered by LiFePo4 battery

Excellent post! Thinking about making similar system. What about:

1) Having transmitter in deep sleep mode, waking up by reed switch to send alert

2) Powering transmitter by LiFePo4 3.2V battery on solar charge

1. Have Green LED for have mail, red LED for no mail.

2. Add either 2 or 4 line LCD display to show initial conectivity, display mail status, and Date/Time when mailbox last opened.

Since 1 & 2 are changes to the receiver, no additional current drain on transmitter. Might need a transformer for the receiver to minimize batter use. Starting to work on this shortly, will post circuit and details.

thanks, amazing project

how long does your battery last ? is there a way to warn (for example another led) when one of the 2 module are low power ?

Smart idea! I really like this project. Thanks for shearig :)

Great minds think alike ;)

Good first instructable. Nice work!

Thanks :)