mBot Mastery

Contributed By: Tri Ngo &          Jacob Lingley

Questions? 

Click here for a forum post that is associated with this classroom project. I would be happy to help you out with any questions you or your students may have. 

Why do we love the mBot? 

The mBot from Makeblock holds a special place in our brilliant hearts. To roughly quote some romantic prose "Oh dearest mBot, how doth I love thee; let me count the reasons:" (1) These robots are relatively low cost at just over $100 CAD. (2) They can be assembled in under an hour, (3) They are great for beginners and with the input sensors allow for advanced users to be satisfied, (4) They are super cute, (5) We leave the best for last: They can be programmed in both SCRATCH and ARDUINO

It goes without saying (but I will say it anyway), with the increasing focus on teaching our students how to code, most of our students in Atlantic Canada are now mini-experts in Scratch coding. If you are still wondering why there is so much hype surrounding the drag-and-drop, block based coding language of Scratch from MIT, please take the time and try it yourself (www.scratch.mit.edu).

 

This focus on Scratch, has allowed our students to become masters of event based coding, however many students still have the impression that "coding" or programming means that their set of newly minted instructions that they have created exist only within the confines of the computer monitor. What the mBot enables students to realize is that learning to code empowers them with the ability to physically manipulate and control the world around them. While this thought likely brings concern to our minds, as we think about a small army of classroom robots carrying our morning coffee away from our needy hands, it is important to realize that our students will be the engineers of the most innovative robotic platforms our world has ever seen. 

With robotic platforms this cute and lovable, it is often easy for us to simply relegate them to a toy category - however they have the ability to dramatically innovate your curriculum offerings. 

 
Purchasing Options

Click on the image of the item below for our preferred purchasing locations. 

Bluetooth mBot from Robotshop.ca
($97.42 CAD)
Bluetooth mBot direct 
from Makeblock.cc 
($94.99 USD)
Project Title Goes Here

Mastering the mBot by Makeblock

An example of Scratch coding blocks. 

An example of mBlock robotic coding blocks. 

Curriculum Connections

As with many innovative applications for classroom learning, the curriculum connection are too numerous to mention, however we have found some to be more excitingly apparent than others. However, many of the most valuable curriculum connections will appear spontaneously as teachers observe the authentic connections students make while using their mBots. When we talk about formative assessment and collecting evidence from conversations, you will be amazed at the level of language complexity students begin using in order to express their pride in the code that they have written for their little mBots. 

Before we talk about specific outcomes, here are some of the more general subject area connections we have observed:

 

Music: Can you believe that these little mBots can even play single and combination chords of 8-bit notes. From within the mBlock software, students can code their robot to play their own rendition of classic 8 note tunes like "row-row-row your boat," or even "Old MacDonald." If you can stand the shrill sound of the speaker of which these sounds are emitted, perhaps you can challenge your students to write their own "chip tune" soundtrack for their robot. 

 

Language Arts: There are plenty of news related articles out there on how coding education can improve student literacy skills including speaking, reading and listening. We have seen evidence of this when students start programming their robots to use conditional statements like "if/then," "and/or," and the more complex "if/then/else." The meta-cognitive though patterns that we speak of when we want our students to "think about their thinking" become immediately necessary in order for them to correctly translate their thoughts into specific instructions for their semi-autonomous robot. 

Science: The connections to upper-level physics are too numerous and lengthy to mention here. However, we may not think of these mBots providing a parallel to biology. One of the most common statements we hear from students when using the mBots is "Aww, it looks like the robots have eyes." Of course they are referring to the ultrasonic distance sensor. One of the "eyes" transmits a high frequency wave that bounces off an intervening surface and returns to the adjacent receiving "eye." Often, no sooner do we start this geeky (yet, biologically relevant) explanation of sensor mechanics, when a student screams out "That's echolocation!" Insert incredibly large tooth-filled smile on any teacher's face. 

Mathematics: Let's be serious, when these mBots are so inexpensive, we are sacrificing some features of larger robotic platforms. It is in this sacrifice however, that the real mathematics inspired learning occurs. For instance, the motors that drive the mBot wheels cannot be programmed to a set number of degrees of revolution. Therefore, students have to rely on the only variable available to them: time. Students soon realize that in order to allow their mBot to turn a certain degree angle, they need to program the speed of each independent wheel. This, combined with real-time feedback from the ultrasonic sensor ensure that students are practicing the most complex of math inspired content.  

 
mBot Setup

The setup instructions below have been written with the New Brunswick teacher in mind. Their latest teacher laptops run Windows 10, and therefore we have designed these step-by-step instructions with that operating system in mind. These mBots however have been designed to run on other versions of Windows and Mac OS X. If you are planning on connecting via iOS, please scroll down. 

For manufacture instructions, please click here. 

 

Computer Software Installation

Click the appropriate link above to download the appropriate version of mBlock software for your operating system. If your system requires administration credentials to instal software, you will have to submit a "help-desk" request with your system administrator. 

Driver Installation

If your technician is visiting you to install the software, we highly encourage you to have them install the associated arduino driverThis will allow your students to use the USB cable to send programs directly to their mBots without depending on bluetooth connection. 

To install the driver, launch your newly installed version of mBlock, click Connect --> Install Arduino Driver. If you run into issues, please consult the instructions found here

(Image courtesy of Makeblock)

How to Connect Your PC to Your mBot ​(Bluetooth Version)

1. Open mBlock, and click Connect --> Bluetooth --> Discover.

2. The first time you attempt to connect to your mBot, Windows 10 may provide a pop-up as follows. Simply click YES and the pairing process will begin. 

3. If you have more than one mBot with a bluetooth connection, you will see the following. Each bluetooth module on your mBot has a unique identification number. This number can be found on the underside of your bluetooth module, or in your bluetooth settings on your computer. Once you identify your specific mBot, we encourage you to label your mBot. 

4. After you have selected to connect to your desired bluetooth enabled mBot, you can verify the connection either by clicking on Connect --> Bluetooth --> and there will be a checkmark next to the correct Makeblock (ID NUMBER) or clicking on the green ROBOTS category where you will see a green dot (rather than a red dot) confirming the mBot connection. 

How to Connect Your PC to Your mBot ​(2.4 GHz Module)

This is the mBot model with a separate grey USB dongle. 

*We have just discovered that there is an issue with the 2.4GHz module connecting with PCs using Windows 10. We are working on a solution, however if this problem persists, we recommend replacing your 2.4 GHz module with a bluetooth module, available for purchase here.*

(mBot 2.4 GHz Module)

  1. Begin the connection process with your mBot off, and the USB dongle NOT connected.

  2. Power-on the mBot.

  3. Press the small grey button on the 2.4 GHz module. This will change the rate at which the on-board LED is blinking.

  4. Insert the USB Dongle. This will cause the on-board LED to stop blinking.

  5.  Open mBlock, and navigate to Connect --> 2.4 G Serial --> Connect. When a successful connection occurs, the green dot will appear under the robots category. 

* Please note that the USB dongles are not specific to the mBots. However, it may be easier to label both the dongle and the corresponding mBot. If the dongles and mBots do become mixed-up, repeat the process above to reconfigure the dongle to the mBot. 

 

Mobile Programming with iOS mBot Compatible Apps

Makeblock has two compatible iOS apps that you can use to program your mBots. They are very simple to use. Please follow this link to learn more. 

How to Code your mBot

We are excited to see what you and your students will come up with for mBot programs. The following examples are only provided as introductory resource to get you started. 

Basic Programming Example: Follow the on-screen block placement to create a program that will allow you to control your mBot with your keyboard. It's very important for you to use both "when key pressed" as well as "when key released" or else your mBot may run straight into a wall (which isn't the worst that can happen). 

This basic program will likely only keep you and your students satisfied for so long. Sure, it is fun to use this program to create your own mBot soccer game, or to introduce your friendly robot friend to your neighbouring classroom, however it would be much better if your program included some conditional control statements. In the two examples below, your students will learn about branching (a sequential set of actions) and looping (deciding how many times an action will take place). 

More Advanced Robot GoalmBot runs forwards, then stops at a fixed distance from an obstacle. When obstacle is removed, mBot continues to run forward. 

1. In mBlock, connect to your mBot. 

2. Click on the category "Data & Blocks"

3. Click on "Make a Variable"

4. Name that variable "Distance" for all sprites. Click OK.

5. Now create your block of code, beginning with the event "When Flag Clicked"

6. Drag over the corresponding blocks as shown in the image below, on the left.

 

 

It's important to note that the units used by the ultrasonic distance sensor are centimetres. Go ahead and try your code to see what happens. By using the conditional statement "if/else" the robot should run forward until it is less than (or equal) to 10 cm away from the obstacle. Unfortunately, because of this code, it will not continue to run forward when the obstacle is removed... hrmmm... did we talk about looping yet? 

7. Drag over the "repeat until" block found under controls. 

8. Drag the "key pressed" block found in sensing into the modifier in "repeat until" block. 

9. Create the program found in the image below,  on the right. 

If done correctly, your robot should now interact with your environment as your goal intended. 

Now what about the other sensor: The Line-Following Sensor?

As you have likely noticed, the mBot comes packaged with two input sensors: one to sense distance, and the other to sense contrast between a light and dark surface (line-following). The mBot comes with a paper track that you can use out of the box, but we have had great success with simply using  sharpie, or even the contrast between the top of a table and the floor below (use a safety net for your poor mBot). 

There is quite a bit of science happening in order for the mBot to follow contrast variation. As the photo below demonstrates, the line-following sensor contains an infrared emitting LED as well as a infrared sensing LED. When the light energy from the emitting LED reflects off of a surface, information about the reflective properties of the surface is transmitted back to the mBot. As grade 8 optics has taught us, the lighter colour the surface, the more light is reflected in comparison to the amount of light that is reflected from a dark coloured surface. 

Let's get that mBot following a line! 

You are likely looking for your mBot to do something like the image below suggests: 

mBot moves forward as it is sensing black, or limited reflected light. 

mBot turns left as the left LED only, senses black, or limited reflected light. 

mBot turns left as the right LED only, senses black, or limited reflected light. 

In order to get this to happen, we will need to write the following code. 

1. Turn on your mBot and connect as you have done before. 

2. Click on the category "Data & Blocks"

3. Make a block named "Move" 

4. Make the following variables for this sprite: "Speed" and "Line Sensor Value"

5. Create the following program. 

Classroom Considerations
 

We hope you enjoy using your mBots with your students as much as we do. In addition to the above tutorials, we have had success with issuing simple challenges to students. Don't worry about creating challenges that you don't even understand how to code, they will collaborate with one another to reach the goal. Here are some of our favourites: (1) By pushing one key only, have your mBot navigate around an obstacle in a circle; (2) By pushing one key only, have your mBot run forward, stop, turn around, and come back to the starting position; (3) Have your mBot create the perimeter of different polygons. 

We can't wait to hear about all of your coding success! Thanks for reading. 

support:

We are here to help with your planning and evaluation.  Let us know if you have any questions. Plus, we'd  like to share your project work so please keep us updated. 

Jacob Lingley

Jacob is a self-proclaimed geek and the New Brunswick Program Director for Brilliant Labs. A long time middle-level mathematics teacher, Jacob travels throughout Atlantic Canada hoping to inspire the geeks of tomorrow with tales from 3D Printers to interactive clothing. Joined Brilliant Labs in 2015.