Skip to main content
Version: ACS CC

Eq-Detector

An earthquake detector with real-time seismic graph visualization.

info

Author: Mitran Ramona Luminita
GitHub Project Link: https://github.com/UPB-PMRust-Students/proiect-mnoramona

Description

Eq-Detector is an earthquake detector built using a Raspberry Pi Pico 2W and an ADXL335 accelerometer. It monitors 3-axis vibration levels in real time and triggers alerts when exceeding a predefined threshold. The project also includes a Python-based visualization component that plots seismic data live via serial communication.

The embedded software is written in Rust, using the rp2040-hal crate for hardware abstraction and embedded-hal for peripheral control. LCD communication is done via I2C, and accelerometer data is acquired using ADC pins.

Motivation

Earthquakes pose a serious risk, especially in areas with poor infrastructure. This project aims to offer a low-cost, accessible, and educational way of building a basic seismic alert system. It merges electronics with real-time data visualization to provide a hands-on learning experience.

Architecture

The architecture of the Eq-Detector system is centered around the Raspberry Pi Pico 2W microcontroller, which interfaces with multiple peripheral devices to detect and respond to seismic activity.

An ADXL335 accelerometer is connected to the Pico via its ADC0 pin, providing analog data about vibrations across one or more axes. The Pico processes this data in real time.

If the detected vibration exceeds a predefined threshold, the Pico triggers two output signals:

A buzzer for an audible alert.

An LED connected via GPIO2 for a visual alert.

The system also includes a 16x2 I2C LCD display, which receives data through the I2C interface, showing real-time information such as vibration intensity or alert status.

Additionally, the Pico sends data via serial connection to a PC, where a Python application using Matplotlib can graphically visualize the vibration levels over time.

Figure 1: System Architecture

Log

Week 5 - 11 May

TBC

Week 12 - 18 May

TBC

Week 19 - 25 May

TBC

Hardware

  • Microcontroller: Raspberry Pi Pico 2W (RP2040-based)
  • Sensor: ADXL335 (X, Y, Z analog output)
  • Output Devices: 16x2 I2C LCD, buzzer, red LED
  • Other: Breadboard, jumper wires, USB cable

Schematics

  • ADXL335 to GP26-GP28 (ADC0-ADC2)
  • LCD to GP0 (SDA) and GP1 (SCL)
  • Buzzer to GP2 (digital out)
  • LED to GP3 (digital out)

Figure 2: Electrical Schematic

Bill of Materials

DeviceUsagePrice
Raspberry Pi Pico 2WRust-capable MCU~40 RON
ADXL335 AccelerometerVibration sensor~13 RON
16x2 I2C LCDDisplay output~17 RON
BuzzerAudible alarm~2 RON
Red LEDVisual indicator~0.50 RON
readboardPrototyping~4 RON
Jumper Wires (M-M)Wiring~4 RON

Software

LibraryDescriptionUsage
rp2040-halRP2040 Hardware Abstraction LayerUsed for peripheral control (ADC, GPIO, I2C)
embedded-halHardware abstraction traitsTrait-based drivers for Rust embedded
lcd1602-rsLCD I2C display libraryUsed for displaying sensor values
defmt + panic-probeDebug logging and panic handlingUsed for debugging on embedded target
pyserial (Python)Serial communicationReads data from Pico in Python
matplotlib (Python)Graph plottingReal-time visualization of X/Y/Z axes
  1. About Raspberry Pi Pico 2w
  2. About Rust
  3. Arduino Project, for inspiration only
  4. ADXL335 Datasheet ...