Bad Posture Alarm With DIY Flex Sensor

by TechMartian in Circuits > Assistive Tech

2633 Views, 7 Favorites, 0 Comments

Bad Posture Alarm With DIY Flex Sensor

2016-08-30 19.21.09.jpg
2016-08-30 19.21.16.jpg

This is an alarm that warns you if you have been slouching. At my workplace many senior developers have suffered from back pain mainly because we are all software developers sitting in front of a computer for most of the day.

This is a device that warns the user if they have been slouching through a flex sensor to minimize damage to the back. In this project, we will be making our own flex sensor since one sensor can easily cost over $20.

Making DIY Flex Sensor: Cut Paper

IMG_2710.jpg

Cut a strip of paper the area and length of your back in which you want to measure the curvature.

Making DIY Flex Sensor: Shade Paper

IMG_2712.jpg

Shade both sides of the paper with a pencil to transfer the graphite onto the paper. The softer the lead the better the outcome.

Making Flex Sensor: Cut Aluminum Foil

IMG_2714.jpg

Cut two pieces of aluminum foil with the same dimensions as the piece of paper, or slightly smaller, since we want to prevent a short circuit between the two strips which will be placed in opposite sides of the paper.

Making Flex Sensor: Cut Cardboard

IMG_2715.jpg

Cut the cardboard into two strips the same length as the piece of paper

Making Flex Sensor: Assemble It!

IMG_2716.jpg
IMG_2717.jpg
IMG_2718.jpg

Tape the aluminum foil onto the cardboard and attach a wire onto the aluminum foil. Repeat this for both pieces of aluminum and cardboard pair.

Sandwich the paper in between the foil/cardboard pair.

Tape it together tightly.

Bad Posture Warning System: Mount the Flex Sensor

2016-08-30 18.24.44.jpg

Attach the flex sensor to the back of your shirt. You may attach multiple ones, but for this project I am only demoing with one flex sensor. You can sew it on, or you can tape it. I chose to tape it since it's temporary and need to mounted to other shirts if I were to change clothing.

Bad Posture Warning System: Wiring

2016-08-30 19.17.46.jpg
2016-08-30 19.19.35.jpg
2016-08-30 19.18.03.jpg
2016-08-30 19.20.01.jpg

Follow the table below on how to interface the I/Os with the ESP32 Development board.


.tg  {border-collapse:collapse;border-spacing:0;} .tg td{font-family:Arial, sans-serif;font-size:14px;padding:10px 5px;border-style:solid;border-width:1px;overflow:hidden;word-break:normal;} .tg th{font-family:Arial, sans-serif;font-size:14px;font-weight:normal;padding:10px 5px;border-style:solid;border-width:1px;overflow:hidden;word-break:normal;} .tg .tg-yw4l{vertical-align:top}
I/OI/O Pin# Arduino Pin#
Flex Sensor1D4
2GND
Buzzer1D5
2GND

Code

Screen Shot 2017-09-01 at 1.08.13 AM.png
void setup() {
  pinMode(D4, INPUT);
  pinMode(D5, OUTPUT);
}
void loop() {
 int flex = map(flex, 0, 1024, 0, 3);
 if (flex >=2)
  {
    tone(D5, 8000, 200);
    delay(200);
    noTone(D5);
  }
  else {
    noTone (D5);}
}