Science and Math with Robotics

Page 1


Math and Science with mBot Table of Contents Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 The mBot Robot . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 mBlock 5 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 Motion and the mBot . . . . . . . . . . . . . . . . . . . . . . . . 11 STEM Integration . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 Uploading the code . . . . . . . . . . . . . . . . . . . . . . . . . . 15 Science and math concepts . . . . . . . . . . . . . . . . . . 18 Start options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20

Digital Maestro Magazine

Page 3


Math and Science with mBot

Introduction Coding is very popular. This is due in part to the Hour of Code and sites like code. org. Millions of people have learned the fundamentals of coding. It is something that anyone can learn. Coding is used to program robots like mBot to perform a variety of tasks. Robots like the mBot include a variety of sensors for input. This input is used by developers to program a robot to perform a series of actions. The actions are what we call output. One action from the mBot is motion. The mBot has motorized wheels to travel through most flat surfaces.

Page 4

Digital Maestro Magazine

Code is developed for the mBot on a computer. The development environment is a program called Blockly. This program is similar the popular Scratch programing environment. Blockly uses blocks of code that look like puzzle pieces. These pieces snap together to create strings of coded instructions. The text code is hidden behind these blocks. The blocks represent a simplified version of the code. In this issue we will look at the latest version of the mBlock development environment. The latest version is still in Beta. Beta is a term used to define a piece of software that is still under development.


Math and Science with mBot When software is under development there is likely to be issues. These issues are known as bugs. Bugs are instructions in code that cause problems by not working as expected. Software is developed by humans. As humans, we are prone to make mistakes. These mistakes appear as bugs in code. We will experience some of these bugs in our own code. It is part of the development process. I like bugs in code. Especially when teaching. It provides opportunities for problem solving. I refer to them as teachable opportunities. I like these opportunities when working with teachers. They need to experience and expect that things will go wrong. It’s uncomfortable when things go wrong in the classroom. I’ve been there. Learning to use that to your advantage in the classroom is an important concept.

Scratch is a visual programming language for children. They use it to develop code by connecting bricks in an editor. The projects are created online. There is no need to install software. All they need is a browser. The programming language has been translated to over 70 languages. The service is online. This is to encourage the sharing of projects. Projects are often shared, reused, and combined to develop new projects. The projects are licensed under the Creative Commons Attribution-Share A Like. The user that created the original project is automatically given credit. Reused projects include the original creator’s name. Scratch is used to create interactive stories and games. It is also used to create animations. Scratch is adaptable and useful in several instructional content areas. These areas include math, science, and writing. With Scratch, students create meaningful projects. These projects have a relationship to real-world applications. Scratch is used as the basis for learning other programs like Java and Python. It is also used to develop coding environments for devices.

Digital Maestro Magazine

Page 5


Math and Science with mBot The mBot Robot The mBot robot is a product from Make Block. It is a STEM robot kit. The acronym STEM refers to Science, Technology, Engineering, and Math. There are several variants of STEM. One of these is STEAM. The A in STEAM refers to the Arts. Another variant is STREAM. The R refers to Research or Reading and wRiting. I prefer the STREAM form. It is more inclusive and allows for greater diversity of projects. The robot includes two motorized wheels. This configuration of motors and wheels defines a steering system. This steering system is similar to that used in Tanks. This is one reason it is called Tracked Steering. The wheels work in unison or independently to turn the robot. One wheel must travel faster than the other to turn left or right. There are a variety of sensors on the mBot. One is an infrared sensor. An infrared sensor transmits or receives infrared light. Infrared light is part of the light spectrum. It is invisible to the naked human eye. The infrared sensors are attached to a special module at the front of the robot. This module is facing down. The sensor is used to track a black line. This black line is used to guide the robot around a course.

Page 6

Digital Maestro Magazine

A sonic sensor module is attached to the front of the robot. This sensor looks like eyes for the robot. A sonic sensor sends radio signals. Some of these signals bounce back. Signals that bounce back are received by another sensor on the same module. The computer on the circuit board calculates the time it took for the sound to return. This calculation determines distance. The sonic sensor determines how far an object is and when there is an object in its path. This detection is important if we want the robot to avoid hitting things like walls. We can use the sonic sensor to follow objects instead of avoiding objects. There are two LED, Light Emitting Diode, lights on the robot. These lights are fun to code and provide useful lessons in how the eye works. There are two sets of LED lights on the robot. Each set has three LEDs. There is a Red, Green, and Blue light for each set. This color combination is important. Our eyes use Rods and Cones to detect color and light. The cones are responsible for detecting color. There are three types of cones. One for each of the primary colors red, green, and blue. These are the same colors in the LED sets. Combining and adjusting the intensity of these colors gives us the variety of colors we see.


Math and Science with mBot The Micro-controller The mBot has a circuit board with several components. One important component is part of the circuit board. This component is at the heart of everything the mBot is programmed to do. This is the micro-controller. A micro-controller is a very basic computer. It is designed to execute very simple instructions. It is also designed to interact with components like the motors and LEDs. The micro-controller will take our program and translate the instructions.

Digital Maestro Magazine

Page 7


Math and Science with mBot mBlock 5 The mBlock software is available for download from the MakeBlock website. The software is free to use. We don’t need to own the mBot to use the software. I work with teachers that have just one or two robots in their classroom. Students develop code that is eventually uploaded to the robot. Developing code without a robot is fine if you don’t have one. I will let you know what to expect.

Download mBlock 5

Select the download button for your computer. The software is always being updated. This will not affect the instructions. Download the installation package and run the installer.

Download the mBlock software from the MakeBlock website. The link for the download is at www.mblock.cc/software. Select the option to download the PC software.

The mBlock Environment

There are two versions of the software. Version 3 is recommended for computers with older operating systems. The mBlock software works on the latest operating systems. These include Windows 10 and MacOS X. Select the mBlock 5 option.

Page 8

Digital Maestro Magazine

The mBlock software on Macs is installed into the Applications folder. The mBlock application is inside another folder titled Makeblock. The software in Windows is accessible from the applications list. A shortcut to the app is created during the Windows installation and placed on the desktop.


Math and Science with mBot The basic coding environment is the same on both operating systems. The application opens to fill the entire screen. At the top center of the app are two tabs. The My Projects tab is our starting point. The Example Programs tab has some sample programs to get us started. These example programs are specific to the Cody robot.

The right side has one large button. This button is used to create projects. Click this button to create the first project.

The Stage section is like that used in Scratch. We will not be using the Stage to develop for the robot. Below the Stage, we have three tabs. These tabs are for devices, sprites, and backgrounds. Sprites and backgrounds are related to the Stage. Sprites are characters in interactive stories or games. The Devices section is where we select the robot we want to use. The Cody robot is selected for us. We will return to this later.

The last item on the bottom left is a button. This button is used to connect to the robot.

There are several sections in the development environment. We will begin on the left and move over to the right. The first section on the left has a Stage area. This area is used to develop applications. We create interactive stories and games in this section.

Digital Maestro Magazine

Page 9


Math and Science with mBot The panels to the right of the stage focus on the code blocks. Code blocks are used to develop scripts. Scripts are uploaded to the robot. The robot runs these scripts line by line. The left panel here has the categories for the scripts. The Display category is selected for the Cody robot. Code blocks are within each category. These blocks are connected to form scripts.

The large white area on the right side is where we develop scripts for the robot. The code blocks are placed anywhere on this canvas.

Page 10

Digital Maestro Magazine

Blockly is a JavaScript library used for creating visual programming languages and editors. It is an open-source project from Google. The programs usually run in web browsers. Blockly looks like the Scratch visual programming environment. It uses blocks thank link together. This makes the process of writing code easier. It is used in a variety of projects. Some of these projects include Code.org and Roboblockly.


Digital Maestro Magazine Thank you for reading these sample pages.

Purchase the full issue at‌

digitalmaestro.org/shop


Microsoft Class Notebook for OneNote

Digital Maestro Magazine

35


Turn static files into dynamic content formats.

Create a flipbook
Issuu converts static files into: digital portfolios, online yearbooks, online catalogs, digital photo albums and more. Sign up and create your flipbook.