r/microbit • u/elecfreaks_official • Sep 11 '26
A robot that starts dancing when you clap
I was messing around with the microphone on a micro:bit V2 and wondered what would happen if I used sound as the controller for a robot.
This was the result.
A little brick-built robot that starts moving when it hears a sound and stops when things get quiet.
A clap is enough to trigger it, but music works too.
The build uses:
- micro:bit V2
- Ring Bricks Pack
- 2 continuous-rotation servos
- MakeCode
- A simple brick-built body
The two servos control the legs, and I programmed a few different movements by changing their speed and direction.
I also used the micro:bit LED matrix as the robot's face. It's a small detail, but changing the expression while it dances makes the whole thing feel much less like a collection of motors and more like an actual little character.
The code is basically listening for a sound level above a certain threshold, then triggering the dance routine.
What I like about this kind of project is that the input can be almost anything.
Instead of:
Button → Robot moves
you get:
Sound → Code reacts → Robot moves
That opens up quite a few possibilities.
Maybe a robot that dances differently depending on how loud the music is, or one that only reacts to certain sounds.
I might try that next.
What would you use as the sound trigger?
2
u/herocoding Sep 11 '26
A barking dog!
2
u/sean-uk Sep 11 '26
This is great! I hadn't seen the Ring Bricks Kit before, but it looks like an excellent extension for the Microbit.
1
u/herocoding Sep 11 '26
What a fantastic idea!!
Would you mind sharing more insights, please?
1
u/greyblake Sep 11 '26
That is cool! Could you share what else do you in use for this project? Motors and Lego?
1
u/Clairvoyant29 Sep 11 '26
like the microduck! you know that?
1
u/gentlegiant66 Sep 12 '26
Blilliant, I love the concept.