Bad Posture Alarm With DIY Flex Sensor

Introduction: Bad Posture Alarm With DIY Flex Sensor

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.

Step 1: Making DIY Flex Sensor: Cut Paper

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

Step 2: Making DIY Flex Sensor: Shade Paper

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

Step 3: Making Flex Sensor: Cut Aluminum Foil

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.

Step 4: Making Flex Sensor: Cut Cardboard

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

Step 5: Making Flex Sensor: Assemble It!

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.

Step 6: Bad Posture Warning System: Mount the Flex Sensor

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.

Step 7: Bad Posture Warning System: Wiring

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

Step 8: Code

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);
  else {
    noTone (D5);}
Makerspace Contest 2017

Participated in the
Makerspace Contest 2017

Be the First to Share


    • Pocket-Sized Speed Challenge

      Pocket-Sized Speed Challenge
    • Audio Challenge 2020

      Audio Challenge 2020
    • Maps Challenge

      Maps Challenge

    2 Discussions


    1 year ago on Step 8

    I'm new to Arduino but isn't this code missing something to set pin D4 to flex?


    2 years ago

    Nice thought...!!!