
Fixing a project's HTML explainer on screen and handing it off as one link
I'm building NOS: fix the text of a project explainer right on the page, then share it as a link that stays the same after edits.

A clear plastic skull that turns to stare at you, with no camera inside. A 24 GHz radar sees straight through the plastic, an RP2040 decides who to look at, two servos move the head with eased, predator-like motion, and LED eyes change colour as you get closer. Open source C++, with a three-part video series.

Walk into the room and the head wakes up, turns, and follows you. Move quickly and it snaps towards you. Stand still for 30 seconds and it gets bored and dozes off. It tracks up to three people at once, and the eyes show what it's thinking.
It started as a Halloween prop. It turned into a test bed for the three things every animatronic needs: sensing, natural movement and behaviour.
1. Radar instead of a camera. Radar goes through plastic, fur and fabric, so nothing on the outside gives the sensor away, and there's no image processing. The KW307 hands you a distance and an angle per person, which is exactly what a head needs to aim.
2. Servo easing. Servos accelerate flat out and stop dead, which is why hobby robots look robotic. Easing curves fix that. A sine in-out curve looks calm and natural, for waking up or turning to someone standing still. An exponential-in curve speeds up hard and stops abruptly: that's the strike when a target moves. Same servo, same angle, a completely different creature.
3. A state machine for behaviour. Radar data arrives by interrupt. The callback just stores it and returns: never move a servo inside an interrupt. The main loop runs a state machine (asleep, watching, hunting) that looks at how fresh the data is and how far the target has moved, then picks the next move and its easing curve.
The eyes run off the same data: the iris colour shows distance, the number of lit LEDs shows how many people it can see, and a pulsing pupil means it's asleep.
The same radar, easing and state machine code now drives my next animatronic, a snowman that watches the room and waves. If you build your own head, I'd love to see what it does when it wakes up.
Dr Jon EA · https://drjonea.co.uk
Log in to comment.
No comments yet. Be the first!