Skip to main content
Version: FILS English

Security-Robot

Security robot that detects motion, avoids obstacles, displays facial expressions and sends real-time Telegram alerts.

info

Author: Alexandru-Costin Dumitrache
GitHub Project Link:https://github.com/UPB-PMRust-Students/project-qnight99

Description

This project uses a Raspberry Pi Pico W as the brain of security robot. The robot is equipped with motion and ultrasonic sensors for intruder detection and obstacle avoidance, DC motors for movement, and a facial display made of an RGB LED matrix. The LED face changes expression depending on its environment-green (happy) when safe, and red (angry) when detecting motion or obstacles. It connects to Wi-Fi to send alerts to a Telegram bot, allowing real-time monitoring.

Motivation

The inspiration for this project came from two sources. First, I saw a robot dog on TikTok that could move autonomously and respond to its environment. It looked alive and expressive, which sparked the idea of building something similar—simple, fun, and reactive—but using only the components I had access to. Second, as a fan of the game Rust, I liked how the game alerts you in real-time if someone invades your base. I thought it would be interesting to bring that concept into the real world by making a small robot that can guard an area, detect movement, and notify you instantly through Telegram.

Architecture

Schematic Diagram

Schematic diagram

Raspberry Pi Pico 2W

  • Role: Acts as the brain of the robot-handling sensor input, controlling motors, facial expressions and Wi-Fi communication.
  • Connections: GGPIO pins for motor control, sensor data,SPI/I2C for RGB Matrix,ADC for ultrasonic sensor,UART/Wi-Fi libraries for Telegram

PIR Motion Sensor

  • Interface: GPIO
  • Role: Detects motion from potential "intruders".

Ultrasonic Sensor - HC-SR04

  • Interface: TRIG and ECHO pins connected to GPIO
  • Role: Obstacle detection for navigation

RGB LED Matrix

  • Interface: GPIO
  • Role: Shows a “face” that reacts to environment (happy/angry).
  • Expression Logic: Green when safe(no motion,no obstacle) and Red when motion is detected.

2x DC Motors and L298N Motor Driver Module

  • Interface: GPIO, PWM
  • Role: Movement

LM2596S Step-Down

  • Role: Voltage reduction from ~7V to 5V

Log

Week 6-7

After the project was approved, I gathered most of the necessary parts for the project.

Week 8-9

I also began designing a 3D model for the chassis of the robot, but I haven't decided yet about the final product. I started the hardware assembly and made the sensors and the alerts on telegram work except the movement part because I don't have the chassis yet, nor the wheels.

Hardware

The core of the project is the Raspberry Pi Pico 2W, which controls all the peripherals and handles logic, sensing, and communication. For motion detection, a PIR sensor is used to detect any presence or movement in the area being monitored. An ultrasonic sensor is mounted at the front of the robot to detect obstacles and prevent collisions during navigation. For movement, the robot uses two DC motors connected to a motor driver module, allowing it to drive forward, backward, and turn left or right. The robot has a RGB LED matrix mounted on the front, representing a face. It displays different expressions: green and smiling when the environment is safe, and red and angry when danger is detected (motion is sensed).

Schematics

Schematic diagram

Bill of Materials

DeviceUsagePrice
Raspberry Pi Pico 2WThe microcontroller40 RON
PIR SensorMotion-detection6 RON
Ultrasonic SensorTo avoid obstacles6.49 RON
L298N Dual H-Bridge Motor DriverControls two DC Motors11 RON
2xDC MotorsMovement59.40 RON
Matrix LedFor the "face"79 RON
LM2596SVoltage reduction5.21 RON

Software

CrateDescriptionDocumentation
embassy-rpHardware support package for Raspberry Pi Pico using the Embassy frameworkDocs.rs
embassy-executorAsync/await executor for embedded devicesDocs.rs
embassy-timeTiming utilities (delays, timeouts, clocks) for embedded async RustDocs.rs
embassy-syncAsync-aware synchronization primitives (Mutex, Channel, Signal)Docs.rs
embedded-hal-asyncAsynchronous embedded Hardware Abstraction LayerDocs.rs
ili9341Driver for ILI9341 TFT displays over SPIDocs.rs
embedded-graphics2D graphics library for drawing text and shapes on embedded displaysDocs.rs
gpioGPIO abstraction for embedded systems (depending on usage, may be HAL-specific)Docs.rs
adcAnalog-to-Digital Converter interface (might be included via embassy-rp)Docs.rs
pwmPulse Width Modulation abstraction (included in HAL or platform crate)Docs.rs
reqwest (Optional)Used for sending Telegram messages over HTTP (only available on std, not embedded)Docs.rs
  1. https://www.youtube.com/watch?v=ioDFU68lt2E
  2. https://www.youtube.com/watch?v=-l2QIIpeXSs