I recently acquired a motorized table-frame from IKEA for my current desk.
After returning the first D.O.A table-kit and getting it replaced with a working one, height adjustment worked up nicely and I had a good standing/sitting workstation.
Problem with the setup was that I forgot to use it. As a solution, I made a small widget that reminds me to stand up in set intervals. After a piece of software has been written, it’s easy to continue working on. This time by hacking the hardware!
Reverse engineering the table controls
I tried my best to poke the leads of the tables button-unit with a multi-meter guessing there is some two switches and probably few resistors.
I opened the unit and discovered it was actually made up of proper looking electronics. Easiest way to hack that kind of system would be to add relays parallel to the membrane-switches which virtually push the up or down button.
I soldered three 0,25 mm copper wires to the connector that goes to the switch membrane, those thin wires to a 4 pin-cable generously donated by defective DX.com USB-cable and made a cheap-ass strain remover by tying the cable carefully to a knot.
Everything goes neatly into the controller’s original case, with the hopes that nobody will have to take it apart again.
Designing an relay-shield
Box that does the actual button-pushing consists of Arduino Uno Development board, proto-shield and two 5 V miniature relays. As an extra, I added some connectors I had laying around.
Relays are connected directly to the digital pins on the Arduino as these models require little current to operate. Connected in parallel with the relay coils are 1N4148 diodes to allow the safe dissipation of the coil’s magnetic field. Induction transients that occur when the relays are opened can be fatal to the Arduino if not taken care of.
Simple is beautiful. Also works quite well!
Arduino with the relay shield was just tossed somewhere in the desk’s cable management system and forgotten to do it’s magic quietly.
Developing the firmware for Arduino
I did not want to use a lot of time to get the system working so I slapped the code together quickly in Flowcode 6.
In Flowcode you make component definitions, what is connected where and then draw a flow-chart. Flowcode generates the C-code and HEX-files, it even programs the Arduino for you.
In the images above is all the code to get the system working. There is no fancy time-outs or safety limits, just the bare-bones to get the system working. Further development is needed here!
There is no program, so I made one. Called UpButt’n and its used to control the table. It contains a timer to notify user to switch position now and then. Sitting and standing times can be changed easily with sliders.
When the timer counts down to zero, program will play a sound and show a little message-balloon in the bottom right corner of the screen. There is setting where you can select which COM-port your Arduino is connected to and simple up and down buttons that control the table.
Down-button makes the table go down until magnetic sensor senses the height setting magnet. Up button makes the table go up 18 seconds from the last position (probably the sitting position) to set the table to optimum standing-height for me. Program was written in Visual Basic with Microsoft Visual Studio 2010. Project files available below.
Sitting position of the table is set by moving a magnet on an Allen key that has been glued to the leg of the table.
Arduino stops pushing the down-button when the reed-switch meets up with a magnet.
There are two magnets: first one sets the proper sitting-height and the other stops the control-module for trying to push the table through the floor if the table is already at it’s lowest position.
Control system works, promotes healthy laziness and costs less than a pizza to make.
One-click solution makes it more comfortable to change between standing and sitting modes when you don’t need to push some hard-to-push buttons for long time and adjusting back and forth whether the this height is good now.
Quick and dirty, simple, fun and useful. Perfect project for a weekend.
- Standing workstation is great for the back, easier to move around the office.
- Option to sit down makes the workstation more comfortable.
- Reminder and a single click interface takes the hassle out of changing position.
Difficulty ★★☆☆ Time ★★★☆☆ Price ★★☆☆☆
Software and Source-files »
UpButt’n & SmartDesk, writtend and designed by Henri Rantanen, are licensed under Creative Commons Attribution-ShareAlike 4.0 International.