SafeDelivery
A smart package security system to monitor and verify package integrity during transport
Author: Sebastian Stefan Bahrin
GitHub Project Link: [link_to_github]
Description
SafeDelivery is an intelligent system for securing package transport, built with Raspberry Pi Pico 2W. The device monitors the physical conditions of a package during transport and detects opening attempts, rough handling, or abnormal positioning. The system logs all these events to a microSD card, allowing recipients to verify if the package was properly handled throughout delivery.
Motivation
The inspiration for this project came from my personal experiences with damaged deliveries and the frustrating uncertainty of not knowing whether valuable items were mishandled before they reached me. By creating an affordable, reliable monitoring system, SafeDelivery empowers both senders and recipients with irrefutable evidence of a package's treatment during transit.
Beyond individual consumers, this technology has significant implications for industries shipping sensitive, fragile, or high-value items such as medical supplies, electronics, or artwork. SafeDelivery represents not just a technical solution but a step toward greater accountability in global logistics chains.
Architecture
Main Components:
-
Sensor Array - Multiple sensors that monitor different aspects of package integrity:
- Light sensor (LDR) for detecting package opening
- Vibration sensor (SW-420) for detecting rough handling
- Reed switch with magnets for detecting seal breakage
- IMU sensor (MPU6050) for detecting orientation and position changes
-
Processing Unit - Raspberry Pi Pico 2W processes all sensor inputs and makes decisions
-
Storage System - microSD card with SPI adapter for logging all events with timestamps
-
Notification System:
- OLED display showing package status
- LED indicator (green = intact, red = tampered)
- Active buzzer for audible alerts
-
Power Management - Battery system for autonomous operation
Connection Diagram:
System Diagram
TBA
Log
Week 5 - 11 May
TBA
Week 12 - 18 May
TBA
Week 19 - 25 May
TBA
Hardware
The project uses the Raspberry Pi Pico 2W as its central microcontroller, which offers Wi-Fi connectivity, low power consumption, and sufficient GPIO pins for all sensors. The sensor array includes an LDR for light detection, SW-420 for vibration sensing, reed switches with magnets for tamper detection, and an MPU6050 IMU for orientation monitoring. Visual feedback is provided through an OLED display and status LEDs, while a buzzer provides audible alerts. All events are logged to a microSD card via SPI interface.
Schematics
TBA
Bill of Materials
Device | Usage | Price |
---|---|---|
Raspberry Pi Pico 2W | The main microcontroller that manages all sensors and logs events | 40 RON |
Light Sensor (LDR) | Detects if the package has been opened (light exposure) | 5 RON |
Vibration Sensor (SW-420) | Detects shocks, movements, or violent handling of the package | 5 RON |
Reed Switch + Magnets | Detects if the package lid has been opened (magnetic seal broken) | 20 RON |
IMU Sensor (MPU6500) | Monitors orientation, detects abnormal tilting or positioning | 13 RON |
LCD de 1.44'' | Displays package status (intact/tampered) and stores all recorded events for later verification with the SD card | 40 RON |
GPS Module | Provides real-time location tracking of the package, allowing you to monitor its journey and verify if it has deviated from the intended route | 60 RON |
Battery | Provides autonomous power during transport | 20 RON |
Case / Box | Simulates the sealed package in which sensors are mounted | Found at home |
Software
Library | Description | Usage |
---|---|---|
embassy | Asynchronous embedded framework for Rust | Core framework for running async tasks on the Raspberry Pi Pico 2W |
embassy-rp | Embassy HAL for RP2040 | Hardware abstraction layer for the Raspberry Pi Pico 2W |
embedded-hal | Hardware Abstraction Layer (HAL) traits | Provides unified interfaces for hardware drivers |
embedded-graphics | 2D graphics library | Used for drawing to the OLED display |
ssd1306 | Rust driver for SSD1306 OLED displays | Controls the 0.96" OLED display |
mpu6050 | Rust driver for MPU6050 | Interfacing with the IMU sensor |
shared-bus | Bus sharing for embedded Rust | Sharing I2C/SPI buses between multiple devices |
embedded-sdmmc | SD/MMC card access | Managing log files on the microSD card |
defmt | Logging framework for embedded devices | Debugging and development logging |
chrono | Date and time library | Creating timestamps for event logging |