Introduction: Posture Perfect

Picture of Posture Perfect

Balance is an issue that is caused by many afflictions, most prominently Parkinson's disease. People with Parkinson’s will very often have a tendency to lean forwards, and will not even notice it. This can cause pain and discomfort. My device will help alleviate this problem by notifying the user when he or she is leaning too far forwards so that he or she can correct his or her posture. The device uses an accelerometer to detect how much the user is tilted forwards, and triggers a buzzer to sound if the tilt passes a certain threshold. When the accelerometer detects that the tilt is back within an appropriate range, the buzzer will stop sounding, notifying the user that he or she has returned to a neutral posture. This device is small, light, and worn on the chest, so it will not be a burden or an inconvenience to the user. This device will be immensely helpful in resolving balance issues associated with diseases such as Parkinson’s.

Step 1: Parts List

1 Piezo Buzzer

1 ADXL345 Accelerometer

1 Adafruit Trinket Pro 5V

Female header pins

6 Wires

Step 2: Electronics Configuration/Setup

Picture of Electronics Configuration/Setup

Buzzer setup

Attach one wire from the positive end of the buzzer to digital pin 13 on the Trinket. Attach another from the negative end of the buzzer to GND on the the Trinket.


Wiring the Accelerometer

Attach one wire from VIN on the accelerometer to 5v on the Trinket, and add one from GND on the accelerometer to GND on the Trinket. Attach the last two wires; the first will go from SDA to analog pin 4, the second will go from SCL to analog pin 5.

Step 3: Setup

Place this setup into a container of suitable size. Ascertain that the accelerometer is perfectly horizontal (i.e. the text “ADXL345 Digital Accelerometer” is readable). Download the code below to the Arduino IDE (Make sure that the correct board is selected under Tools->Board and that the programmer is set to USBtinyISP. For more information on how to download Adafruit boards, visit their website: https://learn.adafruit.com/add-boards-arduino-v164/setup)

Step 4: Code

Download the attached code and upload it to the board.

**********************************************************************************************************************

#include

#define BUZZPIN 13

#define VIBRATEPIN 8 #define VIBRATE 0

#define BUZZ 1

int configuration = BUZZ; // BUZZ or VIBRATE /* Assign a unique ID to this sensor at the same time

*/ Adafruit_ADXL345_Unified accel = Adafruit_ADXL345_Unified(12345);

void setup(void)

{

Serial.begin(9600);

pinMode(VIBRATEPIN, OUTPUT);

Serial.println("Accelerometer Test"); Serial.println("");

/* Initialise the sensor */

if(!accel.begin())

{

/* There was a problem detecting the ADXL345 ... check your connections */

Serial.println("Ooops, no ADXL345 detected ... Check your wiring!"); while(1); } Serial.println(""); }

void loop(void)

{

/* Get a new sensor event */

sensors_event_t event;

accel.getEvent(&event);

/* Display the results (acceleration is measured in m/s^2)

*/ double y = event.acceleration.y;

boolean returnToBase = false;

while(y>1) {

returnToBase = true;

Serial.println("Y: " + (String)y + "- Too right");

if(configuration == BUZZ) tone(BUZZPIN, 65.4064);

else

{

//digitalWrite(VIBRATEPIN, HIGH);

analogWrite(VIBRATEPIN, 200);

}

sensors_event_t event; accel.getEvent(&event);

y = event.acceleration.y;

delay(500);

}

if(returnToBase && y >= -1 && y <= 1) {

returnToBase = false;

if(configuration == BUZZ)

{

noTone(BUZZPIN);

tone(BUZZPIN, 261.626, 1500);

Serial.println("Y: " + (String)y + "- Back to middle"); }

delay(500); }

Step 5:

Comments

About This Instructable

358views

7favorites

License:

Bio: The BCAMRL is a Mechatronics Research Lab, found in 2014 on the campus of Bergen County Academies a magnet high school within the Bergen County ... More »
More by bcamrl:Infrared Red Therapy Device (IRTD)RQ Bot IN-STOP
Add instructable to: