background image

 Programmable robot with micro:bit 

1

Programmable robot

with micro:bit

Activity book

Innovative  Experiment  Co.,Ltd

Summary of Contents for iBIT RACER

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

Page 2: ...X and INEX logo are trademarks of Innovative Experiment Co Ltd micro bit and micro bit logo are trademarks of micro bit Educational Foundation I2 C is a registered trademark of NXP Semiconductors Micr...

Page 3: ...plus introduction and part list 5 2 iBIT Racerrobot Assembly Insturctions 17 3 Aboutmicro bit 31 4 Getting start coding with micro bit 39 5 iBIT Racer robot operation with iBIT Block package 51 6 iBI...

Page 4: ...4 Programmable robot with micro bit...

Page 5: ...ous robot suitable for learning of the Microsoft PXT Graphical programming language This version is most affordable for beginners in robotics 2 iBIT robot kit Plus It also includes all main components...

Page 6: ...features are as follows 25 individually programmable LEDs 2 programmable buttons Physical connection pins Light and temperature sensors Motion sensors accelerometer and compass Wireless Communication...

Page 7: ...Programmable robot with micro bit 7 Figure 1 2 micro bit s input output pin assignment Figure 1 1 micro bit features and components...

Page 8: ...er 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 A barrel ja...

Page 9: ...AN3 AN4 AN5 8 7 6 5 4 3 2 1 SDA 15 16 VDD 3 3V A0 12 A1 13 AN6 AN7 GND COM 9 11 IC3 ADS7828 s s s s s s s s 3 3V 14 SCL 3 3V Vm K11 8 SERVO1 K12 12 SERVO2 Vs C1 470 F 16V C3 470 F 16V R1 1k LED1 POWER...

Page 10: ...rvo motor outputs I2 C bus port SCL and SDA for extension 2 of DC motor outputs with indicators Supports motor voltage of 4 5 to 9Vdc 1A output current 2 of servo motor outputs connect with the digita...

Page 11: ...to 12Vdc Current consumption 40mA 6Vdc and no load Average speed 440 round per minute RPM 6V and no load Weight is 9 5 grams Stall torque is 0 29 kg cm 6Vdc Attached with the mounting bracket with scr...

Page 12: ...ns are STANDARD SERVO MOTOR Body shaft connector cable GND Signal Vm Operating voltage is 4 8 to 6Vdc max Speed 0 deg to 180 degree in 0 3 seconds on average Weight 13 4 grams Torque 1 6kg cm 21oz inc...

Page 13: ...rikes the infrared transistor s base causing it to conduct current The more infrared incident on the transistor s base the more current it conducts When used as an analog sensor the ZX 03 can detect s...

Page 14: ...e for interfacing with the computer 1 5 1 JST3AA 8 cable This is an INEX standard cable 3 wires combined with 2mm The JST connector is at each end 8 inches 20cm in length Used for connecting between m...

Page 15: ...le is drilled to 3mm Which is very common shaft for miniature gearmotors It has an M4 set screw inside so It holds motor s shaft mechanically and firmly The kit includes 2 pairs of the wheel and silic...

Page 16: ...more mechanical parts 1 6 4 Plastic bracket There are 30 pieces of mixed color bracket They are made from PVC plastic They can be connected together or by using screws and 3 mm nuts in installation Th...

Page 17: ...3x10mm M3 truss head screws 4 of 3x15 mm M3 truss head screws 4 of 3x25mm M3 screws 30 of 3mm M3 nuts and 4 of 3mm washer 1 6 8 Metal standoffs and Thumb screws They are metal parts for supporting an...

Page 18: ...18 Programmable robot with micro bit...

Page 19: ...Programmable robot with micro bit 19 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: ...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 in...

Page 21: ...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 in...

Page 22: ...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...

Page 23: ...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 screw and nut 12 Assembl...

Page 24: ...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: ...d nut 16 Place the battery holder at position of the top of robot chassis following the photo below Attach with the chassis by using 2 sets of 2x20mm flat head screw and nut 17 Install the IR reflecto...

Page 26: ...ttach 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 P...

Page 27: ...Programmable robot with micro bit 27 20 Insert the standoffs on the top of the robot chassis Tighten with 3mm nuts...

Page 28: ...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: ...orrect 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...

Page 30: ...30 Programmable robot with micro bit Now the BIT Racer robot is ready for coding and fun...

Page 31: ...y 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 Figure 3 1 Illustrat...

Page 32: ...ess 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 The micro bit has 25 individually programmable LEDs allow...

Page 33: ...gh drive 5mA mode with a maximum of 3 pins in high drive mode at any one time Rings 3 large IO rings and two large power rings 4mm plug and crocodile clip compatible GPIO features 19 assignable GPIO p...

Page 34: ...emperature in degrees Celsius Really micro bit does not detect the ambient temperature directly It detects the CPU operating temperature Because the micro bit is open and CPU inside the microcontrolle...

Page 35: ...rdic Gazell Frequency band 2 4GHz Channel rate 1Mbps or 2Mbps Encryption None Channels 101 0 100 Group codes 255 Tx power 8 user configurable settings from 0 30dbm to 7 4dbm Payload size 32 standard t...

Page 36: ...to communicate with a wide range of Bluetooth devices including smartphones and tablets Stack Bluetooth 4 1 with BLE Band 2 4GHz ISM Industrial Scientific and Medical Channels 50 2MHz channels only 40...

Page 37: ...o bit Educational Foundation in order to document the hardware and software that make the micro bit work the way it does By doing so we hope to encourage contributions into all of the projects that ar...

Page 38: ...38 Programmable robot with micro bit...

Page 39: ...n Blocks Javascript Python Scratch and more no software required There are three exmple of coding tools for micro bit 1 JavaScript Blocks Editor The micro bit JavaScript Blocks editor makes it easy to...

Page 40: ...f premade images and music give you a helping hand with your code Powered by the global Python Community 3 Android and iOS apps The micro bit apps let you send code to your micro bit wirelessly using...

Page 41: ...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...

Page 42: ...direct 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 This is very important step You must do...

Page 43: ...ro bit 43 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 t...

Page 44: ...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 Macs PCs Chromebooks and Linux systems inc...

Page 45: ...rammable robot with micro bit 45 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 worksp...

Page 46: ...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...

Page 47: ...orever 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...

Page 48: ...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: ...ro bit 49 9 The micro bit will pause and the yellow LED on the back of the micro bit will blink while your code is programmed Once that s finished the code will run automatically micro bit LED shows t...

Page 50: ......

Page 51: ...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 Chapter 5 Operation with iBIT block extension Fi...

Page 52: ...acer 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 Right sensor is connected with...

Page 53: ...irect 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 This is very important step You must...

Page 54: ...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 t...

Page 55: ...r by offline 5 2 How to make code for iBIT Racer Robot Coding for micro bit of the iBIT Racer robot is easy There are only 4 main steps following the figure 5 2 Step 1 Go to https makecode microbit or...

Page 56: ...56 Programmable robot with micro bit Figure 5 2 How to make code for micro bit of the iBIT Racer Robot...

Page 57: ...ws 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 Servo motor control blocks 4 Senso...

Page 58: ...able 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...

Page 59: ...bot movement They include 1 Straight moving direction forward backward 2 Turning direction turn left turn right 3 Spin moving direction spin left spin right 5 5 1 Straight direction moving blocks This...

Page 60: ...ivot 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...

Page 61: ...Programmable robot with micro bit 61...

Page 62: ...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 t...

Page 63: ...Programmable robot with micro bit 63...

Page 64: ...of servo motor s shaft position User could be select the servo motor output channel and moving angle from 0 to 180 degree 2 ServoStop This block is just one operation It stops the operation of the se...

Page 65: ...IT 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 Turn on the POWER switch of the iBIT Rac...

Page 66: ...f the iBIT Racer robot Disconnect the microUSB cable 4 Place the robot on the floor Turn on the POWER switch of the iBIT Racer robot micro bit shows icon X and the robot does not move 5 Press button A...

Page 67: ...Servo Output 1 Insert the servo motor s horn Fix it by tightening the servo motor s screw 5 Turn on the POWER switch of the iBIT Racer robot 6 Press button A of micro bit then observe the servo motor...

Page 68: ...uter s USB port 3 Download the code into micro bit of the iBIT Racer robot Disconnect the microUSB cable 4 Turn on the POWER switch of the iBIT Racer robot 5 Place the robot on the white area 6 Press...

Page 69: ...o bit then observe the micro bit LED operation micro bit reads the sensor s value from analog input ADC0 and shows on its LED display The value must low because the sensor detects the black surface It...

Page 70: ...70 Programmable robot with micro bit...

Page 71: ...nd black line value We can describe again for doing the activity continue Purpose 1 Press button A for starting to read the sensor value from ADC0 input to shows on micro bit s LED display The sensor...

Page 72: ...oor Place the robot by the sensor position must over the black tape 6 1 Press button A of micro bit then observe the micro bit LED operation micro bit reads the sensor s value from analog input ADC0 a...

Page 73: ...cedure 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 ca...

Page 74: ...block editor click on the Variable in the left menu The block of variable will appear following the screen short below Click on the Make a Variable block 2 The dialog box for setting the variable nam...

Page 75: ...n 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 This is l...

Page 76: ...nd 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 The block of Logic will a...

Page 77: ...Programmable robot with micro bit 77 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: ...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...

Page 79: ...the command at the ending else block 2 Boolean operator and Comparison 2 1 Boolean Operator A Boolean has one of two possible values True and False or 1 or 0 2 2 Boolean logical operator Boolean logi...

Page 80: ...alse 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 not true false 2 3 Comparison block There are six blocks represent compa...

Page 81: ...cer robot with computer s USB port 3 Download the code into micro bit Disconnect the microUSB cable 4 Turn on the POWER switch of the iBIT Racer robot 5 Place the robot over the white surface See the...

Page 82: ...below 2 Connect the iBIT Racer robot with computer s USB port 3 Download the code into micro bit Disconnect the microUSB cable 4 Turn on the POWER switch of the iBIT Racer robot 5 Stick the black lin...

Page 83: ...ward over the black line 2 Only the Left sensor detects the black line Result Robot spins left until both sensors meet the white surface 3 Only the Right sensor detects the black line Result Robot spi...

Page 84: ...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 Disconne...

Page 85: ...the robot s operation iBIT Racer robot moves along the black line continue It is possible that the robot moves out of the line You can improve the precision by editing the program with adjusting the...

Page 86: ...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 fun...

Page 87: ...ammable robot with micro bit 87 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...

Page 88: ...an 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...

Page 89: ...along the black line at all times If the robot detects the crossing line it spins left to change the moving path to left 1 2 3 4 Move forward along the black line Both IR Reflector sensors detect the...

Page 90: ...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 de...

Page 91: ...Programmable robot with micro bit 91 Procedure 1 Create the program following the block code below...

Page 92: ...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 5 Place the...

Reviews: