The 2015 ARM mbed Hackathon

The task was to create a wearable device using the ARM mbed Internet of Things software platform and a Bluetooth Low Energy development chip in 24 hours. Our result: the Slouch-o-meter.

The brief: in just 25 hours, create a wearable device using the ARM mbed Internet of Things software platform and a Bluetooth Low Energy development chip.

The team: Bianca Bilovolschi, Laurence Cochrane, Siddharth Gupta and myself.

The product: The Slouch-o-meter – a pocket posture-correcting device.

For my first hackathon, our concept was for a small, lightweight sensor which would remind the user of bad posture – i.e. ‘slouching’ – through an audible alarm and companion smartphone data logging interface. ARM, sponsoring the event, provided a copy of their mbed IoT platform, and a RedBear BLE Nano chip for us to build on. By developing the embedded software in C++ using ARM’s modified Yotta compiler, we were able to detect the resistance of an input sensor assembly and how it responds to changes in the user’s posture.

While our ideal solution would include an accelerometer, one was not available during the hackathon so we had to improvise using a flex sensor (which is apparently the same model used in the Nintendo PowerGlove!) and weights. This, when mounted to the user’s shoulder, detects the subtle change in angle of between 5-15 degrees when moving from a good posture to a slouching position. Thus, the product was named the Slouch-o-meter.

After testing with a rapidly expanding number of jumper cables – and therefore large number of opportunities for frustration at inconsistent connections! – the circuit design was prototyped and soldered onto a single-hole breadboard. It also included a piezo speaker (whose tone was set using pulse width modulation in the software) and a momentary switch, which is used to calibrate the unit to different body positions – press once in an upright position and again in a slouching position, and the threshold for warning the user is dynamically updated. The entire system, excluding the flex sensor which is attached to longer travelling wires, fits well within an 8 x 5 x 2.5 cm box, including the 3 V cell which powers the unit.

The software was developed from an example service provided by ARM which sends Bluetooth characteristic values continuously to the paired smartphone, over a low energy connection. This led to some very long hours spent in the early morning trying to decipher the bitwise encoding patterns of different Bluetooth information protocols.

We eventually managed to get the polling data we needed sent from the chip to the smartphone, which enabled us to prototype our companion app using Evothings and JavaScript/HTML, making it immediately cross-platform. The app displays a count of the number of times the user has slouched since the last reset, the idea being that they would monitor their progress to reduce this number over time.

If given more time and funds to develop the product, we would look into replacing our flex sensor assembly with smaller accelerometers which could be worn under a user’s clothing if desired, and would improve the aesthetics of the product when used. We would also like to include an option to disable the on-board loudspeaker (useful though it may be for shaming the user into sitting straight!) in favour of a silent push notification their phone, for cases when the product must be used in silence.

In discussing ideas from the brief, we really wanted to create something which could only exist with a specific wearable sensor/chip, not just something that can be done with current products or a smartphone. The mbed / BLE platform made it easy to integrate both the electronics and logic software to make this happen.

We feel that the concept could be used by a wide variety of people, including office workers with back pain, and perhaps people recovering from injuries where posture is important to their recovery. All in all, my first hackathon was very tiring but also great fun, and I’m very glad we could get what we feel is a complete working proof of concept shipped in the time available. While we didn’t win a prize, we were happy to get a special mention from the ARM judges at the end.

Find the code and more documentation for our entry on GitHub.