Coding with Legos in G2

This year once again I am doing a “Coding with Legos” lesson in grade two. I first discovered this lesson through a Twitter post that led me to and idea put out by “An Excited Educator“. I have used this idea in both my Geek Squad and in grade two.

The grade two students study a unit with the central idea of “People use symbols to be expressive and to communicate”. My coding with Legos lesson works well with this unit because part of the lesson is to develop a “programming language”. I talk to the students about how we are going to develop our own language using symbols to help a robot move Legos on a base plate. I show them what I mean by moving them. Then I ask them to think about what directions/moves they might need.

We generally end up with the usuals of forward, backward, move right, move left, turn right, turn left. We also decided that we needed pick up and put down for when to take the Lego off of the board and when to push it back into the board.

Once we have decided on our language we copy it down from the board so that it is in their math books for them to easily reference. They use math books with 1cm squares so I ask them to make sure that the symbol is in one square but not too close to the edges.

Then they begin to decide on a starting position. As a pair they

work together to decide where their Legos will begin. One of the lessons that I have learned by doing this is to give about 6 Legos that are different sizes and colours. This helps with the directions and knowing which piece to move.

After they find their starting position they need to draw that starting position on their paper. They have to decide how they will represent their Lego pieces when doing this. Some choose 4 Lego dots = 1 square, some decide 1dot = 1 square. This is a good time to see how the student’s spacial awareness is. I find that some students are very comfortable with making a copy of their starting position and some need a lot of guidance encouraging them to count rows and dots, in order to find the right spots on their paper. If I have a group that is really struggling and I am running out of time I take a picture and they finish at the beginning of the next lesson. This is usually the end of lesson one.

Lesson 2 begins with the students recreating their starting positions. Once they have found these starting positions I give them a bit of time to think about how they want their Legos to end up. I tell them that they must have some that are stacked, but that is all that I say. They play around with finding a pattern that they like.

Then we come together and I say to them. “Now you have to program your robot. You need to tell you robot which colour Lego it should start with. Then draw that on your page and under it with one direction in each square write a program for your robot, using only the symbols.” The very cool thing about this part and most of the steps until here is that even the EAL learners are able to participate fully. Because this is not an activity that is English based they have no problems writing their code with their partner. For them it must be a relief to be able to do a lesson where English is not a huge focus. Once they understand what they are doing they need very little help.



At points along the way, I will interrupt them and be the “robot”. I try out their code and see if I get to the places that they want me to get. The biggest issue so far is the interpretation of a turn right or turn left command. That can make all of the difference. Since these are just second graders I tell them that they must show their robot before it starts what their turns look like, so the robot can try to copy it. If I was doing this with older kids I would have them figure out a way to embed it into the coding of the program. I generally need at least three full lessons to complete this activity, but one of the nice things is that it works so well in the classroom, I can leave it with the teachers and they finish it. This frees up our IT time to work on something else.

For me for IT the goals of this lesson are an introduction to coding/programming, using problem solving techniques to fix programming errors and making an authentic connection from the curriculum to my subject. For a classroom teacher the goals of this lesson could include using problem solving techniques, instructional writing techniques, working in partners, proofreading their work to clarify it, and organizing their steps in a sequence. I am sure depending on your scope and sequence documents this list could change and grow.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s