Electronic – Sensor for adjustable standing desk

sensor

I'm a novice when it comes to electronics, so please bear with me. 🙂 I have this idea of a Internet connected hight adjustable desk that keeps tracks of it's "modes". With other words: I would like to know when the desk is adjusted from sitting to standing and vice versa.

This is my plan:

  • Some kind of sensor connected to a Raspberry Pi through GPIO.
  • Simple daemon that reads the input from the sensor and determines if the desk is adjusted for sitting or standing.
  • The daemon logs everything to a database.
  • A web app that presents the data in some nifty way.

My only problem is the sensor. I have no idea of how I should determine the state of the desk. Any ideas?

The desk is an IKEA Galant with adjustable legs. Sorry about the Swedish on that page.

Best Answer

If you would mount a distance sensor like a HC-SR04, LV-EZ4 or similar on the underside of the desk looking at the floor you would not only be able to see when the desk is moving but also you would see the height of the desk. (For detecting when the desk is moving simply check to see if the distance changes more than the )

Example of someone who hooked up a HC-SR04 to a pi