Grade 4_Robotics-I_Text_Ebook

Page 1


ROBOTICS-1

Revised Edition

Tekie

Robotics-1

Acknowledgements

Academic Authors: Neha Verma, Ayushi Jain, Anuj Gupta, Simran Singh

Creative Directors: Bhavna Tripathi, Mangal Singh Rana, Satish

Book Production: Rakesh Kumar Singh, Sanjay Kumar Goel

Project Lead: Jatinder Kaur

VP, Learning: Abhishek Bhatnagar

All products and brand names used in this book are trademarks, registered trademarks or trade names of their respective owners.

© Uolo EdTech Private Limited

First impression 2024

Second impression 2025

This book is sold subject to the condition that it shall not by way of trade or otherwise, be lent, resold, hired out, or otherwise circulated without the publisher’s prior written consent in any form of binding or cover other than that in which it is published and without a similar condition including this condition being imposed on the subsequent purchaser and without limiting the rights under copyright reserved above, no part of this publication may be reproduced, stored in or introduced into a retrieval system, or transmitted in any form or by any means, electronic, mechanical, photocopying, recording or otherwise, without the prior written permission of both the copyright owner and the above-mentioned publisher of this book.

Book Title: Tekie Robotics - 1 Grade 4

ISBN: 978-81-982844-2-6

Published by Uolo EdTech Private Limited

Corporate Office Address:

85, Sector 44, Gurugram, Haryana 122003

CIN: U74999DL2017PTC322986

Illustrations and images: www.shutterstock.com, www.stock.adobe.com and www.freepik.com

All suggested use of the internet should be under adult supervision.

Robotics

What is Robotics?

Robotics is the study and creation of robots. Robots are machines that can perform various tasks. They are built using parts like metal, wires, and circuits, and programmed with special instructions to tell them what to do.

Some robots look like humans, while others are designed to work in specific places, like factories, hospitals, or even outer space! For example, a robot might assemble cars in a factory or explore the surface of Mars where humans cannot go easily.

Robots can sense their surroundings using sensors. These sensors act like the robot’s eyes, ears, and hands, helping it understand distance, temperature, or touch. Once the robot knows its surroundings, it can make decisions based on its programming.

The field of robotics combines science, technology, engineering, and mathematics (STEM) to solve problems and create amazing inventions. It is an exciting way to bring creativity and technology together!

Components of Robots

Robots are made up of different parts that work together to help them move, sense, and do tasks. These parts are grouped into three main types: mechanical, electronic, and coding interface. Let us learn about them.

Mechanical Parts

Mechanical parts are like the bones and muscles of a robot. They include wheels, gears, motors, and arms. These parts help the robot move, pick up things, or spin. For example, wheels let a robot roll around, and motors make robots move by turning wheels, spinning gears, or lifting arms.

Electronic Parts

The electronic parts are like the robot’s brain and nerves. They include circuits, sensors, and batteries. These parts help the robot think and sense its surroundings. Sensors act like eyes, ears, or even a nose for the robot, allowing it to detect light, sound, or obstacles. The battery gives the robot the power it needs to work.

Coding Interface

Coding is how we talk to robots and tell them what to do. Coding means writing instructions for them to follow. The coding interface is the program or app used to give these instructions. Once coded, the robot can move in a specific direction, stop when it sees something, or even dance.

By combining these three parts—mechanical, electronic, and coding—robots come to life and do amazing things.

ABot

About the Hardware Kit 1

ABot is a robotics kit that enhances STEM education and problem-solving skills while sparking curiosity and creativity in young innovators. Let’s explore its components.

Electronics

Construction Parts and Tools

1. Brain × 1 2. IR Sensor × 2
Touch Sensor × 1
Ultrasonic Sensor × 1
High-Speed Motors × 2
6. Programming Cable × 1
Connecting Cables × 4
Battery × 1
× 1
1. Wheels × 2
3.5” Axles × 2
2.5” U-Beam × 2
Chassis × 1
Allen Key × 1
6. Spanner × 1 7. Caster Wheel × 1
12mm Bolts × 10
6mm Bolts × 12 10. K-Nuts × 10
11. Axle Lock × 6
Zip Ties × 5
Fillers × 6

About the Brain

Following are the components of the Brain:

Component

Programming Buzzer

Two Programmable RGB LEDs

Sensor Ports

Battery Level Indicator

DC Jack

Power Button

Programming Port

Motor Ports

Description

The programming of tones and time gives you many different sounds to play with.

You can program the intensity of red, green, and blue colours produced by the LEDs and make many colours.

These ports help you connect sensors to the Brain.

An indicator will show you the energy level of your bot, whether it is feeling low or full of energy.

Connect the 9V Battery to this port.

This button helps you to turn the Brain ON and OFF.

Connect your Programming wire to this port.

These ports help you connect motors to the Brain.

Basics of Building and The Motors

Identify the rotation direction of motors by looking at it with the Axle facing you.

The robots move in different directions by the combination of the rotation from each wheel. For example:

Rotation

Rotation

Let’s understand some basics of building the robots:

Tightening Screws:

Tightening Axle Lock:

Tightening Axle Lock:

Tighten (Rotate Clockwise) Loosen (Rotate Anti-Clockwise)

Tighten (Rotate Clockwise) Loosen (Rotate Anti-Clockwise)

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

The coding interface consists of the following 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. Control Buttons: The Control Buttons consist of Save, Compile, and Connect buttons.

• Save Button: The Save button helps save your code.

• Compile Button: The Compile button helps compile your code.

• Connect Button: The Connect button helps burn your code to the hardware.

4. Arena: This is the area where you can see the output.

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

6. Play Button: The Play button runs the code.

7. Reset Button: The Reset button resets the arena.

Burning means loading your code into the hardware. This process, mainly, has the phases as shown:

1. Once you have completed your experiment, connect the bot to a PC/Laptop using a USB cable or Bluetooth.

2. Save and compile your code by clicking on the Save and Compile buttons, respectively.

3. Now, click on Connect.

4. Click on the USB Connect option or the BLE Connect (Bluetooth) option.

5. Click on the Connect Device button, and a small window will appear. Thereafter, select your connected device, and then click on Connect.

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

7. You have successfully written your code into the hardware. Now you can experiment on the bot.

Building a Remote Control Car

1 Insert the axle lock and the 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.

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

7 Screw the Battery to the chassis using 6mm bolts as shown.

8 Now, connect the Brain to the chassis in front of the battery as shown.

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

Left Motor
Right Motor

Experiment 1: Bot Movements Using Motor Control 2

Objective

Let's learn how to control a robot by making it move forward, backwards, left, and right using motors. This helps in understanding the basics of how robots work and is a great start to learning robotics!

Background

This experiment uses the concept of time delay. The delay function is used to suspend the execution of a program for a particular time. Let us understand this by looking at the process of cooking a dish in the microwave.

Let’s Code

1. Click on the Control category from the Blocks panel.

Put the dish in the microwave.

Set the timer of the microwave.

Is the buzzer beeping? Yes No

Wait for the buzzer to beep.

Take the dish out.

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.

3. Drag the Move Motor at the block from the Motor category and drop it inside the My Program block.

4. Configure the motor at Port1 as clockwise by selecting the Clockwise option from the drop-down.

5. Select the speed of the motor as High, Medium, or Slow from the Speed drop-down.

6. Similarly, drag another Move Motor at the block and drop it below the previous block.

7. Select the Port2 option from the drop-down menu.

8. Configure the motor at Port2 as anticlockwise by selecting the Anticlockwise option from the drop-down menu.

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

10. Drag the Time block from the Control category and drop it below the second Move Motor at the 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 menus.

14. To move the bot backwards 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 motors at Port1 and Port2 as Anticlockwise.

16. Drag and drop the Time block below the second Move Motor at the block. Type "1100" in the value box for the block.

17. To turn the bot to the left, configure the motor at Port1 as Clockwise and Port2 as Clockwise too.

Note: When you turn the bot left or right, the time 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 it, and then compile it.

19. Now, the program is ready to burn on the ABot.

Scan QR code to view output

A. Tick () the Correct Option.

1 Where do you need to keep your code blocks to begin your program?

a  Control category b  Workspace

c  Arena d  Output area

2 What is the default value of the “Repeat while” block?

a  True b  False

c  Can’t say d  None of these

3 If the motor at Port1 and Port2 is configured to move anticlockwise, which direction will the bot turn?

a  Left b  Right

c  Forward d  Backward

B. Answer the Following.

1 What is the concept of time delay?

2 For what purpose are the blocks in the Motor category used?

C. Apply Your Learning.

1 In which real-life application can you see the usage of the bot movement?

2 What will happen if the “Repeat while” block is not used in the code?

3 Experiment 2: Draw Shapes

Objective

Make your robot move to create shapes like squares and rectangles to practice its movements using the concept of time delay.

Let’s Build

Attach a pen to the RC bot as shown here, using zip-ties.

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.

3. Drag the set pen block from the Robot category and drop it inside the My Program block.

4. This block is set to ON by default. Select any colour of your choice from the colour box.

5. Drag and drop two Move Motor at blocks from the Motor category. Configure the first Move Motor at the block at Port1 as clockwise by selecting the Clockwise option from the drop-down.

6. For the second Move Motor at block, select Port2 from the drop-down menu. Configure this block as Anticlockwise.

7. Drag the Time block from the Control category and drop it below the second Move Motor at the block. Type "4000" in the value box of the block. This will allow the forward movement of the motor for 4000 milliseconds or 4 seconds.

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

9. Now, 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.

11. Post taking a right, stop the bot for 1000 milliseconds.

Note: When you turn the bot left or right, the time 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 the one given below:

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

A. Tick () the Correct Option.

1 What is the default value of the set pen block?

a  ON b  OFF

c  0 d  1

2 In which direction will the bot move if the first motor rotates clockwise and the second motor rotates anticlockwise?

a  Forward b  Backward

c  Right d  Left

3 In which category do you find the time block?

a  Control b  Loops

c  Math d  Text

B. Answer the Following.

1 How many times does the robot need to turn to make a square?

2 Is there a shorter way to avoid repeating the same type of multiple steps in the code?

C. Apply Your Learning.

1 Can you rewrite the code using the “Repeat while” block?

2 What is the real-life application of this code?

Experiment 3: Hand Follower/Repeller

Objective

Students will design a bot that has two infrared (IR) sensors to detect how close a hand is to the robot. When the first IR sensor detects a hand nearby, the bot will move forward to follow it. At the same time, if the second IR sensor detects a hand approaching it, the bot will move backwards to stay away from it.

Background

In this experiment, the following concepts are used:

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. For example, i_count is the name of a variable.

2. Conditionals

• Human beings (and other animals) make decisions all the time that affect their lives, for eg. a. "Should I eat one cookie or two?"   b. "Should I play cricket or badminton?"

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

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 has else if and else blocks.

• If the condition given in the if block is true, then the set of code is executed; otherwise, the code given in else if or else block is executed.

4. IR Sensor

• An infrared (IR) sensor is an electronic device that measures and detects infrared radiation in its surrounding environment. Everything around us, including our bodies and objects, gives off heat in the form of infrared radiation. Warmer objects emit more infrared radiation than cooler ones.

• In the IR sensor, the sensor state is high when a reflective object is in front of it. Black or dark-coloured objects do not reflect the IR rays.

Let’s Build

• Attach two IR sensors in the front of the Abot using 6mm bolts.

• Connect the left IR sensor to Port1 of the Brain and the right IR sensor to Port2 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.

3. Click on the Variables category.

4. Click on the Create variable button. A pop-up box appears asking you to enter a new variable name.

• Enter a suitable variable name, let us say “IR_left”, to store the data of the IR sensor value received from the left sensor.

5. Drag the set to block from the Variables category and drop it inside the My Program block. Select IR_left from the drop-down menu.

6. Then, drag the number block from the Math category and attach it to the set to block.

7. Similarly, click on the Variables category and create another variable “IR_right”, to store the data of the IR sensor value received from the right sensor.

8. Drag and drop another set to block below the previous set to block. Select IR_right from the drop-down menu. Then, drag the number block from the Math category and attach it to the set to block.

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

10. Drag the set to block from the Variables category and drop it inside the Repeat while block. From the drop-down of the set to block, select “IR_left”.

11. Drag another set to block and drop it below the previous set to block. The second set to block should have the value “IR_right”.

12. Drag the Read IR Sensor at block from the Sensor category and attach this block to the set IR_left to block. The Read IR Sensor at block is configured to Port1 by default.

13. Similarly, drag another Read IR Sensor at block and attach this block to the set IR_right to block. From the drop-down of the Read IR Sensor at block, select option “Port2”.

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

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

16. Drag the else if and else blocks and place them below the if block in the pop-up box (refer to the given image).

17. Again, click on the settings icon to hide the pop-up box.

18. Drag the equal operator block from the Control category and attach it to the right of the if block.

19. Select the ‘>’ option from the drop-down menu of the equal operator block.

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

21. Now, drag the number block from the Math category and drop it in the right part of the greater than operator block. Type “800” in the text part of the number block. Now, if the value of the IR_left variable is greater than 800, i.e., the left touch sensor is pressed, then blocks under the if block will be executed, else the blocks under the else block will be executed.

22. Drag and drop two Move Motor at blocks from the Motor category into the do part of the if block.

23. Configure the first Move Motor at the block at Port1 as clockwise by selecting the Clockwise option from the drop-down. For the second Move Motor at block, select Port2 from the drop-down menu. Configure this block as Anticlockwise. This will move the bot in the forward direction.

24. The Speed of both motors is set to High by default.

25. Now, drag the Time block from the Control category and drop it below the second Move Motor at block. This block is set to 1000 milliseconds, by default. This will allow the forward movement of the motor for 1000 milliseconds or 1 second.

26. Similarly, drag the equal operator block from the Control category and attach it to the right of the else if block.

27. Select the ‘>’ option from the drop-down of the equal operator block.

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

29. Now, drag the number block from the Math category and drop it in the right part of the greater than operator block. Type “800” for the text part of the number block. Now, if the value of the IR_right variable is greater than 800, i.e., the right sensor is pressed, then blocks under the else if block will be executed.

30. Similar to the steps above for Move Motor at blocks, drag and drop two more Move Motor at blocks. Configure the motor at Port1 as Anticlockwise and motor at Port2 as Clockwise.

31. Drag and drop the Time block from the Control category.

32. Now, drag and drop two Move Motor at blocks and attach them to the else block. Configure the motors at Port1 and Port2 to stop.

33. Give a name to your program, save it, and then compile it.

34. Now, the program is ready to burn on the ABot.

Scan QR code to view output

A. Tick () the Correct Option.

1 In which category of blocks will you find the “move motor in” block?

a  Sensor

b  Control

c  Motor d  Variable

2 Which block will create an infinite loop in your code?

a  Repeat while true

c  Loop while true

3 What is the default speed of the motors?

a  Low

c  Medium

B. Answer the Following.

b  Repeat while false

d  Loop while false

b  High

d  Less

1 How will you make the motor move in the forward direction?

2 What is the role of the IR sensor in moving the motor in forward direction?

C. Apply Your Learning.

1 Where can you see the other applications of the hand follower/repeller robot?

2 What will happen if you do not add the ‘Time’ block after the ‘Move Motor at’ block?

5 Experiment 4: Object Avoider

Objective

To create an object detection bot and teach it how to move around by itself. This will help the bot avoid obstacles and choose a path on its own in real-time.

Things Around Us

The concept of object avoider is mostly used in the automatic vacuum cleaners.

Let’s Build

• Attach the 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.

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

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

7. Then drag the Read IR Sensor at block from the Sensor category and attach this block with the set to block.

8. Select the "Port 2" option from the drop-down menu of the Read IR Sensor at the 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.

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" in 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.

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 LED 1 and LED 2 to green.

20. Drag the play tone of the 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.

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 the 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 the block.

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 in any direction as you wish.

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

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 it, and then compile it.

33. Now, the program is ready to burn on the ABot.

Scan QR code to view output

A. Tick () the Correct Option.

1 Which category of blocks is used to create variables in your code?

a  Control b  Display

c  Robot d  Variables

2 How can you add an “else” block to an “if” block in your code?

a  Using the Settings icon

c  Using the Variables category

b  Using the Control category

d  Using the Robot category

3 How many options are there in the drop-down menu of the equal operator block?

a  4 b  5

c  6 d  7

B. Answer the Following.

1 What is the purpose of the “equal operator” block?

2 What role does the “play tone of frequency” block play in your code?

C. Apply Your Learning.

1 What will happen in your code if you do not add the time delay?

2 Why do you use the “else” block in your code?

6 Experiment 5: Piano Bot

Objective

Students will program their “Piano Bot” using IR sensors that intelligently detect how close an object is or if it has been touched. The bot will produce different notes depending on whether the left IR sensor, the right IR sensor, or both sensors detect an object or touch something. The frequency and duration of each note will create a dynamic musical experience, simulating the behaviour of different piano keys.

Let’s Build

• Attach two IR sensors in the front of the Abot using 6mm bolts.

• Connect the left IR sensor to the ( ) port of the Brain and the right IR sensor to the ( ) port 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.

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 asking you to enter a new variable name.

• Enter a suitable variable name, let us say “IR_left”, to store the data of the IR sensor value received from the left sensor.

• Click on the OK button.

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

7. Drag the Read IR Sensor at block from the Sensor category and attach it with the set to block. The Read IR Sensor at block has a value of Port 1, by default.

8. Similarly, click on the Variables category and create another variable “IR_right” to store the data of the IR sensor value received from the right sensor.

9. Now, drag the set IR_right to block and drop it below the set IR_left to block.

10. Click on the Sensor category, drag the Read IR Sensor at block and attach it with the set IR_right to block. Select the option “Port 2” from the drop-down of the Read IR Sensor at the block.

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

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

13. Drag the else if block twice and then the else block, and place them below the if block in the pop-up box (refer to the given image).

14. Again, click on the settings icon to hide the pop-up box.

15. Drag the and block from the Control category and drop it to the right of the if block.

16. Now, drag two equal operator blocks from the Control category. Drop one block to the left of the and block and drop the second block to its right.

17. Select the ‘>’ operator from the drop-down menu of both the equal operator blocks.

18. Drag the IR_left block from the Variables category and drop it in the left part of the first greater than operator block.

19. Click on the Math category and drag and drop the number block in the right part of the first greater than operator block. Type ‘400’ in place of ‘0’.

20. Similarly, drag and drop the IR_right block in the left part of the second greater than the block and the number block to its right. Type ‘400’ in place of ‘0’.

21. Drag the play tone of the frequency block from the Indicators category and drop it in the do part of the if block. Set the frequency value to ‘800’ Hz. The time for this block is set to 100 milliseconds, by default. This will play a buzzer for 100 milliseconds when both the left and the right IR sensors become active.

22. Similarly, set the IR_left block to greater than 400 and IR_right block to less than 400. This will make only the left IR sensor active. Drag and drop the play tone of the frequency block in the do part of the else if block. Set its frequency value to ‘700’ Hz. So, when only the left IR sensor becomes active, the buzzer will play for 100 milliseconds.

23. Similarly, you can set the IR_left block to less than 400 and IR_right block to greater than 400. This will make only the right IR sensor active. Drag and drop the play tone of the frequency block in the do part of the else if block. Set its frequency value to ‘450’ Hz. So, when only the right IR sensor becomes active, the buzzer will play for 100 milliseconds.

24. Now, drag the LED block from the Indicators category and drop it in the else part of the if block. Select the colour from the color palette you want your LED should display and set its brightness to ‘100’.

25. Give a name to your program, save it, and then compile it.

26. Now, the program is ready to burn on the ABot.

Scan QR code to view output

A. Tick () the Correct Option.

1 Which block is used to keep the program running continuously?

a  My Program

c  Set to

b  Repeat while

d  If

2 What is the purpose of creating a variable named "IR_left"?

a To store LED colours

c To store IR sensor data from the right sensor

b To store IR sensor data from the left sensor

d To play a sound tone

3 What does setting the "play tone of frequency" block to "800 Hz" do in the program?

a  Activates LED

c  Reads IR sensor data

B. Answer the Following.

d  Plays a buzzer tone

d  Sets up an infinite loop

1 Which block is used to create a delay in this program?

2 How do you set the colour and brightness for the LED?

C. Apply Your Learning.

1 Describe how you would add another colour to the LED based on a specific IR sensor value.

2 What would you change if you wanted the buzzer to play for 200 milliseconds instead of 100 milliseconds?

7 Experiment 6: Rope Car Robot

Objective

Design a robot that works like a cable car using a pulley mechanism. This model can be used to transfer things and people from one place to another.

Let’s Build

1 Insert a 3.5” axle in both the highspeed motor with an axle lock.

2 Attach a motor to the Intro chassis using 6mm bolts at hole 3 of row 2, as shown.

3 Repeat the above step for the other side.

4 Then attach the wheels to both axles using fillers and axle locks.

5 Remove the rubber from both wheels.

6 Finally, attach the brain to the chassis using 6mm bolts at holes 3 and 4 of row 4.

7 Attach the battery as shown. 8 Tie a thread and run the robot on it.

1. Click on the Control category from the Blocks panel.

2. Drag the My Program block to the workspace area to begin your program.

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

4. Drag the play tone of frequency block from the Indicators category and drop it below the Repeat while block. This block is used to play a buzzer sound.

5. Set the frequency to 1250 Hz for 250 ms.

6. Drag two LED blocks from the Indicators category and drop them below the play tone of frequency block. Select “2” from the drop-down menu for the second LED block.

7. Set the colour of LED 1 and LED 2 to green and brightness to 100.

8. Now, drag a Move Motor at the block from the Motor category and drop it below the second LED block.

9. Configure the motor at Port1 as clockwise by selecting the Clockwise option from the drop-down menu.

10. Select speed as High from the Speed drop-down menu.

11. Drag another Move Motor at the block and drop it below the previous Move Motor at the block.

12. Configure the Motor at Port2 to rotate clockwise.

13. Select speed as High from the Speed drop-down menu.

14. Drag the Time block from the Control category and drop it below the second Move Motor at the block.

15. Type “5000” in the value box of the block. This will allow the movement of the motor for 5000 milliseconds or 5 seconds.

16. Similarly, set conditions for Red LEDs, as shown in the figure below.

Scan QR code to view output

A. Tick () the Correct Option.

1 Which of the following blocks is used to start an infinite loop in the code?

a  My Program b  Repeat while

c  Move Motor d  Time block

2 What frequency is set for the buzzer in the program?

a  250 ms

c  1250 ms

3 In which category do you find the LED block?

a  Control

b  5000 ms

d  1000 ms

b  Motor

c  Sensor d  Indicators

B. Answer the Following.

1 Describe the purpose of setting one motor clockwise and the other anticlockwise in the program.

2 How does the Time block affect the motor operation in this program?

C. Apply Your Learning.

1 How can you slow down the Rope car’s speed in the program?

2 Where can pulley-based mechanisms, like cable car systems, be applied in real-life scenarios?

Maker Board

Exploring the Hardware Kit 1

About Maker Board

Maker Board is an easy-to-use electronic platform that helps you to make innovative projects. It consists of a 5×5 RGB LED matrix, a buzzer, four push buttons and six GPIO pins. You can use your creative ideas using the Maker Board by controlling its electronic sensors and modules. You can make and play interactive games using the LED matrix and the push buttons. You can make a piano, a snake game, a smart band, and many more such things.

Components of the Hardware Kit

The Maker Board robotics kit contains the following components:

The Maker Board can be programmed using the Maker Studio coding interface, an easy-to-use Graphical User Interface (GUI) block-based coding platform.

1. Maker Board 2. IR Sensor
3. Servo Motor 4. LEDs
5. Jumper Cable 6. Batteries 7. LDR Sensor 8. Rain Sensor

Detailed Description of the Components

1. GPIO Pads

There are 4 Pulse Width Modulation (PWM) pins and 2 Analog to Digital Converter (ADC) pins, which make a total of 6 General Purpose Input Output (GPIO) pins to interface with analog and digital sensors, LEDs, Motors, etc., using jumper cables and alligator clips.

2. Power Pins

1 VCC pin—This pin outputs a regulated voltage of 3.3V.

2 GND pins—Power Output (0V).

1 VIN pin—The input voltage to the Maker Board when it is using an external power source.

3. Programming LED Matrix

An LED matrix is a grid of addressable Red, Green, and Blue (RGB) LEDs arranged in rows and columns. In this, a total of 25 addressable RGB LEDs are used, which can be controlled individually. An LED matrix can be used to display animations or scroll text, numbers, patterns, etc. It can also be used to make different types of 8-bit games.

4. Push Buttons

There are 4 on-board push buttons named A, S, W, and D to perform various operations like activate, deactivate or move the blinking light of the LED in different directions.

5. Buzzer

The buzzer is used to make different types of sounds at distinct frequencies and at different beats per minute.

6. Reset Button

The reset button is used to restart any program loaded in the Maker Board.

7. Bluetooth Module (HC-05)

The Bluetooth module gets you started with the possibilities of IoT and enables wireless controlling of various equipment connected to the Maker Board.

IoT stands for Internet of Things which refers to a network of interconnected devices embedded with sensors and software, enabling them to collect, exchange data, and make autonomous decisions.

8. Standoff Holes

These holes are present to ensure that the Maker Board can be safely used on electrically conductive surfaces.

About Maker Studio Coding Interface

The Maker Studio coding interface acts as an integrated development environment that allows you to write code for all of your projects. This code is then loaded into the Maker Board.

The Maker Studio coding interface consists of five major components:

1. A workspace area to drag blocks for the code you want to create.

2. A blocks panel, which contains all the blocks required to make your code.

3. The Share Code option in the File drop-down menu generates a shareable link for the project.

4. Buttons to save, compile, and burn your code.

5. The Simulator Window to see the output.

Burning Your Code into Maker Board Hardware

Burning means loading your code into the Maker Board hardware. This process, mainly, has the following phases: Arrange the blocks to create the code Save the code In case of error, recheck the code.

Experiment 1: Print Your Name on Digital Display 2

Objective

Let’s make a program to display your name in the LED matrix and in your favourite colour.

Background

Programming LED Matrix

An LED matrix is a grid of addressable RGB LEDs arranged into rows and columns. In this, a total of 25 addressable RGB LEDs are used, which can be controlled individually. The LED matrix can be used to display animations or scroll text, numbers, patterns, etc. It can also be used to make various types of 8-bit games.

Things Around Us

Some of the real-life examples of LED matrix are:

1. LED display in real time clocks 2. Digital signage at the airport

LED display on buses

Let’s Code

1. Click on the Control category from the Blocks panel.

2. Drag and drop the My Program block to the workspace to begin your program. The execution of all the blocks present inside this block occurs step by step.

3. To glow LEDs on the LED matrix in a pattern, various blocks are available in the Display category. Drag and drop the show character block inside the My Program block.

4. Type the letter “N” within the double quotes.

5. Select your favourite colour and set the brightness to 100.

6. Drag and drop the wait block from the Control category below the show character block.

7. Type 1000 in the space before ms (milliseconds). This will create a delay of 1 second in displaying the next step.

8. Add another show character block to display the letter “A”.

9. Add a wait block with 1000 ms.

10. Similarly, add another show character block to display the letter “M” and add a wait block with 1000 ms.

11. Add another show character block to display the letter “E” and add a wait block with 1000 ms.

12. Now, drag the show scrolling text block available in the Display category to display your name.

13. Type your name within double quotes.

14. Set the colour of your choice and also set the brightness to 100.

15. Give a name to your program, save it, and then compile it.

16. Now the program is ready to burn on the Maker Board, and you can see the output on the digital display.

Note: The Maker Board should be connected to your computer through a USB for the experiment to run.

Scan QR code to view output

MEL

A. Tick () the Correct Option.

1 What is an LED matrix?

a  A screen with tiny, coloured dots

b  A grid of addressable RGB LEDs

c  A tool for drawing patterns on paper

d  A single LED that glows in different colours

2 Which block do you use to display each character one by one in this program?

a  wait

c  show character

b  show scrolling text

d  set brightness

3 How do you add a delay between showing each character?

a  By typing a longer name

b  By changing the colour

c  By using the wait block with a delay time

d  By adding more show character blocks

B. Answer the Following.

1 Which block allows you to display moving text on the LED matrix?

2 Explain the steps you would take to add a new letter to display on the LED matrix.

C. Apply Your Learning.

1 Give any two real-life examples where you have seen an LED display.

2 Why is a delay of 1000 milliseconds added between each letter?

Experiment 2: Flag Book 3

Objective

Let’s make a Flag Book to understand the concept of animation.

Background

Animation

Animation is a method in which figures are manipulated to appear as moving images. In traditional animation, images are drawn or painted by hand on transparent celluloid sheets to be photographed and exhibited on film. Today, most animations are made with computer-generated imagery (CGI).

Things Around Us

Some of the real-life examples of flag books are:

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.

Cartoons
Mobile games

3. Drag the repeat while block from the Loops category and drop it inside the My Program block.

4. Drag the show LEDS block from the Display category and drop it inside the repeat while loop block.

5. Select the colour from the Select color palette and click on squares of LED Matrix to change the colour, and set the Brightness to “100”.

6. Drag the wait block from the Control category and drop it below the show LEDS block.

7. Type “1000” in the value box of the wait block. This will create a delay of 1 second in displaying the next step.

8. Drag two more show LEDS blocks and select different colour patterns on them.

9. Give the wait blocks accordingly to adjust the delay.

10. Drag the clear display block from the Display the category and drop it below the wait block used above.

11. Thereafter, drag and drop another wait block and set its value to “1000”.

12. Give a name to your program, save and then compile it.

13. Now the program is ready to burn on the Maker Board, and you can use your Flag Book.

Note: The Maker Board should be connected to your computer through a USB for the experiment to run.

Scan QR code to view output

A. Tick () the Correct Option.

1 Which category of blocks do you select to start building the program? a  Variables  b  Control  c  Loops  d  Display

2 What is the purpose of the wait block in this program?

a  To change LED brightness

b  To set a time delay between actions

c  To add colour to the LED d  To display text

3 What is the brightness level set to in the show LEDS block? a  50 b  75 c  100 d  150

B. Answer the Following.

1 What do you mean by animation?

2 Which hardware needs to be connected to the computer to run the program?

3 What is the purpose of the clear display block in the program?

C. Apply Your Learning.

1 Give any two real-life examples where you have seen animation.

2 How can you reduce the time between each colour showing up on the LED matrix?

Experiment 3: Colour Using AI 4

Objective

Let us colour the Maker Board using AI speech recognition mode.

Background

Artificial Intelligence (AI)

Artificial Intelligence or AI, is the field of computer science that deals with the study of the principles, concepts, and technology for building machines that enable them to think, act, and learn like humans. Machines possessing AI are able to mimic certain human traits, i.e., making decisions, recognising patterns, predicting outcomes based on certain actions, learning, and improving on their own.

Natural Language Processing (NLP)

NLP is a domain of AI that enables computers to understand human language and generate appropriate responses when we interact with them. It allows computers to talk to us in a way that feels natural to us. Popular examples of NLP applications include Google Assistant, Siri, Alexa, Google Translate, etc.

Computer Vision

Computer Vision is a domain of AI which uses cameras to see and understand visual information.

Things Around Us

Some of the real-life examples of NLP are:

1. Virtual Assistants

2. Language Translation Apps

Some of the real-life examples of computer vision are:

1. Face Recognition in Smartphones

2. Self-driving Cars

Colour Using AI: Using Speech Recognition Mode

In this experiment, the use of NLP in the Maker Board includes:

• Recognising various colours such as “yellow“, “red“, “green“, “white“, etc.

• Converting spoken commands into actions that the Maker Board can execute.

• Detecting unclear user input and prompting the user to repeat commands.

Let’s Code

1. Click on the Control category in the Blocks panel.

2. Drag the My Program block to begin your program. The execution of all the blocks present inside this occurs step by step.

3. Drag the repeat while block from the Loops category and drop it inside the My Program block to begin the infinite loop. The loop value is set to true by default.

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.

• Enter a suitable variable name, like “Speech”.

• Click on the OK button.

6. Drag the set to block from the Variables category and drop it inside the repeat while block.

7. Drag the get recognised speech block from the Speech Recognition category and attach it to the set to block. 8. Now, drag the if block from the Control category and drop 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 if block and drop it below the if block three times in the pop-up box (refer to the image below).

11. Click on the settings icon again to hide the pop-up box.

12. Now, drag the includes block from the Text category and attach it to the if block.

13. Drag the Speech block from the Variables category and drop it in the left text box of the includes block.

14. Type “yellow” in the right text box of the includes block.

15. Now, drag the show LEDS block from the Display category and drop it inside the do block.

16. Select the yellow colour from the Select color palette and click on squares of the LED matrix to change the colour, and set the brightness to ‘100’.

17. Repeat steps 12 to 16 thrice to select the various colours on the LEDS block, for example, red, green, and white.

18. Give a name to your program, save it, and then compile it.

19. Now the program is ready to burn on the Maker Board, and you can play the game.

Note: The Maker Board should be connected to your computer through a Bluetooth or USB cable for the experiment to run.

20. Click on the Run button on the AI window.

21. Allow the system to use your microphone to hear your commands.

22. Click on the microphone button present on the AI window.

23. Give any command (yellow, red, green, and white). Here, the AI detects the voice as ‘green’.

24. Again, click on the microphone button and observe the output on the Maker Board.

Colour Using AI: Using Camera Capture Mode

In this experiment, computer vision is used to recognise hand gestures through the camera.

• The AI model is trained to detect specific hand poses, such as “Palm,” “Fist,” and “ThumbsUp”.

• Once trained, the model can identify these gestures in real-time.

• Each gesture then triggers specific actions within the game.

Instructions

Before we start writing the code, let us train our AI Model. Follow the given steps:

1. Allow the system to use your camera.

2. Click on the Configure AI Model in the AI Window on the right of your screen.

3. Choose your model by selecting Handpose from the Create Your Model pop-up window

4. Add a name for your model and save it. You can also skip it.

5. Now, add the label name as ‘Palm’ and click on the Save button.

6. Click on the Start Recording button and show your palm up to 60 Frames on the camera.

7. Now, click on the Plus sign on the top left corner and add a name for Label 2. Here, the name of the Label 2 is “Fist”. Then, click on the Save button.

8. Similarly, show your fist on the camera and record different fist postures by showing your fist on the camera.

9. Similarly add label for ThumbsUp.

10. Now, click on the Train Model button to train the AI about the recorded poses. It will take a few minutes.

11. Add an appropriate model name and save it.

12. Test your model to check whether the AI is able to recognise the palm, fist, and thumbs up poses correctly.

13. Now, click on the Download button.

14. You are now ready to write your code.

1. Click on the Control category in the Blocks panel.

2. Drag the My Program block to begin your program. The execution of all the blocks present inside this occurs step by step.

3. Drag the repeat while block from the Loops category and drop it inside the My Program block to begin the infinite loop. The loop value is set to true by default.

4. Now drag the if block from the Control category and drop it inside the repeat while block.

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

6. Drag the else if block and drop it below the if block in the pop-up box. Repeat this three times.

7. Again, click on the settings icon to hide the pop-up box.

8. Drag the equal operator block from the Control category and attach it to the right of the if block.

9. Now, drag the get detected AI label block from the AI category and drop it in the left part of the equal operator block.

10. Drag and drop the Palm block in the right part of the equal operator block.

11. Now, drag the show LEDS block from the Display category and drop it inside the do part of the if block.

12. Select the yellow colour from the Select color palette and click on squares of the LED matrix to change the colour, and set the brightness to “100”.

13. Repeat steps 8 to 12 thrice to select the various colours on the LEDS block, for example, red, green, and white.

14. Give a name to your program, save, and then compile it.

15. Now the program is ready to burn on the Maker Board, and you can play the game. Note: The Maker Board should be connected to your computer through a Bluetooth or USB cable for the experiment to run.

16. Observe the output on the Maker Board.

Scan QR code to view output

A. Tick () the Correct Option.

1 Which category provides the ‘get recognised speech’ block?

a  Variables b  Text

c  Display d  Speech Recognition

2 What colour does the LED Matrix show when a “Fist” gesture is detected?

a  Yellow b  Red

c  Green d  White

3 Which block detects the hand gesture captured by the camera?

a  show LEDS

c  get detected AI label

B. Answer the Following.

b  repeat while

d  equal operator

1 Why is it important to train the AI model with specific hand gestures before running the code?

2 What does the ‘includes’ block do?

C. Apply Your Learning.

1 Where have you seen examples of computer vision in real life?

2 Imagine you want to add a new colour command, “blue”. Outline the steps you will take to include this in the program.

About the Book

This book introduces learners to the captivating realm of robotics, with a learner-friendly, motivating, and hands-on approach. It combines theoretical understanding with practice, through insightful examples of real-world applications, while promoting creativity and coding skills. Emphasising a project-based learning methodology, the book provides a series of projects, each with detailed instructions. These instructions can be effortlessly executed using the accompanying robotics hardware kit. The assembly and programming of the robotics systems are done through block-based coding, and simulation environments; accelerating the experiential learning journey of the learners.

Special Features

• Hands-on Experiments: Engaging experiments that allow students to build and test-run robots themselves.

• Detailed Coding Practice: Step-by-step coding instructions to program robots, making it easy for beginners to learn.

• Things Around Us: Each experiment connects robotics to real-world scenarios, showing how technology solves everyday problems.

• Comprehensive Background: Clear explanations of the concepts and the technology behind each experiment, helping students understand the "why" and the "how."

• Interactive Exercises: Exercises at the end of each experiment to reinforce learning and to challenge students to think critically.

About Uolo

Uolo partners with K-12 schools to provide technology-enabled learning programs. We believe that pedagogy and technology must come together to deliver scalable learning experiences that generate measurable outcomes. Uolo is trusted by over 15,000+ schools across India, Southeast Asia, and the Middle East.

ISBN 978-81-982844-2-6

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.