Skip to content

Commit 03a76fa

Browse files
committed
update readme files
1 parent 6c21093 commit 03a76fa

File tree

2 files changed

+31
-12
lines changed

2 files changed

+31
-12
lines changed

README.md

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
[![Firmware CI](https://github.com/atomic14/ESP32-LSM6DS3-Demo/actions/workflows/firmware.yml/badge.svg)](https://github.com/atomic14/ESP32-LSM6DS3-Demo/actions/workflows/firmware.yml)
22
[![Frontend CI](https://github.com/atomic14/ESP32-LSM6DS3-Demo/actions/workflows/frontend.yml/badge.svg)](https://github.com/atomic14/ESP32-LSM6DS3-Demo/actions/workflows/frontend.yml)
33

4-
# ESP32S3 Accelerometer Demo
4+
# ESP32S3 IMU (Accelerometer + Gyroscope) Demo
55

6-
A complete hardware + software solution for real-time 3D accelerometer visualization. This project combines an ESP32S3 microcontroller with LSM6DS3 accelerometer and a sophisticated web-based 3D visualization frontend.
6+
A complete hardware + software solution for real-time 3D IMU visualization. This project combines an ESP32S3 microcontroller with the LSM6DS3 accelerometer/gyroscope and a web-based 3D visualization frontend.
77

88
![Demo](images/demo.png)
99

@@ -60,8 +60,11 @@ npm run dev # Start development server
6060
1. Open `http://localhost:5173` in Chrome/Edge
6161
2. Click "Connect to ESP32S3"
6262
3. Select ESP32S3 serial port
63-
4. Place PCB flat and click "Calibrate"
64-
5. Tilt the PCB to see real-time 3D visualization
63+
4. Choose an orientation mode:
64+
- `Accelerometer (abs)`: absolute tilt (pitch/roll) with optional smoothing
65+
- `Gyro (integrated)`: integrates angular rate to track orientation (no smoothing)
66+
5. Use the `Reset` button to zero orientation if needed
67+
6. Tilt/rotate the PCB to see real-time 3D visualization
6568

6669
## Features
6770

@@ -74,13 +77,15 @@ npm run dev # Start development server
7477
### Frontend
7578
- **WebSerial Integration**: Direct browser-to-device communication
7679
- **3D PCB Model**: GLB file support with automatic scaling
77-
- **Adjustable Smoothing**: Fine-tune responsiveness vs stability
80+
- **Orientation Modes**: Accelerometer (absolute tilt) or Gyro (integrated)
81+
- **Adjustable Smoothing (Accel only)**: Fine-tune responsiveness vs stability
82+
- **Dual Charts**: Live accelerometer and gyroscope charts with titles and right-aligned legends
7883
- **Professional Lighting**: Specular reflections and realistic materials
7984
- **Mouse Controls**: Orbit camera, zoom, and inspect the model
8085

8186
## Data Format
8287

83-
The firmware outputs JSON at 10Hz:
88+
The firmware outputs JSON at 10Hz (example):
8489
```json
8590
{"accel":{"x":0.123,"y":0.456,"z":0.789},"gyro":{"x":1.23,"y":4.56,"z":7.89},"temp":25.4}
8691
```
@@ -131,7 +136,7 @@ npm run lint # Code linting
131136
- **Gyroscope Range**: ±125°/s, ±250°/s, ±500°/s, ±1000°/s, ±2000°/s
132137
- **I2C Speed**: 100kHz for reliable communication
133138
- **Serial Baud Rate**: 115200 for fast data transfer
134-
- **Update Rate**: 10Hz (100ms intervals)
139+
- **Update Rate**: 10Hz (100ms intervals) by default (adjustable in firmware)
135140

136141
## License
137142

frontend/README.md

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
# Accelerometer Frontend
22

3-
Real-time 3D visualization of ESP32S3 accelerometer data using Three.js and the WebSerial API.
3+
Real-time 3D visualization of ESP32S3 accelerometer and gyroscope data using Three.js and the WebSerial API.
44

55
## Features
66

7-
- **Real-time 3D Visualization**: Live PCB orientation tracking based on accelerometer data
7+
- **Real-time 3D Visualization**: Live PCB orientation tracking
88
- **WebSerial Integration**: Direct connection to ESP32S3 via WebSerial API
99
- **GLB Model Support**: Displays actual PCB 3D model converted from STEP files
10-
- **Adjustable Smoothing**: Fine-tune responsiveness vs stability
10+
- **Orientation Modes**: Accelerometer (absolute tilt) or Gyro (integrated)
11+
- **Adjustable Smoothing (Accel only)**: Fine-tune responsiveness vs stability
12+
- **Dual Charts**: Separate live charts for accelerometer (g) and gyroscope (°/s)
1113
- **Professional Lighting**: Specular lighting with realistic material reflections
1214

1315
## Requirements
@@ -41,7 +43,12 @@ Real-time 3D visualization of ESP32S3 accelerometer data using Three.js and the
4143
- **Connect Button**: Establishes WebSerial connection to ESP32S3
4244
- **Status Indicator**: Shows connection state (Connected/Disconnected)
4345

44-
### 3D Visualization
46+
### 3D Visualization & Controls
47+
- **Orientation Mode**: Choose between `Accelerometer (abs)` and `Gyro (integrated)`
48+
- In Gyro mode, orientation integrates angular rate with no smoothing (for accuracy)
49+
- In Accel mode, orientation uses absolute tilt (pitch/roll) with optional smoothing
50+
- **Smoothing**: Slider enabled in Accel mode; disabled in Gyro mode
51+
- **Reset**: Resets the model orientation and gyro integration
4552
- **Mouse Drag**: Rotate camera around PCB
4653
- **Mouse Wheel**: Zoom in/out
4754
- **Real-time Updates**: PCB orientation matches physical device
@@ -53,6 +60,13 @@ The frontend expects JSON data from the ESP32S3:
5360
{"accel":{"x":0.123,"y":0.456,"z":0.789},"gyro":{"x":1.23,"y":4.56,"z":7.89},"temp":25.4}
5461
```
5562

63+
## Charts
64+
65+
- Two overlaid charts are rendered:
66+
- **Accelerometer (g)**: X/Y/Z in ±2g by default
67+
- **Gyroscope (°/s)**: X/Y/Z in ±500°/s by default
68+
- Titles appear top-center; legends are right-aligned. Ranges can be adjusted in `src/main.ts` when constructing the graphs.
69+
5670
## Build Commands
5771

5872
```bash
@@ -88,7 +102,7 @@ src/
88102
├── scene.ts # Three.js scene setup and lighting
89103
├── pcb-model.ts # PCB 3D model and orientation logic
90104
├── webserial.ts # WebSerial communication manager
91-
├── graph.ts # Lightweight accelerometer graph overlay
105+
├── graph.ts # Lightweight graph overlay for accel/gyro X/Y/Z
92106
└── types.d.ts # Type definitions
93107
94108
public/

0 commit comments

Comments
 (0)