Technology lessons for educational technology integration in the classroom. Content for teachers and students.

Robotics Alex Robotics Alex

The mBot robot and basic motion

The mBot robot is useful when teaching math, science, and coding concepts. Once the robot is assembled we begin with the fundamentals. These fundamentals include coding the robot’s microcontroller to activate the motors so mBot moves.

mBot robotics basic motion math science coding

Basic math, science, and coding concepts

I like using the mBot in the classroom. It is useful when teaching math, science, and coding concepts. Once the robot is assembled we begin with the fundamentals. These fundamentals include coding the robot’s microcontroller to activate the motors so mBot begins to move around. Once the robot is moving we begin to learn about motion, velocity, and acceleration. This leads to lessons on Newton’s Laws of Motion.

Make sure the robot is not on a table where it can easily roll off and come crashing to the floor. I recommend placing the robot on the floor for the first few examples. You can also place the robot on a small paperback book so the wheels are free to spin.

The application to program the mBot is available online or as a download for your computer or device. Go to https://mblock.cc. Programming in the browser version of mBlock 5 requires an account. There is account integration with Google so students can easily create their accounts. This is useful if your school district uses Google account services.

Create a new project by clicking the new project button on the startup page. Provide a title for the project. Click the word Untitled next to the image of a diskette.

title the mBlock project

Name the project “Move forward and back”. Don’t include the quotation marks.

move forward and back title

We need to load the robot into the development environment. Loading the robot loads the code library for the robot. This code library provides some specific code blocks for mBot.

Go to the Devices section under the Stage and click the Add button. The button is next to the Cody Device.

add a device

A Device selector window will open. Click the mBot device and click the OK button.

mBot device library

There are two devices in the Devices section. The mBot device is selected. A blue highlight appears around the selected device.

mBot device selected

The codes panel updates with the categories and code blocks for the mBot. The first code block in the Action category is used to instruct the robot to move forward.

mBot action code blocks

Using code blocks to build scripts is easy and intuitive. Click and drag the first code block onto the canvas area on the right. This code block has two number values. These values are inside small ovals.

move forward code block

The move forward code block is used to send instructions to the micro-controller on the mBot. The micro-controller sends instructions to all the components on the board. It also sends instructions to the components attached to the board.

The micro-controller interprets the instructions in the code block. The instructions in the current code block will send fifty-percent of the available energy to the motors. It will send this amount of energy for one second. That isn’t much time. We will change these values later.

STEM Integration

Let’s take a closer look. The code here relates to some basic concepts in science. The mBot has a battery pack. It uses four double-A batteries. Each battery is 1.5 volts. There are four of these batteries. That is a combined voltage of 6 volts. Volts are potential energy. Potential energy is a concept covered in physical science.

The code block instructs the micro-controller to send fifty-percent of this potential energy to the motors. The energy is released as current. Current is the flow of electrons from one end of a circuit to another. We can determine the current sent to the motors with a math formula. This formula is taken from

Ohm’s law. Ohm’s law is a formula used to calculate current, resistance, or voltage in a circuit. To determine the current sent through a circuit, we divide the voltage by the amount of resistance in a circuit.

We don’t need to know the exact amount of current sent to the motors. It is enough that we use this moment to apply classroom concepts to real-world applications. We must use the proper academic language.

Through the use of this model, we show students potential energy at work. They understand that the current is flowing through the motors to move the robot. They understand that one form of energy is being converted into another form.

There is another concept that we can teach with math and science. That concept is time. Using the code block, we send current to the motors for one second. We will change this value later to something more reasonable. It is important to note that the code does not have instructions for values that relate to miles per hour or even feet per minute. The values have nothing to do with the measurement of distance.

The values relate to energy and time. These two concepts are closely related to concepts taught in astronomy, physical science, and math. In space, distance is commonly measured in time. For example, the distance from the earth to the sun is 92.96 million miles or 146 million kilometers. Light takes 499 seconds to travel from the sun to the Earth. We call this One Astronomical unit. Light travels at 186,287 miles per second or 299,792 kilometers per second.

There are lots of numbers used to describe the distance from the Sun to the Earth. We can easily get confused when using miles or kilometers. How do we know the sun is that far away from the Earth? Did someone travel there to measure? Did we have a very long measuring tape? We used the constant speed of light to help find the distance. For the most part, light always travels at the same velocity. It is the same almost everywhere we measure. Light is constant. This makes the use of light a reliable measuring tool.

Light is measured in the amount of time it takes to travel from one place to another. The Sun is 499 light seconds from the Earth. The distance to the closest star system is 4.22 light-years. That is about 25 trillion miles or 40 trillion kilometers. A trillion is a number followed by 12 zeros. Time might be easier to understand.

We measure distance in time all the TIME! How long does it take to travel from your city or home town to another city? When children are fussing in the back seat they don’t ask, how many more kilometers ’til we get home? They as when are we getting there. They are already measuring distances in time.

Time is a central part of calculating velocity and acceleration. To determine velocity and acceleration we need a change in time and a change in position. The change in position is the distance traveled from one point to another. The calculation of force requires the calculation of acceleration. Acceleration is part of velocity.

We have strayed far away from the code for the robot. That is part of the point. We can extend and integrate a variety of concepts when using robots for STEM. Coding the robot is a means to an end.

Returning to the code

Let’s get back to the code block. This simple code instruction will help students learn and understand some principles of motion. Students will adjust the code parameters to learn and understand velocity and acceleration.

Update the code block so the mBot travels at half the potential energy for 3 seconds.

move code block with 3 seconds

To upload the code we need to go through a few steps. Connect one end of the USB cable to the mBot. Connect the other end to the USB port on your computer. Turn the mBot ON. Make sure to hold the mBot. Sometimes the mBot wheels will begin to spin. My students often lay the mBot on its back. This leaves their hands free to work with the application and the upload process.

The mBot wheels will roll because it begins to process the instructions in any code uploaded to it from a previous session. The code is saved in the mCore memory. The code in this memory is executed each time the robot is turned on. This is common with devices that have Microcontrollers. The code is cleared out by new code uploaded or by updating the Firmware.

Click the Events category. The code blocks in this category are used to start our instructions. These are conditions that need to be met before the mBot will begin executing the instructions. Some of the conditions include the clicking of a green flag and the press of the space key. These conditions are often used with Scratch and the development of interactive stories and games. These conditions don’t work well with our robot.

The condition block we need is the first one. When mBot(more) starts up. This block is grey. This means the block cannot be selected. We cannot add it to the canvas while it is grey. How can we select it then?

We are currently in test mode. Test mode does not actively connect to the mBot. We need to exit Test mode.

mBot start up event not available

Go to the bottom of the application and look for the Connect button. Above the button is an option for live or upload mode. Click the switch to change to upload mode.

upload mode

The mBot condition block is now available. The condition blocks for the Scratch development environment are grey. This means they are not available for our robot.

other blocks not available

Attach the mBot condition code block to the move code on the canvas.

mBot startup block attached

We need to open a communication link to the mBot from the program. This will allow us to upload the code to the robot. Go to the bottom of the application and click the Connect button.

Uploading is when we send content from our computer to another. We download when we get content from another computer.

connect button

A connection configuration box will open. This configuration box is used to select the USB communication port connected to the robot. The port will be different on Windows and Mac computers. The image below shows the connection port on a Mac computer. The connection is being directed to one of the USB ports.

The connection port on Windows is usually Com3. It can also be Com1 or Com2. Com stands for Communication.

USB communication for Mac

Click the port selector. The available communication ports will be listed. The communication port for the mBot on Mac has a special name. This port is /dev/tty.wchusbserial. The number after the name will depend on your Mac. The important part of the information is “wch”. This identifies the port that communicates with the mBot. Select this port.

other connection port options

Click the connect button.

connecting to the port

A new button appears below the Test button. The connect button changes to Disconnect. Above the Disconnect button is a button to upload our code to the mBot. Click the button to begin the upload process. Make sure the robot will not roll off a table before doing this!

upload button

The mBlock software will compile our instructions. This means the program is checking our instructions for mistakes. It is also converting our instructions into instructions the mCore board understands. The compilation process is both a code checker and a translator.

compilation of code message

The instructions are uploaded after the compilation process is complete. A progress bar will show the upload progress. The upload is usually quick. The mBot will run our instructions once the upload is complete.

upload progress indicator

Turn the robot off. Unplug the cable from the mBot. Leave the other end connected to the computer. We will be returning often to update the code. Each time we update the code it must be compiled and uploaded.

Set the robot on the floor and turn the power switch On. The robot will run the code again. It will do this every time we turn the mBot On.

Read More
Robotics Alex Robotics Alex

Sphero's weight, mass, and density

Sphero is a physical object. It has a mass and it has weight. We will use mass to determine buoyancy. Yes, Sphero floats.

Sphero’s weight mass and density

The Science

Sphero is a physical object. It has mass and it has weight. We will use mass to determine buoyancy. Yes, Sphero floats.

Mass is the amount of matter an object has. The mass of an object remains the same or constant.

The weight of an object is the affect of gravity on an object. The weight depends on the gravity. The gravity on Earth is constant for our purposes. Gravity is affected by altitude on Earth. There is a close connection between mass and weight but they are two separate things.

Gravity relies on the mass of the Earth. It also relies on the elevation of the object weighed. Objects on the surface of the earth feel a greater pull by gravity. Objects in orbit around the earth, like a satellite, don’t feel the pull of gravity as much. This is why objects in space are said to be weightless.

An astronaut on earth could weigh about 200 pounds. In space that same astronaut’s weight can’t be measured. This is because there is not gravity to push down on the weight scale.

This is what makes mass different from weight. The astronaut has not changed. His or her matter has remained the same. Everything is made of matter. Some matter is light and some is heavy. The measurement of this amount of matter is called mass. The more matter something has the greater it’s mass.

Sphero’s Weight

There are a variety of ways to weigh Sphero. The easiest is to use a kitchen scale. Sphero comes with a base for charging. We will use this base to prevent it from rolling off the scale. Get yourself a kitchen scale. Turn on the kitchen scale and place the charging base on the scale. The scale will read the weight of the charging base.

Sphero’s weight in ounces

We need to subtract this weight. There are a couple of ways to do this. The most obvious way is to take the base weight and subtract it from the total weight after adding the Sphero. Another way to eliminate the base weight is to use the Tare option on the scale. Most modern kitchen scales have this option. There is usually a button on the scale that reads Tare.

To use the Tare, press the Tare button on the scale. The scale will eliminate the base’s weight and display a zero. Just like the base was not on the scale.

TARE weight

Place Sphero on the base and read the weight on the scale. In Standard measurement, Sphero weighs approximately 6.35 ounces. In the Metric System, Sphero weighs 180 grams.

Sphero’s weight in grams

Sphero’s mass is 180 grams. The scale compensates for Earth’s gravity. Earth has a constant gravitational pull of 9.807 meters per second squared. The scale eliminates this force from our value.

A Balance scale

Let’s use a balance scale to check our value. Balance scales are used to measure mass. We use a balance scale to measure the mass of one object with the mass of another. We place one object on one side of the scale. On the other side we place objects that have a known mass. The objects are usually metal weights.

Sphero on a balance scale

The mass of the weights is marked on each. We place enough of these weights until the scale is balanced. The total mass placed on the scale is used as a measure of the mass on the other side.

Sphero weighs 180 grams on a balance scale

The the value of the weights placed on the other side of the balance total 180 grams. This agrees with the value from the kitchen scale.

This is part of the scientific process. We take measurements and then we need to verify those measurements. If the measurements are different then we need to understand why.

Buoyancy and Density

We know that Sphero floats. It is water tight. Make sure there are not cracks on your Sphero. These lessons cover buoyancy, density, and water displacement.The buoyancy of something depends on its density. Water has a density of 1. Objects that have a density greater than one will sink. Objects that have a density less than one will float. We will calculate the density of Sphero in a moment.

First, we need to know how we arrived at the density of water. Place a beaker on the kitchen scale. Press the Tare button to set the scale to zero. Pour 250 mL of water into the beaker. Read the measurement on the scale. Make sure the measurement units are in grams. The measurement is the same as the amount of milliliters we placed in the beaker.

To determine the density of water we divide the mass by the volume. The volume in milliliters is 250. The mass in grams is 250. The answer is one. The density of water is one.

Sphero’s Density

Sphero is enclosed in a plastic sphere. We will place Sphero into water and use it to learn about buoyancy and density. Buoyancy is the capacity for something to float. The density of an object has much to do with its ability to float.

We need a container with water. The container needs to have a way for us to measure the amount of water. A beaker is a good container to use if you have one large enough. I find that a two-cup kitchen measuring cup works well if a beaker isn't available. These measuring cups are available at any discount store for a few dollars. They have a nice handle to hold onto.

a regular kitchen measuring cup

Fill the container to the one-cup measurement. Add some food coloring to help you see the water level if necessary.

one cup of water with food coloring

Insert Sphero into the measuring cup. Sphero displaces the water in the measuring cup. Sphero forces the water up and around the measuring cup. The water level rises to one-and-three-quarter cups. Sphero displaces three-quarters of a cup of water.

Sphero displaces water in the measuring cup

Sphero doesn't completely float and it doesn't completely sink either. This is due to Sphero’s density.

To find the density of an object we need to divide the mass of the object by the volume. This is where all the math we did earlier comes together.

Sphero has a mass of 180 grams. It has a volume of 180 cubic centimeters. Sphero’s density is One! This is the same density as that of water. This explains why most of Sphero is submerged in water. Much like an iceberg.

All the science we just did would not be possible without the math we used in the previous lessons. This is that math science connection we are always wanting to make with students.

Read More