Skip to main content
Version: FILS English

Museum Object Defense System

The Museum Object Defense System is a security setup protecting valuable exhibits.

info

Author: Stefania-Daniela Croitoru
GitHub Project Link: (https://github.com/UPB-PMRust-Students/project-Steffc15)

Description​

This project aims to develop a motion and sound based security system using a Raspberry Pi Pico 2W as its core, designed to protect valuable museum exhibits. It utilizes an HC-SR04 ultrasonic distance sensor to detect movement and calculate the distance and speed of an approaching person. A sound sensor adds an extra layer of security by monitoring for unusual noises. When either movement or sound is detected, the system responds by activating a buzzer and illuminating RGB LEDs, providing immediate visual and auditory alerts. This setup acts as a real-time defense mechanism to help prevent unauthorized access or tampering.

Motivation​

I chose this project because it combines engineering with real-world security needs, offering an opportunity to address critical challenges in security (in museum exhibits in my case). The project integrates motion detection, sound monitoring, and immediate alerts using a Raspberry Pi Pico 2W, offering a practical solution to protect valuable spaces. I will use Rust programming language because it offers excellent performance, memory safety, and concurrency features, making it ideal for building efficient, real-time systems. The project is challenging due to the integration of sensors and real-time communication between hardware and software, while also providing valuable hands-on experience in building complex security solutions. Additionally, it offers the opportunity to deepen my knowledge of both hardware-software integration using Rust, with the goal of contributing to creating safer environments.

Architecture​

Main Components:
Central Controller (Raspberry Pi Pico 2W): The core of the system that processes inputs and controls outputs. It runs the code that handles real-time responses to sensor data.
Sensor Module: Ultrasonic Sensor HC-SR04, detects the distance and movement of objects or people in the vicinity and Sound Sensor monitors the environment for unusual noises, providing audio-based input .

Feedback Mechanisms:
Feedback from the sensors is processed in real-time by the Raspberry Pi Pico 2W. Upon detecting movement or sound, the system triggers the RGB LEDs to change color and the buzzer to sound off, alerting anyone nearby.

Display Interface:
A laptop connects to the Raspberry Pi Pico 2W via Wi-Fi, it displays motion and sound activity data, alert status, and allows basic system monitoring and control.

Architecture Architecture Scheme

Log​

Week 6 - 12 May​

I assembled the components on a breadboard for testing, created the initial KiCad schematics, and tested each component’s code individually to ensure proper functionality.

Week 7 - 19 May​

After testing each component on its own, I looked into the right crates and methods needed for my project. I focused on understanding how to control the sensors and other parts using Embassy, and then started putting together the main logic of the system.

Week 20 - 26 May​

Hardware​

2Γ— Raspberry Pi Pico 2W: One runs the system; the other is used for debugging.
Laptop: For programming and displaying the interface via Wi-Fi.
Wires: Female-to-Male, Female-to-Female, and Male-to-Male. Connect components to the Pico and breadboard.
HC-SR04 Sensor: Detects motion by measuring distance with ultrasonic pulses.
SG90 Servo Motor: Rotates to scan areas or indicate movement.
Sound Sensor: Triggers alerts on loud or unusual sounds.
Buzzer: Provides audible alarms during alerts.
220Ξ© Resistors: Protect the RGB LED and control brightness.
Breadboard: Used for prototyping .
Micro USB Cable: Powers and programs the Pico.
LED: Changes color to visually signal system status.

This is what the wiring looks like initially This is what the wiring looks like at the end A the close look

Schematics​

Kicad schematic This is the kicad schematic.

Bill of Materials​

ComponentDescriptionPrice
Raspberry Pi Pico 2WThis is used as the main microcontroller (Γ—2 – one for debugging)39.66 RON
HC-SR04 Ultrasonic SensorUsed to detect object distance and movement20 RON
SG90 Micro Servo MotorUsed to rotate the ultrasonic sensor for scanning14 RON
Sound Sensor ModuleUsed to detect sudden loud noises4.99 RON
Buzzer ModuleUsed to emit audible alerts1 RON
220Ξ© Resistors (Γ—3)Used to limit current for the RGB LED1.5 RON
BreadboardUsed to prototype the circuit without soldering10 RON
LEDUsed to show visual alerts through color2 RON
Male-Male Jumper WiresUsed for general wiring connections~7 RON
Female-Female Jumper WiresUsed to connect between modules and breadboard~7 RON
Female-Male Jumper WiresUsed for flexible pin-to-board connections~7 RON

Software​

LibraryDescriptionUsage
embassyAsync runtime for embedded systemsProvides non-blocking async infrastructure for efficient task execution
embassy-executorRust embedded systemsUsed for asynchronous programming
embassy-timeTime management libraryUsed for time-based operations such as delays
embassy-rpPeripheral access libraryUsed for initializing and interacting with peripherals
embassy-halHardware Abstraction Layer for Raspberry Pi Pico WInterfaces with low-level hardware in a safe and portable way
embassy-netEmbedded networking stackHandles Wi-Fi networking and IP configuration
embassy-gpioGPIO managementControls GPIO pins for devices and inputs
embassy-usbUSB managementManages USB operation
  1. Debug the Raspberry Pi Pico Using Another Pico
  2. HC-SR04 Ultrasonic Distance Sensor