Robotics_CB_Grade4_Ebook

Page 1

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

4

Singapore | Gurugram | Bengaluru | © 2024 Uolo EdTech Pvt. Ltd. All rights reserved.

RB_CB_Grade4_Cover.indd All Pages

18/01/24 5:12 PM



ROBOTICS

Grade 4

Grade 4.indd 1

1/18/2024 6:39:36 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: Keyboard Movement

16

8

Experiment 2: Bot Movements Using Motor Control

18

9

Experiment 3: Draw Shapes

23

10

Experiment 4: Object Detection

29

11

Experiment 5: Object Avoider

38

12

Experiment 6: Dancer Car

47

ii ii

Grade 4.indd 2

1/18/2024 6:39:38 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 4.indd 1

1/18/2024 6:39:38 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 4.indd 2

1/18/2024 6:39:39 PM


2 About the Brain

3

Grade 4.indd 3

1/18/2024 6:39:39 PM


1. P rogramming Buzzer: The programming of tones and time gives you many different sounds to play with.

2. T wo Programmable RGB LEDs: You can program the intensity of red, blue, and green colors produced by the LEDs and make many colours. 3. S ensor Ports: These ports help you connect sensors to the Brain.

4. B attery 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. P ower Button: This button helps you to turn the Brain ON or OFF.

7. P rogramming Port: Connect your programming wire to this port. 8. M otor Ports: These ports help you connect motors to the Brain.

4

Grade 4.indd 4

1/18/2024 6:39:39 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 4.indd 5

1/18/2024 6:39:40 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 4.indd 6

1/18/2024 6:39:40 PM


Tightening Axle Lock:

g

01 Insert Axle

02 Lock Axle Lock

03 Insert Plate

04 Insert Bolts

Basics of Building

Grade 4.indd 7

7

1/18/2024 6:39:40 PM


5 Building an RC Car

1. Insert axle lock and 3.5” axles into the high-speed motors as shown.

2. A fter attaching the axles to both motors, screw them to the chassis using the 6mm bolts as shown.

8

Grade 4.indd 8

1/18/2024 6:39:41 PM


3. R epeat 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. A ttach the previous assembly to the chassis as shown with 12mm bolts.

Building an RC Car

Grade 4.indd 9

9

1/18/2024 6:39:42 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 4.indd 10

1/18/2024 6:39:42 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. W orkspace Area: This is the area where you drag blocks for the code you want to write.

2. B locks Panel: The blocks from the Blocks Panel help make your code. 3. S hare Code: The Share Code option generates link for the project to share it with the teacher.

4. B utton 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. B uttons: 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 4.indd 11

1/18/2024 6:39:42 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

8

How to burn your program into the ABot hardware? 1. O nce you have completed your experiment, connect the ABot with a PC/Laptop using a USB cable or Bluetooth.

12

Grade 4.indd 12

1/18/2024 6:39:42 PM


2. Save and Compile your code.

3. Now, click on Burn.

About Coding Interface

Grade 4.indd 13

13

1/19/2024 12:51:45 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 4.indd 14

1/19/2024 12:51:45 PM


6. Now, click on Burn to write your program into the ABot.

7. Y ou have successfully written your code into the ABot hardware. Now you can perform the experiment on the ABot.

About Coding Interface

Grade 4.indd 15

15

1/18/2024 6:39:43 PM


7

Experiment 1: Keyboard Movement

Objective

Introducing you to the exciting world of robotics by guiding your RC Car through keyboard-controlled movements in a virtual environment, fostering early familiarity with technology and instilling fundamental concepts of robotic motion.

Let’s Code

1. T o play the game, click on the game screen and then use A, D, W, S keys to move the bot left, right, forward, and backward respectively. 2. Now, complete the following five tasks:

a) Move the bot forward to throw garbage in the dustbin. b) Move the bot right to throw garbage in the dustbin. c)

Move the bot left to throw garbage in the dustbin.

d) Move the bot backward to throw garbage in the dustbin. e) Use all movements to collect multiple items.

16

Grade 4.indd 16

1/18/2024 6:39:43 PM


Scan QR code to view output

Experiment 1: Keyboard Movement

Grade 4.indd 17

17

1/18/2024 6:39:43 PM


8

Experiment 2: 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 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. 18

Grade 4.indd 18

1/18/2024 6:39:43 PM


ot g

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 menu.

9. S elect speed of your choice from the Speed drop-down menu.

Experiment 2: Bot Movements Using Motor Control

Grade 4.indd 19

19

1/18/2024 6:39:43 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.

20

Grade 4.indd 20

1/18/2024 6:39:44 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 Port1 and Port2 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 2: Bot Movements Using Motor Control

Grade 4.indd 21

21

1/18/2024 6:39:44 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

22

Grade 4.indd 22

1/18/2024 6:39:44 PM


9

Experiment 3: 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.

23

Grade 4.indd 23

1/18/2024 6:39:44 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 Port1 as clockwise by selecting the Clockwise option from the drop-down.

6. F or the second Move Motor at block, select Port2 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

24

Grade 4.indd 24

1/18/2024 6:39:45 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 3: Draw Shapes

Grade 4.indd 25

25

1/18/2024 6:39:45 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:

26

Grade 4.indd 26

1/18/2024 6:39:45 PM


Experiment 3: Draw Shapes

Grade 4.indd 27

27

1/18/2024 6:39:45 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

28

Grade 4.indd 28

1/18/2024 6:39:45 PM


10

Experiment 4: Object Detection

Objective

To create a bot that intelligently pauses when it detects obstacles using IR sensors, providing a gateway to explore, and learn about the principles of sensor technology and autonomous decision-making.

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.

Here, i_count is a name of a variable.

29

Grade 4.indd 29

1/18/2024 6:39:45 PM


2. Conditionals

• Human beings need to make decisions all the time that affect their lives. For e.g.,

⸰ "Should I eat one cookie or two?"

⸰ "Should I play cricket or badminton?"

• Similarly, to make decisions and carry out actions accordingly, in code, we use Conditionals.

Condition 1 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.

30

Grade 4.indd 30

1/18/2024 6:39:45 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.

Things Around Us

ADAS (Advanced Driver Assistance System) and Emergency Braking Systems

Experiment 4: Object Detection

Grade 4.indd 31

31

1/18/2024 6:39:45 PM


Let’s Build •

Attach IR sensor to the front on holes 1 and 2 in row 2 of the chassis.

Connect the 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 present inside this occurs step by step, in sequence.

3. Drag the Repeat while block from the Loops category and drop inside the My Program block to begin the infinite loop. This block is set to true by default.

32

Grade 4.indd 32

1/18/2024 6:39:46 PM


4. Click on the Variables category.

5. Click on the Create Variable button. A pop-up box appears asking you to enter a New variable name.

6. Enter a suitable variable name, let’s say "IR_Sensor" to store the data of the IR sensor value received from the sensor.

7. Click on the OK button.

8. Drag the set to block from the Variables category and drop it inside the Repeat while block.

9. Then drag the Read IR Sensor at block from the Sensor category and attach this block with the set to block. Select "Port2" from the drop-down of the Read IR Sensor at block.

10. Drag the if block from the Control category and drop it below the set to block. 11. Click on the settings icon of the if block. A pop-up box appears.

12. Drag the else block and drop it below the if block in the pop-up box. Experiment 4: Object Detection

Grade 4.indd 33

33

1/18/2024 6:39:46 PM


13. Click on the settings icon again to close the pop-up box. 14. Drag the equal operator block from the Control category and attach it to the right of the if block.

15. Select the '>' option from the drop-down of the equal operator block.

16. Drag the IR_Sensor block from the Variables category and drop it in the left part of the greater than operator block. 17. Now, drag the number block from the Math category and drop it in the right part of the greater than operator block. Type "400" in the text part of the number block. Now, if the value of the IR_Sensor variable is greater than 400, i.e., the IR Sensor senses

34

Grade 4.indd 34

1/18/2024 6:39:46 PM


the object, then blocks under the if block will be executed, else the blocks under the else block will be executed.

18. Drag two set led blocks from the Indicators category and drop them inside the do condition block. 19. Select "2" from the drop-down for the second set led block. 20. Also set the colour of the LED 1 and LED 2 to green.

21. Drag the play tone of frequency block from the Indicators category and drop it below the second set led block. This block is used to play the buzzer.

22. Now, drag two Move Motor at blocks from the Motor category for Port1 and Port2 to Stop both the motors. This will instruct the bot to stop when there is an object in front.

Experiment 4: Object Detection

Grade 4.indd 35

35

1/18/2024 6:39:46 PM


23. Drag and drop two Move Motor at blocks in the else condition block.

24. Configure the motor at Port1 as clockwise by selecting the Clockwise option from the drop-down. Select the speed of the motor as Medium.

25. Similarly, select Port2 from the drop-down menu 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 Medium. This will move both the motors forward as long as no object is detected ahead.

36

Grade 4.indd 36

1/18/2024 6:39:47 PM


26. Give a name to your program, save, and then compile it. 27. Now, the program is ready to burn on the ABot.

Scan QR code to view output

Experiment 4: Object Detection

Grade 4.indd 37

37

1/18/2024 6:39:47 PM


11

Experiment 5: Object Avoider

Objective

Building upon the object detection experiment, you will learn to empower your bot to autonomously navigate, enhancing problem-solving abilities and reinforcing the concept of real-time decision-making in robotics.

Things Around Us

Automatic Vacuum Cleaner

Let’s Build •

Attach IR sensor to the front on holes 1 and 2 in row 2 of the chassis.

38

Grade 4.indd 38

1/18/2024 6:39:48 PM


Connect the 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 present inside this occurs step by step, in sequence.

3. Drag the Repeat while block from the Loops category and drop inside the My Program block to begin the infinite loop. This block is set to true by default.

4. Click on the Variables category.

5. C lick on the Create Variable button. A pop-up box appears asking you to enter a New variable name.

• Enter a suitable variable name, let’s say "IR_Sensor"

to store the data of the IR sensor value received from the sensor.

• Click on the OK button. Experiment 5: Object Avoider

Grade 4.indd 39

39

1/18/2024 6:39:48 PM


6. Drag the set 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 this block with the set to block. 8. S elect the "Port 2" option from the drop-down menu of the Read IR Sensor at block.

9. Drag the if block from the Control category and drop it below the set to block.

10. Click on the settings icon of the if block. A pop-up box appears.

11. Drag the else block and drop it below the if block in the pop-up box.

12. Click on the settings icon again to close the pop-up box. 13. Drag the equal operator block from the Control category and attach it to the right of the if block.

14. Select the '>' option from the drop-down of the equal operator block. 40

Grade 4.indd 40

1/18/2024 6:39:48 PM


15. Drag the IR_Sensor block from the Variables category and drop it in the left part of the greater than operator block.

16. Now, drag the number block from the Math category and drop it in the right part of the greater than operator block. Type "400" for the text part of the number block. 17. If the value of the IR_Sensor variable is greater than 400, i.e., the IR Sensor senses the object, then blocks under the if block will be executed, else the blocks under the else block will be executed.

Experiment 5: Object Avoider

Grade 4.indd 41

41

1/18/2024 6:39:48 PM


18. Drag two set led blocks from the Indicators category and drop them inside the do condition block. Select "2" from the drop-down for the second set led block. 19. Also set the colour of the LED 1 and LED 2 to green.

20. Drag the play tone of frequency block from the Indicators category and drop it below the second set led block. This block is used to play the buzzer.

21. Now, drag two Move Motor at blocks from the Motor category for Port1 and Port2 to Stop the two motors. This will instruct the bot to stop.

22. Drag and drop the Time block from the Control category. This will instruct the bot to stop for 1000 milliseconds or 1 second when the IR sensor detects an object.

23. Drag and drop two Move Motor at blocks below the Time block.

42

Grade 4.indd 42

1/18/2024 6:39:48 PM


24. Configure the motor at Port1 as anticlockwise by selecting the Anticlockwise option from the drop-down. Select the speed of the motor as Medium.

25. Similarly, select the "Port2" option from the drop-down of the second Move Motor at block.

26. Configure the motor at Port2 as clockwise by selecting the Clockwise option from the drop-down. Select the speed of the motor as Medium. This will move both the motors backwards. 27. Also, drag and drop the Time block below the Move Motor at block.

Experiment 5: Object Avoider

Grade 4.indd 43

43

1/18/2024 6:39:48 PM


28. Then, instruct the bot to Stop again for "1000" ms.

29. Similarly, instruct the bot to move left for "1100" ms by configuring the motor at Port1 and Port2 as Clockwise. You can turn the bot to any direction as you wish.

44

Grade 4.indd 44

1/18/2024 6:39:49 PM


30. Thereafter, Stop the bot for "1000" ms.

Experiment 5: Object Avoider

Grade 4.indd 45

45

1/18/2024 6:39:49 PM


31. In the else condition, instruct the bot to move forward as long as the IR sensor does not detect any object.

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

46

Grade 4.indd 46

1/18/2024 6:39:49 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. Insert 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.

47

Grade 4.indd 47

1/18/2024 6:39:49 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.

48

Grade 4.indd 48

1/18/2024 6:39:49 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. A ttach the touch sensor with the chassis using 6mm bolts.

Experiment 6: Dancer Car

Grade 4.indd 49

49

1/18/2024 6:39:49 PM


9. Then, attach the Brain to the chassis using 12mm bolts.

10. Connect the right motor to "M1" port and left motor to the "M2" port of the Brain.

11. Finally, connect the touch sensor with the "S1" port of the Brain.

50

Grade 4.indd 50

1/18/2024 6:39:50 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.

Experiment 6: Dancer Car

Grade 4.indd 51

51

1/18/2024 6:39:50 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 menu. 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.

14. Drag the else block and drop it below the if block in the pop-up box.

52

Grade 4.indd 52

1/18/2024 6:39:50 PM


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 menu 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. 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 Experiment 6: Dancer Car

Grade 4.indd 53

53

1/18/2024 6:39:50 PM


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.

54

Grade 4.indd 54

1/18/2024 6:39:50 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 menu 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.

Experiment 6: Dancer Car

Grade 4.indd 55

55

1/18/2024 6:39:50 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.

56

Grade 4.indd 56

1/18/2024 6:39:50 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 menu. 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.

Experiment 6: Dancer Car

Grade 4.indd 57

57

1/18/2024 6:39:50 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 the 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.

58

Grade 4.indd 58

1/18/2024 6:39:51 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.

35. Now, again drag the two set led blocks and drop it in the else condition. Set the colour of the LED 1 and LED 2 to red.

Experiment 6: Dancer Car

Grade 4.indd 59

59

1/18/2024 6:39:51 PM


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

60

Grade 4.indd 60

1/18/2024 6:39:51 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

4

Singapore | Gurugram | Bengaluru | © 2024 Uolo EdTech Pvt. Ltd. All rights reserved.

RB_CB_Grade4_Cover.indd All Pages

18/01/24 5:12 PM


Turn static files into dynamic content formats.

Create a flipbook
Issuu converts static files into: digital portfolios, online yearbooks, online catalogs, digital photo albums and more. Sign up and create your flipbook.