'Time to Get Out of Your Chair' Alarm

by TechMartian in Circuits > Assistive Tech

3624 Views, 26 Favorites, 0 Comments

'Time to Get Out of Your Chair' Alarm

IMG_20170827_145406.jpg
IMG_20170827_145307.jpg

This is a device that warns and sets off an alarm when you've been sitting on your chair for too long, reminding you to get off of your @$$ and get some exercise! It's the Pomodoro Clock of Chairs, one chair to rule them all!

Working as a software developer as a day job means I am almost always glued to a chair. Many older people suffer from back problems due to the nature of the job. I have created a mechanism that may circumvent this problem by detecting how long you've been sitting on a chair and sounding an alarm if you have been there for too long!

BoM

IMG_20170827_144527.jpg

* Photosensor

* 10kΩ Resistor

* Jumper Cables

* Arduino

Tools:

* Soldering Iron

Solder

IMG_20170827_110414.jpg
IMG_20170827_110327.jpg
IMG_20170827_110228.jpg
IMG_20170827_110608.jpg
IMG_20170827_110850.jpg

Since I wanted to go breadboard-less we'd need to solder the resistor onto one of the pins of the photosensor (call this pin 1) since the photosensor will use a voltage divider to relay input signals to the Arduino.

Connections

IMG_20170827_144403.jpg
IMG_20170827_144446.jpg
IMG_20170827_144508.jpg
IMG_20170827_144424.jpg

Follow the table below for the connections between the I/Os and the

I/OI/O pinArduino Pin
Photosensor1A0
Photosensor2GND**
Buzzer*19
Buzzer*2GND**

* Order of pins do not matter for the buzzer

** The Arduino board has at least 3 GND pins

Code

Screen Shot 2017-08-29 at 8.44.54 PM.png
/**
 * 'Get out of your chair alarm!'
 * By TechMartian
 *
/cosntants for the pins where sensors are plugged into.
const int sensorPin = 0;
const int buzzPin = 9;
unsigned long minute1; 
float time1;
//Set up some global variables for the light level an initial value.
int bright;  // initial value
int lightVal;   // light reading
void setup()
{
  // We'll set up the LED pin to be an output.
  bright = 900;
  //we will take a single reading from the light sensor and store it in the lightCal        //variable. This will give us a prelinary value to compare against in the loop
}
void loop()
{
  lightVal = analogRead(sensorPin); // read the current light levels
  //if lightVal is less than our initial reading withing a threshold then it is dark.
  if(lightVal <  bright)
  {
      // reset the timer, person began to sit down
      minute1 = minute();
  }  else   // otherwise it's bright
  {
      hour1 = -1;
      minute1 = -1;
  }
  unsigned long minute = minute();
  if (abs(60 - minute + minute1 )>20){
    // time to stand up
    while (lightVal <  bright) {  // still sitting
    tone (buzzPin, 1000, 100);
    delay (100);
    noTone(buzzPin);  }
  }
    
}

Setup

IMG_20170827_145125.jpg
IMG_20170827_144959.jpg
IMG_20170827_145012.jpg
IMG_20170827_145019.jpg
IMG_20170827_145138.jpg
IMG_20170827_145347.jpg

Place the photosensor at the back of the char where you won't sit on it, but will be blocked off of the light when you sit down.

Enjoy!

IMG_20170827_145201.jpg
IMG_20170827_145039.jpg

Enjoy your lengthened and healthier lifestyle!

Live long and Prosper!