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
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
-
Raspberry Pi Pico 2W
– Acts as the main controller and WiFi client -
HB100 Doppler Radar Sensor
– Measures object speed via frequency shift -
LM358 Operational Amplifier
– Amplifies weak IF signal for ADC processing -
LCD 1602 with I²C Adapter
– Displays speed and settings -
OV2640 Camera Module
– Captures images when threshold is exceeded -
microSD Card Module
– Stores JPEG images locally -
Buzzer
– Audible alert when speed is exceeded -
Red & Green LEDs
– Visual status indicators -
Push Buttons (×3)
– Adjust speed threshold and trigger capture -
Logic Level Shifter
– For safe I²C communication (LCD module at 5 V, Pico at 3.3 V) -
Breadboard & jumper wires
– Rapid prototyping and testing -
External 5 V USB Power Supply
– Ensures sufficient power for all componentsSchematics
Bill of Materials
Device | Usage | Price |
---|---|---|
Raspberry Pi Pico 2W | Main microcontroller, handles all components and WiFi | 39,66 RON |
HB100 Doppler Radar Sensor | Measures object speed via Doppler shift | 19,99 RON |
LM358 Operational Amplifier | Amplifies low-frequency IF signal from HB100 | 2,40 RON |
OV2640 Camera Module | Captures images when speed exceeds threshold | 51,28 RON |
LCD 1602 I²C Display | Displays measured speed and configurable speed limit | 16,34 RON |
microSD Card Module | Stores captured images on microSD card | 4,08 RON |
microSD Card 16 GB | Storage medium for image files | 39,99 RON |
Level Shifter 3.3V ↔ 5V (TXS0108E) | Enables safe I²C communication between Pico and 5V devices | 3,99 RON |
Breadboard 400-point | Rapid prototyping without soldering | 4,56 RON |
Jumper Wires (Male–Male) | Connects components on breadboard | 7,99 RON |
Push Buttons 6×6×6 mm | Used for user input (threshold control & manual trigger) | 2,16 RON |
Red & Green LEDs 5mm | Visual indicators for speed status | 2 RON |
Buzzer | Audible alert for overspeed detection | 1,98 RON |
Resistors (10 kΩ, 220 Ω) | Pull-up resistors, current limiting for LEDs and filters | 1 RON |
Condensator 10 nF ceramic | Filter for Doppler signal smoothing | 2,34 RON |
Software
Library | Description | Usage |
---|---|---|
embassy‑rp | RP2040 HAL + async executor | Low‑level access to GPIO, ADC, I²C, SPI, timers |
embedded‑hal | Hardware abstraction traits | Common trait layer used by almost all drivers |
esp‑wifi | Wi‑Fi stack for Pico 2W | Connects to WLAN, sends images via HTTP/Telegram |
embassy‑net | Async TCP/UDP stack | Networking primitives used together with esp‑wifi |
hd44780‑driver | LCD1602 driver over I²C | Prints speed & threshold on the display |
ov2640 | OV2640 camera driver | Captures JPEG images on overspeed |
embedded‑sdmmc | FAT‑FS for microSD | Saves captured images locally |
heapless | Fixed‑capacity buffers | Stores image data & message queues without malloc |
fugit | Time‑keeping utilities | Delay & timestamp calculations |
microfft | Lightweight FFT | Extracts Doppler frequency for speed computation |