Posture Monitor
A simple device that alerts you when your posture is not proper.
Author: Daria-Florentina Sanda
GitHub Project Link: https://github.com/UPB-PMRust-Students/project-dariasanda11
Description
This project aims to be a wearable device that detects when the user is sloughing using an MPU9250 accelerometer and gyroscope sensor. When bad posture is detected, the system provides alerts via vibrations, and an LED turns on so the users knows they should improve their posture.
Motivation
I chose this project because I spent a lot of time sitting at a desk in school and at home, often without maintaining proper posture. Besides not being aesthetically pleasing, bad posture can lead to various back problems that could be prevented with regular reminders to sit up straight. Also, a key factor in my decision for this project is that it uses sensor interaction and LED/motor control, which are elements that I found in the labs.
Architecture
- MPU9250 Sensor: It is used to detect the user's posture with the accelerometer and gyroscope that are connected to the Raspberry Pi Pico 2W via I2C
- Raspberry Pi Pico 2W:Acts as the central processing unit, interpreting signals from the MPU9250 sensor and controlling the other components
- Vibration Motor and LED: Used to alert the user and both are connected to the GPIO pins via a transistor for the motor and a resistor for the LED
- Transistor: Used to switch the motor on and off
- Diode:: Potects the circuit from back-voltage that could be generated when turning off the motor
- Resistors: Used to limit the current where needed, such as for the LED and the base of the transistor
- Possible, not sure yet Push Button: Used for user input, such as to reset
Log
Week 5 - 11 May
Week 12 - 18 May
Week 19 - 25 May
Hardware
Schematics
Bill of Materials
Device | Usage | Price |
---|---|---|
2 Raspberry Pi Pico 2W | The microcontroller and one as a debugger | 80 lei |
MPU9250 Sensor | Detects posture | 47 lei |
Breadboard HQ (830 Puncte) | For assembling the prototype | 10 lei |
Breadboard wires | For connections | 8 lei |
Vibration Motor | Alerts the user to correct their position | 2.5 lei |
NPN Transistor 2N2222 | Controls motor via GPIO pin | 0.17 lei |
1N4007 Diode | Protects against voltage spikes | 0.49 lei |
Female-Female Jumper Wires (10 pcs, 30 cm) | For connections | 4.79 lei |
Female-Male Jumper Wires (10 pcs, 20 cm) | For connections | 4 lei |
Push Button 6x6x6 mm | For manual reset | 0.36 lei |
LED | Alerts the user to correct their position | 0.39 lei |
330 Ohm Resistor | Limits current to LED | 0.10 lei |
1k Ohm Resistor | Limits current | 0.10 lei |
Software
Library | Description | Usage |
---|---|---|
embassy | Async runtime for embedded systems | Manages tasks and system operations |
embassy-hal | Hardware Abstraction Layer | Interfaces with Raspberry Pi Pico 2W hardware |
embassy-executor | Task executor | Handles asynchronous tasks such as sensor polling |
embassy-time | Timing module | Delays and periodic alerts (vibration, LED blinking) |
embassy-gpio | GPIO management | Manages GPIO pins for LED, vibration motor, and button |
embassy-sync | Sync primitives | Coordinates between concurrent tasks safely |
defmt | Logging and formatting | Debug logging with minimal runtime overhead |
panic-probe | Panic handler | Handles runtime panics and reports via RTT |
embedded-hal | Abstraction layer | Interfaces with peripherals like I2C and digital IO |
rp2040-hal | HAL for the Raspberry Pi Pico's RP2040 chip | Direct access to microcontroller peripherals |
mpu9250-driver | Driver for the MPU9250 IMU sensor | Reads posture data from the accelerometer and gyroscope via I2C |