articles

Wireless mBot Car Racing On Figure 8 Track - Part 2: Before mBlock Programming

Tuesday, November 29, 2016

Assembling the mBot was pretty easy to do and best of all, you can start using it right away as it's plug and play. The mBot comes pre-programmed with a "line follower code" and "wall avoidance code" that allows the mBot to find its way by detecting walls and objects in front of its path. Simply turn on the mBot and press the "push button" (see picture below) and the mBot starts doing its thing! It's pretty cool!
As mentioned in Part 1, the mBot uses a 2.4 GHz wireless adapter, which is the same technology you find in wireless mice and routers.With the 2.4G mBot version there is no pairing required and the connection is solid and stable. You control the mBot via IR remote, desktop PC or laptop to play with it.
the IR remote uses a CR2025 cell coin battery

You can power the mBot wireless robot car with either a 3.7V DC lithium battery or four AA batteries. The 3.7V lithium battery uses a 2-pin jst-ph connector.

Another great thing about the mBot is that the 2.4G wireless adapter can be replaced with a Bluetooth adapter so you can control the mBot via Bluetooth smartphone. The mBot is very intuitive to assemble and you do get an instruction manual with illustration pictures showing you in detail how the mBot is put together and where each wire goes.

The mBot comes with its own ultrasonic sensor though you can use an ultrasonic 4-pin sensor like the Ranger V2.0 together with the mBot ultrasonic sensor.
the mBot supports Bluetooth 2.1 and Bluetooth 4.0 or higher, as well as iOS 7 or higher

You can fully program the mBot using Scratch 2.0 as the programming language, which uses graphical programming so it's very easy to understand without having a steep learning curve. If you are in the process of learning Scratch 2.0, the mBot is a really cool way to put into practice the Scratch programming skills you learn.

Here are the first steps before you start programming with mBlock:

1) Download the mBlock software from http://www.mblock.cc/ and install it on your PC or laptop.


2) Install the Arduino Driver so that your PC can communicate with the mBot. Go to Connect->Install Arduino Driver
3) Connect the mBot to your PC/laptop using the USB cable or 2.4gHz adapter included in the mBot kit, and open mBlock. Go to Connect-> Serial Port -> (port ID). The portID is the port that you are connected to. If you are connecting via 2.4gHz module, Go to Connect->2.4G Serial->Connect.

4. Go to Boards->mBot (mCore). If you are using the mBot Version 1.1 then the board to select is the mCore.

The mBot line follower code allows the mBot to literary follow a line thanks to the line follower sensor mounted on the mBot, which allows the mBot to detect "light" and "dark" colors.
The Figure 8 racing track is black and white; hence why the mBot is able to race around the Figure 8 track. The mBot line follower code is as follows:

Here is the mBot racing on a Figure 8 track:
In conclusion,with the MakeBlock mBot you get a nice introduction to robotics and basic programming concepts so you get to grasp very easily how to code, program and engineer a robot. Once assembled, the mBot is really fun to play with and it is as enjoyable as playing with a radio control car. For now, I leave you with a very naughty mBot racing loose on my living room floor (naughty naughty):

You Might Also Like

0 comments

About Gadget Explained

Connect With Gadget Explained