Download Print this page

Innovative iBIT RACER Activity Booklet

Programmable robot with micro:bit

Advertisement

Quick Links

Programmable robot with micro:bit 
1
Programmable robot
with micro:bit
Activity book
Innovative Experiment Co.,Ltd

Advertisement

loading
Need help?

Need help?

Do you have a question about the iBIT RACER and is the answer not in the manual?

Questions and answers

Subscribe to Our Youtube Channel

Summary of Contents for Innovative iBIT RACER

  • Page 1  Programmable robot with micro:bit  Programmable robot with micro:bit Activity book Innovative Experiment Co.,Ltd...
  • Page 2 Credits iBIT ; the robot controller board are trademarks of Innovative Experiment Co., Ltd. iBIT robot kit, iBIT robot kit logo, INEX, and INEX logo are trademarks of Innovative Experiment Co., Ltd. micro:bit and micro:bit logo are trademarks of micro:bit Educational Foundation.
  • Page 3  Programmable robot with micro:bit  Contents 1 - iBIT robot kit plus introduction and part list................5 2 - iBIT:Racer robot Assembly Insturctions..................17 3 - About micro:bit..........................31 4 - Getting start coding with micro:bit..................39 5 - iBIT:Racer robot operation with iBIT Block package............51 6- iBIT:Racer robot with Line tracing activity................71...
  • Page 4   Programmable robot with micro:bit...
  • Page 5: Part List

     Programmable robot with micro:bit  Chapter 1 introduction and part list iBIT robot kit is a micro:bit-based mobile robotic kit. It comes complete with wheels, motors, sensors, software, documentation, etc. The iBIT controller board support the micro:bit microcontroller. The Microsoft Programming Experience Toolkit or Microsoft PXT Block Editor, JavaScript and Python software is recommended.
  • Page 6   Programmable robot with micro:bit 11. A 3/8” plastic ball caster set 12. iBIT:Racer robot chassis 13. Metal standoffs set 14. Plastic bracket and Strip bracket set (30 and 12 pieces) 15. Nuts and Screws set 16. 4AAA battety holder with terminal plug 17.
  • Page 7  Programmable robot with micro:bit  Figure 1-1 micro:bit features and components Figure 1-2 micro:bit’s input/output pin assignment...
  • Page 8   Programmable robot with micro:bit 1.3 iBIT controller board The summarized technical feature of the iBIT controller board for micro:bit is as follows : 80-pin edge connector for supporting micro:bit and pluggable the micro:bit  adaptor board Terminal block for battery connections. It supports +4.8 to +9Vdc ...
  • Page 9  Programmable robot with micro:bit  Vin 7-9Vdc micro:bit I/O slot 470F 470F FDS6675 7-9Vdc +3.3V 39 37 31 29 POWER 38 36 30 28 470F KIA278R05 Vout 1000F 2.2k 6.3V LED2 BD48K30 LOW-BATT. +3V 3 9 10 11 12 13 14 15 16 LED3 LED1...
  • Page 10   Programmable robot with micro:bit +3.3Vdc switching regulator power supply circuit. Its regulates the supply  voltage for micro:bit and all components +6Vdc power supply circuit for servo motor output  8-ch analog inputs with 12-bit ADC integrated circuit. Voltage input range 0 ...
  • Page 11  Programmable robot with micro:bit  1.4 Output devices features 1.4.1 Micro metal gearbox motors This robot kit provides 30:1 ratio micro metal gearbox motors low power model MG1-30LP with IDC connector cables and mounting part sets. Features include : Operating voltage is 3 to 12Vdc ...
  • Page 12: Sensor Module Features

      Programmable robot with micro:bit 1.4.3 Standard mini servo motor The mini standard servo is ideal for robotics and basic movement projects. These servos will allow a movement range of 0 to 180 degrees. The servo output gear shaft is a standard Futaba configuration.
  • Page 13  Programmable robot with micro:bit  1.5.2 ZX-03 : Infrared reflector sensor The heart of this sensor is TCRT5000 reflective object sensor. It is designed for close proximity infrared (IR) detection. There’s an infrared diode behind its transparent blue window and an infrared transistor behind its black window. When the infrared emitted by the diode reflects off a surface and returns to the black window, it strikes the infrared transistor’s base, causing it to conduct current.
  • Page 14   Programmable robot with micro:bit 1.5 iBIT robot kit cable information The iBIT robot kit includes some signal cables for the interfacing between the controller board, sensor module and the computer. They includes the JST3AA-8 cables for interconnection to the sensor module and the standard USB-microB cable for interfacing with the computer.
  • Page 15  Programmable robot with micro:bit  1.6 Mechnical part features 1.6.1 Aluminum wheels and Silicone Tire set This is good traction wheel and tires. The wheel’s inside aluminum rim is processed at CNC lathes. Better for 2 wheeled robots. Also suitable for fast line follower robots. These are features of the wheels : Weight is 22 grams.
  • Page 16   Programmable robot with micro:bit 1.6.3 Racer chassis This chassis is made from high quality PVC plastic. It was designed suitable for fixing the micro metal gearbox motor and the ball caster wheel. This chassis has many 3mm. holes for fixing the controller board, sensors and more mechanical parts. 1.6.4 Plastic bracket There are 30 pieces of mixed-color bracket.
  • Page 17  Programmable robot with micro:bit  1.6.6 Right-angle metal bracket It is 7.5mm. width right-angle metal bracket. Each bracket has 3mm. hole for inserting the screw to fix with another structures. The set includes 4 pieces of 1x2, 2x2 and 2x5 holes metal bracket. 1.6.7 Screw and Nut set Includes 2 of 2mm.
  • Page 18   Programmable robot with micro:bit...
  • Page 19  Programmable robot with micro:bit  Chapter 2 Assembly Instructions 2.1 Overview All parts for assembly the iBIT:Racer robot are shown in the figure 2-1. Figure 2-1 : iBIT:Racer robot parts...
  • Page 20   Programmable robot with micro:bit 2.2 Assembly Instructions (1) Prepare the wheel and tire set. It includes a pairs of 33x20mm. aluminum wheel, silicone tires, M4 socket screws and an Allen Wrench (2) Open the silicone tire to find the fixing hole. (3) Tighten the socket screw into the hole by using the wrench.
  • Page 21  Programmable robot with micro:bit  (4) Tighten the screw to fix the wheel with the motor shaft. Do same for another wheel and tire set. (5) Fix the mounting bracket with the micro metal gearbox. Do 2 sets. (6) Insert the mounting nuts (2mm. nut) into both fixing holes of the mounting.
  • Page 22   Programmable robot with micro:bit (7) Place the motor with bracket on the robot chassis at the position following the photo below. (8) Insert the mounting screws (2x20mm. screw) to fix the motor with the robot chassis and tighten it. (9) Fasten both motor gearboxes on the chassis.
  • Page 23  Programmable robot with micro:bit  (10) String the motor cables through the trapezoid aperture and flip over the robot chassis. The motor gearbox installation is ready. (11) Next is ball caster assembly. Prepare the ball caster wheel part. It includes Ball caster, 2 pieces of pad, 2 sets of the 2x20mm.
  • Page 24   Programmable robot with micro:bit (13) Flip the robot chassis. Place the bass caster at the front. (14) Tighten the ball caster with 2 pieces of 2mm. nuts on the top side of chassis.
  • Page 25  Programmable robot with micro:bit  (15) Prepare the battery holder part set. It includes a 4AAA battery holder, 2 sets of 2x20mm. flat head screw and nut. (16) Place the battery holder at position of the top of robot chassis following the photo below.
  • Page 26   Programmable robot with micro:bit (18) Flip over the robot chassis again. Attach both ZX-03 sensors at the front of the robot chassis following the photo below by tightening the 3mm. nuts. String the sensor cables through the trapezoid aperture. (19) Flip the robot chassis back.
  • Page 27  Programmable robot with micro:bit  (20) Insert the standoffs on the top of the robot chassis. Tighten with 3mm. nuts...
  • Page 28   Programmable robot with micro:bit (21) Place the iBIT controller board over the standoffs. Tighten with 3 of the hand screws. (22) Plug the terminal header of battery holder to the iBIT board.
  • Page 29  Programmable robot with micro:bit  (23) Plug the micro:bit to the iBIT board. Make sure plugging correct side. See the photo for making correctly. (24) Connect all cables to the iBIT board : (24.1) The motor cables Left motor is connected to the Motor output -1. Right motor is connected to the Motor output-2.
  • Page 30   Programmable robot with micro:bit Now, the BIT:Racer robot is ready for coding and fun.
  • Page 31  Programmable robot with micro:bit  Chapter 3 About micro:bit introduction and more technical micro:bit is a tiny programmable computer, designed to make learning and teaching easy and fun! This chapter introduces and describe some technical information about micro:bit. The figure 3-1 illustrate about micro:bit’s component that showing more technical details.
  • Page 32   Programmable robot with micro:bit 3.1 Overview micro:bit has the following physical features:  25 individually-programmable LEDs  2 programmable buttons  Physical connection pins  Light and temperature sensors  Motion sensors (accelerometer and compass)  Wireless Communication, via Radio and Bluetooth  USB interface Let’s take a look at what these components do and discover how to code them! 3.1.1 LEDs micro:bit individually-...
  • Page 33: Input/Output Pins

     Programmable robot with micro:bit  3.1.3 Input/Output Pins There are 25 external connectors on the edge connector of the micro:bit, which we refer to as ‘pins’. Program motors, LEDs, or other electrical components with the pins, or connect extra sensors to control your code! The edge connector brings out many of the GPIO circuits of the application processor.
  • Page 34: Light Sensor

      Programmable robot with micro:bit 3.1.4 Light Sensor This is fantastic features of micro:bit. Normally LED is output devices. This is different story of LED operation. By reversing the LEDs of the screen to become an input, the LED screen works as a basic light sensor, allowing you to detect ambient light.
  • Page 35  Programmable robot with micro:bit  3.1.7 Compass The compass detects the earth’s magnetic field, allowing you to detect which direction the micro:bit is facing. The compass has to be calibrated before it can be used. ‘Calibrating’ the compass ensures the compass results are accurate.
  • Page 36: Usb Interface

      Programmable robot with micro:bit 3.1.9 Bluetooth A BLE (Bluetooth Low Energy) antenna allows the micro:bit to send and receive Bluetooth signals. This allows the micro:bit to wirelessly communicate with PCs, Phones, and Tablets, so user can control the mobile phone from micro:bit and send code wirelessly to the target device from mobile phone! Before using the Bluetooth Antenna user will need to pair micro:bit with another device.
  • Page 37  Programmable robot with micro:bit  3.2 About the micro:bit Processor The nRF51 application processor is where user programs run. A single, complete application including user code, runtime code and bluetooth stack is loaded and run directly from on chip flash memory. All user accessible GPIO pins are provided by this processor.
  • Page 38   Programmable robot with micro:bit...
  • Page 39  Programmable robot with micro:bit  Chapter 4 Getting start coding with micro:bit micro:bit’s coding is very easy. It can be coded from any web browser in Blocks, Javascript, Python, Scratch and more; no software required. There are three exmple of coding tools for micro:bit 1.
  • Page 40   Programmable robot with micro:bit 2. Python Editor Python editor is perfect for those who want to push their coding skills further. A selection of snippets and a range of premade images and music give you a helping hand with your code. Powered by the global Python Community. 3.
  • Page 41: Getting Start

     Programmable robot with micro:bit  4.1 Getting start The JavaScript Blocks Editor is a visual, intuitive programming environment. Program your micro:bit in Blocks or switch to JavaScript, and take full advantage of the device’s many features, such as peer-to-peer radio and Bluetooth. 4.1.1 Preparation software Normally the micro:bit JavaScript Blocks Editor is web-based then user must connect to internet and access to MakeCode webpage for coding.
  • Page 42   Programmable robot with micro:bit (2) At the JavaScript Blocks Editor section, click on the Let’s Code button. It redirect to MakeCode webpage for coding at https://makecode.microbit.org/# (3) Add the iBIT block extension. Select Advance > Extensions from command list on the left menu.
  • Page 43  Programmable robot with micro:bit  (4) Type the iBIT extension name into the search box then click SEARCH button. (5) iBIT extension appears in the command list on the left menu. Try to click on the iBIT name. All blocks are under the iBIT package will appear...
  • Page 44   Programmable robot with micro:bit (6) Bookmark this webpage. Try to close web browser. Disconnect internet. Open web browser again and open the MakeCode web page from bookmark. Now you can coding with JavaScript Blocks Editor by offline. 4.1.2 Connect it (1) Connect the micro:bit to the computer via a micro USB cable.
  • Page 45  Programmable robot with micro:bit  4.1.3 Program It (1) Using JavaScript Blocks Editor, write the first micro:bit code. Go to menu Basic then select forever block. (2) Drag the forever block and drop to workspace.
  • Page 46   Programmable robot with micro:bit (3) Back to Basic menu again. Select the show leds block. (4) Drag the show leds block inside the forever block. (5) Make the heart icon on the show leds block by clicking on any LED in the show leds block as follows.
  • Page 47  Programmable robot with micro:bit  (6) Copy the show leds block and drop under forever block. Then create another heart pattern on the second show leds block to make it blink. (7) 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.
  • Page 48   Programmable robot with micro:bit (8) Once the hex file has downloaded, copy it to your micro:bit just like copying a file to a USB drive. On Windows you can right click and choose Send To MICROBIT.
  • Page 49  Programmable robot with micro:bit  (9) The micro:bit will pause and the yellow LED on the back of the micro:bit will bl ink whil e your code is program med. Once that’s finished the code will run automatically. micro:bit LED shows the flashing heart continue.
  • Page 51  Programmable robot with micro:bit  Chapter 5 Operation with iBIT block extension Coding the iBIT:Racer robot is simple and easy by using the iBIT block extension in Makecode Block editor. User can add erxtension following the steps in Chapter 4. Figure 5-1 iBIT:Racer Robot connection assignment...
  • Page 52   Programmable robot with micro:bit User must know some information about the hardware connection of iBIT:Racer robot. The figure 5-1 shows the important details about connection assignment. iBIT:Racer robot’s left motor is connected with MOTOR-1 output. iBIT:Racer robot’s right motor is connected with MOTOR-2 output. Left sensor is connected with ADC0 analog input.
  • Page 53  Programmable robot with micro:bit  (2) At the JavaScript Blocks Editor section, click on the Let’s Code button. It redirect to MakeCode webpage for coding at https://makecode.microbit.org/# (3) Adding the iBIT block extension. Select Advance > Extensions from command list on the left menu.
  • Page 54   Programmable robot with micro:bit (4) Type the iBIT extension name into the search box then click SEARCH button. (5) iBIT extension appears in the command list on the left menu. Try to click on the iBIT name. All blocks are under the iBIT package will appear...
  • Page 55  Programmable robot with micro:bit  (6) Bookmark this webpage. Try to close web browser. Disconnect internet. Open web browser again and open the MakeCode web page from bookmark. Now you can coding with JavaScript Blocks Editor by offline. 5.2 How to make code for iBIT:Racer Robot Coding for micro:bit of the iBIT:Racer robot is easy.
  • Page 56   Programmable robot with micro:bit Figure 5-2 How to make code for micro:bit of the iBIT:Racer Robot...
  • Page 57  Programmable robot with micro:bit  5.3 iBIT block extension Figure 5-3 shows the overview all command blocks of iBIT package. There are 4 groups as follows : 1. Movement control blocks with one motor 2. Movement control blocks with two motors 3.
  • Page 58   Programmable robot with micro:bit 5.4 Movement control blocks with one motor There is one block as follows : This block support each motor outputs with forward / backward direction and set the speed from 0 to 100% like these :...
  • Page 59  Programmable robot with micro:bit  5.5 Movement control blocks with two motors. There are many function blocks for controlling the robot movement. They include : 1. Straight moving direction (forward / backward) 2. Turning direction (turn left / turn right) 3.
  • Page 60   Programmable robot with micro:bit 5.5.2 Turning direction blocks The pivot point of robot moving is at the center point of the wheel of the motor which is off. The robot will turn with speed value until the time that user set. These blocks control 2 motor outputs in same time with turn left / turn right and set the speed from 0 to 100% like these :...
  • Page 61  Programmable robot with micro:bit ...
  • Page 62   Programmable robot with micro:bit 5.5.3 Spin moving direction blocks The pivot point of robot moving is at the center point of the robot between both motors. The robot will turn with speed value until the time that user set. These blocks control 2 motor outputs in same time with spin left / spin right and set the speed from 0 to 100% like these :...
  • Page 63  Programmable robot with micro:bit ...
  • Page 64   Programmable robot with micro:bit 5.6 Servo motor control blocks There are 2 blocks for control the servo motor operation. 1. Servo This block is used to control the movement of servo motor’s shaft position. User could be select the servo motor output channel and moving angle from 0 to 180 degree. 2.
  • Page 65  Programmable robot with micro:bit  5.8 iBIT:Racer robot movement example This topic has 2 examples about how to control the robot’s movement. 5.8.1 Example-1 (1) Create the program following the block code below. (2) Connect the iBIT:Racer robot with computer’s USB port. (3) Download the code into micro:bit of the iBIT:Racer robot.
  • Page 66   Programmable robot with micro:bit 5.8.2 Example-2 (1) Create the program following the block code below. (2) Connect the iBIT:Racer robot with computer’s USB port. (3) Download the code into micro:bit of the iBIT:Racer robot. Disconnect the microUSB cable. (4) Place the robot on the floor.
  • Page 67  Programmable robot with micro:bit  5.9 Servo motor control example This topic demonstrates the servo motor position control. (1) Create the program following the block code below. (2) Connect the iBIT:Racer robot with computer’s USB port. (3) Download the code into micro:bit of the iBIT:Racer robot. Disconnect the microUSB cable.
  • Page 68   Programmable robot with micro:bit 5.10 Reading sensor example This topic demonstrates hwo to reading the analog sensor value from iBIT’s analog inputs. (1) Create the program following the block code below. (2) Connect the iBIT:Racer robot with computer’s USB port. (3) Download the code into micro:bit of the iBIT:Racer robot.
  • Page 69  Programmable robot with micro:bit  (7) Press button-B of the micro:bit. then observe the micro:bit LED operation again. micro:bit reads the sensor’s value from analog input ADC1 and shows on its LED display. (8) Stick the black tape on the floor. Place the robot by the sensor position must over the black tape.
  • Page 70   Programmable robot with micro:bit...
  • Page 71  Programmable robot with micro:bit  Chapter 6 with Line Tracing Activity The most popular of the education robot activity and learning is Line tracing robot. iBIT:Racer robot also support and has good performance about this activity. This chapter describes about how to make code for micro:bit robot to detect the black line and white surface for making the simple line tracing robot.
  • Page 72   Programmable robot with micro:bit (4) Turn on the POWER switch of the iBIT:Racer robot. (5) First, read value from the white area. Place the robot on the white area. (5.1) Press button-A of micro:bit then observe the micro:bit LED operation. Now micro:bit reads the sensor’s value from analog input ADC0 and shows on its LED display and record it.
  • Page 73  Programmable robot with micro:bit  6.2 Black line detection This activity demonstrates the black line detection by reading the Left IR reflector sensor and compare with the reference value. Result is shown by LED display of the micro:bit. Procedure : (1) Create the program following the block code below.
  • Page 74   Programmable robot with micro:bit (6) Place the robot over the black line. See the detection result from micro:bit display. The display shows HAPPY icon Because the sensor value is less than the reference value (left < 1500). How to make a variable in Microsoft PXT block editor (1) At the main window of Microsoft PXT block editor, click on the Variable in the left menu.
  • Page 75  Programmable robot with micro:bit  (3) Back to main window, in the Variable block list has a new variable block. It is left block. (4) Drag and drop the on the workspace. (5) Change the variable by clicking on the variable name and select the target variable.
  • Page 76   Programmable robot with micro:bit Learn about condition and comparison block Most operation of the code is checking and comparison data. The Microsoft PXT block editor also provides the condition and comparison blocks. These are short tutorial. At the main window of Microsoft PXT block editor, click on the Logic list from a block category on the left hand side of the page.
  • Page 77  Programmable robot with micro:bit  (1.1) Drag and drop the if…then block on the workspace (1.2) Click on the setting button of the if block (1.3) Drag and drop the else…if block to connect the if block.
  • Page 78   Programmable robot with micro:bit (1.4) Drag and drop the else block to connect the else…if block. Click on the setting button of the if block again to finish. (1.6) If you want to loop checking condition, select to Basic block category then drag and drop the forever block to cover all if blocks following the screen short below.
  • Page 79  Programmable robot with micro:bit  Operation of if…else…if block could be describe as follows : (a) Check the first condition. If false, check next condition of else…if block (b) If condition still is false, code will execute the command at the ending else block.
  • Page 80   Programmable robot with micro:bit A or B evaluates to true if-and-only-if either A is true or B is true: false or false = false  false or true = true  true or false = true  true or true = true  not A evaluates to the opposite (negation) of A: not false = true ...
  • Page 81  Programmable robot with micro:bit  6.3 Black line detection with 2 sensors This activity demonstrates the black line detection by reading both IR reflector sensors; Left and Right then compare with the reference value. Result is shown on LED display of the micro:bit.
  • Page 82   Programmable robot with micro:bit 6.4 Robot finds the black line This activity demonstrates the robot moves forward to finds the black line. It will stop immediately after both sensors detect the black line together. Procedure : (1) Create the program following the block code below. (2) Connect the iBIT:Racer robot with computer’s USB port.
  • Page 83  Programmable robot with micro:bit  6.5 Simple line tracing robot There are 4 scenarios of the line tracing robot operation. 1. Both sensors detect the white 2. Only the Left sensor detects surface. the black line Result : Robot moves forward over the Result : Robot spins left until both sensors black line.
  • Page 84   Programmable robot with micro:bit Procedure : (1) Create the program following the block code below. (2) Connect the iBIT:Racer robot with computer’s USB port. (3) Download the code into micro:bit of the iBIT:Racer robot. Disconnect the microUSB cable.
  • Page 85  Programmable robot with micro:bit  (4) Make the simple black line field following the illustration below. The white surface area is 90 x 60 cm. and black line width is 1 inches (2.5 cm.) (5) Place the robot at the start point and over the black line. (6) Turn on the POWER switch of the iBIT:Racer robot.
  • Page 86   Programmable robot with micro:bit 6.6 How to make function for Line Tracing Robot Function is the small program that contains some command block. It helps the code minimal and shorter. (1) Select block category Advanced > Functions then select Make a Function. (2) Set the function name.
  • Page 87  Programmable robot with micro:bit  (4) Set the command block for this function. (5) The created function will add into the menu Function automatically. (6) Users and developers can use the new function for their code.
  • Page 88   Programmable robot with micro:bit 6.7 Create line tracing function From the simple line tracing robot topic 6.5, we can make the better operation with better code by making function. There are 2 functions for this activity. 1. Cross_Stop - The operation of this function is looping to check both sensors status and try to control the robot moving along the black line at all times.
  • Page 89  Programmable robot with micro:bit  2. Cross_Left - The operation of this function is looping to check both sensors status and try to control the robot moving along the black line at all times. If the robot detects the crossing line, it spins left to change the moving path to left. Robot spins left until both sensors detect the white area.
  • Page 90   Programmable robot with micro:bit Cross_Left function for iBIT:Racer robot From creating 2 functions for tracing the black line, you can make the new code for improving the line tracing robot. The next activity is making the smarter line tracing robot. It can move along the black line and spins left when detect the first crossing line.
  • Page 91  Programmable robot with micro:bit  Procedure : (1) Create the program following the block code below.
  • Page 92   Programmable robot with micro:bit (2) Connect the iBIT:Racer robot with computer’s USB port. (3) Download the code into micro:bit of the iBIT:Racer robot. Disconnect the microUSB cable. (4) Make the black line arena depend on your design and add 2 crossing lines or junctions.