Skip to content

b24es1005-debug/esp32s3-wifi-csi-sensing

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

21 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ“‘ ESP32-S3 WiFi CSI Sensing for Human Activity Recognition

Project banner placeholder

Platform Domain ML Status License

A research-oriented WiFi CSI Human Activity Recognition (HAR) platform built around ESP32-S3, real-time CSI streaming, feature-based ML inference, and a live analytics dashboard. This repository is designed for embedded AI portfolios, RF sensing demonstrations, and internship/research applications.


✨ Feature Highlights

  • πŸ“Ά ESP32-S3 CSI Capture over WiFi with serial packet streaming
  • πŸ§ͺ RF Sensing Pipeline from raw CSI amplitude to activity labels
  • πŸ€– ML Training + Inference for HAR (empty, walk, stand, sit, wave)
  • πŸ“Š Real-Time Dashboard with confidence bars and CSI waveform plotting
  • πŸ—‚οΈ Dataset Collection Workflow for reproducible activity sessions
  • πŸ“š Research-Grade Documentation for setup, architecture, demo, and training

πŸ† Key Achievements

  • Built realtime WiFi CSI HAR system on ESP32-S3
  • Achieved 90% classification accuracy
  • Designed live PyQt RF dashboard
  • Implemented CSI preprocessing + feature extraction pipeline
  • Developed embedded-to-ML end-to-end workflow

🧠 Project Overview

This project demonstrates how commodity WiFi hardware can be used as a non-invasive RF sensing modality for activity recognition. The ESP32-S3 firmware captures CSI measurements, streams packets over UART, and Python-based tooling processes data for model training and real-time prediction.

Positioning:

  • WiFi CSI Human Activity Recognition system
  • Embedded AI + signal processing platform
  • Real-time RF analytics dashboard
  • ESP32-S3 CSI sensing research testbed

πŸ—οΈ Architecture Overview

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  Human Motion Scene  β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
           β”‚ affects channel state
           β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚   WiFi AP + ESP32-S3 β”‚
β”‚   (CSI Capture Node) β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
           β”‚ CSI packets over UART
           β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ Python Serial Logger β”‚
β”‚  + Dataset Storage   β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
           β”‚ windowing + feature extraction
           β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚   ML Model Training  β”‚
β”‚  (Random Forest HAR) β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
           β”‚ model + real-time CSI frames
           β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ Realtime Inference & β”‚
β”‚ Dashboard Visualizer β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

For detailed architecture documentation, see docs/architecture/system_architecture.md.


πŸ” End-to-End Pipeline

Stage Component Output
1 ESP32-S3 firmware (firmware/) CSI lines streamed over UART
2 Serial logging (python/logger.py, python/serial_reader.py) Labeled CSV recordings
3 Dataset loading (ml/dataset_loader.py) Windowed training samples
4 Feature extraction (ml/features.py) Numeric feature vectors
5 Model training (ml/train.py) ml/models/activity_model.pkl
6 Realtime inference (ml/realtime_predictor.py) Live activity predictions
7 Dashboard (ml/dashboard.py) Interactive RF analytics UI


πŸŽ₯ Live Demo

πŸ–ΌοΈ Screenshots & Showcase

πŸ“Š Main Dashboard β€” Walking Detection


βœ‹ Activity Recognition β€” Wave Gesture


🧍 Activity Recognition β€” Standing Detection


🌈 CSI Heatmap Visualization


πŸ€– ML Prediction Outputs


πŸ“‘ ESP32-S3 Firmware Serial Monitor


πŸ”§ Hardware Setup


πŸŽ₯ Demo Video

docs/videos/demo.mp4

πŸ“ˆ Example Results

Metric Value
Activities Recognized 5
ML Model Random Forest
Dataset Windows 488
Feature Vector Length 260
Accuracy 90%
Platform ESP32-S3
Interface Real-Time PyQt Dashboard

🧾 Supported Activities

Label ID Activity
0 EMPTY
1 WALK
2 STAND
3 SIT
4 WAVE

πŸ”Œ Hardware Requirements

  • ESP32-S3 development board (CSI-capable firmware target)
  • USB data cable
  • Linux/macOS/Windows host machine
  • WiFi environment with stable AP conditions
  • Optional tripod/marker for repeatable sensing zone setup

πŸ’» Software Requirements

  • Python 3.10+ (tested with 3.11)
  • ESP-IDF (for firmware build/flash)
  • pip and virtual environment tooling
  • Serial access permissions (dialout/uucp group on Linux)

πŸš€ Installation Guide

git clone https://github.com/b24es1005-debug/esp32s3-wifi-csi-sensing.git
cd esp32s3-wifi-csi-sensing
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt

See full setup notes: docs/setup/setup_guide.md.


βš™οΈ Firmware Flashing Guide

cd firmware/csi_receiver
idf.py set-target esp32s3
idf.py build
idf.py -p /dev/ttyACM0 flash monitor

Detailed firmware notes: docs/setup/firmware_guide.md.


πŸ“Š Dashboard Running Guide

source .venv/bin/activate
cd ml
python dashboard.py

Dashboard-specific guide: docs/demo/dashboard_guide.md.


🧠 Training Pipeline Guide

source .venv/bin/activate
cd ml
python train.py

Training and data prep docs:

  • docs/training/ml_pipeline.md
  • docs/training/dataset_collection.md

πŸ—ƒοΈ Dataset Collection Guide

Example logging flow:

source .venv/bin/activate
cd python
python logger.py

Also available:

cd python
python serial_reader.py --port /dev/ttyACM0 --baud 115200 --duration 60

Detailed procedure: docs/training/dataset_collection.md.


πŸ—‚οΈ Repository Structure

esp32s3-wifi-csi-sensing-github/
β”œβ”€β”€ firmware/
β”œβ”€β”€ ml/
β”œβ”€β”€ python/
β”œβ”€β”€ docs/
β”‚   β”œβ”€β”€ architecture/
β”‚   β”œβ”€β”€ demo/
β”‚   β”œβ”€β”€ images/
β”‚   β”œβ”€β”€ setup/
β”‚   └── training/
β”œβ”€β”€ data/
β”œβ”€β”€ README.md
β”œβ”€β”€ LICENSE
β”œβ”€β”€ CONTRIBUTING.md
β”œβ”€β”€ requirements.txt
└── .gitignore

πŸ› οΈ Troubleshooting

  • Serial port unavailable: verify device path with ls /dev/ttyACM* /dev/ttyUSB*.
  • Permission denied: add user to serial group and re-login (dialout or uucp).
  • No CSI lines: verify firmware is running and UART baud matches host scripts.
  • Model file missing: run python ml/train.py to generate ml/models/activity_model.pkl.
  • Dashboard import errors: ensure virtual env is active and pip install -r requirements.txt completed.

πŸ”­ Future Improvements (Roadmap)

  • CNN/LSTM-based HAR for temporal modeling
  • Transformer-based HAR architectures
  • Fine-grained gesture recognition
  • Respiration and micro-motion sensing
  • Fall detection for ambient assisted living
  • Multi-person RF sensing and source separation

πŸ™Œ Acknowledgements

  • Espressif ESP32-S3 and ESP-IDF ecosystem
  • Open-source scientific Python and visualization tooling
  • RF sensing and WiFi CSI HAR research community

πŸ“„ License

This project is licensed under the MIT License. See LICENSE.

About

ESP32-S3 WiFi CSI Human Activity Recognition system with real-time RF sensing, ML inference, and live visualization dashboard.

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors