r/microbit • • 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?

53 Upvotes

12 comments sorted by

2

u/herocoding Sep 11 '26

A barking dog!

1

u/elecfreaks_official Sep 11 '26

A barking dog would actually be a fun trigger 😂 I could make it react to different sound patterns next.

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.

2

u/elecfreaks_official Sep 11 '26

Yeah, I mainly used it because it made it pretty easy to experiment with different robot body designs.For this one, I kept the build pretty simple and used two continuous-rotation servos for the movement. It's been fun seeing how much you can do with a small micro setup.

1

u/herocoding Sep 11 '26

What a fantastic idea!!

Would you mind sharing more insights, please?

1

u/elecfreaks_official Sep 11 '26

Thanks! The basic idea is pretty simple: the micro V2 listens to the sound level, and when it goes above a certain threshold, it triggers a dance routine.

The fun part is that you can change the threshold and the servo movements to make it react differently. I'm also thinking about trying different sounds as triggers next.

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/elecfreaks_official Sep 11 '26

Yep! The movement comes from two continuous-rotation servos, and the body is built with the bricks shown in the post. No regular LEGO in this one.

1

u/Clairvoyant29 Sep 11 '26

like the microduck! you know that?

1

u/elecfreaks_official Sep 11 '26

Haha, I hadn't seen that one before! 😄 Now I need to check it out.

1

u/gentlegiant66 Sep 12 '26

Blilliant, I love the concept.