Skip to content
Patrick Desjardins Blog
Patrick Desjardins picture from a conference

Side Project: Exercise Machine using Water

Posted on: 2022-04-07

Last summer, I unsuccessfully moved a kid-inflated pool - it contained too much water. The mass volumic of the water tricked me! Forward to this past winter, I had the idea to create an exercise machine where the source of weight is water. Water has the characteristic to be almost free and also that it can be moved automatically with a pump. Hence, the core idea of having a machine adjust by itself depends on the exercise and the current sets.

Sketch of the machine

The image describes how the machine operates. The human can pull from the top (tricep) or the bottom (bicep), which lifts a tank of water. The weight is calculated when the upper tank gets back on the middle platform. The delta is determined, and the water pump adds or removes water. With a small ultrasonic sensor, the user can also see the tempo by repetition on the screen.

Building the Software

I started building the software in parallel to designing the physical machine's detail. By doing the development in parallel, I could sustain my motivation and have ideas.

The software is open-source and build using TypeScript, SolidJS, WebSocket and NodeJS. The high-level architecture diagram shows how the information flows. There are sensors pushing data to Raspberry PI physical pins. The NodeJS server listened to these pins and interpreted the data to be pushed in real-time with Websocket to the user interface built using SolidJS. The SolidJS application language is TypeScript and uses Websocket and Canvas to draw the real-time movement of each repetition.

Architecture Diagram

Dev Features

I will highlight two features dedicated to development that I think is crucial for a good development experience.

Storybook

The system gives you two choices when launching the web application: the main application or the storybook. The storybook provides access to the custom-created components. Hence, we can work on the components without having to find a place in the system. Indeed, on the actual machine, the launcher does not appear.