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
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
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
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
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
Cut the cardboard into two strips the same length as the piece of paper
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.
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.
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/O | I/O Pin# | Arduino Pin# |
---|---|---|
Flex Sensor | 1 | D4 |
2 | GND | |
Buzzer | 1 | D5 |
2 | GND |
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); delay(200); noTone(D5); } else { noTone (D5);} }