Scratch-ing the LEGO WeDo

I have been Scratch-ing with LEGO WeDo kits, and my high school level students absolutely love it. The LEGOยฎ Education WeDo™ robotics kit is normally ear-marked as an elementary school product, and Scratch was developed by MIT for young children to be able to program, but the combination of the two has tapped the interest of my elementary school daughter, my middle school son, and my Computer Science students at the high school level. Link: https://scratch.mit.edu/wedo

oldLEFTnewRIGHT2013
Scratch – old and new

LEGO Software is available for younger students, but Scratch programming has inherent drag-and-drop blocks that resemble MIT App Inventor interfaces for Android Phones that my advanced students have been using. Directly plug in the LEGO WeDo USB to the computer with pre-loaded free Scratch drag-and-drop the robotics components will automatically appear in Scratch.

LEGO WeDo USB and the ScratchEd Screen
LEGO WeDo USB and the ScratchEd Screen

If you have a motor raising and lowering, you need to put an interface on the screen to explain what is happening, and if the interface is interactive, we are hitting the core-level of robotics understanding that we originally were going over student’s heads with NXTs because the software-hardware-interaction was not immediate.

An example program I created is called updownduck where a physical LEGO Duck is raised and lowered by clicking the words UP and DOWN on the screen. Scratch provides emulators where you can see the screen-programming in action (letters will change colors when you click them), but without the robotic LEGO WeDo motor and duck attached tethered to your computer, the program will not make sense to someone interacting with the screen (I have received comments saying that the program does not work from the sharing-Scratch community).

An example program using LEGO WeDo with Scratch called updownduck.
An example program using LEGO WeDo with Scratch called updownduck.

When you view the source code within Scratch (by clicking on the See Inside button), you can understand the purpose of the programming.

Source Code for updownduck in Scratch.
Source Code for updownduck in Scratch.
The Scratch website also has starter projects and setup instructions on how to use each WeDo Component. These intro projects give easy-to-follow LEGO directions within the Scratch window.

We modified the motor project to lift a platform of LEGO Men provided from the WeDo kit. Our challenge was to create a way to make sure the platform stops at a safe level without knocking off the LEGO men.

LegoWeDoScratch02-290x300
Scratch Screen and LEGO Customized WeDo

Complex projects were created at the MIT Lab and you can download the Scratch Files:

  • Submarine Rescue – interactive adventure
  • Balancing Robot – I wish they would post the LEGO designs so we can build the same bot
  • King Duck vs. Fatman Protagonist -interactive balancing and storytelling
  • Caterpillar Love Story – AWESOME storytelling
  • Skiing Moose Ferris Wheel – I wish they would post the LEGO designs for the arm-swinging moose

Many of these projects require teachers or upper-level students to build the components, but once built the storytelling capabilities are incredible.

The robotic LEGO WeDo components that work in Scratch are a Distance Sensor, The Tilt Sensor, and a rotating Motor. The new Science Standards of Learning in Virginia indicate students must have an understanding of probeware, sensor, and accumulate data. The LEGO WeDo components also give numerical indicators on the Scratch Screen of distances and tilt values that can be transferred into authentic data. When the distance sensor shows a value of 2, students can measure with a ruler the distance and chart the values. When the tilt sensor shows a value of 3, students can determine how many degrees equal a value of 3.