LEGO Mindstorms 31313 Wack3m

It's been a while since I got to play with the Mindstorms set :( The Wack3m model (designed by Martyn Boogaarts) is one of 12 community models that were provided with the bundled software and the first one I've built. This is a whack-a-mole type game where your reaction speeds are tested by hitting one of three disks as they popup randomly.


When plugging the programmable brick in for the first time in a while, it detected that new firmware was available. Unlike the main software, this is a forced upgrade. My old version was 1.03H and this took it to 1.06H.

It was a simple process and everything worked fine.

The main Mindstorms software also had an update recently but I did that a month or so ago and didn't take any screenshots. I am now on Version 1.1.0 (20140513.1).


I asked my son which of the community models he wanted to build first. After watching the videos, he decided on the Wack3m by Martyn Boogaarts. This is a whack-a-mole type game where your reaction speeds are tested by hitting one of three disks as they popup randomly. My first thoughts were "uh-oh this is going to break something", but so far all is good :)

Like the five LEGO models, the community models include a demonstration video (in most cases), building instructions and the completed EV3 program. However, unlike the LEGO models, the program does not have a tutorial mode where it takes you step-by-step through creating the program yourself. Which is fine, as by this stage you have plenty of practice from the other models.

My 7yo son built 95% of this model. Compared to the normal LEGO produced building instructions, he found a few parts harder to understand and trickier to put together. I had to help with pushing in some axles which hurt his fingers, and he often put on some beams backwards. I'm not sure if it's because the instructions weren't clear enough or just the nature of the model which is hard to represent on a flat screen.

Structurally, the model consists of three very similar blocks connected to each other which can make it boring I guess. The programmable brick connects on the end, which I think could have been made stronger. Changing the batteries on the brick caused things to fall apart easily.

How does it work?

Each of the three disks have a servo motor driving them - two large and one medium, which seemed to make the middle disk (medium motor) pop up a little slower than the others, despite a large gear ratio. The program picks a motor at random and turns it to push a wheel up and then reverses the motor to let the disk get pushed down without running into any motor braking. The IR sensor then waits until it detects a whack - however it doesn't actually know that you've hit the disk. It assumes any IR proximity change is good enough. It records how long it took to hit and adds it to your total. After 10 whacks, the game is over and it displays your average response time.


At first I was convinced there was a bias for disks #1 and #3. The middle disk rarely popped up. Looking at the code reveals a bit of a strange section.

This is the section that picks one of the three disks at random. It works as follow:

  1. The first red stage picks a random number between 1 and 90. The

  2. The second red stage divides that number by 30.

  3. The third red stage rounds that number up to the closest integer.

  4. The orange stage is a switch that picks branch numbered 1, 2 or 3 based on the random number from the previous stage.

Why not just initially pick a number between 1 and 3 then use that directly? I modified the program to do this and it worked fine. After some more play testing with the original and new program there didn't seem to be any bias after all, but it still left me questioning that bit of code as it seems a strange thing to do.

In the end I also changed the power level for the middle motor to give it more oomph which seemed to help.

A real problem I found was that if you are a fast whacker, the IR sensor does not always detect it. I found you get better results if you leave the hammer (or your hand if you prefer) on the disk briefly after hitting it.

The program is otherwise very clear and easy to follow. It uses one custom block - perhaps just for demonstration purposes as it's not reused and doesn't really achieve much to simplify the code. There are several blocks used for timings and variables which will help you understand how to use them in your own projects.

Next Steps

There are a few improvements I could think of that would make a good challenge your kids:

  1. Change the sounds when it gets whacked. There are plenty of provided ones to pick from and can make it more entertaining such as having it say "ouch" or other sound effects.

  2. Make the game harder. I'm thinking mainly about reducing the time between disks popping up here. A very simple change.

  3. Allow multiple disks to pop up together if you take too long, like a real whack-a-mole game does. This would take some re-programming to allow all three disks to run independently.

  4. Stop cheating by making the IR sensor know which disk you hit. Perhaps some fine tuning of the proximity settings could improve this, I'm not sure.

I made a number of improvements along these lines as you can see in this video comparing the original game with the enhanced version!


The game itself is pretty fun. It kept my kids entertained for a while, although I had to be careful when the younger ones got a hold of it as they got a bit carried away with their whacking.

I'm impressed at the quality of the model and the build instructions considering this is a not a LEGO designed robot. It is a great way to get inspired for your own projects and learn how to program the blocks in various ways.

I love the Mindstorms platform as an education tool for my kids. They are learning how to program computers very young these days which I think will be very important for their future, and essential for any STEM related career path.

Rebrickable does not have many EV3 MOCs (only this hilarious one!), it would be great to see plenty more submitted :)

Click here for the full list of Mindstorms EV3 reviews


Login to your account to write comments.