DIY Smart Parcel Locker System Using Raspberry Pi, SQL, and Web Dashboard

by jasper-lanoote in Circuits > Raspberry Pi

305 Views, 8 Favorites, 0 Comments

DIY Smart Parcel Locker System Using Raspberry Pi, SQL, and Web Dashboard

20260614_122810.jpg

In this project, I will show you how to build a Smart Parcel Locker that automatically detects when a package has been delivered and securely stores it until it is collected.

When a delivery driver places a package inside the locker, the system automatically detects the delivery, records it in a database, and immediately locks the compartment. This ensures that every package remains safe and protected from unauthorized access.

The locker can be unlocked in three different ways, depending on the user's preference or situation:

  1. RFID/NFC Card Access – Simply present a registered RFID or NFC card to the reader to unlock the locker instantly.
  2. Physical Key Switch – A traditional key switch provides an additional secure access method when a card is unavailable.
  3. Remote Web Application – Users can unlock the locker remotely through a web-based dashboard, making it convenient even when they are not physically present.

The web application offers more than just remote control. It also allows users to view a complete history of package deliveries, including recorded delivery events and locker activity. This provides a clear overview of all packages that have been received and accessed.

By combining automatic package detection, multiple secure unlocking methods, and a web-based management system, this Smart Parcel Locker provides a reliable, user-friendly, and secure solution for receiving and managing deliveries.

Supplies

Electronics

  1. 1 × Raspberry Pi 5 (8GB)
  2. 1 × Raspberry Pi 5 Power Supply
  3. 1 × HX711 Load Cell Amplifier
  4. 4 × Load Cells
  5. 1 × PN532 RFID/NFC Reader
  6. 1 × I2C LCD Display
  7. 1 × Solenoid Lock
  8. 1 × Reed Switch (Door Sensor)
  9. 1 × Key Switch
  10. 1 × Push Button
  11. 1 × 12-24V Power Adapter (for the solenoid lock)
  12. 1 × 9V Power Adapter (for the external power supply)
  13. 1 × External Power Supply
  14. 1 × USB Flash Drive (for raspbarry pi os)

Wiring & Prototyping

  1. 1 × Prototype PCB / Perfboard
  2. 1 × Ethernet Patch Cable
  3. 1 × RJ45 Panel Connector
  4. 2 × WAGO Connectors
  5. Jumper Wires

Enclosure And Mechanical Parts

  1. 1 × 6mm basewood
  2. 1 × Piano Hinge
  3. 1 × Power Inlet Socket
  4. 2 × Plugs For Power Supplys
  5. Mounting Screws And Nuts

Tools

  1. Soldering Iron
  2. Solder
  3. Wire Strippers
  4. Screwdrivers
  5. Drill and Drill Bits
  6. Multimeter
  7. Laser Cutter
  8. 3D Printer

3D Print All Parts

20260516_161244.jpg
20260516_161300.jpg
20260516_200609.jpg
20260516_200754.jpg
Schermafbeelding 2026-06-14 162352.png
20260603_155754 (2).jpg

You can find all the files for 3D printing here. Once you have printed it, you can click the load cells and the PN532 into place. For the reed switch section, you need to insert the legs through the small holes. This will hold the reed switch securely in place by itself.

Lasercut All Parts

The parts need to be lasercut on a 6mm sheet

Downloads

Insert All Parts in the Front Plate

20260530_141240.jpg

You can now install the push button, the key switch, and the NFC plate into the front plate.

Both the push button and the key switch are secured with a nut.

The NFC plate uses a snap-fit (click) mounting system. Please do this carefully to avoid breaking the small retaining tabs around the edges.

Screw on the Load Cells

20260530_140930.jpg

You can now screw the load cells onto the bottom shelf. make shure to leave 6mm on al sides for during the glueing process.

Be careful: make sure the screws are not too long and do not go all the way through the wood.

Glue the Lasercut Parts Together (step1)

20260530_143226.jpg
20260530_143231.jpg
20260530_143238.jpg
20260530_143250.jpg

First, take the four pieces with the square holes and the divider for the electronics compartment. Glue them together and clamp them tightly using clamps until they are fixed securely against each other.

Glue the Lasercut Parts Together (step2)

20260530_143505.jpg
20260530_143508.jpg
20260530_143717.jpg

Take the two top pieces to make the lid. Glue them together as shown in the picture. When assembling them, make sure you leave a 6 mm margin on all sides.

Carefully place something with a bit of weight on top to keep everything pressed together, and make sure it doesn’t shift during the process.

Glue the Lasercut Parts Together (step3)

20260614_123127.jpg
20260602_113636.jpg

Also glue the bottom shelf in place and secure it with clamps, as shown in step 6, so that you achieve the result shown in the photo.

Hinge

20260614_123055.jpg
20260614_165837.jpg

The door is attached using a piano hinge. Cut it to 18 cm and pre-drill the screw holes carefully before attaching it.

If you don’t do this properly, the wood may split.

Add the Lock

20260614_165854.jpg
20260614_123105.jpg

To install the lock, first glue a small wooden block onto the right side so that the lock extends past the edge. Then mount the lock onto this block.

After that, attach the metal strike plate to the door using two screws, making sure it aligns correctly with the lock inside the cabinet.

Again, be careful not to use screws that are too long, so they don’t go through the wood.

Make the Appropriate Holes for Your Connectors/plugs.

20260614_122853 (2).jpg

The holes for the connectors still need to be made manually, since they are not included in the design.

You can, for example, install an Ethernet connector and a power cable connector like I did, but you can also use cable glands (grommets) instead if you prefer.

Connecting 230v Side

20260614_193629.jpg
20260614_193638.jpg

To fit the connectors neatly and compactly inside, you can use extension cable plugs without a grounding pin. These can then be connected to the plug that is located at the back of the box.

Everything is connected using WAGO connectors, which are in turn connected to the power plug at the back of the box.

Connect All the Electronics to Your Raspberry Pi

schema project one2_bb.png
schema project one2_schema.png
20260614_122932 (2).jpg
20260614_122934.jpg
20260616_115528.jpg

Above you can find the wiring diagram showing how everything should be connected. You can either build this on a breadboard or on a prototype PCB the choice is yours.

My preference is to solder everything and use proper connectors so everything is securely fixed.

A good tip for projects like this is to buy a kit for making custom cables amazon link

Start You Raspberry Pi And

Start up your Raspberry Pi and connect to it via SSH using Visual Studio Code remote explorer.

Clone Github Repo

Clone the github repo by copying its URL and using the Clone Git Repository button in Visual Studio Code and pasting the url.

Install Requirements

create a venv in the working directory

python3 -m venv myenv

activate venv

source myenv/bin/activate

install requirements.txt

pip install -r requirements.txt

run the app.py python file to start the backend

Install the DB on Ur Raspberry Pi

You can find the SQL file in the GitHub repository under the data folder.

Run this file on the MariaDB instance on the Raspberry Pi via mySQL workbench.

If MariaDB is not installed yet, you can find the installation and configuration instructions in the GitHub repository under 2_configuration.md.

Set Up Apache and Autostart Python

follow the instructions in the github repo under the folder docs in file 3_production.md. You simply need to change Apache's default document root so that it points to your index file.

You Are Now Ready to Use Your Smart Parcel Locker

enjoy!!