This DIY Watch Features a Custom Real-Time Operating System
To make their DIY smartwatch — called Leta — as responsive as possible, Snoopymeoww built a custom RTOS.
What is responsible for the feeling of “responsiveness” in a device? Why is that some devices feel so much more responsive than others? Clearly, it is not solely the result of processor clock speed or memory — many devices have very little of either, yet feel very responsive. There are several factors that influence how we perceive responsiveness (and perception iskey), but a great deal of it comes down to the way in which an operating system handles multiple tasks. To make their DIY smartwatch, called Leta, as responsive as possible, Snoopymeoww built a custom RTOS.
An RTOS differs from a typical operating system, like Windows or macOS, in how it manages tasks. If you’ve ever found your PC unresponsive and opened up the task manager to find the culprit, you’ve seen that there are a multitude of programs and services all consuming resources at the same time. The OS attempts to give all of them a piece of the resource pie, so they can continue doing their work in the background. An RTOS, on the other hand, more strictly controls tasks — devoting all (or most) resources to the single active task. That ensures a timely response to events, such as button presses, while also improving performance on systems with limited resources, such as embedded systems.
In this case, the Leta watch is running a custom RTOS called AK-mOS, which Snoopymeoww spun off from the very popular FreeRTOS. Thanks careful scheduling functions, it can perform specific tasks whenever necessary — but not waste resources on those tasks when it isn’t necessary. For example, a clock that only shows the hours and minutes doesn’t need to waste resources updating the display every millisecond. So, it is more efficient to schedule a task to update the clock display once per minute.
Snoopymeoww’s AK-mOS runs on an STM32F1 microcontroller hosted by a custom PCB, with an OLED screen. The PCB also contains the buttons, charging circuitry, an MPU6050 IMU, an HCM5883L compass, an RF-BM-4044B4 BLE module, and an AHT21 temperature and humidity sensor. Power comes from a small lithium battery. Those components fit into a simple 3D-printed enclosure that attaches onto a leather watchband.
Simple “apps” let the user launch tasks associated with the available hardware. For instance, the compass app displays a graphical compass that constantly updates while it is open. There is even a nifty pseudo-3D runner game. Because of the RTOS’s careful resource management, the interface is extremely responsive and runs smoothly.