Ks0356 keyestudio Micro:bit Mini Smart Robot Car: Difference between revisions

From Keyestudio Wiki
Jump to navigation Jump to search
 
(31 intermediate revisions by the same user not shown)
Line 6: Line 6:
Moreover, supply the power by 18650 batteries, supporting charge when run out of power. You will be able to adjust the motor speed.<br>
Moreover, supply the power by 18650 batteries, supporting charge when run out of power. You will be able to adjust the motor speed.<br>
This micro:bit robot is a perfect toy for kids to start learning robotics. The plug-and-play allow children to quickly learn graphic programming in entertaining, nurturing children's interest in science and logical thinking.<br>
This micro:bit robot is a perfect toy for kids to start learning robotics. The plug-and-play allow children to quickly learn graphic programming in entertaining, nurturing children's interest in science and logical thinking.<br>
<span style=color:red>Note: <big>'''we adopt V1.5 micro:bit in the whole tutorial, but our tutorial is also compatible with the latest version micro:bit.
When doing experiment with latest micro:bit, you need to transfer code into Makecode online editor first, save code again then download it to micro:bit.'''</big></span>


<br>
<br>
==Specifications==
==Specifications==
* Voltage: 4.2-5.5V
* Voltage: 4.2-5.5V
Line 76: Line 80:
|align="center"| M3 Nickel plated nut
|align="center"| M3 Nickel plated nut
|align="center"| 2
|align="center"| 2
|align="center"| <br>[[File:M3 Nickel.png|200px|frameless|thumb]]<br>
|align="center"| <br>[[File:M3 Nickel.png|100px|frameless|thumb]]<br>
|-
|-


Line 103: Line 107:
'''a.''' Firstly prepare all the assembly components. Place them together before install the micro:bit robot car.
'''a.''' Firstly prepare all the assembly components. Place them together before install the micro:bit robot car.
<br>[[File:ks0356 a.png|700px|frameless|thumb]]<br>
<br>[[File:ks0356 a.png|700px|frameless|thumb]]<br>
 
<br>
'''b.''' The first step should mount 2pcs hex copper pillar and 2pcs M3 Nickel plated nut on the front of car shield.
'''b.''' The first step should mount 2pcs hex copper pillar and 2pcs M3 Nickel plated nut on the front of car shield.
<br>[[File:ks0356 b.png|700px|frameless|thumb]]<br>
<br>[[File:ks0356 b.png|700px|frameless|thumb]]<br>
 
<br>
'''c.''' Connect the JST PH2.0MM-5PIN double-head cable to line tracking sensor.  
'''c.''' Connect the JST PH2.0MM-5PIN double-head cable to line tracking sensor.  
<br>[[File:ks0356 c.png|700px|frameless|thumb]]<br>
<br>[[File:ks0356 c.png|700px|frameless|thumb]]<br>
 
<br>
'''d.''' Then fix the line tracking sensor and W420 steel universal wheel onto the hex copper pillar on the car shield using 2pcs M3*6MM round-head screws.   
'''d.''' Then fix the line tracking sensor and W420 steel universal wheel onto the hex copper pillar on the car shield using 2pcs M3*6MM round-head screws.   
<br>[[File:ks0356 d-1.png|700px|frameless|thumb]]  [[File:ks0356 d-2.png|700px|frameless|thumb]]<br>
<br>[[File:ks0356 d-1.png|700px|frameless|thumb]]  [[File:ks0356 d-2.png|700px|frameless|thumb]]<br>
 
<br>
'''e.''' After that, mount the 2pcs N20 motor wheels into the DC motor.  
'''e.''' After that, mount the 2pcs N20 motor wheels into the DC motor.  
<br>[[File:ks0356 e-1.png|700px|frameless|thumb]]  [[File:ks0356 e-2.png|700px|frameless|thumb]]<br>
<br>[[File:ks0356 e-1.png|700px|frameless|thumb]]  [[File:ks0356 e-2.png|700px|frameless|thumb]]<br>
 
<br>
'''f.''' Now, we insert the ultrasonic sensor and micro:bit main board into the car shield.
'''f.''' Now, we insert the ultrasonic sensor and micro:bit main board into the car shield.
<br>[[File:ks0356 f-1.png|700px|frameless|thumb]]  [[File:ks0356 f-2.png|700px|frameless|thumb]]<br>
<br>[[File:ks0356 f-1.png|700px|frameless|thumb]]  [[File:ks0356 f-2.png|700px|frameless|thumb]]<br>
 
<br>
'''g.''' Connect the JST PH2.0MM-5PIN cable connected to line tracking sensor to the car shield.
'''g.''' Connect the JST PH2.0MM-5PIN cable connected to line tracking sensor to the car shield.
<br>[[File:ks0356 g.png|700px|frameless|thumb]]<br>
<br>[[File:ks0356 g.png|700px|frameless|thumb]]<br>
 
<br>
'''h.''' Finally, insert the 18650 battery into the car shield.
'''h.''' Finally, insert the 18650 battery into the car shield.
<br>[[File:ks0356 h.png|700px|frameless|thumb]]<br>
<br>[[File:ks0356 h.png|700px|frameless|thumb]]<br>
<br>
'''i.''' Congrats! The mini micro:bit robot car is installed well. Pretty simple.


'''i.''' Congrats! The mini micro:bit robot car is installed well. Pretty simple.
<br>
<br>
==micro:bit Driver Installation==
==micro:bit Driver Installation==
Next, let’s install the driver for micro:bit main board.<br>
Next, let’s install the driver for micro:bit main board.<br>
'''1)''' First of all, connect the micro:bit to your computer using a USB cable.
'''1)''' First of all, connect the micro:bit to your computer using a USB cable.
<br>[[File:361 3-1-1.jpg|500px|frameless|thumb]]<br>
<br>[[File:361 3-1-1.jpg|500px|frameless|thumb]]<br>
 
<br>
'''2)'''Then, double click the [https://drive.google.com/open?id=1MDYYjSwXjA0M1ZoUkIOmo_awPfpM9iz9 driver software] to install it. Here you can click the icon below to download it.[[File:361 3-1-2.png|50px|frameless|thumb]]<br>
'''2)'''Then, double click the [https://drive.google.com/open?id=1MDYYjSwXjA0M1ZoUkIOmo_awPfpM9iz9 driver software] to install it. Here you can click the icon below to download it.[[File:361 3-1-2.png|50px|frameless|thumb]]<br>
<br>[[File:361 3-1-3.png|500px|frameless|thumb]]<br>
<br>[[File:361 3-1-3.png|500px|frameless|thumb]]<br>
 
<br>
'''3)''' After that, click Next to continue the installation.  
'''3)''' After that, click Next to continue the installation.  
<br>[[File:361 3-1-4.png|500px|frameless|thumb]]<br>
<br>[[File:361 3-1-4.png|500px|frameless|thumb]]<br>
 
<br>
'''4)''' Wait the driver installing finished.  
'''4)''' Wait the driver installing finished.  
<br>[[File:361 3-1-5.png|500px|frameless|thumb]]<br>
<br>[[File:361 3-1-5.png|500px|frameless|thumb]]<br>
 
<br>
'''5)''' Wait the driver installing finished.  
'''5)''' Wait the driver installing finished.  
<br>[[File:361 3-1-6.png|500px|frameless|thumb]]<br>
<br>[[File:361 3-1-6.png|500px|frameless|thumb]]<br>
 
<br>
'''6)''' Driver installation completed, then you can right click the “Computer” —> “Properties”—> “Device Manager”.  
'''6)''' Driver installation completed, then you can right click the “Computer” —> “Properties”—> “Device Manager”.  
<br>[[File:361 3-1-7.png|500px|frameless|thumb]]<br>
<br>[[File:361 3-1-7.png|500px|frameless|thumb]]<br>
Line 150: Line 154:
<br>[[File:361 3-1-8.png|500px|frameless|thumb]]<br>
<br>[[File:361 3-1-8.png|500px|frameless|thumb]]<br>


<br>
==micro:bit Example Use==
==micro:bit Example Use==
<br>
<br>
Line 156: Line 161:
<br>[[File:Ks0305-6.png|800px|frameless|thumb]]<br>
<br>[[File:Ks0305-6.png|800px|frameless|thumb]]<br>
<br>
<br>
===Step 2: Program It===
===Step 2: Program It===
Using micro bit MakeCode Block editor https://makecode.microbit.org/, write your first micro:bit code. <br>
Using micro bit MakeCode Block editor https://makecode.microbit.org/, write your first micro:bit code. <br>
Line 168: Line 174:
Here you can name the project as LED1, then click “Save”. Shown below.
Here you can name the project as LED1, then click “Save”. Shown below.
<br>[[File:Ks0305-3.png|600px|frameless|thumb]]<br>
<br>[[File:Ks0305-3.png|600px|frameless|thumb]]<br>
 
<br>
Once the hex file has downloaded, copy it to your micro:bit just like copying a file to a USB drive. On Windows find the microbit-LED1 file, you can right click and choose "Send To→MICROBIT."
Once the hex file has downloaded, copy it to your micro:bit just like copying a file to a USB drive. On Windows find the microbit-LED1 file, you can right click and choose "Send To→MICROBIT."
<br>[[File:Ks0305-4.png|600px|frameless|thumb]]<br>   
<br>[[File:Ks0305-4.png|600px|frameless|thumb]]<br>   
Line 180: Line 186:
You can power it using USB cable or battery. The battery holder need to connect two 1.5V AA batteries. Shown below.  
You can power it using USB cable or battery. The battery holder need to connect two 1.5V AA batteries. Shown below.  
<br> [[File:Ks0305-7.png|800px|frameless|thumb]] <br>
<br> [[File:Ks0305-7.png|800px|frameless|thumb]] <br>
<br>
<br>
==micro:bit Pins==
==micro:bit Pins==
Before getting started with the following projects, first need to figure out each pin of micro:bit main board. Please refer to the reference diagram shown below.
Before getting started with the following projects, first need to figure out each pin of micro:bit main board. Please refer to the reference diagram shown below.
<br>[[File:MB0098 英文版 (7).jpg|600px|frameless|thumb]]<br>
<br>[[File:MB0098 英文版 (7).jpg|600px|frameless|thumb]]<br>
The BBC micro:bit has 25 external connections on the edge connector of the board, which we refer to as ‘pins’. The edge connector is the grey area on the right side of the figure above. There are five large pins, that are also connected to holes in the board labelled: 0, 1, 2, 3V, and GND. And along the same edge, there are 20 small pins that you can use when plugging the BBC micro:bit into an edge connector.<br>
The BBC micro:bit has 25 external connections on the edge connector of the board, which we refer to as ‘pins’. The edge connector is the grey area on the right side of the figure above. There are five large pins, that are also connected to holes in the board labelled: 0, 1, 2, 3V, and GND. And along the same edge, there are 20 small pins that you can use when plugging the BBC micro:bit into an edge connector.<br>
 
<br>
Note that it read from the BBC micro:bit official website. More reference you can click the link below:<br>
Note that it read from the BBC micro:bit official website. More reference you can click the link below:<br>
'''BBC micro bit Pins:''' http://microbit.org/guide/hardware/pins/ <br>
'''BBC micro bit Pins:''' http://microbit.org/guide/hardware/pins/ <br>
Line 199: Line 205:
<br>
<br>
==Learning Projects==
==Learning Projects==
===Playing Music===
===Playing Music===


Line 210: Line 217:
<br>[[File:robot shield.png|400px|frameless|thumb]]<br>
<br>[[File:robot shield.png|400px|frameless|thumb]]<br>


 
<br>
'''Test Code'''<br>
'''Test Code'''<br>
<br>[[File:ks0356 code1.png|700px|frameless|thumb]]<br>
<br>[[File:ks0356 code1.png|700px|frameless|thumb]]<br>


 
<br>
'''Test Result'''<br>
'''Test Result'''<br>
Send well the test code to micro:bit main board, then insert the micro:bit main board into the micro:bit robot shield. Connect a 18650 battery to the shield, and turn the POWER and BUZZER switch ON. <br>
Send well the test code to micro:bit main board, then insert the micro:bit main board into the micro:bit robot shield. Connect a 18650 battery to the shield, and turn the POWER and BUZZER switch ON. <br>
Line 228: Line 235:
In the experiment, we drive the 25 LED lights show a big heart and a small heart images.<br>
In the experiment, we drive the 25 LED lights show a big heart and a small heart images.<br>


 
<br>
'''Test Code'''<br>
'''Test Code'''<br>
<br>[[File:ks0356 code2.png|400px|frameless|thumb]]<br>
<br>[[File:ks0356 code2.png|400px|frameless|thumb]]<br>


 
<br>
'''Test Result'''<br>
'''Test Result'''<br>
<br>[[File:ks0356 Result2.png|700px|frameless|thumb]]<br>
<br>[[File:ks0356 Result2.png|700px|frameless|thumb]]<br>
Line 242: Line 249:
'''Description'''<br>
'''Description'''<br>
The micro:bit robot shield has a built-in TB6612FNG chip. When using, you just need to insert the micro:bit main board into the shield, and send the test code to micro:bit main board. Insert well the 18650 battery into the shield to control the two motors rotate, thus control the micro:bit car run.<br>
The micro:bit robot shield has a built-in TB6612FNG chip. When using, you just need to insert the micro:bit main board into the shield, and send the test code to micro:bit main board. Insert well the 18650 battery into the shield to control the two motors rotate, thus control the micro:bit car run.<br>
 
<br>
'''Below is a table of TB6612FNG chip pins (PWM range of 0~1023)'''
'''Below is a table of TB6612FNG chip pins (PWM range of 0~1023)'''
<br>[[File:TB6612FNG chip pins.png|600px|frameless|thumb]]<br>
<br>[[File:TB6612FNG chip pins.png|600px|frameless|thumb]]<br>
<br>
<br>
 
<br>
'''Test Code'''<br>
'''Test Code'''<br>
<br>[[File:ks0356 code3.png|700px|frameless|thumb]]<br>
<br>[[File:ks0356 code3.png|700px|frameless|thumb]]<br>
Line 254: Line 261:
Send well the test code to micro:bit main board, then insert the micro:bit main board into the car shield, and connect a 18650 battery into the car shield. <br>
Send well the test code to micro:bit main board, then insert the micro:bit main board into the car shield, and connect a 18650 battery into the car shield. <br>
Turn the POWER switch ON. The micro:bit car will go forward for 3 seconds, backward for 3 seconds, stop for 3 seconds, turn left for 3 seconds and turn right for 3 seconds, repeatedly.
Turn the POWER switch ON. The micro:bit car will go forward for 3 seconds, backward for 3 seconds, stop for 3 seconds, turn left for 3 seconds and turn right for 3 seconds, repeatedly.
<br>
<br>


=== Line Tracking ===
=== Line Tracking ===
====Test the tracking sensor====
====Test the tracking sensor====


Line 267: Line 276:
<br>[[File:line-2.jpg|400px|frameless|thumb]]<br>
<br>[[File:line-2.jpg|400px|frameless|thumb]]<br>


 
<br>
'''TECH SPECS'''<br>
'''TECH SPECS'''<br>
* Operating Voltage: 3.3-5V(DC)
* Operating Voltage: 3.3-5V(DC)
* Interface: 5Pin connector
* Interface: 5Pin connector
* Output Signal: digital signal
* Output Signal: digital signal
<br>
<br>
'''Test Code'''<br>
'''Test Code'''<br>
<br>[[File:ks0356 code4.png|500px|frameless|thumb]]<br>
<br>[[File:ks0356 code4.png|500px|frameless|thumb]]<br>
Line 281: Line 290:
Send the test code to micro:bit main board, then insert the micro:bit main board into the car shield and connect a 18650 battery, turn the POWER switch ON.
Send the test code to micro:bit main board, then insert the micro:bit main board into the car shield and connect a 18650 battery, turn the POWER switch ON.
At this moment, the micro:bit LED matric has no display.<br>
At this moment, the micro:bit LED matric has no display.<br>
But if approach your finger to the first tracking sensor (S1), the LED matrix will showⅠin the middle;<br>
But if approach your finger to the first tracking sensor (S1), the LED matrix will show '''Ⅰ'''in the middle;<br>
Approach your finger to the second tracking sensor (S2), the LED matrix will showⅡ;<br>
Approach your finger to the second tracking sensor (S2), the LED matrix will show '''Ⅱ''';<br>
Approach your finger to the third tracking sensor (S3), the LED matrix will show Ⅲ;<br>
Approach your finger to the third tracking sensor (S3), the LED matrix will show '''''';<br>
<br>[[File:巡线.png|400px|frameless|thumb]]  [[File:巡线 (2).png|400px|frameless|thumb]]  [[File:巡线 (3).png|400px|frameless|thumb]]<br>
<br>[[File:巡线.png|500px|frameless|thumb]]  <br>
<br>[[File:巡线 (2).png|430px|frameless|thumb]]  [[File:巡线 (3).png|450px|frameless|thumb]]<br>




<br>
<br>
====Line Tracking Car====
====Line Tracking Car====
'''Description'''<br>
'''Description'''<br>
In the previous section, we have introduced the principle and application of line tracking module and motor driving. After that, combine the tracking sensor and module to build a line following car. <br>
In the previous section, we have introduced the principle and application of line tracking module and motor driving. After that, combine the tracking sensor and module to build a line following car. <br>
So at first what does line tracking mean? It refers to follow the line trajectory. You might often see some robots always follow or track a black line.  
So at first what does line tracking mean? It refers to follow the line trajectory. You might often see some robots always follow or track a black line.  
<br>
<br>
'''How does it work?''' <br>
'''How does it work?''' <br>
It uses the tracking sensor to detect the black track on the pavement, and detection signal will feed back to the micro:bit main board. Then micro:bit main board will analyze and judge the collected signals to control and drive the motor in time, thus can adjust the car’s turning direction. <br>
It uses the tracking sensor to detect the black track on the pavement, and detection signal will feed back to the micro:bit main board. Then micro:bit main board will analyze and judge the collected signals to control and drive the motor in time, thus can adjust the car’s turning direction. <br>
That is why the micro:bit car can automatically follow the black track, achieving the automatic line tracking function.
That is why the micro:bit car can automatically follow the black track, achieving the automatic line tracking function.
<br>
<br>
'''Programming Thinking'''<br>
'''Programming Thinking'''<br>
'''①'''At first judge the middle tracking sensor. If it detects a black line, no matter detect a black line on either side, the micro:bit car always goes forward.
'''①'''At first judge the middle tracking sensor. If it detects a black line, no matter detect a black line on either side, the micro:bit car always goes forward.
Line 305: Line 316:
If the right sensor detects a black line, but the left sensor doesn’t, the micro:bit car will turn right; <br>
If the right sensor detects a black line, but the left sensor doesn’t, the micro:bit car will turn right; <br>
If all three sensors do not detect a black line, the micro:bit car will stop.
If all three sensors do not detect a black line, the micro:bit car will stop.
<br>
<br>
'''Test Code'''<br>
'''Test Code'''<br>
<br>[[File:ks0356 code5.png|700px|frameless|thumb]]<br>
<br>[[File:ks0356 code5.png|700px|frameless|thumb]]<br>
<br>
<br>
'''Test Result'''<br>
'''Test Result'''<br>
Send the test code to micro:bit main board, then insert the micro:bit main board into the car shield and connect a 18650 battery, turn the POWER switch ON.
Send the test code to micro:bit main board, then insert the micro:bit main board into the car shield and connect a 18650 battery, turn the POWER switch ON.
Line 326: Line 337:
'''Description'''<br>
'''Description'''<br>
There is an animal called bat in nature. The bats can fly at night, not depend on its eyes, but on its ears and vocal organs. When the bat flies, it will emit a scream, an ultrasonic signal that humans cannot hear because of its high audio frequency. If these ultrasonic signals hit other objects on the flight path, they will be reflected back immediately. After receive the returned information, the bats complete the whole process of listening, seeing, calculating and bypassing obstacles during the flutter.
There is an animal called bat in nature. The bats can fly at night, not depend on its eyes, but on its ears and vocal organs. When the bat flies, it will emit a scream, an ultrasonic signal that humans cannot hear because of its high audio frequency. If these ultrasonic signals hit other objects on the flight path, they will be reflected back immediately. After receive the returned information, the bats complete the whole process of listening, seeing, calculating and bypassing obstacles during the flutter.
<br>[[File:KS0313 3-2-1.png|800px|frameless|thumb]]<br>
<br>[[File:KS0313 3-2-1.png|300px|frameless|right]]
 
The principle of the ultrasonic module is as the same as the above principle. <br>
The principle of the ultrasonic module is as the same as the above principle. <br>
The ultrasonic module will emit the ultrasonic waves after trigger signal. When the ultrasonic waves encounter the object and are reflected back, the ultrasonic module outputs an echo signal, so it can determine the distance of object from the time difference between trigger signal and echo signal.<br>
The ultrasonic module will emit the ultrasonic waves after trigger signal. When the ultrasonic waves encounter the object and are reflected back, the ultrasonic module outputs an echo signal, so it can determine the distance of object from the time difference between trigger signal and echo signal.<br>
Line 334: Line 346:
<br>[[File:蓝色超声波.png|800px|frameless|thumb]]<br>
<br>[[File:蓝色超声波.png|800px|frameless|thumb]]<br>


 
<br>
'''TECH SPECS'''<br>
'''TECH SPECS'''<br>
* Operating Voltage: 5V(DC)
* Operating Voltage: 5V(DC)
Line 353: Line 365:
If the measured distance between an obstacle and ultrasonic module is less than 10cm, the micro:bit LED matrix will show a big prismatic image; <br>
If the measured distance between an obstacle and ultrasonic module is less than 10cm, the micro:bit LED matrix will show a big prismatic image; <br>
If the measured distance is greater than 10cm, the micro:bit LED matrix will show a small prismatic image.  
If the measured distance is greater than 10cm, the micro:bit LED matrix will show a small prismatic image.  
<br>[[File:超声波避障测试.jpg|400px|frameless|thumb]]  [[File:超声波避障测试 (2).jpg|400px|frameless|thumb]]
<br>[[File:超声波避障测试.png|440px|frameless|thumb]]  [[File:超声波避障测试 (2).png|400px|frameless|thumb]]


<br>
<br>
==== Ultrasonic Obstacle Avoiding Car====
==== Ultrasonic Obstacle Avoiding Car====
'''Description'''<br>
'''Description'''<br>
Line 364: Line 377:
<br>[[File:蓝色超声波.png|700px|frameless|thumb]]<br>
<br>[[File:蓝色超声波.png|700px|frameless|thumb]]<br>


 
<br>
'''Programming Thinking'''<br>
'''Programming Thinking'''<br>
'''①'''At first, use a ultrasonic module to measure the distance between the micro:bit car and an obstacle ahead.<br>
'''①'''At first, use a ultrasonic module to measure the distance between the micro:bit car and an obstacle ahead.<br>
Line 373: Line 386:
<br>[[File:ks0356 code7.png|700px|frameless|thumb]]<br>
<br>[[File:ks0356 code7.png|700px|frameless|thumb]]<br>


 
<br>
'''Test Result'''<br>
'''Test Result'''<br>
Send the test code to micro:bit main board, then insert the micro:bit main board into the car shield and connect a 18650 battery, turn the POWER switch ON.<br>
Send the test code to micro:bit main board, then insert the micro:bit main board into the car shield and connect a 18650 battery, turn the POWER switch ON.<br>
Line 379: Line 392:
<br>[[File:超声波避障.jpg|400px|frameless|thumb]]  
<br>[[File:超声波避障.jpg|400px|frameless|thumb]]  
<br>
<br>


===Infrared Avoiding Obstacles===
===Infrared Avoiding Obstacles===
Line 390: Line 402:
You can rotate the potentiometer on the shield to adjust the detection distance. It is better to adjust the potentiometer to make the SIG1/SIG2 LED in a state between on and off. The detection distance is the best, almost 10cm.
You can rotate the potentiometer on the shield to adjust the detection distance. It is better to adjust the potentiometer to make the SIG1/SIG2 LED in a state between on and off. The detection distance is the best, almost 10cm.
<br>[[File:ir.png|500px|frameless|thumb]]  
<br>[[File:ir.png|500px|frameless|thumb]]  
<br>
<br>
'''Test Code'''<br>
'''Test Code'''<br>
<br>[[File:ks0356 code8.png|700px|frameless|thumb]]<br>
<br>[[File:ks0356 code8.png|700px|frameless|thumb]]<br>
<br>
<br>
'''Test Result'''<br>
'''Test Result'''<br>
Send the test code to micro:bit main board, then insert the micro:bit main board into the car shield and connect a 18650 battery, turn the POWER switch ON.<br>
Send the test code to micro:bit main board, then insert the micro:bit main board into the car shield and connect a 18650 battery, turn the POWER switch ON.<br>
Line 403: Line 415:
* If the left infrared sensor detects an obstacle, but the right sensor doesn’t, the left column of LED matrix will  light up.<br>
* If the left infrared sensor detects an obstacle, but the right sensor doesn’t, the left column of LED matrix will  light up.<br>
* If the right infrared sensor detects an obstacle, but the left sensor doesn’t, the right column of LED matrix will light up.<br>
* If the right infrared sensor detects an obstacle, but the left sensor doesn’t, the right column of LED matrix will light up.<br>
<br>[[File:红外避障测试.png|400px|frameless|thumb]]  [[File:红外避障测试1 (2).png|400px|frameless|thumb]]  
<br>[[File:红外避障测试.png|400px|frameless|thumb]]  [[File:红外避障测试1 (2).png|420px|frameless|thumb]]  
<br>[[File:红外避障测试1 (3).png|400px|frameless|thumb]]  
<br>[[File:红外避障测试1 (3).png|400px|frameless|thumb]]  


<br>


====Infrared Obstacle Avoiding Car====
====Infrared Obstacle Avoiding Car====
Line 411: Line 424:
In the previous project, we have combined sensor and micro:bit car shield to build a specific function car.<br>
In the previous project, we have combined sensor and micro:bit car shield to build a specific function car.<br>
Now, we use an infrared obstacle detector module and motor driving circuit on the micro:bit car shield to build an infrared obstacle avoiding car.
Now, we use an infrared obstacle detector module and motor driving circuit on the micro:bit car shield to build an infrared obstacle avoiding car.
 
<br>
'''How does it work?'''<br>
'''How does it work?'''<br>
We have introduced the principle of infrared obstacle detector module before. We can make use of two infrared obstacle detector modules integrated on the car shield to detect whether have obstacles on the both sides of micro:bit car. Thus control the car’s running state according to the testing interface.
We have introduced the principle of infrared obstacle detector module before. We can make use of two infrared obstacle detector modules integrated on the car shield to detect whether have obstacles on the both sides of micro:bit car. Thus control the car’s running state according to the testing interface.
Line 421: Line 434:
'''③'''If detects no obstacle at both sides, the car will go forward.<br>
'''③'''If detects no obstacle at both sides, the car will go forward.<br>
'''④'''If detects obstacles at both sides, the car will stop for 0.5 second, then go backward for 0.2 second and then turn left for 0.5 second.
'''④'''If detects obstacles at both sides, the car will stop for 0.5 second, then go backward for 0.2 second and then turn left for 0.5 second.
<br>
<br>
'''Test Code'''<br>
'''Test Code'''<br>
<br>[[File:ks0356 code9.png|700px|frameless|thumb]]<br>
<br>[[File:ks0356 code9.png|700px|frameless|thumb]]<br>
<br>
<br>
'''Test Result'''<br>
'''Test Result'''<br>
Send the test code to micro:bit main board, then insert the micro:bit main board into the car shield and connect a 18650 battery, turn the POWER switch ON.<br>
Send the test code to micro:bit main board, then insert the micro:bit main board into the car shield and connect a 18650 battery, turn the POWER switch ON.<br>
Line 452: Line 465:
'''Test Code'''<br>
'''Test Code'''<br>
<br>[[File:ks0356 code10.png|700px|frameless|thumb]]<br>
<br>[[File:ks0356 code10.png|700px|frameless|thumb]]<br>
<br>
<br>
'''Test Result'''<br>
'''Test Result'''<br>
Send the test code to micro:bit main board, then insert the micro:bit main board into the car shield and connect a 18650 battery, turn the POWER switch ON.
Send the test code to micro:bit main board, then insert the micro:bit main board into the car shield and connect a 18650 battery, turn the POWER switch ON.
Line 465: Line 478:


<br>
<br>
 
<br>
=== Bluetooth Controlled Car===
=== Bluetooth Controlled Car===
==== Bluetooth Test====  
==== Bluetooth Test====  
Line 479: Line 492:
Connect the micro:bit main board to your computer using a USB cable.
Connect the micro:bit main board to your computer using a USB cable.
<br>[[File:361 3-1-1.jpg|500px|frameless|thumb]]<br>
<br>[[File:361 3-1-1.jpg|500px|frameless|thumb]]<br>
<br>
Open micro:bit MakeCode Block editor: https://makecode.microbit.org/#editor.  
Open micro:bit MakeCode Block editor: https://makecode.microbit.org/#editor.  
Firstly click the '''Extensions'''.
Firstly click the '''Extensions'''.
<br>[[File:01.png|500px|frameless|thumb]]<br>
<br>[[File:01.png|600px|frameless|thumb]]<br>
<br>
Then click the '''Bluetooth'''.
Then click the '''Bluetooth'''.
<br>[[File:02.png|500px|frameless|thumb]]<br>
<br>[[File:02.png|600px|frameless|thumb]]<br>
 
<br>
TAP Remove extensions and add Bluetooth.
TAP Remove extensions and add Bluetooth.
<br>[[File:03.png|500px|frameless|thumb]]<br>
<br>[[File:03.png|600px|frameless|thumb]]<br>
<br>
Finally, you should see the Bluetooth is added well.
Finally, you should see the Bluetooth is added well.
<br>[[File:04.png|500px|frameless|thumb]]<br>
<br>[[File:04.png|600px|frameless|thumb]]<br>
 
<br>
Then click the '''Extensions''' again, enter the library link below and search:<br>
Then click the '''Extensions''' again, enter the library link below and search:<br>
https://github.com/LaboratoryForPlayfulComputation/pxt-BlockyTalkyBLE-UART
https://github.com/LaboratoryForPlayfulComputation/pxt-BlockyTalkyBLE-UART
<br>[[File:05.png|500px|frameless|thumb]]<br>


<br>[[File:05.png|600px|frameless|thumb]]<br>
<br>
Finally, you should see the library '''blocky Talky BLE''' is added successfully.
Finally, you should see the library '''blocky Talky BLE''' is added successfully.
<br>[[File:06.png|500px|frameless|thumb]]<br>
<br>[[File:06.png|600px|frameless|thumb]]<br>


<br>
<br>
Line 502: Line 519:


<br>
<br>
'''Bluetooth APP Use''<br>
'''Bluetooth APP Use'''<br>
After add the library and send the test code to micro:bit main board, power on the micro:bit main board.
After add the library and send the test code to micro:bit main board, power on the micro:bit main board.
<br>[[File:361 3-1-1.jpg|500px|frameless|thumb]]<br>
<br>[[File:361 3-1-1.jpg|500px|frameless|thumb]]<br>
Line 510: Line 527:
Installed the APP, click the APP icon to open it.  [[File:0356 APP.png|200px|frameless|thumb]]<br>
Installed the APP, click the APP icon to open it.  [[File:0356 APP.png|200px|frameless|thumb]]<br>
When your phone detects the Bluetooth module on the micro:bit main board, the APP will prompt to open the Bluetooth. Choose to open the Bluetooth. Pop up the interface below.
When your phone detects the Bluetooth module on the micro:bit main board, the APP will prompt to open the Bluetooth. Choose to open the Bluetooth. Pop up the interface below.
<br>[[File:0356 界面.png|400px|frameless|thumb]]<br>
<br>[[File:0356 界面.png|600px|frameless|thumb]]<br>
<br>
Then click the Bluetooth icon [[File:0356 蓝牙.png|100px|frameless|thumb]] , it will pop up the micro:bit information.
Then click the Bluetooth icon [[File:0356 蓝牙.png|100px|frameless|thumb]] , it will pop up the micro:bit information.
<br>[[File:0356 界面1.png|400px|frameless|thumb]]<br>
<br>[[File:0356 界面1.png|600px|frameless|thumb]]<br>
 
<br>
Then click [[File:DBF6.jpg|200px|frameless|thumb]] to connect the micro:bit Bluetooth.
Then click [[File:Bbc microbit.png|400px|frameless|thumb]] to connect the micro:bit Bluetooth.
<br>[[File:0356 界面2.png|400px|frameless|thumb]]<br>
<br>[[File:0356 界面2.png|600px|frameless|thumb]]<br>
 
<br>
After that, click [[File:DBF61.jpg|100px|frameless|thumb]] for connection, pop up the interface shown below.
After that, click [[File:Bluetooth connect.png|100px|frameless|thumb]] for connection, pop up the interface shown below.
<br>[[File:0356 界面3.png|400px|frameless|thumb]]<br>
<br>[[File:0356 界面3.png|600px|frameless|thumb]]<br>
<br>
Here the Bluetooth is connected successfully, you can use the APP to control your micro:bit car. The options are shown on the right side.  
Here the Bluetooth is connected successfully, you can use the APP to control your micro:bit car. The options are shown on the right side.  
<br>
You can click the [[File:DBF62.png|200px|frameless|thumb]] to disconnect the Bluetooth. Shown below.
<br>[[File:0356 界面4.png|600px|frameless|thumb]]<br>


You can click the [[File:DBF62.png|200px|frameless|thumb]] to disconnect the Bluetooth. Shown below.
<br>[[File:0356 界面4.png|400px|frameless|thumb]]<br>
<br>
<br>
'''Test Result'''<br>
'''Test Result'''<br>
Send well the test code to micro:bit main board, and power on the micro:bit main board. Follow the method mentioned above, connect the Bluetooth on the micro:bit main board using your phone’s APP. <br>
Send well the test code to micro:bit main board, and power on the micro:bit main board. Follow the method mentioned above, connect the Bluetooth on the micro:bit main board using your phone’s APP. <br>
Connected, click the right icons on the APP, the LED matrix on the micro:bit main board should show different letters.
Connected, click the right icons on the APP, the LED matrix on the micro:bit main board should show different letters.
<br>[[File:ks0356 Result8.1.jpg|400px|frameless|thumb]]  [[File:ks0356 Result8.2.jpg|400px|frameless|thumb]]<br>
<br>[[File:ks0356 Result8.1.jpg|400px|frameless|thumb]]  [[File:ks0356 Result8.2.jpg|400px|frameless|thumb]]<br>
<br>


====Bluetooth Controlled Car====
====Bluetooth Controlled Car====
Line 549: Line 570:


'''Test Result'''<br>
'''Test Result'''<br>
Send the test code to micro:bit main board, then insert the micro:bit main board into the car shield and connect a 18650 battery, turn the POWER switch ON.
Send the test code to micro:bit main board, then insert the micro:bit main board into the car shield and connect a 18650 battery, turn the POWER switch ON. <br>
When your phone’s APP is connected to Bluetooth module, the built-in LED matrix on the micro:bit main board should show the heart shape. If connection failed, it will show a smile face. <br>
When your phone’s APP is connected to Bluetooth module, the built-in LED matrix on the micro:bit main board should show the heart shape. If connection failed, it will show a smile face. <br>
Bluetooth connected, you should be able to control the movement of micro:bit robot car using APP.
Bluetooth connected, you should be able to control the movement of micro:bit robot car using APP.
<br>[[File:蓝牙.jpg|300px|frameless|thumb]] <br>
<br>[[File:蓝牙.png|400px|frameless|thumb]] <br>


<br>
<br>
===Wireless Gamepad Control===
===Wireless Gamepad Control===
'''Description'''<br>
'''Description'''<br>
Apart from the Andriod APP controlling Bluetooth mentioned above, you can also control the micro:bit through IOS Bluetooth wireless programming and control.
Apart from the Android APP controlling Bluetooth mentioned above, you can also control the micro:bit through IOS Bluetooth wireless programming and control.
 


<br>
'''Test Code'''<br>
'''Test Code'''<br>
<br>[[File:ks0356 code13.png|800px|frameless|thumb]]<br>
<br>[[File:ks0356 code13.png|800px|frameless|thumb]]<br>


<span style="color: red"> '''Pay close attention to:'''</span><br>
<span style="color: red"> '''Pay close attention to:'''</span><br>
When open the MakeCode Editor, click the icon [[File:设置.jpg|100px|frameless|thumb]] , select the project settings, shown below.  
When open the MakeCode Editor, click the icon [[File:Settings.png|100px|frameless|thumb]] , select the project settings, shown below.  
<br>[[File:07.png|500px|frameless|thumb]]  [[File:08.png|500px|frameless|thumb]]<br>
<br>[[File:07.png|500px|frameless|thumb]]  [[File:08.png|500px|frameless|thumb]]<br>
<br>
<br>
 
<br>
====How to control the car through IOS Bluetooth programming? ====
====How to control the car through IOS Bluetooth programming? ====
'''Step 1:''' Open the App store on your ipad/iPhone.<br>
'''Step 1:''' Open the App store on your ipad/iPhone.<br>
'''Step 2:''' Search the micro:bit to download and install.  
'''Step 2:''' Search the micro:bit to download and install.  
<br>[[File:0356 Step2.png|700px|frameless|thumb]]<br>
<br>[[File:0356 Step2.png|700px|frameless|thumb]]<br>
 
<br>
'''Step 3:''' open the micro:bit interface, click '''Choose micro:bit'''.  
'''Step 3:''' open the micro:bit interface, click '''Choose micro:bit'''.  
<br>[[File:0356 Step3.png|400px|frameless|thumb]]<br>
<br>[[File:0356 Step3.png|400px|frameless|thumb]]<br>
<br>
Then click '''Pair a micro:bit''', and click '''Next'''.
Then click '''Pair a micro:bit''', and click '''Next'''.
<br>[[File:0356 Step3-1.png|400px|frameless|thumb]]<br>
<br>[[File:0356 Step3-1.png|400px|frameless|thumb]]<br>
 
<br>
'''Step 4:''' power on the micro:bit main board, HOLD the A and B buttons, then press and release RESET button. The micro:bit main board will enter the Bluetooth pairing mode.  
'''Step 4:''' power on the micro:bit main board, HOLD the A and B buttons, then press and release RESET button. The micro:bit main board will enter the Bluetooth pairing mode. <br>
You should see an image showing on the LED matrix.
You should see an image showing on the LED matrix.
<br>[[File:0356 Step4.png|400px|frameless|thumb]]<br>
<br>[[File:0356 Step4.png|400px|frameless|thumb]]<br>
 
<br>
'''Step 5:''' copy the pattern from your micro:bit device and tap '''Next'''.  
'''Step 5:''' copy the pattern from your micro:bit device and tap '''Next'''.  
<br>[[File:0356 Step5.png|400px|frameless|thumb]]  [[File:0356 Step5-1.png|400px|frameless|thumb]]<br>
<br>[[File:0356 Step5.png|400px|frameless|thumb]]  [[File:0356 Step5-1.png|400px|frameless|thumb]]<br>
 
<br>
Continue to tap '''Next''' to pair.  
Continue to tap '''Next''' to pair.  
<br>[[File:0356 Step5-2.png|400px|frameless|thumb]]  [[File:0356 Step5-3.png|400px|frameless|thumb]]<br>
<br>[[File:0356 Step5-2.png|400px|frameless|thumb]]  [[File:0356 Step5-3.png|400px|frameless|thumb]]<br>
 
<br>
OK, pairing successful!   
OK, pairing successful!   
<br>[[File:0356 Step5-4.png|400px|frameless|thumb]]
<br>[[File:0356 Step5-4.png|400px|frameless|thumb]]


<br>
<br>
 
<br>
====How to control your micro:bit car using the Bluetooth?====
====How to control your micro:bit car using the Bluetooth?====
'''Step 1:''' press down the RESET button on the micro:bit main board. Then TAP the Monitor and Control on the APP interface.
'''Step 1:''' press down the RESET button on the micro:bit main board. Then TAP the Monitor and Control on the APP interface.
<br>[[File:0356 Step3.png|400px|frameless|thumb]]<br>
<br>[[File:0356 Step3.png|400px|frameless|thumb]]<br>
 
<br>
'''Step 2:''' Tap the '''Add''' and then select the '''Gamepad.'''  
'''Step 2:''' Tap the '''Add''' and then select the '''Gamepad.'''  
<br>[[File:0356car Step2.png|400px|frameless|thumb]]<br>
<br>[[File:0356car Step2.png|400px|frameless|thumb]]<br>
 
<br>
And you should see the control interface shown below. Click '''Start''' to connect.
And you should see the control interface shown below. Click '''Start''' to connect.
<br>[[File:0356car Step2-1.png|400px|frameless|thumb]]<br>
<br>[[File:0356car Step2-1.png|400px|frameless|thumb]]<br>
 
<br>
Connection successful! Click '''Stop''' to disconnect.
Connection successful! Click '''Stop''' to disconnect.
<br>[[File:0356car Step2-2.png|400px|frameless|thumb]]<br>
<br>[[File:0356car Step2-2.png|400px|frameless|thumb]]<br>
Line 609: Line 632:
'''Test Result'''<br>
'''Test Result'''<br>
When you press the key '''A''', the micro:bit car goes front; press the key '''B''', go back; press the key '''C''', turn left; press the key '''D''', turn right; press '''Stop''', disconnect the Bluetooth, the car will stop.
When you press the key '''A''', the micro:bit car goes front; press the key '''B''', go back; press the key '''C''', turn left; press the key '''D''', turn right; press '''Stop''', disconnect the Bluetooth, the car will stop.
<br>[[File:蓝牙 (2).jpg|400px|frameless|thumb]]  [[File:蓝牙 (3).jpg|400px|frameless|thumb]] <br>
<br>[[File:蓝牙 (2).png|450px|frameless|thumb]]  [[File:蓝牙 (3).png|390px|frameless|thumb]] <br>
 
<br>
 
==Related Resources ==
 
'''You can download micro:bit driver,Bluetooth APP and test code :'''<br>
 
https://fs.keyestudio.com/KS0356


==Related Resources Link ==
<br>
You can download all the information needed from the link below:<br>
https://drive.google.com/open?id=1bIvuCCkZ8lT9uoF6YkpzBCCk0ptlvqGS


Download the micro:bit driver:<br>
==Buy From==
https://drive.google.com/open?id=1YbX1_Wjy3IpcEWjqrx0x1CTyJPjToP9d
*'''Official website:''' http://www.keyestudio.com/ks0356.html


Download the Bluetooth APP:<br>
https://drive.google.com/open?id=17jJB--GKxPytDyPuqqhs6B2NUCCu7kST


Download the User Guide:<br>
https://drive.google.com/open?id=1mqcH3-G_wu85ziQlWVoUKKYW71R45GXV


Download all the test code:<br>
[[category: Smart Car]]
https://drive.google.com/open?id=18zSPeJhsjR4o7ZrDmZbj1Kohz-W5oMAQ

Latest revision as of 10:44, 9 March 2021

Keyestudio Micro:bit Mini Smart Robot Car

Product Description

Here comes the educational robot based on Micro:bit programming. Micro: bit is an ARM structure microcontroller designed by BBC. It is only half size of a credit card, onboard comes with Bluetooth, accelerometer, compass, three buttons, 5x5 LED matrix, mainly used for teens programming education.
The Micro:bit Mini Smart Robot Car integrates ultrasonic and infrared obstacle avoidance as well as line following. Also comes with a passive buzzer for playing music. Moreover, supply the power by 18650 batteries, supporting charge when run out of power. You will be able to adjust the motor speed.
This micro:bit robot is a perfect toy for kids to start learning robotics. The plug-and-play allow children to quickly learn graphic programming in entertaining, nurturing children's interest in science and logical thinking.

Note: we adopt V1.5 micro:bit in the whole tutorial, but our tutorial is also compatible with the latest version micro:bit. When doing experiment with latest micro:bit, you need to transfer code into Makecode online editor first, save code again then download it to micro:bit.


Specifications

  • Voltage: 4.2-5.5V
  • Current: USB power supply or power supply with a capacity greater than or equal to 1A
  • Maximum power: maximum output power is 5W
  • Operating temperature range: 0-50 degrees Celsius
  • Dimensions: 120*90.7mm
  • Environmental attributes: ROHS


Packing List

No. Specification Quantity Picture
1 Micro:bit main board black 1
thumb
2 keyestudio Micro:bit smart robot shield (Black and Eco-friendly) 1
thumb
3 USB cable A/MICRO OD: 4.0 Black with magnetic spring L=1.2m Eco-friendly 1
thumb
4 Keyestudio line tracking sensor (Black and Eco-friendly) 1
thumb
5 HC-SR04 ultrasonic sensor 1
thumb
6 JST PH2.0MM-5PIN double-head cable length 55MM 1
thumb
7 W420 steel universal wheel 1
thumb
8 N20 motor wheel diameter:43mm ; width: 19mm ; hole diameter: 3mm type DABS plastic + rubber yellow 2
thumb
9 M3 Nickel plated nut 2
thumb
10 Single pass M3*6mm+6mm hex copper pillar 2
thumb
11 M3*6MM round-head screw 2
thumb
12 yellow-black handle 3*40MM phillips screwdriver 1
thumb


Installation Method

a. Firstly prepare all the assembly components. Place them together before install the micro:bit robot car.
thumb

b. The first step should mount 2pcs hex copper pillar and 2pcs M3 Nickel plated nut on the front of car shield.
thumb

c. Connect the JST PH2.0MM-5PIN double-head cable to line tracking sensor.
thumb

d. Then fix the line tracking sensor and W420 steel universal wheel onto the hex copper pillar on the car shield using 2pcs M3*6MM round-head screws.
thumb thumb

e. After that, mount the 2pcs N20 motor wheels into the DC motor.
thumb thumb

f. Now, we insert the ultrasonic sensor and micro:bit main board into the car shield.
thumb thumb

g. Connect the JST PH2.0MM-5PIN cable connected to line tracking sensor to the car shield.
thumb

h. Finally, insert the 18650 battery into the car shield.
thumb

i. Congrats! The mini micro:bit robot car is installed well. Pretty simple.


micro:bit Driver Installation

Next, let’s install the driver for micro:bit main board.
1) First of all, connect the micro:bit to your computer using a USB cable.
thumb

2)Then, double click the driver software to install it. Here you can click the icon below to download it.thumb

thumb

3) After that, click Next to continue the installation.
thumb

4) Wait the driver installing finished.
thumb

5) Wait the driver installing finished.
thumb

6) Driver installation completed, then you can right click the “Computer” —> “Properties”—> “Device Manager”.
thumb
You can check the detailed Ports information shown as below.
thumb


micro:bit Example Use


Step 1: Connect It

Connect the micro:bit to your computer via a micro USB cable. Your micro:bit will show up on your computer as a drive called 'MICROBIT'. 
thumb

Step 2: Program It

Using micro bit MakeCode Block editor https://makecode.microbit.org/, write your first micro:bit code.
You can drag and drop some example blocks and try your program on the Simulator in the Javascript Blocks Editor, like in the image below.
thumb

Click the JavaScript, you can see the corresponding program code. Shown as below figure.
thumb

Step 3: Download It

Click the Download button in the editor. This will download a 'hex' file, which is a compact format of your program that your micro:bit can read. Here you can name the project as LED1, then click “Save”. Shown below.
thumb

Once the hex file has downloaded, copy it to your micro:bit just like copying a file to a USB drive. On Windows find the microbit-LED1 file, you can right click and choose "Send To→MICROBIT."
thumb

thumb


Step 4: Play It

The micro:bit will pause and the yellow 5*5 LED on the back of the micro:bit will display the images while your code is programmed.
thumb

You can power it using USB cable or battery. The battery holder need to connect two 1.5V AA batteries. Shown below.
thumb


micro:bit Pins

Before getting started with the following projects, first need to figure out each pin of micro:bit main board. Please refer to the reference diagram shown below.
thumb
The BBC micro:bit has 25 external connections on the edge connector of the board, which we refer to as ‘pins’. The edge connector is the grey area on the right side of the figure above. There are five large pins, that are also connected to holes in the board labelled: 0, 1, 2, 3V, and GND. And along the same edge, there are 20 small pins that you can use when plugging the BBC micro:bit into an edge connector.

Note that it read from the BBC micro:bit official website. More reference you can click the link below:
BBC micro bit Pins: http://microbit.org/guide/hardware/pins/
BBC micro:bit website: http://microbit.org/
Micro bit MakeCode Block Editor: https://makecode.microbit.org/
Meet micro:bit starter programming: http://microbit.org/guide/
BBC micro:bit Features Guide: http://microbit.org/guide/features/
BBC micro:bit Safety Warnings: http://microbit.org/guide/features/
BBC micro:bit Quick Start Guide: http://microbit.org/guide/quick/

thumb thumb


Learning Projects

Playing Music

Description
Buzzers can be categorized as active and passive ones.
The difference between the two is that an active buzzer has a built-in oscillating source, so it will generate a sound when electrified.
A passive buzzer does not have such a source, so DC signal cannot drive it beep. Instead, you need to use square waves whose frequency is between 2K and 5K to drive it. Different frequencies produce different sounds. You can use micro:bit to code the melody of a song, quite fun and simple.
The keyestudio Micro:bit robot shield comes with a passive buzzer element. The signal terminal of buzzer is connected to the P9 interface of micro:bit main board.
In the experiment, we make use of the software built-in library to drive the passive buzzer play a song of Happy Birthday.
thumb


Test Code

thumb


Test Result
Send well the test code to micro:bit main board, then insert the micro:bit main board into the micro:bit robot shield. Connect a 18650 battery to the shield, and turn the POWER and BUZZER switch ON.
You should hear the micro:bit robot shield playing a song of《Happy Birthday》


Micro:bit LED Matrix Display

Description
LED stands for Light Emitting Diode. The micro:bit has 25 individually-programmable LEDs, allowing you to display text, numbers, and images.
The micro:bit MakeCode Block editor has built-in library. So you can use it to control the 25 LED lights on and off, showing the different images.
In the experiment, we drive the 25 LED lights show a big heart and a small heart images.


Test Code

thumb


Test Result

thumb


Motor Driving

Description
The micro:bit robot shield has a built-in TB6612FNG chip. When using, you just need to insert the micro:bit main board into the shield, and send the test code to micro:bit main board. Insert well the 18650 battery into the shield to control the two motors rotate, thus control the micro:bit car run.

Below is a table of TB6612FNG chip pins (PWM range of 0~1023)
thumb


Test Code

thumb


Test Result
Send well the test code to micro:bit main board, then insert the micro:bit main board into the car shield, and connect a 18650 battery into the car shield.
Turn the POWER switch ON. The micro:bit car will go forward for 3 seconds, backward for 3 seconds, stop for 3 seconds, turn left for 3 seconds and turn right for 3 seconds, repeatedly.


Line Tracking

Test the tracking sensor

Description
The tracking sensor is actually an infrared sensor. The component used here is the TCRT5000 infrared tube.
Its working principle is to use the different reflectivity of infrared light to the color, then convert the strength of the reflected signal into a current signal. During the process of detection, black is active at LOW level, but white is active at High level.

The following picture is our keyestudio line tracking sensor designed for Micro:bit robot car. We have integrated 3 sets of TCRT5000 infrared tube on a single board, pretty convenient for wiring and controlling.
thumb


TECH SPECS

  • Operating Voltage: 3.3-5V(DC)
  • Interface: 5Pin connector
  • Output Signal: digital signal


Test Code

thumb


Test Result
Send the test code to micro:bit main board, then insert the micro:bit main board into the car shield and connect a 18650 battery, turn the POWER switch ON. At this moment, the micro:bit LED matric has no display.
But if approach your finger to the first tracking sensor (S1), the LED matrix will show in the middle;
Approach your finger to the second tracking sensor (S2), the LED matrix will show ;
Approach your finger to the third tracking sensor (S3), the LED matrix will show ;

thumb

thumb thumb



Line Tracking Car

Description
In the previous section, we have introduced the principle and application of line tracking module and motor driving. After that, combine the tracking sensor and module to build a line following car.
So at first what does line tracking mean? It refers to follow the line trajectory. You might often see some robots always follow or track a black line.


How does it work?
It uses the tracking sensor to detect the black track on the pavement, and detection signal will feed back to the micro:bit main board. Then micro:bit main board will analyze and judge the collected signals to control and drive the motor in time, thus can adjust the car’s turning direction.
That is why the micro:bit car can automatically follow the black track, achieving the automatic line tracking function.


Programming Thinking
At first judge the middle tracking sensor. If it detects a black line, no matter detect a black line on either side, the micro:bit car always goes forward. If the middle tracking sensor does not detect a black line, then judge the sensor on both sides.
If the left sensor detects a black line, but the right sensor doesn’t, the micro:bit car will turn left;
If the right sensor detects a black line, but the left sensor doesn’t, the micro:bit car will turn right;
If all three sensors do not detect a black line, the micro:bit car will stop.


Test Code

thumb


Test Result
Send the test code to micro:bit main board, then insert the micro:bit main board into the car shield and connect a 18650 battery, turn the POWER switch ON. At this moment, the micro:bit mini robot car will follow a black line.

Special Note:
When testing the car, do not test it under the sun. During the test, if go wrong, you can try to test it in a darker environment.
thumb


Ultrasonic Avoiding Obstacles

Ultrasonic Ranging

Description
There is an animal called bat in nature. The bats can fly at night, not depend on its eyes, but on its ears and vocal organs. When the bat flies, it will emit a scream, an ultrasonic signal that humans cannot hear because of its high audio frequency. If these ultrasonic signals hit other objects on the flight path, they will be reflected back immediately. After receive the returned information, the bats complete the whole process of listening, seeing, calculating and bypassing obstacles during the flutter.


KS0313 3-2-1.png

The principle of the ultrasonic module is as the same as the above principle.
The ultrasonic module will emit the ultrasonic waves after trigger signal. When the ultrasonic waves encounter the object and are reflected back, the ultrasonic module outputs an echo signal, so it can determine the distance of object from the time difference between trigger signal and echo signal.
Ultrasonic sensor has a wide range of sensitivity, no blind area, and no interference with obstacles.
As the following picture shown, it is our keyestudio ultrasonic module. It has two somethings like eyes.
One is transmitting end, the other is receiving end.
thumb


TECH SPECS

  • Operating Voltage: 5V(DC)
  • Operating Current: 15mA
  • Operating Frequency: 40khz
  • Maximum Detection Distance: 3-5m
  • Minimum Detection Distance: 3-4cm
  • Sensing Angle: less than 15 degrees


Test Code

thumb


Test Result
Send the test code to micro:bit main board, then insert the micro:bit main board into the car shield and connect a 18650 battery, turn the POWER switch ON.
At this moment, when the micro:bit mini robot car detects an obstacle ahead, the measured result will be showed on the micro:bit LED matrix.
If the measured distance between an obstacle and ultrasonic module is less than 10cm, the micro:bit LED matrix will show a big prismatic image;
If the measured distance is greater than 10cm, the micro:bit LED matrix will show a small prismatic image.
thumb thumb


Ultrasonic Obstacle Avoiding Car

Description
In the previous project, we have combined a tracking sensor and micro:bit car shield to build a line tracking car.
Here we combine a ultrasonic module and micro:bit car shield to build an ultrasonic obstacle avoiding car.
How does it work?
We have introduced the principle of ultrasonic module before. We can use a ultrasonic module to measure the distance between the micro:bit car and an obstacle ahead. Then control the running state of micro:bit robot car according to the measured distance.
thumb


Programming Thinking
At first, use a ultrasonic module to measure the distance between the micro:bit car and an obstacle ahead.
When the measured distance is less than 10cm, the micro:bit car stops for 0.2 second, then turns left for 0.5 second and then goes forward. If the measured distance is greater than or equal to 10cm, the micro:bit car will directly go forward.


Test Code

thumb


Test Result
Send the test code to micro:bit main board, then insert the micro:bit main board into the car shield and connect a 18650 battery, turn the POWER switch ON.
At this moment, if the micro:bit robot car encounters an obstacle ahead, it will turn left to a certain angle, then go forward.
thumb

Infrared Avoiding Obstacles

Infrared Detection

Description
The micro:bit robot car shield comes with two infrared obstacle detector sensors. It is actually designed for infrared obstacle avoidance robot.
The infrared obstacle detector sensor has a pair of infrared transmitting and receiving tubes.
The transmitter emits an infrared rays of a certain frequency. When the detection direction encounters an obstacle (reflecting surface), the infrared rays are reflected back, and receiving tube will receive it.
At this time, the indicator (SIG1/SIG2 LED) lights up. After processed by the circuit, the signal output terminal will output Digital signal.
You can rotate the potentiometer on the shield to adjust the detection distance. It is better to adjust the potentiometer to make the SIG1/SIG2 LED in a state between on and off. The detection distance is the best, almost 10cm.
thumb


Test Code

thumb


Test Result
Send the test code to micro:bit main board, then insert the micro:bit main board into the car shield and connect a 18650 battery, turn the POWER switch ON.
The two infrared obstacle detector sensors on the micro:bit mini robot car can used to detect an obstacle ahead.

  • If the infrared sensors on both side do not detect an obstacle, the LED matrix will show a big heart image.
  • If the infrared sensors on both side detect an obstacle, the LED matrix will show a small heart image.
  • If the left infrared sensor detects an obstacle, but the right sensor doesn’t, the left column of LED matrix will light up.
  • If the right infrared sensor detects an obstacle, but the left sensor doesn’t, the right column of LED matrix will light up.


thumb thumb
thumb


Infrared Obstacle Avoiding Car

Description
In the previous project, we have combined sensor and micro:bit car shield to build a specific function car.
Now, we use an infrared obstacle detector module and motor driving circuit on the micro:bit car shield to build an infrared obstacle avoiding car.
How does it work?
We have introduced the principle of infrared obstacle detector module before. We can make use of two infrared obstacle detector modules integrated on the car shield to detect whether have obstacles on the both sides of micro:bit car. Thus control the car’s running state according to the testing interface.


Programming Thinking
If detects an obstacle on the left side but not on the right side, the car will turn right for 0.05 second.
If detects an obstacle on the right side but not on the left side, the car will turn left for 0.1 second.
If detects no obstacle at both sides, the car will go forward.
If detects obstacles at both sides, the car will stop for 0.5 second, then go backward for 0.2 second and then turn left for 0.5 second.


Test Code

thumb


Test Result
Send the test code to micro:bit main board, then insert the micro:bit main board into the car shield and connect a 18650 battery, turn the POWER switch ON.
The left infrared sensor on the car shield detects an obstacle, the car will turn right at a certain angle and then go forward.
The right infrared sensor on the car shield detects an obstacle, the car will turn left at a certain angle and then go forward.
If both of them detect no obstacle, the car will go forward.
If both of them detect obstacles, the car will stop, then go backward, turn left at a certain angle and then go forward.


Ultrasonic and Infrared Avoiding Obstacles

Description
In the previous sections, we have introduced ultrasonic obstacle avoiding car and infrared obstacle avoiding car. To be more accurate, this lesson we combine both ultrasonic module and infrared obstacle detector sensors to build an obstacle avoiding car.


Programming Thinking
① When the distance between the car and front obstacle is less than or equal to 10cm, the robot car will stop, passive buzzer beeps for 0.5 second, mini car will go backward for 0.2 second, and then turn left for 0.3 second.
② When the distance between the car and front obstacle is greater than 10cm, use two infrared obstacle detector modules on the car shield to detect whether there is obstacles on the front left or on the front right.

  • If detects an obstacle on the left side but not on the right side, the car will turn right.
  • If detects an obstacle on the right side but not on the left side, the car will turn left.
  • If detects no obstacle at both sides, the car will go forward.
  • If detects obstacles at both sides, the car will stop, passive buzzer will beep for 0.5 second, then robot car goes backward for 0.2 second and then turns left for 0.3 second.


Test Code

thumb


Test Result
Send the test code to micro:bit main board, then insert the micro:bit main board into the car shield and connect a 18650 battery, turn the POWER switch ON. When the front obstacle distance measured by ultrasonic sensor is greater than 10cm.

  • If detects an obstacle on the left side but not on the right side, the car will turn right at a certain angle then go forward.
  • If detects an obstacle on the right side but not on the left side, the car will turn left at a certain angle then go forward.
  • If detects no obstacle at both sides, the car will go forward.
  • If detects obstacles at both sides, the car will stop, passive buzzer will produce an audible beep, after 500ms, robot car goes backward, after 200ms, turns left at a certain angle and then goes forward.

When the front obstacle distance measured by ultrasonic sensor is less than or equal to 10cm, the car will stop, passive buzzer will produce an audible beep, after 500ms, robot car goes backward, after 200ms, turns left at a certain angle and then goes forward.
thumb



Bluetooth Controlled Car

Bluetooth Test

Description
The micro:bit robot car shield comes with a Bluetooth module. We can use the built-in Bluetooth module to communicate with your phone’s APP, thus control the external devices connected to micro:bit control board using APP.
In the experiment, we only use the phone’s APP to control the LED matrix on the micro:bit main board, showing the different characters.
(note that when controlled by Bluetooth, use leds show matrix drawing module, easy to crash.)

Library link settings
The micro:bit robot car shield comes with a Bluetooth module.
Before sending the test code, we should add the library to micro:bit on the browser. The method is as below.
Connect the micro:bit main board to your computer using a USB cable.
thumb

Open micro:bit MakeCode Block editor: https://makecode.microbit.org/#editor. Firstly click the Extensions.
thumb

Then click the Bluetooth.
thumb

TAP Remove extensions and add Bluetooth.
thumb

Finally, you should see the Bluetooth is added well.
thumb

Then click the Extensions again, enter the library link below and search:
https://github.com/LaboratoryForPlayfulComputation/pxt-BlockyTalkyBLE-UART


thumb

Finally, you should see the library blocky Talky BLE is added successfully.
thumb


Test Code

thumb


Bluetooth APP Use
After add the library and send the test code to micro:bit main board, power on the micro:bit main board.
thumb
Click the link to download the Bluetooth APP:
https://drive.google.com/open?id=17jJB--GKxPytDyPuqqhs6B2NUCCu7kST

Installed the APP, click the APP icon to open it. thumb
When your phone detects the Bluetooth module on the micro:bit main board, the APP will prompt to open the Bluetooth. Choose to open the Bluetooth. Pop up the interface below.
thumb

Then click the Bluetooth icon thumb , it will pop up the micro:bit information.
thumb

Then click thumb to connect the micro:bit Bluetooth.
thumb

After that, click thumb for connection, pop up the interface shown below.
thumb

Here the Bluetooth is connected successfully, you can use the APP to control your micro:bit car. The options are shown on the right side.
You can click the thumb to disconnect the Bluetooth. Shown below.
thumb


Test Result
Send well the test code to micro:bit main board, and power on the micro:bit main board. Follow the method mentioned above, connect the Bluetooth on the micro:bit main board using your phone’s APP.
Connected, click the right icons on the APP, the LED matrix on the micro:bit main board should show different letters.
thumb thumb


Bluetooth Controlled Car

Description
In the previous projects, we have combined the sensors and robot shield to make the specific function car. In this project, we use the shield’s motor driving circuit and Bluetooth module to build a Bluetooth controlling car.


How does it work?
Connect well the Bluetooth module using phone’s APP, when the Bluetooth module receives the characters sent by APP, it will control the motion state of robot car based on the received data.


Programming Thinking
 When your phone’s APP is connected to Bluetooth module, the built-in LED matrix on the micro:bit main board should show the heart shape. If connection failed, it will show a smile face.
 Bluetooth connected, click front, the APP will send the char “F”, controlling the car forward; if click back, it will send the char “B”, controlling the car backward; if click left, it will send the char “L”, controlling the car turn left; if click right, it will send the char “R”, controlling the car turn right; if click stop, it will send the char “S”, controlling the car stop.

Test Code

thumb


Test Result
Send the test code to micro:bit main board, then insert the micro:bit main board into the car shield and connect a 18650 battery, turn the POWER switch ON.
When your phone’s APP is connected to Bluetooth module, the built-in LED matrix on the micro:bit main board should show the heart shape. If connection failed, it will show a smile face.
Bluetooth connected, you should be able to control the movement of micro:bit robot car using APP.
thumb


Wireless Gamepad Control

Description
Apart from the Android APP controlling Bluetooth mentioned above, you can also control the micro:bit through IOS Bluetooth wireless programming and control.


Test Code

thumb

Pay close attention to:
When open the MakeCode Editor, click the icon thumb , select the project settings, shown below.
thumb thumb


How to control the car through IOS Bluetooth programming?

Step 1: Open the App store on your ipad/iPhone.
Step 2: Search the micro:bit to download and install.
thumb

Step 3: open the micro:bit interface, click Choose micro:bit.
thumb

Then click Pair a micro:bit, and click Next.
thumb

Step 4: power on the micro:bit main board, HOLD the A and B buttons, then press and release RESET button. The micro:bit main board will enter the Bluetooth pairing mode.
You should see an image showing on the LED matrix.
thumb

Step 5: copy the pattern from your micro:bit device and tap Next.
thumb thumb

Continue to tap Next to pair.
thumb thumb

OK, pairing successful!
thumb



How to control your micro:bit car using the Bluetooth?

Step 1: press down the RESET button on the micro:bit main board. Then TAP the Monitor and Control on the APP interface.
thumb

Step 2: Tap the Add and then select the Gamepad.
thumb

And you should see the control interface shown below. Click Start to connect.
thumb

Connection successful! Click Stop to disconnect.
thumb


Test Result
When you press the key A, the micro:bit car goes front; press the key B, go back; press the key C, turn left; press the key D, turn right; press Stop, disconnect the Bluetooth, the car will stop.
thumb thumb


Related Resources

You can download micro:bit driver,Bluetooth APP and test code :

https://fs.keyestudio.com/KS0356


Buy From