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 Basketball Robot or our Speedcuber Alarm Clock.
The Robot Construction
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.
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.
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.
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.
Once we had captured the video, we used Windows Movie maker to add the music, add the sound effect of the door opening, and to record narration from a USB microphone. This software is very easy to use and my daughter already had experience using Movie Maker from her Stop Motion Animation project. (Check out our latest family stop motion project, an Exploding Rubik’s Cube).
Windows Movie Maker also provides an easy way to add a title screen, credits, and a closing image to a video which is very nice if you plan to share a video on Youtube.
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.
Want to keep up with the latest projects and resources from Teach Kids Engineering? You can subscribe to the page and follow us on Facebook, Youtube, and Pinterest.