Description

This ebook will introduce you to the mBot, the world’s friendliest educational robotics platform. The mBot is an Arduino-based, two-wheel robot that comes with build-in sensors and actuators, and that you can program using Scratch, a graphical programming language.

The mBot is also extensible, with a lot of components available that you can use to build your own robotic creations.

In this ebook, I will show you how to assemble the mBot, discuss the additional hardware options, and demonstrate how to program it on your tablet and your Windows or Mac OS computer.

The main project involves programming the mBot to follow an arbitrary black line on the floor. In this project we must combine our robot’s sensors and actuators efficiently to enable it to stay on the line while it travels on it as quickly as possible.

At first glance, you may think that getting a robot to follow a line is easy. That’s not true for a robot.

As the programmer, you must “teach the robot” to do something that to a human is intuitive. You need to extract the intuitive understanding of how to follow a line and convert it into code.

The required hardware is the mBot itself, and a computer (Windows or Mac OS). You can purchase an mBot direct from its manufacturer, Makeblock, or from your local reseller. You can download the software from free from the Makeblock website.

This ebook has a video companion course titled “Arduino Robotics with the mBot“. If you learn better through video, you will find “Arduino Robotics with the mBot” particularly interesting.

SECTION 1 – GETTING TO KNOW YOUR MBOT ………….. 5
The mBot parts ………………………………………………………………………………………………………. 6
Assembly: Attaching the DC Motors, Line Follower and Range Finder …………………………. 23
Assembly: mCore tour and Bluetooth module …………………………………………………………… 33
Assembly: Wiring batteries, and attaching the mCore ………………………………………………… 38
A quick demonstration …………………………………………………………………………………………… 44

SECTION 2 – MBOT PROGRAMMING OPTIONS …………. 51
Options for programming the mBot ………………………………………………………………………….. 52
Demonstration of the mBlockly ……………………………………………………………………………….. 57
Demonstration of the MakeBlock …………………………………………………………………………….. 71
Demonstration of the mBlock ………………………………………………………………………………….. 85
Recapping Section 2 ……………………………………………………………………………………………… 90

SECTION 3 – GETTING STARTED WITH MBLOCK ……… 92
Programming the mBot on your computer using mBlock …………………………………………….. 93
Install mBlock on your computer ……………………………………………………………………………… 94
A quick look at Scratch ………………………………………………………………………………………… 100
Creating and uploading your first program ……………………………………………………………….. 114
Motor control ………………………………………………………………………………………………………. 125
Moving left, right, backwards ………………………………………………………………………………… 130
Recapping Section 3 ……………………………………………………………………………………………. 139

SECTION 4 – LOOPS, DECISIONS, AND SENSORS ….. 141
Programming structures and sensors …………………………………………………………………….. 142
The loop …………………………………………………………………………………………………………….. 144
The distance/proximity sensor ………………………………………………………………………………. 153
The “if” and “if…else” control structures ………………………………………………………………….. 163
The buzzer …………………………………………………………………………………………………………. 171
Recapping Section 4 ……………………………………………………………………………………………. 175

SECTION 5 – THE LINE FOLLOWER PROGRAM ………. 177
The line sensor …………………………………………………………………………………………………… 178
Adding the motors ……………………………………………………………………………………………….. 186
Turning around at the end of the line ……………………………………………………………………… 192
Using a button to start and stop …………………………………………………………………………….. 199
Custom blocks (functions) …………………………………………………………………………………….. 205
Recapping Section 5 ……………………………………………………………………………………………. 215

SECTION 6 – OTHER THINGS YOU SHOULD KNOW … 216
Restoring the firmware …………………………………………………………………………………………. 218
Restoring the default program ………………………………………………………………………………. 224
Recapping Section 6 ……………………………………………………………………………………………. 227

Appendix A – Glossary …………………………………………………………………………………………. 228

Share your thoughts!

Let us know what you think...

What others are saying

There are no contributions yet.

×

Login

Register

Your personal data will be used to support your experience throughout this website, to manage access to your account, and for other purposes described in our privacy policy.

Continue as a Guest

Don't have an account? Sign Up

You may also like…

  • Arduino Robotics with the mBot

    $50.00

Getting Started with mBot (eBook)

eBook in PDF format, printable

Buy this ebook. If you have a discount coupon, please apply it in the shopping cart page.
Get it for $28