Software apps and online services
Hand tools and fabrication machines
This project is about building a Secure Package Reception Box, which is basically a large size smart and connected mailbox for receiving packages/parcels/mails. It will allow reception of parcels/packages without being present at home. The mailbox can be unlocked locally with the order/tracking number of the parcel provided by the delivery guy. Alternatively, it can also be unlocked remotely by the user if needed. Once the package it placed inside the box, it will lock itself and send notification to the recipient/user using Particle Argon. The package will be secured until the recipient unlocks the box. Thus any package can be received while receiver is not at home, it will be secured from package thieves and user will get real-time notification during delivery.
- Local unlocking with authentication
- Outdoor vault for exchanging stuffs
- Mail/package notification on app/email
- Remote locking/unlocking
- Parcel/package anti-theft
- Cool user interface
- Voice instruction
The solution is built with a mix of plastic/wooden/metal materials and necessary electronics. The Particle Argon will be the controller for the system to control the locking/unlocking mechanism, authentication & notification processes. Particle Argon will be connected to home WiFi. A servo motor will control the locking and unlocking mechanism
This is how the mailbox looks like (before installing electronics) after building it :
Dimensions (in cm)
- Back Plastic Box: 28 x 19 x 5.5
- Top/Bottom WPCboards: 29.5 x 19.5
- Left/Right WPCboards: 28.5 x 25.5 (+4.5 overlapping plastic box)
- Front Aluminum Door: 30 x 20
- Thickness : Door 3 mm, WPCboard 4 mm, Plastic 2.5 mm
Originally, I wanted to use this old intercom box for the mail box, because it has a cool Aluminium Front Panel. It is enough for receiving documents/mails but too small for receiving parcels/packages.
That's why, this intercom box is modified by adding 4 side walls of WPC board to increase it's area.
Tools required : Ruler, Hot-blade, Motor driven Mini-Saw, Marker, Screw Driver
Parts required : Metal Hinge (2cm x 6 cm), Metal Angle with holes, washer, nuts and bolts, screws, magnet
Materials Required: WPC(Wood Plastic Composite) board, Hot+Super Glue, Resin Adhesive, Polyethylene Tape , Double sided tape
- Step 1 : Cut WPC board with saw according to dimensions
- Step 2: Attach the pieces with hot glue+super glue & epoxy resin
- Step 3: Wrap around with polyethylene cloth tape
- Step 4: Reinforce the box with metal angle and screws
Attaching the front door
- Step 1: Attach Metal Hinges on the front Al door with nuts and bolts
- Step 2: Mark the screw positions on a WPC reinforcing beam
- Step 3: Apply wood adhesives, align the door and tighten with screws
Following parts and hardware are installed and interconnected in the mailbox to build a functional system for the secure package reception box.
Which hardware is for what?
Particle Agron I/O mapping to external hardware
Particle Argon has 20 mixed signal I/O pin, here is the pin budget
- 6 GPIO >> 20x4 LCD
- 7 GPIO >> 3*4 keypad
- 1 ADC >> door position sensing
- 1 PWM >> servo motor for lock control
- 1 ADC >> package sensing with LDR
- 1 GPIO >> audio message playback
- 2 I2C >> control 8 Status LEDs
Here is the schematic for this system (see schematic section for details)
Particle Argon and power supply:
The Particle Argon is connected on a breadboard attached to the back side of the front panel (door). To power the project, 18650 LiPo is also installed next to the breadboard.
Particle Argon has built-in LiPo Charger, so the project can be powered from 5V adapter or Solar Panel with DC step down regulator for longer operation.
LCD display and keypad:
The display will have instructions for the delivery guy about unlocking the box. To unlock it locally, the delivery guy needs to enter the order/tracking number of the parcel/package pressing the keypad.
Keypad and LCD is installed on the front side of the door. Only the numeric keys, *, # will be used by the user.
20x4 3.3V LCD is placed on the rectangular cut on the front door.
- Step 1: Attach the keypad on the front door with back sticker
- Step 2: Install the LCD on the front door with double sided foam tape
- Step 3: Block the openings with Ice-cream stick
- Step 4: Pour Epoxy glue to seal the LCD on the front panel door
Door position sensing:
An Infrared photo-interrupt is attached on the inner ceiling of the box near the door to sense door opening/closing. A female header is glued on the door to interrupt the IR light.
5 LDRs are placed on the deck of the box in parallel to sense package/parcel.
- Step 1: Make five 5mm holes on a 18.5x28.9 cm^2 WPC board
- Step 2: Wrap the board with masking tape
- Step 3: Place 5 LDRs in those holes and add copper tape on back
- Step 4: Solder all the LDR in paralled and install inside the mailbox
Door locking/unlocking mechanism:
A servo motor with metal arm is installed inside the front door to control the locking/unlocking mechanism. An L-shaped angle is screwed on the side wall to latch with the moving arm.
- Step 1: Mount L-angle on side wall with screws
- Step 2: Attach Servo Motor on the door with screws and epoxy glue
- Step 3: Make connection between servo and Particle Argon
Status LEDs on front panel
An Arduino UNO in breadboard will control 8 status LEDs by receiving I2C commands from Particle Argon. I had to do this, because there is not enough I/O on Particle Argon for this project.
- Step 1: Upload the attached arduino code to an Arduino Uno board
- Step 2: Remove the ATmega328P chip and put on a mini breadboard
- Step 3: Connect I2C lines, 16 MHz Xtal, Power and LEDs to the chip
- Step 4: Send I2C command from Argon to control 8 LEDs
Here are the front panel LEDs' functions:
- " WiFi Signal OK" Blue LED glows when Wifi Signal Quality > 25.0%
- "Connected to Cloud" Blue LED glows when Connected to Cloud
- "Healthy System Power" Green LED glows when Battery Voltage > 3.5 V
- "Authentication Success" Green LED glows when Tracking number matches
- "Mailbox Door is Locked" Red LED glows when box is locked
- "Mailbox Door has Unlock" Blue LED glows when box is unlocked
- "Mail/Package Awaiting" Red LED glows when no package/mail sensed
- "Mail/Package Received" Green LED when a package/mail sensed
LED labels for front panel:
LEDs are install on the back side of the front panel with double sided tape and masked with masking tape for reflecting light through front tag windows.
- Step 1: Put double sided tapes and place LEDs, resistors
- Step 2: Solder the connections and connect to Atmega328P
- Step 3: Mask with 4 layers of masking tape
Voice message recording and playback:
ISD1820 voice message chip can hold 8-12 seconds of voice message, drive 8 ohms speaker directly. It can be controlled with one I/O pin of Particle Argon (see circuit diagram for details) for playing audio message.
When the door unlock is successful, this voice message will tell user what to do. Instead of recording from microphone, which is noisy for recording, I have used online text to speech service to generate the audio and connected ISD 1820 board to PC audio port while pressing the record button to record that audio.
After the audio is recorded successfully, this board is installed inside the mailbox with double sided tape, cable clip and screw.
Before writing the code, lets see what is suppose to happen here-
- Libraries, Hardware Initialization (LCD, Keypad etc), Variables, Blynk Timers, Virtual Pins etc are Included on the program that will run on Particle Argnon. (see attached code below, it's heavily commented)
- In the main Loop, Blynk.run and Blynk Timers will keep running forever, timer functions perform calling of all other functions periodically for scanning keypad, updating LCD, LEDs, door lock/unlock, package/door sensing, communication with Blynk remote app on smartphone etc.
- User will setup mailbox with package tracking number from Blynk app. User will get the tracking number from delivery service provider through email.
- During delivery, Delivery guy will enter the exact tracking number using the local keypad. It will be printed on the package/parcel label.
- If tracking number matches, authentication LED will turn on, servo unlocks door and door is opened by delivery guy, door unlock LED will be on, door lock LED will be off, voice message plays from ISD1820
- User will get authentication success/attempts status message on the app, IFTTT email (in case app is not running, user can still get notified)
- Once the package placed by delivery guy and the door is closed, servo motor locks the door, package sensed status is sent to App (also email and Particle console). All LEDs are updated both on mailbox and Blynk app
- Alternatively, user can directly lock/unlock the door from app if needed.
- Keypad is scanned every 30 mS, LCD will only update if any key is pressed. Mailbox sensing function will check everything every 5 seconds, app undate function will send status every 3 seconds.
To develop program for Particle Argon, following steps are required
- Login and Start writing code for a new app
- Including Libraries for Hardware Support on the code
- Checking Particle API references and Blynk API
- Flash the code on hardware and see how it works
Following screenshot shows how libraries are added to Web IDE code editor
This code can be copied from following link to your Particle IDE
https://go.particle.io/shared_apps/5d7401570e69780005199a01Configuring the Blynk app
Mailbox owner needs to configure the system from a smartphone app (Blynk) connected to the Particle Argon (which is inside the Secure Package Reception Box) by providing the expected package order number/tracking number through terminal on the app.
By providing that number through keypad, the mailbox can be unlocked locally. Alternatively locking and unlocking can be done directly from Blynk app. The app also shows the status of the smart mailbox with 8 virtual LEDs in it.
See Blynk API references to understand how these functions work.
Following video shows how to configure Blynk app and use it to monitor/control the smart mailbox remotely -Application demonstration
DeviceGetting email notification from mailbox
With the help of IFTTT, email notification will be sent from the Argon, if something happens with the mailbox.
Following steps to configure email alert:
Step 1: Sign-up or Login to IFTTT service
Step 2: Go to IFTTT send email applet
Step 3: Login to Particle from there and allow IFTTT to access Particle device(s)
Step 4: Configure Event on IFTTT side and Particle.publish on Web IDE (see picture below)
Step 5: Flash new firmware and get email alerts like this :
Once the code is flashed on the Argon, activities on the mailbox like door locking/unlocking, authentication, package sensing etc can be monitored on Particle Console - https://console.particle.io/events
When something happens, following Particle Cloud APIs can be called to update events on the console
Particle.publish("Failed Attempt to unlock mailbox");
- Unlike regular mailbox, no unauthorized person can unlock it to steal the package. Keeps online purchases safe from package thieves.
- When a package is received inside the box, user will get notification on app or email. There is no need to check mailbox regularly when it is empty.
- Outdoor safe/vault to exchange anything with someone when you are not at home. Get your music CD back from your neighbor when you are away.
- The entire process can be automated if the shipping/retail party sends the tracking/order number to the mailbox over internet, the package has a barcode label/NFC tag of that tracking number and the mailbox has a barcode reader/NFC reader instead of keypad. Delivery guy will scan the package label near the mailbox to unlock it and deliver securely.
If the home WiFi network not within the range of the smart mailbox, few Particle Xenons may be used to reach connectivity to the mailbox and the Particle Argon can act as the Gateway device to connect to the cloud through home WiFi network.
You can learn more in details about each components in these tutorials:Conclusion
This project is an application example of Particle technology in urban deployments for upgrading existing mailbox to smart mailbox.
All the materials, hardware and firmware used to build this project requires further improvement. For example, a full metal box with larger dimensions, PCB for the circuits, reliable power sources and improved bug free firmware. This is just a homemade prototype of the idea of a better smart mailbox.