Ordering online is a great way to get the things you need without having to leave your house. But what if you are not at home while the delivery is made? Being able to receive your packages at a secure location is a great way to ensure that your packages are still there when you get home from work, grocery shopping, or doing sports.
We thought about this problem and came up with a solution: a smart parcel box that can be controlled via a mobile app. This box can be placed in front of your house and can be opened remotely. It will track your deliveries and notify you when a package has been delivered.
ArchitectureThe system consists of three main components: the smart parcel box, the Next.js backend server, which also serves the mobile app. A Postgres database saves all relevant data which the backend stores and retrieves for the mobile app.
The smart parcel box is equipped with a Particle Photon 2, load cells, a lock, a window sensor, and an accelerometer. The controller is connected to the Particle cloud and can send events to it. Connection is established via Wi-Fi.
We chose wood as the box material. A second flooring houses all components and enables weighing of parcels.
The source code for the photon 2 can be found below. A custom backend server and mobile app can be build with the list of events.
EventsThe Particle Photon 2 will send events to the Particle cloud when the following events occur:
- The box is opened or closed physically
- The weight of the box changes
- The box is moved
These events are relayed to the backend server where they get evaluated and stored to the database.
Backend ServerThe backend server is built with Next.js and is responsible for handling the webhooks from the Particle cloud. It will send notifications to the user's mobile app when a package has been delivered. The server also serves the mobile app.
Configuration of the webhook is needed to connect the Particle cloud to the backend server. The webhook will send a POST request to the server when an event is triggered. Access to the Particle cloud and a public address for the server are needed for this to work.
Mobile AppConnected to the backend server, the mobile app is used to control the smart parcel box. The user can set the delivery time, open the box, and see the status of the box and the packages.
After ordering a package online and getting the time frame or tracking number, the user can set the delivery time in the app. The box will automatically open when the delivery is made and the delivery person can place the package inside and close the box. This triggers a change in weight and lid status of the box. With this information, the Particle Photon 2 will send an event to the Particle cloud. The event is processed by a webhook on the backend server, which will send a notification to the user's mobile app. The weight of the parcel will be included in the notification.
Arriving home, the user can open the box with the app and take out the package. The app will also show the status of the box, expected and delivered packages.
Should a malicious person try to open or move the box in the meantime, the accelerometer will detect the movement and a notification will be sent to the app.
Comments
Please log in or sign up to comment.