Project 04, 2025
Head-Motion Controller
A hands-free controller for people who can't use their hands. Three ultrasonic sensors around the head measure where it is. Tilting it to one side or leaning forward drives a small robot over Bluetooth, and holding it still stops the robot.
- Controller
- Mbed LPC1768, plugged into a custom PCB
- Sensors
- 3 × HC-SR04 ultrasonic rangefinders: left, right and rear
- Link
- 2 × HC-05 Bluetooth modules, 9600 baud
- Robot
- Pololu m3pi (3pi base driven by its own Mbed)
- Structure
- 3D-printed headband and stand
- Code
- C++ with the Mbed libraries, on both boards
The idea
Most assistive controllers need some movement of the hands or fingers, or contact with the face, like sip-and-puff switches or chin joysticks. This one needs neither. The user rests their head inside the band, and the sensors measure, without touching, how far the head is from each side and from the back.
From distances to commands
The Mbed fires the three sensors one after another. Each one sends a 10 µs trigger pulse and times the echo, giving up after 30 ms. Because they fire in turn rather than all at once, one sensor doesn't pick up another's echo. The distances then go through a small set of rules:
| Head position | Rule | Command |
|---|---|---|
| Tilted left | left < 50 mm and closer than right | G, or g if the head also rests against the rear sensor |
| Tilted right | right < 50 mm and closer than left | D, or d with the head back |
| Leaning forward | rear > 100 mm | A |
| Anything else | no rule matched | S: stop |
The letters are French: gauche, droite, avancer, stop. The most important rule is the last one. Stop is the default, so the robot only moves while the user deliberately holds a position, and relaxing back to neutral always stops it.
Bluetooth link
Each command goes to the robot as a single character over a pair of HC-05 Bluetooth modules at 9600 baud. The robot is a Pololu m3pi, a small two-wheeled base driven by its own Mbed, which turns each letter into a motion. For debugging, the headset also prints the three distances and the chosen command over USB.
Deciding on the headset was a change from an earlier version, which streamed the three raw distances to the robot (12 bytes per update) and let the robot decide. Sending a decision instead of the data keeps the messages tiny, and the robot side stays the same if the sensing changes.
Hardware
The headband and its stand are 3D-printed. The sensors mount at the two ends of the band and on a raised plate at the back. The Mbed plugs into a custom PCB on the stand, with a connector for each sensor cable, so the sensors can be unplugged and the wiring stays tidy without a breadboard.