Eq-Detector
An earthquake detector with real-time seismic graph visualization.
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.
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)
Bill of Materials
Device | Usage | Price |
---|---|---|
Raspberry Pi Pico 2W | Rust-capable MCU | ~40 RON |
ADXL335 Accelerometer | Vibration sensor | ~13 RON |
16x2 I2C LCD | Display output | ~17 RON |
Buzzer | Audible alarm | ~2 RON |
Red LED | Visual indicator | ~0.50 RON |
readboard | Prototyping | ~4 RON |
Jumper Wires (M-M) | Wiring | ~4 RON |
Software
Library | Description | Usage |
---|---|---|
rp2040-hal | RP2040 Hardware Abstraction Layer | Used for peripheral control (ADC, GPIO, I2C) |
embedded-hal | Hardware abstraction traits | Trait-based drivers for Rust embedded |
lcd1602-rs | LCD I2C display library | Used for displaying sensor values |
defmt + panic-probe | Debug logging and panic handling | Used for debugging on embedded target |
pyserial (Python) | Serial communication | Reads data from Pico in Python |
matplotlib (Python) | Graph plotting | Real-time visualization of X/Y/Z axes |