mBot: Learning robotics the easy way.

OMG! Still the first 3 months of 2020 and the world moves almost to a halt.

The Corona Virus stretched it legs and caused many inconveniences during the later part of 2019 and now going to the first quarter of 2020 causing a pandemic which affected the world. I lived in the Philippines and most provinces is in a state of calamity and community quarantine. In Cebu (where I live) we are requested just to stay at home to avoid spreading the virus. School was stopped and suddenly my kid have a lot of time and nothing to do. Her plan is just o binge watch on Netflix for the whole duration of the quarantine. I really don’t like that plan and decided on something to have her occupied.

Analysis, programming and a lot of time.

My daughter have asked me before to teach her programming, I am a bit reluctant to introduce it to her. She showed interest so maybe we can try it out. Programming involves mostly analysis and problem solving. It is worth noting that she does have a good memory, but I am not sure with her analytic skills. The situation just created the right time to teach her programming. I formulated a plan on how to teach her programming.

Learn by experience, teach by experience and improvise along the way.

  • The problem
  • My solution
  • Your solution
  • The difference

Originally my plan was to create gizmos and have them controlled by raspberry pi, but I realized that using a off the shelf platform like Lego Mindstorm would be much easier. The problem was Lego Mindstorm is not locally available and the kit is too expensive. The kit from MakeBlock is not that flashy but not that expensive and is available locally.

Introducing MakeBlock’s mBot

The basic MakeBlock kit is called mBot, this is a programmable STEAM education robot. STEAM stands for Science, Technology, Engineering Arts, Mathematics. In a nutshell it should get everything I want covered.

The kit comes in a 2 version, the 2.4GHz Wireless Serial and the Bluetooth version. I got the 2.4G version because I was expecting that this also supports Bluetooth considering that this kit is more expensive, but sad to say.. this version does not support Bluetooth. The colors could be Pink and Blue, I got the Blue kit.

The kit is packed in a blue and white box with some tidbits about the mBot. Openning the box you can find that this is divided into 2 layers. The first layer contains the mCore and the mBot body. The second layer contains the accessories and all the other parts.

The mCore

This is main controller board which is housed on a frosted acrylic case. This board runs on Arduino Uno and all the other supporting controller is implemented on this board. The board also houses 2 RGB LEDs, 1 On Board Switch and a pair of IR Reciever and Transmitter. There is a Type B USB for connecting to host as well as a Power Switch. The board powered by either a 3.7 LiPo or a 6V AA Pack but not both and they should not be connected at the same time. The batteries are not included with the kit.

Mobot philosophy and design

MakeBlock mBot follows the mobot philosophy and design, there is a pair of drive wheels and a third caster wheel for balance. The drive wheels are powered individually by a geared DC motor. The caster wheel is not powered by any motor and is made of plastic. The main DC motor for the wheels is also directly connected to the main board. The main wheels are made of 2 parts, a plastic and a rubber for traction.

The expansion boards

The MakeBlock approach on the “expand and customize robot” is cleanly implemented. While the main board houses the main controller and supporting controllers. The input and output devices can be added on by RJ25. The kit includes a Ultrasonic sensor and a Line tracing senor. There are other sensors that can be bought as an add-on.

The IR Remote

MakeBlock provide a remote that can interact with the mBot by the IR receiver. The remote is powered by a single CR2025 coin cell which is also not included with the kit. The IR reciever is sensitive and you can point the remote at the sides and still this can be received and interpreted by the robot.

Visual Programming

MakeBlock’s mBlock software is based on Scratch 2.0, which is a visual programming approach. With the visual programming approach, we don’t need to mind language syntax and just go with logic making programs by using blocks. Going to the editor, we will be greeted by a big work space as a the main window, a window for the devices and a Panda. The editor is really designed to make programming for kids fun.

The application is free for download from https://www.mblock.cc/en-us/download. The app can also run on the browser without needing it to be installed.

Programming the mBot in 2 ways

  • Tethered mode – the mBot is connected to the PC by USB or by the 2.4G wireless serial or by Bluetooth. Program upload and mBot Update can only be done by using the USB.
  • Standalone mode – the mBot runs the program internally without relying on the PC. The mBot should be connected by USB to upload the program.

In my opinion as a firmware engineer

MakeBlock really did great on the design with mBot. The construction is solid and safe. The whole kit contains enough peripherals to have a fun way to learn about robots. The software is well designed for kids. The total experience brings it close to real firmware development.

  • Programs starts with the entry point and the main program body.
  • Programs run sequentially and stops after all the blocks are run.
  • Loading the program to the robot takes a little bit more time compared with just running the program directly from mBlock
  • Loading the program goes thru the usual compile and upload procedure.
  • Running the program from mBlock is much slower compared with running the program loaded to the robot.

A short note on threads and arduino

To put it simply programs are running as Threads. Arduino Uno does not have HW support for multiple threads, this means that only a single thread of execution can be running at any time. In perspective to mBot, mBlock supports creating a program with multiple start points, which could look like multiple thread programming, but because of Arduino Uno does not have HW support for multiple threads, the same program will run differently if loaded to the robot.

For instance this program below will run differently from tethered or from standalone mode.