About the Book This book introduces students to the captivating realm of robotics. The book takes a learner-friendly, motivating, and hands-on approach. It combines theoretical understanding with real-world applications, while promoting creativity and problem-solving abilities in learners. Emphasizing a project-based learning methodology, the book provides a series of projects, each equipped with detailed instructions. These instructions can be effortlessly executed using the accompanying robotics hardware kit, complete with essential components and tools. The assembly and programming of the robotics system are facilitated through block-based coding and simulation environments, enabling the experiential learning journey.
About Uolo
Uolo partners with K-12 schools to bring technologybased learning programs. We believe pedagogy and technology must come together to deliver scalable learning experiences that generate measurable outcomes. Uolo is trusted by over 10,000 schools across India, South East Asia, and the Middle East.
hello@uolo.com
In partnership with Avishkaar
5
Singapore | Gurugram | Bengaluru | © 2024 Uolo EdTech Pvt. Ltd. All rights reserved.
RB_CB_Grade5_Cover.indd All Pages
18/01/24 3:00 PM
ROBOTICS
Grade 5
Grade 5.indd 1
1/18/2024 3:45:42 PM
Contents 1
About the Hardware Kit
1
2
About the Brain
3
3
The Motors
5
4
Basics of Building
6
5
Building an RC Car
8
6
About Coding Interface
11
7
Experiment 1: Bot Movements Using Motor Control 16
8
Experiment 2: Draw Shapes
21
9
Experiment 3: Edge Avoider
27
10
Experiment 4: Sensor Car
37
11
Experiment 5: Line Follower
46
12
Experiment 6: Dancer Car
58
ii ii
Grade 5.indd 2
1/18/2024 2:57:55 PM
1
About the Hardware Kit
Electronics 1. Brain × 1
2. IR Sensor × 2
3. Touch Sensor × 1
4. High-Speed Motors × 2
5. Programming Cable × 1
6. Connecting Cables × 4
7. Battery × 1 (attached behind the brain)
8. Charger × 1
1
Grade 5.indd 1
1/18/2024 2:57:55 PM
Construction Parts and Tools: 1. Wheels x 2
2. 3.5” Axles × 2
3. 2.5” U-Beam × 2
4. Chassis × 1
5. Allen Key × 1
6. Spanner × 1
7. Caster Wheel × 1
8. 12mm Bolts × 10
9. 6mm Bolts × 12
10. K-Nuts × 10
11. A xle Lock × 6
12. Zip Ties × 5
13. F illers × 6
2
Grade 5.indd 2
1/18/2024 2:57:56 PM
2 About the Brain
3
Grade 5.indd 3
1/18/2024 2:57:57 PM
1. Programming Buzzer: The programming of tones and time gives you many different sounds to play with.
2. Two Programmable RGB LEDs: You can program the intensity of red, blue and green colors produced by the LEDs and make many colors. 3. Sensor Ports: These ports help you connect sensors to the brain.
4. Battery Level Indicator: An indicator will show you the energy level of your bot—whether it is low or full of energy. 5. DC Jack: Connect the 9V Battery to this port.
6. Power Button: This button helps you to turn the brain ON or OFF.
7. Programming Port: Connect your programming wire to this port. 8. Motor Ports: These ports help you connect motors to the brain.
4
Grade 5.indd 4
1/18/2024 2:57:57 PM
3 The Motors Identify the rotation direction of motors by looking at it with the axle facing you.
Clockwise Rotation
Anti-Clockwise Rotation
Bots move in different directions by the combination of the rotation from each wheel. For example:
Forward Direction
Backward Direction
Left Direction
Right Direction 5
Grade 5.indd 5
1/18/2024 2:57:57 PM
4 Basics of Building Let’s understand some basics of building. Tightening Screws:
Tighten (Rotate Clockwise)
Loosen (Rotate Anti-Clockwise)
Tightening Axle Lock:
Tighten (Rotate Clockwise)
Loosen (Rotate Anti-Clockwise)
6
Grade 5.indd 6
1/18/2024 2:57:58 PM
Tightening Axle Lock:
g
01 Insert Axle
02 Lock Axle Lock
03 Insert Plate
04 Insert Bolts
Basics of Building
Grade 5.indd 7
7
1/18/2024 2:57:58 PM
5 Building an RC Car
1. Insert axle lock and 3.5” axles into the high-speed motors as shown.
2. After attaching the axles to both motors, screw them to the Chassis using the 6mm bolts as shown.
8
Grade 5.indd 8
1/18/2024 2:57:58 PM
3. Repeat the previous step to attach the second high-speed motor to the other side of the Chassis.
4. Add a filler to the axle, then add the wheel and lastly add another axle lock. Do this for both the axles.
5. Screw the Caster wheel to both U-Beams using 2 K-nuts and 6mm bolts as shown below.
6. Attach the previous assembly to the Chassis as shown with 12mm bolts.
Building an RC Car
Grade 5.indd 9
9
1/18/2024 2:57:59 PM
7. Screw the Brain to the Chassis using 6mm bolts as shown and then connect the left motor to the M1 slot and right motor to the M2 slot in the brain using the connecting cables.
8. Connect the left motor to the 'M1' port and connect the right motor to the 'M2' port of the Brain using the connecting cables as shown.
10
Grade 5.indd 10
1/18/2024 2:58:00 PM
6
About Coding Interface
The coding interface serves as the central hub for your kit, acting as an Integrated Development Environment (IDE) that enables you to write code for all of your experiments. This code is then transferred to the ABot. The coding interface consists of nine major components: 1. Workspace Area: This is the area where you drag blocks for the code you want to write. 2. Blocks Panel: The blocks from the Blocks Panel help make your code. 3. Share Code: The Share Code option generates link for the project to share it with the teacher.
4. Button Area: The Button Area contains Save, Compile, and Burn buttons. • Save button: The Save button helps save your code. Compile button: The Compile button helps compile • your code. Burn button: The Burn button helps burn your code to • the ABot. 5. Arena: This is the area where you can see the output.
6. Buttons: The buttons help move the bot front, back, left or right. The buttons also help rotate the bot clockwise and anticlockwise in the virtual arena. 11
Grade 5.indd 11
1/18/2024 2:58:00 PM
7. Play Button: The Play button runs the code.
8. Reset Button: The Reset button resets the arena.
9. Simulation Window: User can do the following actions on the simulation window: i) Change the bot view using the and options from the Simulation Window. ii) View the arena in full screen using the
button.
iii) Move the bot left, right, forward and backwards. iv) Rotate bot clockwise and anticlockwise.
9
How to burn your program into ABot hardware? 1. Once you have completed your experiment, connect the ABot with a PC/Laptop using a USB cable or Bluetooth.
12
Grade 5.indd 12
1/18/2024 2:58:00 PM
2. Save and Compile your code.
3. Now, click on Burn.
About Coding Interface
Grade 5.indd 13
13
1/18/2024 2:58:00 PM
4. C lick on the USB Connect option or the BLE Connect (Bluetooth) option.
5. C lick on the Connect Device button and a small window will appear. Thereafter, select your connected device and then click on Connect.
14
Grade 5.indd 14
1/18/2024 2:58:00 PM
6. Now, click on Burn to write your program into the ABot.
7. Y ou have successfully written your code into ABot hardware. Now you can perform the experiment on the ABot.
About Coding Interface
Grade 5.indd 15
15
1/18/2024 2:58:01 PM
7
Experiment 1: Bot Movements Using Motor Control
Objective
Learn the essentials of physical bot control by mastering basic movements (forward, backward, left, and right) using motors, cultivating a foundation in practical robotics concepts.
Background 1. Time Delay
elay function is used to suspend execution of a program D for a particular time.
Let’s Code
1. Click on the Control category from the Blocks panel.
16
Grade 5.indd 16
1/18/2024 2:58:01 PM
2. Drag the My Program block to the workspace to begin your program. The execution of all the blocks present inside this occurs step by step, in sequence.
3. Drag the Move Motor at block from the Motor category and drop it inside the My Program block.
4. C onfigure the Motor at Port1 as clockwise by selecting the Clockwise option from the drop-down. 5. S elect the speed of the Motor as High, Medium, or Slow from the Speed drop-down.
6. S imilarly, drag another Move Motor at block and drop it below the previous block. 7. Select the Port2 option from the drop-down menu.
8. C onfigure the Motor at Port2 as anticlockwise by selecting the Anticlockwise option from the drop-down.
9. S elect speed of your choice from the Speed drop-down menu.
Experiment 1: Bot Movements Using Motor Control
Grade 5.indd 17
17
1/18/2024 2:58:01 PM
10. Drag the Time block from the Control category and drop it below the second Move Motor at block. 11. Type "2000" in the value box of the block. This will allow the forward movement of the motor for 2000 milliseconds or 2 seconds.
12. To move the bot forward for infinite time, use the Repeat while block from the Loops category with the Move Motor at blocks.
13. Similarly, to turn the bot backwards, configure the motor at Port1 as Anticlockwise and Port2 as Clockwise by making the respective selections from the drop-down.
18
Grade 5.indd 18
1/18/2024 2:58:01 PM
14. To move the bot backward for infinite time, use the Repeat while block from the Loops category with the Move Motor at blocks.
15. To turn the bot to the right, configure the Motor at Port 1 and Port 2 as Anticlockwise.
16. Drag and drop the Time block below the second Move Motor at block. Type "1100" in the value box for the block.
Experiment 1: Bot Movements Using Motor Control
Grade 5.indd 19
19
1/18/2024 2:58:01 PM
17. To turn the bot to the left, configure the motor at Port1 as Clockwise and Port2 as Clockwise too.
ote: When you turn the bot left or right, the time N value may vary from system to system. Therefore, to make a 90 degree turn, you can configure the time value accordingly.
18. Give a name to your program, save and then compile it. 19. Now, the program is ready to burn on the ABot.
Scan QR code to view output
20
Grade 5.indd 20
1/18/2024 2:58:01 PM
8
Experiment 2: Draw Shapes
Objective
Solidify your understanding of robotic movements by guiding your bots to craft geometric shapes like squares and rectangles.
Start here
Let’s Build •
Attach a pen to the RC bot, as shown below, using zip-ties.
21
Grade 5.indd 21
1/19/2024 12:46:25 PM
Let’s Code
1. Click on the Control category from the Blocks panel.
2. Drag the My Program block to the workspace to begin your program. The execution of all the blocks inside this occurs step by step, in sequence.
3. Drag the set pen block from the Robot category and drop it inside the My Program block.
4. T his block is set to ON by default. Select any colour of your choice from the colour box.
5. D rag and drop two Move Motor at blocks from the Motor category. Configure the first Move Motor at block at Port 1 as clockwise by selecting the Clockwise option from the drop-down. 6. F or the second Move Motor at block, select Port 2 from the drop-down menu. Configure this block as anticlockwise by selecting the Anticlockwise option from the drop-down.
7. Drag the Time block from the Control category and drop it below the second Move Motor at block. Type "4000" in the value box of the block. This will allow the
22
Grade 5.indd 22
1/18/2024 2:58:02 PM
forward movement of the motor for 4000 milliseconds or 4 seconds.
8. N ow, drag two Move Motor at blocks for Port1 and Port2 to Stop the two motors. This will instruct the bot to stop. 9. N ow, drag and drop the Time block to stop the bot for "1000" milliseconds.
10. Now, configure both the motors in Anticlockwise direction. Also, drag and drop the Time block to move the bot right for a specified time.
Experiment 2: Draw Shapes
Grade 5.indd 23
23
1/18/2024 2:58:02 PM
11. Post taking a right, stop the bot for 1000 milliseconds.
ote: When you turn the bot left or right, the time N value may vary from system to system. Therefore, to make a 90 degree turn, you can configure the time value accordingly.
12. Repeat the above steps 5 to 11 (to move the bot forward stop, turn right and then stop again) till you create all four sides of the square shape. The final code should look like this:
24
Grade 5.indd 24
1/18/2024 2:58:02 PM
Experiment 2: Draw Shapes
Grade 5.indd 25
25
1/18/2024 2:58:03 PM
13. Give a name to your program, save and then compile it. 14. Now, the program is ready to burn on the ABot.
Scan QR code to view output
26
Grade 5.indd 26
1/18/2024 2:58:03 PM
9
Experiment 3: Edge Avoider
Objective
Leveraging IR sensors, students will program their bots to intelligently detect and avoid the edges of raised platforms, enhancing their grasp of sensor-based navigation, and fostering problem-solving skills in real-world scenarios.
Things Around Us
Automatic Vacuum Cleaner
Background 1. Variables
• Variables are used to store information to be referenced and manipulated in a computer program.
• Variables in coding are not just static values, they also
provide a way of labelling data with a descriptive name, so our programs can be understood more clearly. This data can then be used throughout your program. 27
Grade 5.indd 27
1/18/2024 2:58:04 PM
Here, i_count is a name of a variable. 2. Conditionals
• Human beings (and other animals) make decisions all the time that affect their lives, for example:
⸰ "Should I eat one cookie or two?"
⸰ "Should I play cricket or badminton?"
• Similarly, to make decisions and carry out actions in code, use conditionals.
Condition True Do this
False Do Something Else
3. if block
• Conditional blocks have conditions and the program’s
flow is based on whether the condition is true or false.
• To apply conditions in code, use the if block. • The if block is a Control block. • If the condition is true, then the set of code is executed, else nothing happens.
28
Grade 5.indd 28
1/18/2024 2:58:04 PM
4. IR Sensor
• The closer the object, the more radiation it emits,
in the form of heat that can be detected by infrared sensors. An infrared (IR) sensor is an electronic device that measures and detects infrared radiation in its surrounding environment.
• In an IR Sensor, the sensor state is HIGH when a reflective object is in front of it. Black or dark-coloured objects do not reflect IR rays.
Let’s Build
1. R efer to the RC car built from Step 1 to Step 6, your model should look like this:
Experiment 3: Edge Avoider
Grade 5.indd 29
29
1/18/2024 2:58:04 PM
2. Attach two 2.5” U-Beams using 12mm bolts.
3. Then attach a Caster wheel to one 2.5” U-Beam.
4. A ttach an IR sensor to the 2.5” U-Beam using 6mm bolts as shown.
5. A ttach the previous assembly to the Chassis as shown using 12mm bolts.
30
Grade 5.indd 30
1/18/2024 2:58:04 PM
6. Finally attach the Brain to the Chassis using 6mm bolts.
Let’s Code
1. Click on the Control category from the Blocks panel.
2. Drag the My Program block to the workspace to begin your program. The execution of all the blocks inside this occurs step by step, in sequence.
3. Drag the Repeat while block from the Loops category and drop it inside the My Program block to begin the infinite loop. By default, the loop value is set as true.
4. Click on the Variables category.
5. C lick on the Create Variable button. A pop-up box appears.
• Enter a suitable variable name in the New variable name box like IR_Sensor.
Experiment 3: Edge Avoider
Grade 5.indd 31
31
1/18/2024 2:58:04 PM
• Click on the OK button. This will create a variable to store the data of the IR sensor value received from the sensor.
6. Drag and drop the set to block from the Variables category and place it inside the Repeat while block.
7. Then drag the Read IR Sensor at block from the Sensor category and place it next to the set to block. Set the value of the Read IR Sensor at block as Port2.
8. Drag the if block from the Control category and place it below the set to block. 9. Click on the settings icon of the if block. A pop-up box appears.
10. Drag the else block and place it below the if block in the pop-up box (refer to the image below).
11. Again, click on the settings icon to hide the pop-up box.
32
Grade 5.indd 32
1/18/2024 2:58:04 PM
12. Define the condition for the if block using the block from the Control category.
13. Drag the IR_Sensor block from the Variables category and drop it in the left value box of the block.
14. Select the '>' sign from the drop-down list of the block.
15. Drag the
block from the Math category and drop
inside the right value box.
16. Type '400' in place of 0. If the value of the IR_Sensor variable is greater than 400, i.e., the IR Sensor senses the object, blocks under the if block will be executed, otherwise the blocks under the else block will be executed.
17. Drag and drop the set led block from the Indicators category and set the LED colour to green.
18. Again, drag and drop the set led block for the second LED. Select "2" from the drop-down menu. This block is set to ON by default. Experiment 3: Edge Avoider
Grade 5.indd 33
33
1/18/2024 2:58:04 PM
19. Set both motors to move in forward direction when there is a surface below. For this, drag and drop two Move Motor at blocks from the Motor category. Configure the Motor at Port1 as Clockwise and Port2 as Anticlockwise. 20. Set the speed of both the motors to Medium.
21. For the else part, drag and drop the set led block from the Indicators category and set the LED colour to red. 22. Again, drag and drop the set led block for the second LED and set the LED colour to red.
23. Set both motors to Stop by dragging and dropping the Move Motor at blocks.
34
Grade 5.indd 34
1/18/2024 2:58:05 PM
24. Also drag and drop the Time block from the Control category to instruct the bot to stop for 500 milliseconds when there is no object or surface detected below.
25. Set both motors to move backward followed by left direction (you can turn the bot to any direction as you wish). This will instruct the bot to move back and then left when no object or surface is detected.
Experiment 3: Edge Avoider
Grade 5.indd 35
35
1/18/2024 2:58:05 PM
26. Now, set both the motors to Stop.
27. Give a name to your program, save and then compile it. 28. Now, the program is ready to burn on the ABot.
Scan QR code to view output
36
Grade 5.indd 36
1/18/2024 2:58:05 PM
10
Experiment 4: Sensor Car
Objective
Using both IR and touch sensors, students will program their bots to halt upon detecting an object with IR, and upon touch sensor activation, initiate a left turn—providing an engaging introduction to the principles of sensor integration and user-controlled robotic interactions.
Background Touch Sensor
• •
ouch sensor works like a push button or a limit switch. It T simply gets triggered when it is touched or pressed. I n a Touch sensor, the sensor state is HIGH when the sensor is pushed with any object.
37
Grade 5.indd 37
1/18/2024 2:58:05 PM
Let’s Build
1. Attach IR Sensor to the front on holes 1 and 2 in row 2 of the Chassis using 6mm bolts.
2. Connect the IR Sensor to port S1 of the Brain.
3. Attach the Touch Sensor to the side using 6mm bolts and connect it to port S2 of the brain.
Let’s Code
1. Click on the Control category from the Blocks panel.
2. Drag the My Program block to the workspace to begin your program. The execution of all the blocks inside this occurs step by step, in sequence.
38
Grade 5.indd 38
1/18/2024 2:58:06 PM
3. Drag the Repeat while block from the Loops category and drop it inside the My Program block to begin the infinite loop. By default, the loop value is set to true.
4. Click on the Variables category.
5. Click on the Create Variable button. A pop-up box appears.
• Enter a suitable variable name. (IR_Sensor) • Click on the OK button. This will create the IR_Sensor variable to store the data of the IR sensor value received from the sensor.
• Similarly, create one more variable named
Touch_Sensor to store the data of the Touch sensor value received from the sensor.
6. Drag the set IR_Sensor to block from the Variables category and drop it inside the Repeat while block.
7. T hen drag the Read IR Sensor at block from the Sensor category and attach it to the set IR_Sensor to block. This block is set to Port1 by default. 8. S imilarly, drag the set Touch_Sensor to block from the Variables category and drop it below the set IR_Sensor to block.
Experiment 4: Sensor Car
Grade 5.indd 39
39
1/18/2024 2:58:06 PM
9. Drag the Read touch Sensor at block from the Sensor category and attach it to the set Touch_Sensor to block. Set the value as Port2.
10. Drag the if block from the Control category and drop it below the set Touch_Sensor to block. 11. Click on the settings icon of the if block. A pop-up box appears.
12. D rag the else if and else blocks and place them below the if block in the pop-up box (refer to the given image).
40
Grade 5.indd 40
1/18/2024 2:58:06 PM
13. Again, click on the settings icon to hide the pop-up box. 14. Drag
block from the Control category
and drop it to the right of the if block.
15. Now, drag two
blocks from the Control
category. Drop this one block to the left of the
block and drop the second block to the
right of the
bock.
16. Select the ‘>’ operator from the drop-down list of the block to the left and select ‘<’ operator from
the drop-down list of the
block to the right.
17. Drag and drop the IR_Sensor block from the Variables category and place it in the left value box of the block.
18. Drag
block from the Math category and drop it
inside the right value box of the Type ‘400’ in place of 0.
block.
19. Similarly, drag and drop the Touch_Sensor variable block inside the left value box of the
and
block inside its right value box. Type ‘400’ in place of 0.
Experiment 4: Sensor Car
Grade 5.indd 41
41
1/18/2024 2:58:06 PM
20. If the value of the IR_Sensor variable is greater than 400, i.e. the IR Sensor senses the object and Touch_Sensor variable value is less than 400, i.e., the Touch Sensor does not detect any touch, blocks under this if block will be executed.
21. Drag and drop the set led block from the Indicators category. Set the LED colour to green. This block is set to ON by default.
22. Drag and drop another set led block. Select '2' from its drop-down. Set the LED colour to green. 23. Drag and drop the play tone of frequency block from the Indicators category to play a buzzer for 100 milliseconds.
24. Now, set both motors to stop. For this, drag and drop two Move Motor at blocks from the Motor category. Select 'Port2' from the drop-down menu of the second Move Motor at block.
42
Grade 5.indd 42
1/18/2024 2:58:06 PM
25. Similar to the condition defined for the if block, define the condition for the else if block using the or and and operator blocks from the Control category. You can select the or option from the drop-down of the block. 26. If the value of the IR_Sensor is either greater or less than 400, i.e. the IR sensor got triggered or not, but the value of the Touch_Sensor > 400, i.e., the Touch sensor detects a touch; blocks under this else if block will be executed.
Experiment 4: Sensor Car
Grade 5.indd 43
43
1/18/2024 2:58:07 PM
27. Now, set both motors to move left when the Touch sensor is pressed. For this, configure the motors at Port 1 and Port 2 to Clockwise. 28. Drag and drop the Time block from the Control category and set it to '1100' ms. This will move the bot left for 1100 milliseconds. 29. Now, Stop both the motors for '1000' ms.
30. For the else part, set LED '1' and LED '2' to RED light.
44
Grade 5.indd 44
1/18/2024 2:58:07 PM
31. Now, set both the motors to move forward as long as no object is detected ahead.
32. Give a name to your program, save and then compile it. 33. Now, the program is ready to burn on the ABot.
Scan QR code to view output
Experiment 4: Sensor Car
Grade 5.indd 45
45
1/18/2024 2:58:07 PM
11
Experiment 5: Line Follower
Objective
Through the strategic use of two IR sensors, you will program the bot to skillfully track and follow a designated line, fostering an understanding of sensor-based navigation and enhancing problem-solving abilities in robotic applications.
Things Around Us
Advanced Driver Assistance Systems (ADAS) in Cars as Lane Assist
46
Grade 5.indd 46
1/18/2024 2:58:07 PM
Let’s Build
1. R efer to the RC car built from Step 1 to Step 6, your model should look like this.
2. Attach a Caster wheel to both 2.5” U-Beams using 12mm bolts, as shown.
3. T hen, attach two IR sensors to both the 2.5” U-Beams using the 6mm bolts as shown.
4. A ttach the previous assembly to the Chassis using the 12mm bolts as shown.
Experiment 5: Line Follower
Grade 5.indd 47
47
1/18/2024 2:58:07 PM
5. Attach the Brain to the Chassis using 6mm bolts.
6. C onnect the right IR sensor to port S1 and the left IR sensor to port S2 of the Brain.
Let’s Code
1. Click on the Control category from the Blocks panel.
2. Drag the My Program block to the workspace to begin your program. The execution of all the blocks inside this occurs step by step, in sequence.
3. Drag the Repeat while block from the Loops category and drop it inside the My Program block to begin the infinite loop. This block is set to true by default.
48
Grade 5.indd 48
1/18/2024 2:58:08 PM
4. Click on the Variables category.
5. C lick on the Create Variable button. A pop-up box appears.
• Enter a suitable variable name. (rightIR) • Click on the OK button. This will create a variable to store the data of the IR sensor value received from the right IR sensor.
6. Drag the set rightIR to block from the Variables category and drop it inside the Repeat while block.
7. T hen, drag the Read IR Sensor at block from the Sensor category and drop it next to the set rightIR to block. This block is set to Port1 by default. 8. Now, similarly create another variable named 'leftIR'.
9. D rag and drop the set leftIR to block. To its right, drag and drop the Read IR Sensor at block. Set this block to 'Port2'.
10. Drag the if block from the Control category and drop it below the set leftIR to block. 11. Click on the settings icon of the if block. A pop-up box appears.
Experiment 5: Line Follower
Grade 5.indd 49
49
1/18/2024 2:58:08 PM
12. Drag the else if block three times and place them below the if block in the pop-up box (refer to the given image).
13. Now, click on the settings icon again to close the pop-up box. 14. Drag the
block from the Control category
15. Drag two
blocks from the Control
and attach with the if block.
category and drop them inside the left and right boxes block.
of the
16. Select the '>' sign in place of the '=' sign for both the blocks.
50
Grade 5.indd 50
1/18/2024 2:58:08 PM
17. Drag the rightIR block from the Variables category and drop it in the left value box of the
18. Drag and drop the
block.
block from the Math category
inside the right value box of the Type '400' in place of '0'.
block.
19. Similarly, set the condition of the leftIR variable. 20. If the value of the rightIR and leftIR is greater than 400, i.e., both the IR sensors detect the white lines, then, blocks under this if block will be executed.
21. For the if part, configure the motors at Port 1 to Clockwise direction and Port 2 to Anticlockwise direction. This will instruct the bot to keep moving forward when it is on top of the black line.
Experiment 5: Line Follower
Grade 5.indd 51
51
1/18/2024 2:58:08 PM
22. Similar to defining the condition for the if block, define the condition for the first else if part. Set the rightIR value as less than 400 and set the leftIR value as greater than 400. The code under this else if part will execute when the right IR sensor detects the black line below.
52
Grade 5.indd 52
1/18/2024 2:58:08 PM
23. For the first else if part, set both motors to turn right. For this, configure the motors at Port1 and Port2 as Anticlockwise. This will instruct the bot to turn right as long as the right IR sensor is on top of the black line.
Experiment 5: Line Follower
Grade 5.indd 53
53
1/18/2024 2:58:08 PM
24. For the second else if part, use the comparison blocks to set the rightIR value as greater than 400 and set the leftIR value as less than 400. The code under this else if part will execute when the left IR sensor detects the black line below.
54
Grade 5.indd 54
1/18/2024 2:58:08 PM
25. For the second else if part, set both motors to turn left by configuring the motors at Port1 and Port2 as Clockwise. This will instruct the bot to turn left as long as the left IR sensor is on top of the black line.
Experiment 5: Line Follower
Grade 5.indd 55
55
1/18/2024 2:58:09 PM
26. For the third else if part, use the comparison blocks to set the rightIR value as less than 400 and set the leftIR value as less than 400. The code under this else if part will execute when both the left and right IR sensors detect the black line below.
56
Grade 5.indd 56
1/18/2024 2:58:09 PM
27. For the third else if part, set both motors to Stop. This will instruct the bot to stop if both the sensors detect the black line below.
28. Give a name to your program, save and then compile it. 29. Now, the program is ready to burn on the ABot.
Scan QR code to view output
Experiment 5: Line Follower
Grade 5.indd 57
57
1/18/2024 2:58:09 PM
12
Experiment 6: Dancer Car
Objective
Utilising touch sensors, students will program their bots to exhibit distinct dance moves triggered by sequential touch inputs, providing a playful introduction to programming logic and interactive robot behaviours.
Let’s Build
1. I nsert 3.5” axles in both high-speed motors with axle locks and tighten in place.
2. N ow, attach the first high-speed motor with axle to the Chassis using 6mm bolts as shown.
58
Grade 5.indd 58
1/18/2024 2:58:09 PM
3. R epeat the previous step for the other side and attach the second high-speed motor, perpendicularly using 6mm bolts.
4. T hen attach the wheels to both axles using filler and axle locks, and tighten in place.
5. Remove the wheel thread from one wheel.
Experiment 6: Dancer Car
Grade 5.indd 59
59
1/18/2024 2:58:09 PM
6. Attach two 2.5” U-Beam to each other and then attach a Caster wheel as shown using 12mm bolts.
7. A ttach the assembly created in the previous step to the Chassis with a single 12mm bolt.
8. Attach the Touch sensor with the Chassis using 6mm bolts.
60
Grade 5.indd 60
1/18/2024 2:58:09 PM
9. Then, attach the Brain to the Chassis using 12mm bolts.
10. Connect the right motor to 'M1' port and left motor to 'M2' port of the Brain.
11. Finally connect the Touch sensor with 'S1' port of the Brain.
Experiment 6: Dancer Car
Grade 5.indd 61
61
1/18/2024 2:58:10 PM
Let’s Code
1. Click on the Control category from the Blocks panel.
2. Drag the My Program block to the workspace to begin your program. The execution of all the blocks present inside this occurs step by step, in sequence.
3. Click on the Variables category.
4. C lick on the Create Variable button. A pop-up box appears asking you to create a New variable name.
• Enter a suitable variable name, let’s say 'count' to store the number of times the touch sensor was pressed.
• Click on the OK button.
5. Drag the set to block from the Variables category and drop it inside the My Program block. 6. T hen drag the number block from the Math category and attach this block with the set to block.
7. Drag the Repeat while block from the Loops category and drop it below the set to block to begin the infinite loop. The Repeat while block is set to true by default.
62
Grade 5.indd 62
1/18/2024 2:58:10 PM
8. Now, similarly create another variable named 'touchValue' to store the data of the touch sensor value received from the sensor. 9. Drag the set to block from the Variables category and drop it inside the Repeat while block.
10. Select the 'touchValue' variable name from the drop-down.
11. Then, drag the Read touch Sensor at block from the Sensor category and attach it with the set to block. The Read touch Sensor at block is set to Port1 by default.
12. Drag the if block from the Control category and drop it below the set to block. 13. Click on the settings icon of the if block. A pop-up box appears.
Experiment 6: Dancer Car
Grade 5.indd 63
63
1/18/2024 2:58:10 PM
14. Drag the else block and drop it below the if block in the pop-up box.
15. Click on the settings icon again to close the pop-up box. 16. Drag the equal operator block from the Control category and attach it to the right of the if block.
17. Select the '>' option from the drop-down of the equal operator block.
18. Drag the touchValue block from the Variables category and drop it in the left part of the greater than operator block.
64
Grade 5.indd 64
1/18/2024 2:58:10 PM
19. Now, drag the number block from the Math category and drop it in the right part of the greater than operator block. Type '500' for the text part of the number block. Now, if the value of the touchValue variable is greater than 500, i.e., the Touch Sensor is pressed, then blocks under the if block will be executed, else the blocks under the else block will be executed.
20. Drag two set led blocks from the Indicators category and drop them inside the do condition block.
• For the first block, LED value "1" and state "ON" is set by default. Set the colour of the LED to green.
• For the second block, set the LED value to "2", state to "ON" and colour as green.
Experiment 6: Dancer Car
Grade 5.indd 65
65
1/18/2024 2:58:10 PM
21. Drag the set to block from the Variables category and drop it below the second set led block. Select the count variable from the drop-down of the set to block.
22. Drag the add operator block from the Math category and attach it with the set to block.
23. Now, drag the count variable block and drop it inside the left part of the add operator block. This adds a sum of "1" to the variable count every time the touch sensor is pressed.
66
Grade 5.indd 66
1/18/2024 2:58:10 PM
24. Now, drag the if block and drop it below the set to block. Drag the else if block and drop it below the if block twice in the pop-up box.
25. Now, define the condition for the first if block using the equal operator block from the Control category. If the value of the count variable equals "1", then blocks under the if block will be executed.
Experiment 6: Dancer Car
Grade 5.indd 67
67
1/18/2024 2:58:10 PM
26. Drag and drop two Move Motor at blocks in the do condition block.
27. Configure the Motor at Port1 as clockwise by selecting the Clockwise option from the drop-down. Select the speed of the Motor as High.
28. S imilarly, select Port2 from the drop-down of the second Move Motor at block. Configure the Motor at Port2 as anticlockwise by selecting the Anticlockwise option from the drop-down. Select the speed of the Motor as High. This will set the first dance move of the robot in the forward direction.
68
Grade 5.indd 68
1/18/2024 2:58:11 PM
29. Repeat the above four steps and set the value for the number block as "2" instead of "1" for the else if condition.
30. Change the motor movement to Anticlockwise for the first motor and Clockwise for second motor.
31. Use the equal operator block for the second else if condition to set the value of the count variable block to "3". 32. Then, set both motors to Stop.
Experiment 6: Dancer Car
Grade 5.indd 69
69
1/18/2024 2:58:11 PM
33. Drag and drop the set to block below the last Move Motor at block. Also set the value of the count variable to "0" to reset its value. 34. Now, drag the Time block from the Control category and drop it below the if block to add a time delay of "1000" milliseconds.
70
Grade 5.indd 70
1/18/2024 2:58:11 PM
35. Now, again drag two set led blocks and drop it in the else condition. Set the colour of the LED 1 and LED 2 to red.
36. Give a name to your program, save and then compile it. 37. Now the program is ready to burn on the ABot.
Scan QR code to view output
Experiment 6: Dancer Car
Grade 5.indd 71
71
1/18/2024 2:58:11 PM
About the Book This book introduces students to the captivating realm of robotics. The book takes a learner-friendly, motivating, and hands-on approach. It combines theoretical understanding with real-world applications, while promoting creativity and problem-solving abilities in learners. Emphasizing a project-based learning methodology, the book provides a series of projects, each equipped with detailed instructions. These instructions can be effortlessly executed using the accompanying robotics hardware kit, complete with essential components and tools. The assembly and programming of the robotics system are facilitated through block-based coding and simulation environments, enabling the experiential learning journey.
About Uolo
Uolo partners with K-12 schools to bring technologybased learning programs. We believe pedagogy and technology must come together to deliver scalable learning experiences that generate measurable outcomes. Uolo is trusted by over 10,000 schools across India, South East Asia, and the Middle East.
hello@uolo.com
In partnership with Avishkaar
5
Singapore | Gurugram | Bengaluru | © 2024 Uolo EdTech Pvt. Ltd. All rights reserved.
RB_CB_Grade5_Cover.indd All Pages
18/01/24 3:00 PM