Kevin Corvisier
← All projects

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.

3D-printed headband on a stand with ultrasonic sensors at the left, right and rear, and an Mbed microcontroller board on a custom copper PCB below it
The prototype: a 3D-printed headband with a sensor at each end and one at the back, and the Mbed board on its custom PCB.
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.

Top view: the head sits inside the band. A sensor on each side and one at the back point at it. Tilting within 5 cm of a side sensor turns, and leaning more than 10 cm away from the rear sensor drives forward. head left sensor under 5 cm: turn left right sensor under 5 cm: turn right rear sensor over 10 cm: forward lean forward
Top view, schematic. The thresholds are the ones in the code: 50 mm for the side sensors, 100 mm for the rear one.

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 positionRuleCommand
Tilted leftleft < 50 mm and closer than rightG, or g if the head also rests against the rear sensor
Tilted rightright < 50 mm and closer than leftD, or d with the head back
Leaning forwardrear > 100 mmA
Anything elseno rule matchedS: 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.

Pololu m3pi robot: a round two-wheeled base with an Mbed LPC1768 board plugged into an expansion board on top
The robot on the receiving end: a Pololu m3pi, with its own Mbed LPC1768 on top. Photo: Pololu.
System: three HC-SR04 sensors feed the Mbed LPC1768 on the headset, which sends one letter through an HC-05 over Bluetooth to a second HC-05 on the Pololu m3pi robot. on the headset on the robot 3 × HC-SR04left, right, rear Mbed LPC1768picks the command HC-05sends one letter HC-05receives Pololu m3pidrives Bluetooth
The whole system. The decision is made on the headset, so the radio link only carries one letter per command.

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.