Skip to main content
Version: ACS CC

Speed gun

Portable speed detection device.

Author: Rîpeanu Constantin-Adrian
GitHub Project Link: https://github.com/UPB-PMRust-Students/proiect-RipeanuAdrian

Description

A portable radar device that uses a Doppler sensor to measure the speed of moving objects. If the detected speed exceeds a configurable threshold, it activates a buzzer, lights up a red LED, and captures a picture using an OV2640 camera module.

  • The measured speed and speed limit are shown on an LCD 1602 I²C display.

  • The reference speed can be adjusted using physical buttons.

  • When speed is within the safe range, a green LED is lit.

  • When overspeed is detected, the red LED lights up and a buzzer sounds.

  • The image is stored on a microSD card or sent over WiFi via a Telegram bot or HTTP request.

Motivation

This project allowed me to explore embedded systems and real-time hardware control using Rust. I wanted to build something educational and practical — a compact device that detects motion and responds automatically.

I chose this topic because fixed speed cameras are a current subject, especially with the rollout of systems like “e-Sigur”. Inspired by how real traffic radars work, I aimed to recreate a simpler, portable version that can measure speed and take photos.

Arhitecture

System architecture diagram

The Raspberry Pi Pico 2W acts as the core of the system, coordinating all modules:

The HB100 Doppler sensor detects motion and outputs a frequency that reflects the speed.

An LM358 op-amp amplifies the Doppler signal to be read via ADC.

The LCD 1602 I²C displays the measured speed and configurable speed limit.

OV2640 camera captures an image when overspeed is detected.

The microSD card module stores the image, while WiFi can send it to a remote server or Telegram.

Buttons allow manual adjustment of the speed threshold.

LEDs indicate if the detected speed is within or above the limit.

A buzzer sounds on overspeed detection.

Log

Week - May

Week - May

Week - May

Hardware

  1. Raspberry Pi Pico 2W
    – Acts as the main controller and WiFi client

  2. HB100 Doppler Radar Sensor
    – Measures object speed via frequency shift

  3. LM358 Operational Amplifier
    – Amplifies weak IF signal for ADC processing

  4. LCD 1602 with I²C Adapter
    – Displays speed and settings

  5. OV2640 Camera Module
    – Captures images when threshold is exceeded

  6. microSD Card Module
    – Stores JPEG images locally

  7. Buzzer
    – Audible alert when speed is exceeded

  8. Red & Green LEDs
    – Visual status indicators

  9. Push Buttons (×3)
    – Adjust speed threshold and trigger capture

  10. Logic Level Shifter
    – For safe I²C communication (LCD module at 5 V, Pico at 3.3 V)

  11. Breadboard & jumper wires
    – Rapid prototyping and testing

  12. External 5 V USB Power Supply
    – Ensures sufficient power for all components

    Schematics

Bill of Materials

DeviceUsagePrice
Raspberry Pi Pico 2WMain microcontroller, handles all components and WiFi39,66 RON
HB100 Doppler Radar SensorMeasures object speed via Doppler shift19,99 RON
LM358 Operational AmplifierAmplifies low-frequency IF signal from HB1002,40 RON
OV2640 Camera ModuleCaptures images when speed exceeds threshold51,28 RON
LCD 1602 I²C DisplayDisplays measured speed and configurable speed limit16,34 RON
microSD Card Module Stores captured images on microSD card4,08 RON
microSD Card 16 GBStorage medium for image files39,99 RON
Level Shifter 3.3V ↔ 5V (TXS0108E)Enables safe I²C communication between Pico and 5V devices3,99 RON
Breadboard 400-pointRapid prototyping without soldering4,56 RON
Jumper Wires (Male–Male)Connects components on breadboard7,99 RON
Push Buttons 6×6×6 mmUsed for user input (threshold control & manual trigger)2,16 RON
Red & Green LEDs 5mmVisual indicators for speed status2 RON
BuzzerAudible alert for overspeed detection1,98 RON
Resistors (10 kΩ, 220 Ω)Pull-up resistors, current limiting for LEDs and filters1 RON
Condensator 10 nF ceramicFilter for Doppler signal smoothing2,34 RON

Software

LibraryDescriptionUsage
embassy‑rpRP2040 HAL + async executorLow‑level access to GPIO, ADC, I²C, SPI, timers
embedded‑halHardware abstraction traitsCommon trait layer used by almost all drivers
esp‑wifiWi‑Fi stack for Pico 2WConnects to WLAN, sends images via HTTP/Telegram
embassy‑netAsync TCP/UDP stackNetworking primitives used together with esp‑wifi
hd44780‑driverLCD1602 driver over I²CPrints speed & threshold on the display
ov2640OV2640 camera driverCaptures JPEG images on overspeed
embedded‑sdmmcFAT‑FS for microSDSaves captured images locally
heaplessFixed‑capacity buffersStores image data & message queues without malloc
fugitTime‑keeping utilitiesDelay & timestamp calculations
microfftLightweight FFTExtracts Doppler frequency for speed computation
  1. PM‑Rust Laboratory Guide – Lab 01 GPIO & Timers
  2. PM‑Rust Laboratory Guide – Lab 03 I²C & LCD
  3. PM‑Rust Laboratory Guide – Lab 05 SPI & microSD
  4. PM‑Rust Laboratory Guide – Lab 06 Wi‑Fi Networking
  5. Github