Microbit Cutebot, Best Diy Robot Kit for Beginners
Table of Contents
Microbit Robot:
Microbit Robot, Best Diy Robot Kit for Beginners, Micro:bit- Recently I got this Microbit Smart Cutebot a diy programmable Robot Car kit from Elecfreaks. So, let’s go ahead and start the Unboxing.
A line Following Map
Cutebot User Guide
I was really surprised by their user guide. If you just follow this user guide, I do not think you will need to visit any other website. This is because everything related to the robot is explained in it. Not only that, but it also explains how to write your first program and how to run it. There are a lot of examples covered. I will try to cover these examples and some other examples too.
AAA Batteries holder.
Micro:bit
This is the BBC micro:bit is an award-winning programmable device. It’s a small, low-cost, and easy-to-use microcontroller developed by the BBC (British Broadcasting Corporation) in collaboration with several partners. The micro:bit is designed to make coding and electronics accessible to students, teachers, and hobbyists.
This is the new micro:bit V2.21 version and it features
A micro USB connector to use with PC for programming. You can program it with Makecode, Microblocks, Javascript, and Python.
Reset and Power button
Battery Connector
BLE Antenna
A microphone
Microprocessor, ARM Cortex-M4 CPU – upgraded from a Cortex m0 at 16MHz to a Cortex m4 with a floating-point at 64MHz.
A Speaker
Accelerometer and compass and
Edge connector for accessories.
On the other side;
We have a microphone indicator
A touch Logo
25 Programmable LEDs
Two Buttons and
The pins are labeled as 0, 1, 2, 3V, and GND.
Memory has increased by 700% from 16KB to 128KB RAM and 256KB to 512KB flash which gives the device much more capability.
The board can provide 200mA to accessories, up from 90mA in the previous board versions.
And it can support both AI and machine learning.
HC-SR04 Ultrasonic Sensor
Robot Chassis
Finally, here comes the Robot chassis, it’s really a Cutebot. Its design is so attractive.
It has a power switch.
IO expansion ports.
IR Receiver module, you can use an IR Remote controller to control this cute little robot.
Two fully enclosed GA12-N20 DC micro gear deceleration motors with speed upto 300 RPM “rotations per minute”.
A battery port.
A buzzer.
Edge connector for the micro:bit board.
I2C interface
HC-SR04 Ultrasonic Sensor interface
Two RGB Headlights.
On the bottom side
There are two Rainbow LEDs
A pair of tracking sensors and
A universal wheel
Let’s assemble the parts and then we will start the programming.
You can assemble this robot in less than a minute. Don’t think of it as just a toy car; it’s a development kit.
By practicing with this robot, you and your children can greatly improve your programming skills. To get you started, I will first run some basic codes on this robot, and then we will also run the codes given in the user guide. Anyway, the Smart Cutebot is ready, so let’s start the programming.
Amazon Links:
Microbit Cutebot official link
*Disclosure: These are affiliate links. As an Amazon Associate I earn from qualifying purchases.
Open the makecode.microbit.org website and follow the steps
- Click on New Project.
- Give your Project a name.
- Click on the Code options, and select Blocks, JavaScript, and Python. You can also select Python only or JavaScript only. But I am going to continue with the first option. Finally, click on the Create button.
Let’s first take a tour of the editor.
On the left side is the Micro:bit Simulator; see what you code looks like running on a micro:bit!
Next is the Toolbox; drag out blocks of code from the Toolbox categories into the Workspace, snap blocks of code together to build your program.
Once your program is ready, click this download button to download your program onto the micro:bit.
With that Share button on the top, you can create a link to your project to share with others. So, that’s all about the editor tour.
CuteBot Extension:
To add CuteBot in the Toolbox, click on the extensions, search for the Cutebot, and click to add it to the toolbox.
Now if you click on the Cutebot, you will see the Cutebot blocks. Now, using these blocks we can control the motors, Headlights, we can monitor the state of IR Sensors, we can monitor the Ultrasonic Sensor, we can control Servos, and by using the IR module block; we can control the robot using an IR Remote controller.
Before, I am going to start the programming, first, I would like to share some basic information with you guys.
functions in the Arduino. So, on start is an event that runs when the program starts. Use this event to initialize your program.
As I said, forever is similar to the loop() function in the Arduino programming. So, if you want to run a part of your program continuously, you can place it in the forever loop or event.
Unlike other programming languages, you can also add and delete comments.
Apart from this you can duplicate blocks, and if you need help; simply click on the help and then you can read about that block in detail.
If you want to delete any block; simply select that block and while holding the mouse left button drag it to the toolbox and release the mouse left button.
And if you want to do it quickly than simply select the block and press the delete button on your keyboard.
To add a block; go to the desired category in the Toolbox, select the block and drag it to the workplace.
This was some basic information that I wanted to share with you, so that you don’t waste your time exploring these basic things.
Before starting programming, connect your robot to your PC or laptop using a micro USB port. Once connected, you will see a message. If not then you can go to the settings and click on the Connect Device and follow the instructions.
Example #1, CuteBot Headlights:
Let’s first control the RGB Headlights.
I want that when I turn ON the robot, it should first display Red, Green, and Blue colors one by one with a 1-second delay. Then, when it goes into the control forever event, it should display different colors with a 100ms delay. Let’s do it.
Go to the CuteBot category and select the “Set LED headlights” block.
Simply drag it and place it in the on start event.
Duplicate it three times, set it to all, and select Red, Green, and Blue colors. Next, go to the Basic category and from there select the pause (ms) block. We need this block to add a delay of 1000ms.
Now, follow the same exact steps but this time add blocks in the forever event.
Click the download button, and don’t forget to Turn ON the power switch.
Example #2, CuteBot Motors:
Next, we are going to control the CuteBot DC motors. We are going to control its forward, backward, left, and right movement. So, let’s do it.
Block for the DC motor is available in the CuteBot category and the pause (ms) block you can get from the Basic category.
For the practical demonstration watch the video tutorial given at the end of this article.
Example #3, CuteBot DC Motors & Headlights:
Next, we are going to use the DC Motors and Headlights all together. I want the headlights to stay OFF when the robot is moving in the forward direction, and I want the Left and Right Headlights to act as the indicator lights when the robot takes left and right turns.
For the practical demonstration watch the video tutorial given at the end of this article.
Example #4, Ultrasonic Sensor:
Next, we are going to use the Ultrasonic Sonic Sensor. I want the robot to stop when it detects an obstacle. Let’s do it.
You may be already quite familiar with the if condition. The if else block is available in the Logic category.
Drag it and place it in the forever event. Next, you will need the comparison block from the Logic category.
Drag it and place it on the true as you can see in the image below.
Next, go to the CuteBot category and from there select the HC-SR04 Sonar Unit and place it in the if condition. We are going to compare the HC-SR04 Ultrasonic Sensor distance with the preset value.
the following condition means, if the distance measured by the Ultrasonic Sensor in Inches is less than or equal to 5.
The stop the car immediately else set the motors speed at 20%. You can set any speed between 0 and 100.
Example #5, Obstacle Avoidance:
Now, let’s convert this into any obstacle avoidance robot, I want the robot to turn to the Right when it detects any obstacle. Let’s do it.
So far, we have covered Headlights, Ultrasonic Sensor, and DC Motors.
Example #6:
Next, we will learn how to use these 25 LEDs, and we will also use these Pushbuttons and touch logo. For these examples I have already removed the Ultrasonic sensor so that you can clearly see the LEDs, Touch Logo, and pushbuttons.
Using show leds block, you can draw any custom icon. It’s available in the Basic category.
To display numbers, you can use the ‘show number’ block. This block is also available in the Basic category.
For ready-made icons, you can use the ‘show icon’ block. It’s available in Basic category. If you click on the down arrow, you will see lots of readymade icons.
You can use multiple icons to create cool animations.
To print any message, you can use the ‘show string’ block. It’s also available in Basic category. I am going to print Electronic Clinic.
To display different arrows, you can use the ‘show arrow’ block. It’s also available in the Basic category. You can click on the down arrow and select any arrow of your choice. Or if you need a special type of arrow, then you can use the show leds block to create a custom arrow.
Next, we are going to use the push buttons on the Microbit to display custom icons. For this, we will use a condition, let’s say if the Button A is pressed I want the cross icon to display. Else I want all the LEDs to remain OFF. Let’s do it.
Go to the Logic Category and select if else block. Drag it to the workplace and place it in the forever block.
Next, go to the Input category and select “button A is pressed” Block
Now, you can use the show leds block from the Basic Category to display custom icons.
This means if Button A is pressed then
Show this cross icon.
Else
Turn OFF all the Leds.
Next, we are going to use the Logo and let me tell you, it’s use is just like the pushbuttons. Its also available in the Input category.
If the Logo is touched I want to display this “ X” icon.
Else
I want the center Led to remain ON.
Now, let’s use the Gesture Block. Its also available in the Input category and its use is just like the pushbuttons and logo. I simply replaced the logo with the gesture.
You can see we have different types of gestures, simply select the one you want. In my case, I am going to go with the shake gesture. I simply downloaded the code and I was able to display a custom icon whenever I would shake the robot. For the practical demonstration, watch the video tutorial given at the end of this article.
Example #7, Rainbow Leds:
These blocks are available in the Neopixel category. On the Cutebot, bottom side, there are two rainbow leds connected to P15_0 and P15_1. In the following code, you can see why I selected P15 and 2. Rest of the code is pretty straightforward.
I believe I have covered pretty much everything about this robot. There are many other examples in the user guide that you can try to further improve your programming skills.
Example #8, Line Tracking Robot:
We will try the Line-Tracking lesson from the user guide. The Cutebot has two tracking sensors which help it to move along black and white lines. It can also be used to detect the edges of a table.
This is the complete code.
When the tracking sensor on the left side detects no black line, set the speed of the left wheel to be faster than that of the right wheel to correct its movement.
When the tracking sensor on the right detects no black line, the speed of the right wheel has to be adjusted slower than that of the left in the same way.
When both tracking sensors detect black lines, move forward at a even speed.
Let’s upload the code.
The above code didn’t work the Cutebot was moving too fast. So, I modified the code a little bit and then it started to follow the line.
Read my article on how to trap a MicroBit robot inside a Circle.
Support me on Patreon for more videos and articles.
Watch Video Tutorial: