In this post
A state machine the size of a grain of salt
Inside each motion sensor, alongside the actual measuring elements, sits a small programmable logic block: a finite state machine. It steps through simple states, watching thresholds and timers over the live signal. Above this acceleration for that long, move to the next state; signal quiet again too soon, fall back. Reach the final state and the sensor raises an interrupt line. No code on the main processor runs at all until that moment.
The pen's reflex vocabulary
With those engines the pen recognises a practical vocabulary of physical events. A sharp tap on the barrel, a bookmark gesture. A double tap. Free-fall, the signature of a drop, detected while the pen is still in the air. The jolt of being picked up. Sustained stillness, the cue to wind down. Each is detected inside the sensor, for microamps, whether the processor is awake or not.
Why not just do it in software
The processor could detect all of these in firmware, and during active writing it does refine them. The energy economics of idle are the problem: software detection requires the processor awake, examining hundreds of samples a second, around the clock. The sensor's engine does the watching at a vanishing fraction of the cost, and wakes the processor only for the interesting moments, which are rare. Reflexes belong in the spinal cord, not the brain.
Designing good events is the real work
The hard part is not enabling these engines; it is tuning them against real life. A pen rides in backpacks, rolls off desks and gets waved around in conversation. Every threshold is a negotiation between sensitivity and false alarms, and the tuning is validated on recorded real-world motion, so a bumpy bus ride does not become a hundred phantom taps.
Key takeaways
- Motion sensors carry programmable state machines that detect events on their own.
- Taps, double taps, drops, pick-ups and stillness are recognised for microamps.
- Delegation lets the processor sleep deeply while the pen stays instantly responsive.
- The engineering effort is tuning thresholds against messy real-world motion.
The elegant systems are the ones where each part thinks at the level it should. The sensor handles reflexes; the processor saves itself for thought.