LEGO MindstormsProjects

Lego Mindstorms Dancing Robot

(Update 3/15/2020: New video and instructions for adding Alexa voice control to the robot. This allows the robot to adjust speed to songs played on Alexa devices.)

This week our family project with the kids was to build and program a Lego Mindstorms Dancing Robot. I thought this would be a great exercise in computer programming for the kids because a computer program is just a sequence of instructions, and a dance routine is a series of movements. Programming a robot to make specific movements in a set order seemed like a great way for them to get an immediate visual reward for their efforts.

First, watch the video below to see the robot in action and then read beyond if you want to see more details on how it was all done.

Interested in seeing how this was all put together and trying this project at home? I’ll describe the different phases of the project in more detail below. For our other Lego Mindstorms EV3 projects, check out our LEGO Mindstorms Music Box, LEGO Mindstorms Booby Trap, LEGO Mindstorms Basketball Robot or our Speedcuber Alarm Clock.

The Robot Construction

Dancing Robot Build Instructions

The inspiration from the robot design came from one of our favorite EV3 robots on Youtube, Ice’s Giant. I wrote about this robot in an earlier post about our favorite Lego Mindstorms EV3 Robots. I like the basic concept for this robot – it uses the two large motors for the legs and the small motor to control the arms. The legs are very stable so that the robot walks well without falling over. The first challenge that prevented us from using this robot is that there are no good building instructions available.

There is a set of close up photos available that is somewhat helpful and there is an auto-generated instruction set from Lego Digital Designer, but these are not very useful. The second and bigger challenge is that Ice’s Giant was design using the Lego Mindstorm Ev3 Education Set. This uses many components that are not available in our LEGO Mindstorms EV3 Home Edition. (Update: Now the latest LEGO Robotics Robot Inventor set is the newest set available).

We needed to make many modifications to the robot design to build with the pieces available with our set. This was actually much more fun than blindly following the high quality building instructions provided by Lego. We built from the Ice’s Giant photos, modifying as needed. Stability was a big priority for this robot because we did not want the robot to fall over or for an arm or leg to detach while doing repetitive dance movements.

For the legs we followed the same construction as much as possible, while enlarging the feet to improve stability. For the upper body, we followed the same concept of using the small motor to move the arms with sensors for hands, but we really had to do a very different design because we had different pieces to work with.

Detailed Build Instructions are now available. Click the link below to download the build instructions.

Dancing Robot Build Instructions

Front view of Lego Mindstorms Dancing Robot
Front view
Back view of Lego Mindstorms Dancing Robot
View from back
Outer leg view of Lego Mindstorms Dancing Robot
Close view of outside Leg
Inner leg view of Lego Mindstorms Dancing Robot
Inside of Leg
Back view of Lego Mindstorms Dancing Robot
Back view

Programming the Robot to Dance

The Lego Mindstorms EV3 software uses a block programming structure where blocks are dragged with the mouse and snap together. This is similar to the concept used in the popular Scratch programming platform (read more about Scratch here). Each block we used controls the movement of a motor (one of the legs or the arms), sets a wait time or simple loop, or controls one of the display options of the main brick (facial expression or light).

This was also a perfect project to teach the kids about sub-routines within a program because dance movements are very repetitious. We created two custom blocks – Shake_Those_Arms and Take_Steps. For the Take_Steps block, we were able to learn about passing variables into a sub-routine.

Dancing Robot Lego EV3 Top Level Program
Dancing Robot Top Level Program
Dancing Robot Arm Movements
Arm Movement Block
Dancing Robot Leg Movements
Take Steps Block

Click here to download the full Dancing Robot program.

Creating the Video

Once we had fine-tuned the program to move the robot to the song we selected, we were ready to capture it all on video. We chose to add the music afterwards in the video editor for two reasons – recording quality and the ability to accurately sync the music and the movements. The robot was already moving very accurately to the music, but it is difficult to start and stop the music at the exact desired time.

Adding Alexa Voice Control

Once you have the robot built and dancing, another fun project is to add Alexa voice control. In September 2019, hackster.io launched the LEGO Mindstorms Voice challenge with very helpful instructions on adding voice control commands to Mindstorms robots. The contest provided very helpful instructions to add voice control capability. This is a much more advanced project since it involves several technical steps, but it is a great challenge for those who are very comfortable with programming on different platforms. You can see our projects on Hackster.io at the links below.

Alexa-Controlled Dancing Robot

Alexa-Controlled Music Box

Please also check out our LEGO Mindstorms Basketball Robot with a fun video and building instructions. Our latest EV3 project is a Speedcuber Alarm Clock that requires a Rubik’s cube to be solved and scanned by the robot before the alarm will turn off. We’ve also more recently added a Mindstorms Music Box and a Mindstorms Booby trap based on the opening scene of Indiana Jones and the Raiders of the Lost Ark.

Subscribe to our Youtube Channel to keep up with our latest videos.

LEGO Mindstorms Booby Trap

LEGO Mindstorms Music Box

LEGO Mindstorms Basketball Robot

Rubik’s Cube Alarm Clock

 

Want to keep up with the latest projects and resources from Teach Kids Engineering? You can follow us on Facebook and Youtube
 

11 thoughts on “Lego Mindstorms Dancing Robot

Comments are closed.