Build it step by step
0 of 7 doneTest one sensor
Press it and print the reading.
Build the pad
Four sensors under a board and a cushion.
Wire the four dividers
10 kΩ to ground on each.
Read the balance
Print left, right, front, back.
Set the thresholds
Sit normally and note the numbers.
Add the buzzer
Remind after two minutes off-centre.
Add the sitting timer
Remind after 45 minutes.
How do you build a chair posture monitor?
Pressure sensors in a seat cushion show if you lean to one side or slump, with a reminder. You need ESP32 DevKit V1, Force sensitive resistor FSR 402 × 4, Resistor 10 kΩ × 4, Vibration motor (coin type), BC547 NPN transistor, Resistor 1 kΩ and Signal Diode 1N4148. It takes 7 steps and about 150 minutes.
- Level
- Intermediate
- Time
- About 150 min
- Parts
- 7
Parts list
- Development BoardsBuyESP32 DevKit V1 × 1
- SensorsBuy
- PassivesBuyResistor 10 kΩ × 4
- Motors & ActuatorsBuy
- SemiconductorsBuy
- PassivesBuyResistor 1 kΩ × 1
- SemiconductorsBuy
Tick what you already own. It saves to My Garage, so “Build with what I have” knows.
Wiring
| From | To | Why |
|---|---|---|
| FSR 1 to 4 one leg | ESP32 3V3 | Top of each divider |
| FSR 1 to 4 other legs | GPIO34, GPIO35, GPIO32, GPIO33, each with 10 kΩ to GND | Four corners: front left, front right, back left, back right |
| GPIO25 | 1 kΩ to BC547 base | Motor switch |
| BC547 collector | Motor minus | Switched return |
| BC547 emitter | ESP32 GND | Ground |
| Motor plus | ESP32 3V3 | Supply |
| 1N4148 | Across the motor, stripe to 3V3 | Flyback protection |
| USB | ESP32 | Power |
Code
Four force sensors at the corners of a seat pad show where your weight is. The sketch compares left with right and front with back: a strong lean to one side or sliding forward for two minutes triggers a short buzz, and after 45 minutes of sitting two buzzes remind you to stand and move. The reminders are rate-limited so they do not nag. This is a self-awareness tool, not medical advice; if you have back or neck pain, speak to a doctor or physiotherapist. Place the sensors under a thin, firm board and a cushion so that the force spreads over each sensor, and fix them so they do not shift. Keep wiring tidy, out of the way of the chair's moving parts and anyone's legs. The sensors tolerate sitting weight when spread; do not put a concentrated point load on them. Arduino IDE with the ESP32 boards package, board "ESP32 Dev Module".
Runs on a virtual ESP32 Dev Module in your browser, with sliders for the sensors. Happy with it? Verify and upload to your real board from the same page (Chrome or Edge on a computer).
// Chair posture monitor: balance, slump and sitting time. Board: ESP32 Dev Module. No extra libraries.
const int PIN[4] = {34, 35, 32, 33}; // FL, FR, BL, BR
const int MOTOR = 25;
const int SEATED = 800; // total reading above this means someone is sitting (tune it)
unsigned long sitStart = 0, offCentreSince = 0, lastAlert = 0, totalSit = 0, lastTick = 0;
bool sitting = false;
void buzz(int ms) { digitalWrite(MOTOR, HIGH); delay(ms); digitalWrite(MOTOR, LOW); }
void setup() {
Serial.begin(115200);
pinMode(MOTOR, OUTPUT);
analogReadResolution(12);
}
void loop() {
int v[4]; long total = 0;
for (int i = 0; i < 4; i++) { long s = 0; for (int k = 0; k < 8; k++) s += analogRead(PIN[i]); v[i] = s / 8; total += v[i]; }
bool now = total > SEATED;
if (now && !sitting) { sitting = true; sitStart = millis(); lastTick = millis(); }
if (!now) { sitting = false; offCentreSince = 0; }
if (sitting) {
totalSit += millis() - lastTick; lastTick = millis();
float left = v[0] + v[2], right = v[1] + v[3], front = v[0] + v[1], back = v[2] + v[3];
float side = (right - left) / (float)total; // -1 leaning left, +1 leaning right
float fb = (front - back) / (float)total; // positive leaning forward (slouching), negative reclining
bool bad = fabs(side) > 0.25 || fb > 0.35;
if (bad) { if (!offCentreSince) offCentreSince = millis(); } else offCentreSince = 0;
if (offCentreSince && millis() - offCentreSince > 120000 && millis() - lastAlert > 300000) { // 2 minutes off-centre, remind at most every 5
buzz(400); lastAlert = millis();
}
if (millis() - sitStart > 45UL * 60 * 1000 && millis() - lastAlert > 300000) { // 45 minutes of sitting: stand up
buzz(200); delay(200); buzz(200); lastAlert = millis();
}
Serial.print("side "); Serial.print(side, 2); Serial.print(" front-back "); Serial.print(fb, 2); Serial.print(" sitting min "); Serial.println((millis() - sitStart) / 60000);
}
delay(500);
}What the serial monitor should show
Open the serial monitor at the baud rate in the code. This is what our simulator prints for a virtual ESP32 Dev Module with its sensors at their default values. Your numbers will follow your real readings, but the format should match.
side -0.00 front-back 0.00 sitting min 0 side 0.00 front-back 0.00 sitting min 0 side -0.00 front-back -0.00 sitting min 0 side 0.00 front-back 0.00 sitting min 0 side 0.00 front-back -0.00 sitting min 0 side -0.00 front-back -0.00 sitting min 0
Test checklist
What you should see at each check. If a reading is far off, stop and use the troubleshooting list.
| Check | Expected |
|---|---|
| Sit upright | Balance near zero, no alert |
| Lean right for two minutes | A buzz |
| Sit for 45 minutes | Two short buzzes |
| Stand up | Timer resets |
If it does not work
Always seated
Raise SEATED or check the dividers.
Never seated
Lower SEATED and check the 3V3 wiring.
Readings drift
Fix the sensors so they cannot slide.
Buzzes too often
Raise the thresholds.
Still stuck? Find the fault step by step with your multimeter →
Common questions
What parts do I need for the chair posture monitor?
ESP32 DevKit V1, Force sensitive resistor FSR 402 × 4, Resistor 10 kΩ × 4, Vibration motor (coin type), BC547 NPN transistor, Resistor 1 kΩ and Signal Diode 1N4148.
How long does the chair posture monitor take to build?
About 150 minutes for a intermediate maker, in 7 steps.
How do I know the chair posture monitor works?
Sit upright: Balance near zero, no alert. Lean right for two minutes: A buzz. Sit for 45 minutes: Two short buzzes.
Always seated: what should I check?
Raise SEATED or check the dividers.
Never seated: what should I check?
Lower SEATED and check the 3V3 wiring.
Readings drift: what should I check?
Fix the sensors so they cannot slide.
Buzzes too often: what should I check?
Raise the thresholds.
