Skip to main content
Version: FILS English

Posture Monitor

A simple device that alerts you when your posture is not proper.

info

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

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

DeviceUsagePrice
2 Raspberry Pi Pico 2WThe microcontroller and one as a debugger80 lei
MPU9250 Sensor Detects posture47 lei
Breadboard HQ (830 Puncte)For assembling the prototype10 lei
Breadboard wiresFor connections8 lei
Vibration MotorAlerts the user to correct their position2.5 lei
NPN Transistor 2N2222Controls motor via GPIO pin0.17 lei
1N4007 DiodeProtects against voltage spikes0.49 lei
Female-Female Jumper Wires (10 pcs, 30 cm)For connections4.79 lei
Female-Male Jumper Wires (10 pcs, 20 cm)For connections4 lei
Push Button 6x6x6 mmFor manual reset0.36 lei
LED Alerts the user to correct their position0.39 lei
330 Ohm ResistorLimits current to LED0.10 lei
1k Ohm ResistorLimits current0.10 lei

Software

LibraryDescriptionUsage
embassyAsync runtime for embedded systemsManages tasks and system operations
embassy-halHardware Abstraction LayerInterfaces with Raspberry Pi Pico 2W hardware
embassy-executorTask executorHandles asynchronous tasks such as sensor polling
embassy-timeTiming moduleDelays and periodic alerts (vibration, LED blinking)
embassy-gpioGPIO managementManages GPIO pins for LED, vibration motor, and button
embassy-syncSync primitivesCoordinates between concurrent tasks safely
defmtLogging and formattingDebug logging with minimal runtime overhead
panic-probePanic handlerHandles runtime panics and reports via RTT
embedded-halAbstraction layerInterfaces with peripherals like I2C and digital IO
rp2040-halHAL for the Raspberry Pi Pico's RP2040 chipDirect access to microcontroller peripherals
mpu9250-driverDriver for the MPU9250 IMU sensorReads posture data from the accelerometer and gyroscope via I2C

1.https://www.mdpi.com/2076-3417/14/19/9075