Skip to main content

Raspberry Pi Controlled Desk Rises to the Occasion

David Kong's standing desk, controlled via a Raspberry Pi Zero
(Image credit: David Kong)

Dissatisfied with sitting around all day, product strategist, self-described hacker, and Medium contributor David Kong invested in a motorized standing desk, yet still found himself seated a lot and rather sore around the lumbar region. His solution? A desk that rises into its standing position on a schedule, whether he feels like standing or not, controlled by a Raspberry Pi Zero.

Image 1 of 2

The underside of Kong's desk

(Image credit: David Kong)
Image 2 of 2

The soldering to the Pi's GPIO pins

(Image credit: David Kong)

Kong took apart his desk’s control panel, and to his delight discovered a row of exposed pins that, when correctly connected, could simulate the button-presses that trigger the desk’s motors. How best to connect them? To a Raspberry Pi Zero W’s GPIO pins, of course.

Some of the desk’s buttons are programmable, with one set to its seated height and another to its standing height. These are wired through a relay to the Pi’s pins, where they are triggered by a Python script Kong wrote by SSHing into the Pi via USB. One of the GPIO pins is controlled at a random interval between 45 and 60 minutes, triggering the motors to switch between its two programmed states, forcing Kong to sit down and stand up when he least expects it. 

The soldering is, as Kong admits, a bit messy and nothing a little heat shrink wouldn't fix. The way the whole assembly is taped to the bottom of the desk gives it what you might call a charming home-made aesthetic, but he reports it’s been running flawlessly for a few months and improved his back pain, which seems like a win-win situation to us.