Intro Course - Using the mBot in a Classroom This resource is aimed at new users who are getting started with the mBot. It offers some teaching ideas and collates in one place a lot of information from various places across the web.

About the mBot: T​ he mBot is a low cost, easy-to-run robot kit to get hands-on experience about programming, electronics and . It is an all-in-one solution for robotics learning and designed for STEM . Features: ● Easy to assemble ● Electronics are based on the Arduino open source platform ● Supports IOS & Android App. ● Two programming tools: Arduino IDE and mBlock, a drag-and-drop programming tool based on Scratch 2.0 ● Bluetooth or 2.4GHz wireless module included ● Easy and intuitive wiring with color-coded RJ25 connector ● 2 mm thick aluminum chassis, strong and compatible with Makeblock & Lego parts

Check Your Robot: D​ oes your mBot have bluetooth or wifi? Check the specs on the packaging. Spare Parts: ​MakeBlock put out a range of parts, sensors, extras and extension kits so students can also design their own robot for a purpose by either completing building the whole robot or adding to the existing mBot.

Vocabulary mBot ​ is the robot mBlock ​ is the drag n drop to download for Windows or Mac. It is a customised version of Scratch.

Arduino ​ is an open source programming language, and hardware platform. ​ It’s intended for anyone making interactive projects. The Arduino development environment makes it easy to write code and upload it to the I/O board. You can use Arduino language (C\C++) to interact with Arduino hardware. mBot Ranger ​ is a slightly more complex mBot with tank like tracks to move on instead of wheels.

Default program t​ akes the mBot back to the status it started with such as manual control mode, obstacle avoidance mode, line inspection mode. Useful if using the mBot with multiple users so each user starts from the same status each time or when the user wants to use the remote control.

Upgrade firmware Here is an example of a situation where you need to upgrade firmware. Do the online program testing with Green flag head as below:

You may find it won’t work when you click the green flag, this may due to that you haven’t upgrade the firmware for the robot to clear the pre-loaded program on the main board. Remember to Upgrade Firmware for the robot every time before you test the online program.

Getting Started Build the mBot according to the guide book. You will need 4 AA batteries. Rechargeables are better over the long term. Although the initial outlay is higher they will pay for themselves. The remote will need a battery as well.

Using the remote Once built it should work from the remote. If it doesn’t, check that the remote’s battery is in correctly. Play around with the remote. Some ideas are:

Button A is manual control - moving and changing the speed Students could plan and design a game. Eg Robot balloon ball - a game of “football” with a light soft ball or small balloon. Students devise rules that make an interesting game. They will need at least two mBots, the ball and two goal areas drawn on paper.

Button B sets the robot to obstacle avoidance. How does this work - what does the robot do? Students could try to write an algorithm similar to that which was used to program this obstacle avoidance.

Button C sets the robot to follow a line. This does need to be quite chunky with good contrast between the line colour and background colours. This makes a good exercise to experiment - how thin can the line be before the mBot can’t detect it? How much contrast in colours/tone before the mBot can’t detect the line from the background?

Programming Your mBot

On your Laptop or desktop you will need to install the graphical programming software mBlock. mBlock is a graphical programming environment based on Scratch 2 open source code that makes it easy to program. mBlock 3 versus mBlock 5? With mBlock 3 you can see the Arduino coding and even code in Arduino language. mBlock 3 is a block-based programming software based on Scratch 2.0. mBlock 3 interacts with Makeblock controller boards and other Arduino-based hardware, allowing users to create interactive hardware applications.The block-based code can be converted to Arduino C Arduino is an open-source electronics platform based on easy-to-use hardware and software. The Arduino language is based on C\C++. It’s intended for anyone making interactive projects. The Arduino development environment makes it easy to write code and upload it to the I/O board.

With mBlock 5 you can see the Python coding and even code in Python language. mBlock 5 is a block-based and text-based programming software based on Scratch 3.0. mBlock 5 allows users to program Makeblock robots, Arduino boards and micro:bit. Using mBlock 5 without any hardware, users are able to code games and animations. The block-based code can be converted to Python code, be connected to IoT and supports AI-functionality such as face and voice recognition, as well as mood sensing.

The software is available for ​Windows & Mac,​ download here h​ ttp://mblock.cc/download/ mBot communication options

● Option 1: USB cable ● Option 2: Bluetooth ● Option 3: 2.4G wireless serial

mBot Board

When uploading to the mBot’s board the program runs as a standalone. This means that all the programming scripts that were only relevant to the mBlock environment programming (such as “Motion” and “Looks”) are unavailable. On the plus side, because the code is uploaded to the board, there is no lag between, for example, reading sensors and acting accordingly.

When you want to upload a program to the mBot’s Arduino board, you should go into Arduino mode. You can do that by selecting it from the menu. You need to select Edit and Choose Arduino mode.

Connect the mBot to your computer via the cable and turn it on. In the mBlock menu choose Connect, Serial Port, and the appropriate name - in this diagram it is COM3

Finally upload the program to the mBot by clicking the Upload to Arduino button.

Remember to get the mBot back to the original state where it can be controlled via remote you will need to connect the mBot via cable, select Connect and Serial Port, and then go back to the ​Connect ​ menu and choose ​reset default program

Exercises Follow the tutorials and complete the challenge tasks at the end of each tutorial.

1. Code your mBot to move in a square by following the steps here: http://learn.makeblock.com/en/robot-kits/mbot/move-in-a-square/ Challenges: A. Do I need the last movement command in my repeat loop? Can you make the code more streamlined – so it still does what we want, but with less commands issued? B. Can you write a program that moves the robot in a rectangle? C. Can you extend your program from question B to write a program that gives a warning sound before starting, and has lights on while moving?

2. Code your mBot to move in a circle by following the steps here: http://learn.makeblock.com/en/robot-kits/mbot/move-in-a-circle/ Challenge: A. Write a program so your robot moves in a figure-of-eight. B. Write a program so your robot spells your initials.

3. Learn how to control the LEDs here: http://learn.makeblock.com/en/robot-kits/mbot/the-led-display/ Challenge: A. Play with different settings of the LEDS. What different colors can you make? What settings of the RGB LED creates these colors? B. Can you write a program that sets the left LED and the right LED at different times to your favorite color? So if the right LED is on the left LED is off, and vice-versa. C. Can you write a program that gives a light show that is accompanied with music? Remember to add comments

4. Code your mBot to play a tune h​ ttp://learn.makeblock.com/en/robot-kits/mbot/play-music/ Challenge: A. Do you know what the song is? Can you finish the song? Can you amend the comments to reflect the updated status? B. Can you write the song “Merry Christmas”? Be sure to add comments C. Can you write your own song? Add comments

5. Read data from sensors: ​http://learn.makeblock.com/en/get-started/reading-sensors/ Challenge: A. Can you find a way to display the values of different sensors at the same time? B. Can you find out the range of possible values for all the sensors?

6. Complete the challenge for coding the light sensor: http://learn.makeblock.com/en/robot-kits/mbot/the-light-sensor/ Challenge: A. Develop a program where the robot runs forward in the light and stops in the dark. B. Develop a program where the robot dances in the dark (be creative with your dance moves) and rests in the light. C. Develop a program where the robot goes at different speeds depending on the light – the lighter it is, the faster it goes. D. Develop a program that plays lots of different notes – the more light sensed, the higher the note.

This site has many more tutorials which guide the user through the different features including 5 tutorials using sensors and seven that go through more advanced programs. It is the best comprehensive website as at 2018 for mBlock tutorials.

Other resources This site introduces the user to programming using makeblock: https://www.makeblock.com/project/getting-started-programming-with-mblock ​ The image below is a useful reference to the makeblock screen from this website.

Other Material Using Multiple Bluetooth mBots in a classroom​ - how to ensure students connect to the correct robot. https://www.brilliantlabs.ca/mbot-intro Skip down to the section labelled How​ to Connect Your PC to Your mBot (Bluetooth Version) ​ ​

Arduino Programming http://learn.makeblock.com/en/learning-arduino-programming/ This gives an intro to getting started with Arduino but doesn’t teach Arduino programming as such. This site ​https://www.arduino.cc/en/Guide/HomePage​ is more useful as a learning guide to Arduino.

Curriculum Connections​ from ​https://www.brilliantlabs.ca/mbot-intro As with many innovative applications for classroom learning, the curriculum connection are numerous. However, many of the most valuable curriculum connections will appear spontaneously as teachers observe the authentic connections students make while using their mBots. The level of language students begin using in order to explain the code that they have written for their mBots can be complex. ​Here are some of the more general subject area connections:

Music: ​Can you believe that these mBots can 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: T​ here 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:​ The mBots are relatively inexpensive so sacrifice 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.