LED Post Box
This project uses an Arduino Nano to add LEDs to a post box to alert the user to when there is post in the box.
An Post (Ireland’s National Mail Carrier) sell a “DeliveryBox” which is a post box that can take parcels as well as letters. The post worker puts all your post in the box and scans the box which sends you an email. However I wanted a quick visual indicator to alert me when I passed the postbox to whether or not there was post that day.
This project uses a limit switch to determine when the box is opened (post delivered) and then lights LEDs according. The LEDs are reset after a specified period of time. This project was specifically designed for an Irish “DeliveryBox” but the project could be adapted for most international mail boxes.
This project requires
- 220ohm resistor (x2)
- 10kohm resistor
- Bright LEDs of different colours e.g. Green and Red (x2)
- Normally Closed Limit switch
- Connector for the DC power
- Arduino Nano
- Protection Diode (1N4001 or similar)
- Project Box
- LED mounts (x2)
- Wire
- Mounting materials
Build the circuit using the schematics below.
The diode on the power connector is used to prevent reverse voltage to the Arduino. If a barrel connector is used the diode may not be required but I designed my connectors with header pins because it is an easy and cheap way to quickly make connectors but it is easy to accidentally plug the power in incorrectly. This diode is included to protect the Arduino however it can be omitted if you desire.
The completed circuit can be seen below. I used headers to make connectors for the power, LEDs and switch to make the device easier to fit to the postbox and more modular.
The Arduino and passive components fit neatly into this small project box.
The components with their connectors and wires can be seen below.
The AC to DC transformer was fitted with new cable and connector to get power from the attic through a duct to the postbox.
The system uses a normally closed limit switch, so that when the box is closed the switch is pushed in and the circuit is broken but when the box opens the switch is no longer pushed in and the switch closes.
When the Arduino detects that the switch has been closed for more than 500 milliseconds it turns on a green (or blue) LED to alert the user.
After a specified length of time the Arduino resets the system with a red LED on and the other LED off, to indicate that there is no post. Hopefully the residents will have removed the post before then.
You could change the code so that it toggles the LEDs when the box is opened but if the post is not collected the same day it will interfere with the system.
The Arduino can now be programmed using the code below.
//Declare switch Pin No const int switchPin = 2; //Declare Red LED Pin No const int redLed = 3; //Declare Green (or Blue) LED Pin No const int greenLed = 4; //Declare the number of hours before reset const int resetHours = 12; //Calculate reset time in milliseconds int resetTime = 1000 * 60 * 60 * resetHours; void setup() { //Declare inputs and outputs pinMode(redLed, OUTPUT); pinMode(greenLed, OUTPUT); pinMode(switchPin, INPUT); //Set the LED starting values digitalWrite(redLed, HIGH); digitalWrite(greenLed, LOW); } void loop() { //If the post box is open (Switch closed) if (digitalRead(switchPin) == HIGH) { //Wait for 500 milliseconds (debounce - prevent false positives) delay(500); //If the post box is still open (Switch closed) if (digitalRead(switchPin) == HIGH) { //Swap the LED values (Post in box) digitalWrite(redLed, LOW); digitalWrite(greenLed, HIGH); //Wait for the specified reset time delay(resetTime); //Swap the LED values (Reset) digitalWrite(redLed, HIGH); digitalWrite(greenLed, LOW); } } //Wait 500 milliseconds before running loop again (Prvent damage to microcontroller) delay(500); }
The variable resetHours can be changed to suit your needs.
The device can now be fitted to the postbox.
The LEDs were fitted to the box using metal LED mounts (link).
The limit switch was fitted to the post box using some scrap aluminum to get it into the correct position.
Project box and wires were taped to the inside of the postbox and a right angle bracket was added for the project box to sit on to make it more stable.
The project is now completed. When there is no post the light is red and when the box is opened for post the light changes to blue for 12 hours. Opening the postbox to remove the post does not reset this timer.
The completed project can be seen below.
This project has been working continuously at my house for just over 12 months and I have had no issues with it.
The system uses 12.264kWh per year which would cost roughly between €1.50 and €2 to run for the year (depending on your unit price).
More information can be found on the projects GitHub page (https://github.com/conorwalsh/LEDPostBox).
As always if you have any questions please don’t hesitate to ask,
Conor.
This project was originally published on GitHub (https://github.com/conorwalsh/LEDPostBox) in May 2017.
From time to time I will republish some of my previous projects with extra information in order to maintain a consistent publishing schedule.