Introduction: Mailbox Notifier

If your mailbox is far away it might be nice to know if the mail actually arrived before walking there.

In this project i will show you how to build a sender device which will be placed in the mailbox which will send a signal to the receiver device located in your house which will light up when the mail arrives. The user resets the receiver by touching the metal button on the front (turns lights off). The remote device has a very long battery life (years).

Before you start/buy anything

  1. You should have good understanding of electrical components and programming. If you're in over you head it might work out anyway if you're lucky, but if you encounter any problems it will be hard for you to do relevant problem solving if you lack understanding of how the components work.
  2. This project requires common electrical tools (multimeter, cables, serial programmer, soldering iron etc..)
  3. Please read the guide & code thoroughly first to see if you understand everything and feel up for the task.

Step 1: How It Works

Before we get into the details I'd like to first lay out the basics of the project to make it easier to follow.

Outline- Mailbox device

The device runs on 3 AA batteries in series. MCU is a attiny85 and transceiver is a 433 MHz HC-12. On the first run both devices will ping each other to confirm connection, after that the device goes in power-down-mode and is awoken by a interrupt when the mailbox is opened. The MCU then turns on a NPN transistor to power up the transceiver which sends a signal back to the receiver unit and then goes back to sleep. Turning off all components when not in use gives very low power consumption (1µA). With quality lithium batteries the batteries should last for 5-10 years (without realistic deterioration about 300 years) .


Outline- Receiver device
The device is powered by USB connected to the mains, therefor this device never sleeps. It has the same transceiver and MCU as the mailbox device. It constantly listens for signals from the mailbox unit. To let the user know mail has arrived it blinks a color pattern with leds. User can interact with the device using a metal touch button.

Step 2: BOM & $

  1. 2 pcs HC-12 transceiver
  2. 2 pcs Attiny-85 + 2 DIP sockets (you will most likely regret it you decide to yolo without one) :D
  3. 150 Ohm resistor, 100K Ohm resistor
  4. 2 pcs 1000μF electrolytic caps
  5. NPN transistor, i use (BC337-25)
  6. Battery pack + batteries (coin cell will work fine and reduce the overall package size with 500% vs AA).
  7. Usb port for circuit board or usb cable
  8. Sensor for mailbox, i use a reed switch which activates when a magnet passes.
  9. NeoPixel Ring 16
  10. Aluminium button
  11. Cases/boxes containing the devices. A solution that i would recommend if you don't have access to a 3d printer is to buy something off the shelf and use. My initial plan for the receiver was to buy a glass sphere and light it from below (but I couldn't find one in my city)
  12. Micro switch or reed switch. Any suitable switch that triggers when the mailbox is opened.
  13. Depending on range and placement you might want to consider smaller antennas.

The total cost of the project should be around 20 USD.

Work time should be around 3-8 hours depending on bad luck and skill.

Step 3: Getting Started


We'll start with the attiny. My code is written for the arduino IDE. This makes programming the attiny much faster. My code contains a lot of comments so you should be able to follow it.

Start by burning the bootloader, connect a LED and upload the blink sketch to confirm its working. I generally recommend getting some sort of feedback on every step you do during the process. If you don't and it doesn't work when everything is assembled it could be cause by 50 different things.

There's hundreds of guides written about how to use these so I rather not write another one, especially when this guy shows it thoroughly.

This little bugger is also pretty well documented. If you want to reach max distance you have to set it to FU-4 mode.

Check out this guys great guide on the HC-12 and how to set it to FU-4 mode. A good way to make sure they work before continuing is to complete his push button tutorial. If you encounter any problems later down the road at least you'll know the transceivers and attinys are working together. One more thing; the max range is 1.8 km theoretically, in line of sight. I suggest you test the transmitters range early in the project to make sure they are strong enough as the range might be reduced to < 100 m if used in urban environments.

Step 4: Prototype

Before we start to solder stuff together we want to make sure everything is working as it should.

Upload the code to attinys. A good tip is to put a piece of tape on the sender device to keep track of it.

Connect a battery or a PSU to power the circuit (3.3-5.3 V), each transceiver peaks at 100 mA when sending so a bit steep for an arduino uno.

If you decide to use 3 AA batteries as i do, make sure they don't exceed 5.3 V when they're fully charged!

Connect according to schematic above. The mysterious capacitor switch will be explained in the next step.

Step 5: The Switches

The switch is simply an aluminum button with a drilled hole and a cable soldered to it.We will measure capacitance with it and use the readings as a switch.

The second switch is the reed switch. This will pull a pin on the sender unit to low, thereby waking up the the sender and to transmit the signal. The switch will close when introduced to a magnetic field. So we glue a neodyne magnet to the mailbox "door" and when the magnet passes the reed switch the circuit closes.

Step 6: Testing

It's now time to test the circuit!

I designed and ordered 10 general boards for attiny and HC-12 as I have 2-3 projects with these components and will need to make at least 8 boards. These are 2 layer boards and cost me only 10 dollar + 10 dollar shipping and saves a lot of time. I really recommend

When both units are powered on for the first time:

Sender device will start to listen. Receiver will do nothing but blink until user touches the button, then it'll send "22" to the sender which will respond will "33". Sender will now go to sleep and receiver will stop blinking.

When the sender wakes up from an interrupt it will send "55" and goes back to sleep. When receiver receives "55" it will start blinking blue and will continue to do so until user touches button.

Consider these steps when testing! Since the device only draws 1 uA, the 1000 uF cap will sustain the sender device for a long time. This means removing the power source won't reset the device. The best way is to remove the power source and then trigger the alarm (pin2->GND). This will turn on the transceiver and attiny draining all the energy in the cap. Adding a reset switch might be a good idea.

If you encounter problems you can use an arduino uno to eavesdrop on the tinys, just use the Software serial example sketch. I also use a pocket usb oscilloscope (about 120 dollar) for error checking. Initially i had a problem with receiving data (faulty pin in protoboard). In the above image you can see the sent data. I just send a "1" which translates to "00110001" in binary (in unicode). Binary is read from right-to-left and the serial line is pulled high when idle. When the transmission begins it goes low first and then start sending. Thanks to this info I knew the data format and baudrate were correct and could start searching for errors elsewhere.

Step 7: The Cases

If you don't have access to a 3d printer you can use about anything for your cases. If your mailbox is made of metal you most likely need to place the sender device on the outside of the box, hence you need a splash-proof case.

If you want to use my cases you can download them here and print. The only place where a "support" is needed is for the top part of the receiver. I print at high speed so I get a lot of "hairs" on my inside and the outside is quite rough, but that doesn't really matter as I will sand it and paint it later anyway.

I used a piece of 50x50x3 mm acrylic for the "window".

Now that the cases are done the first step is the double check that everything fits. When 3d printing parts with a tight fit it's smart to slice out that specific section from part in cad, print it and test the fit. This way you don't end up with a bad fit after printing a 8 h object.

Step 8: Sanding and Painting

The main rule when painting is you'll get the finish you deserve. Spend a lot of effort on the ground work and your surface finish might look good, spend little effort on the groundwork and your finish will never look good.

  • Now i will continue with the initial sanding, with 300 grit paper i just even out the worst parts. I exclude the interior of the parts as this won't be visible.
  • Then I cover them in 2-component filler, I let it harden for 12 hours. For the initial sanding I use a machine with 180 grit and very carefully remove the roughest parts and the bulk of the filler. Use mask + gloves as this stuff is not healthy!
  • When this step is done I water sand with 300 grit again until they look fairly perfect. Then I apply the base coat/primer to the part. If you don't need/want to use the filler and want to paint PLA parts, make sure to use a primer for plastic before painting!

Layers should be really thin. A classic mistake is to apply a too heavy coat, wait 15 min until it's dry to touch and add some more layers. When you're done and the part is dry to touch you'll notice a push with the nail on the surface will leave a mark.

Why this is happening: The first paint layer has only dried on the surface, not all the way through. If you at this time add another layer it will work as moisture barrier preventing the inner layer to dry. Some paints also needs to harden.

So in conclusion; thin layers and a lot of dry time between layers to be sure. (personally I've never used a good water based spay)

Okay lets continue!

  • After the base coat i add two layers of color. When they have dried I use 600 grit to gently water sand any last imperfections then I apply the final coat.
  • If you want the surface to be perfect you can use a 2000 grit paper to super light water sand after the final layer.

Step 9: The Result

Finally done!

On the second picture you can see I also made my own rubber gasket to protect the unit from moisture, this is necessary only if you intend to place the unit on the outside of the mailbox.

If you managed to get this far, good job!!

If you have any problems with range, try changing the function sendSignal(22,1,80);

to sendSignal(22,5,1500); for instance, this will send message "22" 5 times with 1500 ms delay. Don't forget to increase the time before sender goes to sleep (the transmitter takes about 1 sec to send each message in this mode)

If you still have problems, try using an external antenna. They are fairly cheap and easy to attach.

Good luck!


kamil47 made it!(author)2017-01-25

Very nice and clear project. I am working on it, but I need to modify it slightly: adding one more alarm - alarm for Garage door open. So there are 2 alarms. I need to modify both sender and receiver Arduino software. But there is a small problem, in your receiver file FPZJ5Q...., some parts of code -Pushbutton setting and Interrupt are disabled by remark sign //. Why?

johanmoberg made it!(author)2017-01-25

Thank you! Aha the interrupt is just "left overs" i think. The receiver never sleep so it doesn't need the interrupt. At first I was doing one code for both devices, but it got so long i decided to split it up. The push button is not used, it's only the capacitance button which uses pin 2 and 1. Initially it was supposed to be a push button which later on were swapped to the cap. button. Sorry for any confusion. Good luck!

ahbrown41 made it!(author)2016-10-19

This looks great, thanks! Do you happen to have 3d STL files and the PCB designs (Never made one)? Thanks!

johanmoberg made it!(author)2016-10-19

Yes, you can find the stl files under step 7! I can share the PCBs but i would'nt recomend using them for this project. I made these boards to use in 2-3 different projects so some "special" (read not good) solutions are required to get them to work with this specific one. The other project required 6 boards so i made them to suit that project. Since this project only requires 2 boards i think it will be faster for you just using protoboards. Good luck!

ahbrown41 made it!(author)2016-10-30

Ok I am working on this one but I need to ramp up on some of the electronics. I notice you do not use a transistor on the receiver and the HC-12 ground does not go anywhere. Is the transistor used for both sides?

johanmoberg made it!(author)2016-10-30

Aha no transistor is used for the receiver, its only to save battery for the sender. The HC-12 ground is just connected to ground on the reciever.

sshepard made it!(author)2016-10-25

Sounds like an AWESOME project to hit someday!!! But I'm going to have to tinker around with some smaller Arduino and Raspberry Pi projects first to get an idea of connecting things and programming. I'm just now starting to learn Python and when done will more then likely hit C++.

jennise made it!(author)2016-10-24

great project,i am pcbway manager,i am glad you choose us that make boards for you,hope you can share more and more projects here,in instruable

glennlake made it!(author)2016-10-18

I like this but I have a problem. Do you have a full schematic of the layout of the circuits? All I see here is lables for the pc board. I would like to prototype this but can't from the info provided here. Thanks.

johanmoberg made it!(author)2016-10-19

Hi! I use the labels instead of "wire"( I think it gets less messy). Just add wire between the connections with the same name and you should be good to go!

Daniyal+Shamsi+154 made it!(author)2016-10-05

Great!!!,Gonna make one!!!....

rayxoxo1 made it!(author)2016-10-04

It's a good idea - but I have been using a much more simpler method with regards to checking the mail box, for years. This may only work on country style mail boxes. It is only useful up to about 100 meters but could be further, depending on line of sight and obstructions.

I take a fairly thin piece of flat plastic, tin, card board, or even an old credit card, but for longer distances a 4"X6", piece. For easier seeing, It can be painted. Punch a hole in one corner of the card and use about a 12" piece of string. I attach one end to the mail box and the other end to the plastic card (it doesn't have to be plastic,whatever works best for the weather for the weather. You slide the card into the side of the mail box door, and when the mail man opens the door the card drops out and can be seen from quite a distance. If the card is hanging down from the mail box, it should mean that the mail box has been opened. When you go to check for mail you just need to re close it. Sorry, if this isn't technical enough. But it is a very simple method of seeing from a distance if the door has been opened or you have received any mail.

Hope this is a help.

This is for this type of mail box.

johanmoberg made it!(author)2016-10-04

Thank you for sharing, I love solutions that aren't more complicated than they need to be! I made this to my parents and their mailbox isn't visible until you're standing next to it (hedges and turns).

rayxoxo1 made it!(author)2016-10-04

Thanks for the response - I liked your post, but I am just too lazy to build it... LOL

charlessenf-gm made it!(author)2016-10-04

In our case, the box is +/- 700 ft from the house. Did I miss your discussion on range? Did you run any tests to get an idea of the range? Also, how is it affected by weather events?

johanmoberg made it!(author)2016-10-04

No not really, except from testing the transmitters at the mailbox to make sure it worked before getting into the details. Can't really say if it´ll work for you as obstacles will reduce the range dramatically. What I can say though is the placement of the antennas makes a big difference, in a well insulated house and behind several thick walls is not a good idea. I haven't noticed any differences during different types of weather but that may very well affect the range.

Ortzinator made it!(author)2016-10-04

Not sure I would trust my mailman to not be scared by a strange device in my mailbox.

Suicid made it!(author)2016-10-04

no worries . being a postman myself i can assure you we never look into the boxes while delivering. at least in uk ;)

WannaDuino made it!(author)2016-10-04

i live in a appartment flat and we are 10 hight

will it work with all that concrete between??

becous i want to make it.

i like IT

johanmoberg made it!(author)2016-10-04

If you add a small directional antenna, point it out toward the street and try to bounce the signal off nearby buildings up to your window it might work. I would suggest just purchasing two HC-12 and test with them first before buying anything else. The parts are easy to find, for HC-12 i recommend 5 pack on;

WannaDuino made it!(author)2016-10-04

caou make an arts list and wher to buy, and put it in here.

aliexpress or so, (my favorite) boxes FULL i have

alanjsims made it!(author)2016-10-04


DIY+Hacks+and+How+Tos made it!(author)2016-10-03

This is brilliant. I have got to make one of these before deep winter hits.

johanmoberg made it!(author)2016-10-03

Thank you!

rafununu made it!(author)2016-10-03

I don't understand how the reed is activated when a magnet passes, have you got magnetic letters in your country ?

johanmoberg made it!(author)2016-10-03

Aha see step 5, the magnet is attached to the mailbox "door" so when it´s opened it passes the reed switch.