Grade 8_Robotics_ebook

Page 1


ROBOTICS Tekie.AI

Tekie.AI

Robotics

Acknowledgements

Academic Authors: Neha Verma, Ayushi Jain

Creative Directors: Bhavna Tripathi, Mangal Singh Rana, Satish

Book Production: Rakesh Kumar Singh

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 edition 2026

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.AI Robotics 8

ISBN: 978-93-89789-35-5

Published by Uolo EdTech Private Limited

Corporate Office Address: 91Springboard, 3rd Floor

145, Sector 44, Gurugram, Haryana 122003

CIN: U74999DL2017PTC322986

Printed by: Printpro Solutions

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

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. Wheels × 2
3.5" Axles × 2
Allen Key × 1
6. Spanner × 1 7. Caster Wheel × 1 8. 12mm Bolts × 10 9. 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:

Let’s understand some basics of building the robots:

Tightening Screws:

Tightening Axle Lock:

Tighten (Rotate Clockwise)

(Rotate Anti-Clockwise)

(Rotate Anti-Clockwise) Tighten (Rotate Clockwise)

Connecting High-Speed Motor and Plate using an Axle Lock:

Insert Axle Lock Axle Insert Plate

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 Your Code

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.

Start

Put the dish in the microwave.

Set the timer of the microwave.

Is the buzzer beeping? Yes

No

Wait for the buzzer to beep.

Stop

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. Move the Bot Forward

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

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

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

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

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

• Configure the motor at Port2 as anticlockwise by selecting the Anticlockwise option from the dropdown menu.

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

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

• Type "2000" in the value box of the block. This will allow the forward movement of the motor for 2000 milliseconds or 2 seconds.

• To move the bot forward for infinite time, use the Repeat while block from the Loops category with the Move Motor at blocks.

4. Move the Bot Backward

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

• To move the bot backwards for infinite time, use the Repeat while block from the Loops category with the Move Motor at blocks.

5. Move the Bot Right

• To turn the bot to the right, configure the motors at Port1 and Port2 as Anticlockwise.

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

6. Move the Bot Left

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

Note: Changing the time value will change how much the bot turns. The turning angle may change a little from one robot kit to another because of how tightly the parts are fixed or the type of floor it moves on. It may also differ in simulators used on different computers.

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

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

c  Arena

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

a  True

c  Can’t say

b  Workspace

d  Output area

b  False

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

c  Forward

B. Answer the Following.

1 What is the concept of time delay?

b  Right

d  Backward

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?

Experiment 2: Line Follower 3

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.

Let’s Build Things Around Us

The line follower system is used in Advanced Driver Assistance Systems (ADAS) in cars as Lane Assist.

1 Refer 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 Then, attach two IR sensors to both the 2.5" U-Beams using the 6mm bolts as shown.

4 Attach the previous assembly to the Chassis using the 12mm bolts as shown.

5 Attach the Brain to the Chassis using 6mm bolts.

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

4. Click on the Variables category.

5. Click 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. Then, 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. Drag 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.

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 and attach with the if block.

15. Drag two blocks from the Control category and drop them inside the left and right boxes of the block.

16. Select the '>' sign in place of the '=' sign for both the blocks.

17. Drag the rightIR block from the Variables category and drop it in the left value box of the block.

18. Drag and drop the block from the Math category inside the right value box of the block. Type '400' in place of '0'.

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.

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.

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.

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.

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.

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.

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

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

Scan QR code to view output

A. Tick () the Correct Option.

1 In this program, what does the set right IR to block do?

a  It configures the IR sensor to turn on.

b  It stores the sensor reading from the right IR sensor.

c  It sets a timer for the right IR sensor.

d  It controls the speed of the right motor.

2 If both IR sensors detect a white line (greater than 400), which direction will the bot move?

a  Forward

c  Turn left

B. Answer the Following.

1 How can you create a new variable?

b  Stop

d  Turn right

2 Describe the purpose of the If block in this line-following program.

C. Apply Your Learning.

1 What action is taken when both the IR sensors detect a black line (value < 400)?

2 What changes would you make to reverse the bot's turning directions if the wiring of the motors was inverted?

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

Compile the code Burn the code

In case of error, recheck the code.

Experiment 1: Count till 10 2

Objective

Let’s make a program to understand the programming of variables and display counting till 10 on the Maker Board.

Background

Variables

• In coding, variables are objects that can be manipulated rather than just a placeholder for an unknown value.

• Variables are used to store information to be referenced and manipulated in a computer program. They also provide a way of labelling data with a descriptive name, so our programs can be understood more clearly by the reader and ourselves.

• Consider variables as containers that hold information. Their sole purpose is to label and store data in memory. This data can then be used throughout your program.

Things Around Us

Some of the real-life examples are:

1. Speed in the online game
2. Traffic signal 3. Digital wristwatch

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

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

3. Now, create a variable named "count" using the Variables category and set its value to 1.

4. Drag the count with block from the Loops category having the value of "i" variable from 1 to 10 skipped by 1.

5. Display the value of "i" variable using the show number block from the Display category. Choose the colour of your choice from the colour palette. Set the brightness to 100

6. Drag and drop the Time block from the Control category and type 700 in the value box.

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

8. Now the program is ready to burn on the Maker Board, and you can use your 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

A. Tick () the Correct Option.

1 In coding, variables are used to:

a  Display information only b  Store and label data

c  Only store numbers d  Create images

2 What block do you use to start the program in the Maker Board?

a  Show number block

c  My Program block

b  Wait block

d  Variables block

3 Which block can be used to set a pause time of 700 milliseconds?

a  My Program block

c  Display block

B. Answer the Following.

1 What is the purpose of variables in coding?

b  Wait block

d  Variables block

2 Why should you connect the Maker Board to your computer using a USB?

C. Apply Your Learning.

1 Name three real-life examples of variables. How is each one used to store or display data?

2 Write the steps you would take to make a program count to 5 on the Maker Board instead of 10.

Experiment 2: Calculator Using Functions 3

Objective

Let’s make the Maker Board do some math and make a calculator. We will perform +, −, *, and / operations on numbers depending upon which "W", "A", "S", and "D" keys is pressed by the user. We will use a Maker Board for displaying the numbers.

Background

1. Button-click

• Button-click is an event that causes something to happen.

• We can use these to tell programs under what circumstance(s) a particular action or set of actions should happen.

• As per input/output system, buttons are considered as input and corresponding actions are considered as output.

2. Conditionals

• Human beings (and other animals) make decisions all the time that affect their lives, for example,

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

• A function is a reusable block of code designed to perform a specific task. It takes input, processes it, and returns an output. Functions help structure code, reduce repetition, and make programs more readable.

• Functions can be defined using the to do something block from the Functions category. All blocks placed inside this block collectively form the function definition.

• You can type a suitable name for the function, such as "My_Function", in the text part of the block.

• Since the My Program block is where the execution of all the blocks begins step by step, the function must be called inside the My Program block.

Things Around Us

Some real-life examples are:

Let’s Code

1. Click on the Control category from the

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

1. Mathematical game apps
2. Calculator app in phones
Blocks panel.

3. Create three variables named number1, number2, and result, using the Variables category. Set the values of these three variables to '0' using the Math category. Drag and drop the set to block for all three variables, as shown in the figure here.

4. Drag and drop the repeat while block from the Loops category below the set to block.

5. Create a function named "Generate num1" using the Functions category and increase the value of the number1 variable by 1 to get the desired number using the Variables category. Display the value of the number1 variable using the show number block from the Display category.

6. To create a function, click on the Functions category and drag the to do something block.

Replace the do something with the desired function name. The function will be created.

Note that functions are not set within the code. They are placed separately in the workspace. You can reuse it by calling the function name in your code.

7. Drag the If button block from the Button category, choose the W key from its drop-down menu, and call the function "Generate num1".

8. Create a function named "Generate num2" and increase the value of number2 variable value by 1 to get the desired number and then display it.

Note: You can create a new function from an existing one by right-clicking and selecting ‘duplicate’. Then you can change the function name and other values in the value box as per your requirements.

9. Drag the If button block from the Button category, choose the A key from its drop-down menu, and call the function "Generate num2".

10. Create a function named "Addition" and set the value of the variable result to the sum of number1 and number2 and show the result on the matrix.

11. Drag the If button block and select S key, then call the function "Addition".

12. Create a function named "Subtraction" and set the value of the result to subtraction of number1 and number2 based on which number is greater and show the result on the matrix using the if and else blocks.

13. If the conditional statement of the if block is false, then the statement(s) of the else block will be executed.

14. You can get the else block by clicking on the settings icon of the if block. A pop-up box appears.

15. Drag the else block and drop it below the if block in the pop-up box. Click on the settings icon again to hide the pop-up box.

16. Drag and drop the If button block and select D key, then call the function "Subtraction".

17. Create a function named "Multiplication" and set the value of the result to the multiplication of number1 and number2 and show the result on the matrix.

18. Drag and drop the If button block and select S key, then call the function "Multiplication" on long press.

19. Create a function named "Division" and set the value of the result to the division of number1 and number2 and show the result on the matrix.

20. Drag and drop the If button block and select D key, then call the function "Division" on long press.

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

22. Now the program is ready to burn on the Maker Board, and you can use your calculator.

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 What is the main purpose of the "button-click" event in this project?

a  To display the result on the Maker Board

b  To set the variables to zero

c  To trigger specific actions based on user input

d  To create a conditional block

2 Which key is used to trigger the addition operation in this project?

a  W b  A

c  S

3 What is the role of a conditional block in this project?

a  To store values of variables

b  To create loops for the program

c  To decide the flow of the program based on true or false conditions

d  To call functions in the workspace

B. Answer the Following.

1 Explain how the "Generate num1" function works in this project.

2 What happens when the "Division" function is triggered?

C. Apply Your Learning.

1 Modify the program to calculate the square of a single number when the "A" key is pressed.

2 Give a real-life example of how conditional blocks are used in apps other than calculators.

Experiment 3: Pollution Badge 4

Objective

Let’s make a pollution badge, sensing and measuring the pollution in the neighbouring area and displaying it on the Maker Board.

Background

1. Pollution Badge

• In today’s world, we encounter different scenarios where we see different gases being emitted in the atmosphere through vehicles, burning of waste materials, and home appliances like air conditioners and industrial chimneys.

• Monitoring these gases is very important from a safety point of view.

• Gas sensors are very helpful in accomplishing this task, hence we are using MQ135 Gas Sensor.

• This pollution badge will enable us to know when the air quality is bad.

2. MQ135 Gas Sensor

• The gas sensor module consists of a steel exoskeleton under which a sensing element is housed. This sensing element is subjected to current through connecting leads.

• This current is known as heating current. Through it, the gases coming close to the sensing element get ionised and are absorbed by the sensing element.

• This changes the resistance of the sensing element which alters the value of the current going out of it.

Things Around Us

Some real-life examples are:

1. Air quality monitoring
2. Detection of gases like NO2, CO2, O3

Circuit

• Connect the A0 of the MQ135 gas sensor to the A0 of the Maker Board.

• Connect the Vcc of the MQ135 gas sensor to the Vcc of the Maker Board.

• Connect the Gnd of the MQ135 gas sensor to the Gnd of the Maker Board.

Let’s Code

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

2. Drag and drop 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 set its value to true. The blocks present inside this will be executed sequentially again and again till the condition is true. As soon as the condition becomes false, the working of blocks inside this loop will stop.

4. Create a variable named "airQualitySensorValue". Drag the set to block from the Variables category and drop it inside the repeat while true block. Attach the read analogue value at Channel block from the Hardware category to the set to block. Set its value to A0 pin status.

5. Drag the if block from the Control category and drop it below the set to block. Add the else if and else conditions to the if block (refer to the image below).

6. Now, define the condition for the if block. If the value of the variable is between 100 and 300, then blocks under this if will be executed.

7. Display a pattern using an LED light of green colour from the Display category that will indicate that pollution is in a Safe range. To change the colour of squares in the LED, select the colour "green" and click on each square. Set the brightness to 60. The LED will look like the figure below.

8. Define the condition for the first else if block. If the value of the variable is between 300 and 600, then blocks under this else if will be executed.

9. Next, display a yellow LED light pattern that will indicate that pollution is in the Unsafe range.

10. Now, define the condition for the second else if block. If the value of the variable is between 600 and 900, then blocks under this else if will be executed.

11. Next, display a blue LED light pattern that will indicate that pollution is in the Dangerous range.

12. Now, define the condition for the third else if block. If the value of the variable is between 900 and 1100, then blocks under this else if will be executed.

13. Display a pattern using red LED light that will indicate that pollution is in the Hazardous range.

14. Define else as clear display.

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 use your pollution badge.

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 What does the pollution badge do?

a  Displays light patterns

c  Monitors heating current

b  Detects air quality

d  Controls LEDs

2 Which sensor is used in the pollution badge to detect gases?

a  Temperature Sensor

c  Light Sensor

b  MQ135 Gas Sensor

d  Ultrasonic Sensor

3 What does the red LED light pattern represent in the pollution badge?

a  Safe air quality

c  Dangerous air quality

B. Answer the Following.

b  Unsafe air quality

d  Hazardous air quality

1 Explain how the MQ135 Gas Sensor works to detect air quality.

2 What are the four air quality levels displayed by the pollution badge, and how are they represented using LEDs?

C. Apply Your Learning.

1 Modify the program to display a custom LED pattern when the air quality value is below 100 (very safe range).

2 Suggest one more real-life application for the MQ135 Gas Sensor.

Experiment 4: Automatic Boom Barrier 5

Objective

Let us make a circuit to learn how servo motors can be used to build an automatic boom barrier.

Background

Servo Motor

The servo motor is a special type of motor with a shaft that can move to a specific position and at a specific speed based on the received input.

The servo motor has three main parts: a motor, a sensor, and a controller.

• The motor provides the mechanical power to move or rotate the shaft.

• The sensors measure the position and the speed of the shaft.

• The controller works like the brain of the servo motor. It tells the motor how much to move and in which direction.

Things Around Us

An automatic boom barrier is a gate-like device used to control vehicle entry in restricted areas, such as car parks, toll booths, or private roads.

Circuit

• Connect the P0 of the Maker Board to the OUT pin of the IR sensor.

• Connect the GND of the Maker Board to the GND pin of the IR sensor.

• Connect the VCC of the Maker Board to the VCC pin of the IR sensor.

• Connect the GND of the Maker Board to the GND pin of the Servo motor.

• Connect the GND of the Maker Board to the -ve pin of the battery.

• Connect the +ve pin of the battery to the +ve pin of the servo motor.

• Connect the PWM pin of the servo motor to the P1 of the Maker Board.

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. Now, drag the configure pin block from the Hardware category and drop it inside the My Program block. Select the P0 pin as Input from the drop-down menu of the block.

4. Now, drag and drop the move servo PWM pin block from the Hardware category. Select the ‘P1’ pin from the drop-down menu and type ‘0’ in the text box for the angle of the move servo PWM pin block.

5. Drag the repeat while block from the Loops category and drop it below the move servo PWM pin block. By default, the loop value is set to true.

6. Click on the Variables category.

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

• Click on the OK button.

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

9. Drag the read status block from the Hardware category and attach it to the set to block.

10. Drag the if block from the Control category and place 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 if block and place it below the if block in the pop-up box (refer to the image below).

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

14. Drag the equal operator block from the Control category and attach it to the if block.

15. Drag the sensor_value block from the Variables category and drop it to the left part of the equal operator block.

16. Drag the number block from the Math category and drop it to the right part of the equal operator block. Type ‘1’ in place of ‘0’ in the text box of the number block.

17. Drag and drop the move servo PWM pin block from the Hardware category. Select the ‘P1’ pin from the drop-down menu of the block. The block is set to angle ‘90’, by default.

18. Display a pattern using an LED light of red colour using the show LEDS block from the Display category. Set brightness to '100'.

19. Similarly, set another condition for the sensor value. Drag the equal operator block and attach it to the else if block.

20. Drag the sensor_value block and drop it to the left part of the equal operator block.

21. Drag the number block and drop it to the right part of the equal operator block. The number block is set to ‘0’, by default.

22. Drag and drop the move servo PWM pin block in the do part of the else if block. Select the ‘P1’ pin from the drop-down and type ‘180’ in the text box for the angle of the block.

23. Display a pattern using an LED light of green colour using the show LEDS block.

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

25. Now the program is ready to burn on the Maker Board.

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 Where are automatic boom barriers commonly used?

a  Car parks b  Toll booths

c  Private roads d  All of these

2 Which component of a servo motor determines how much the motor should move and in which direction?

a  Motor b  Sensor

c  Controller d  Shaft

3 In the configuration process, which pin is selected as Input from the drop-down menu of the "Configure Pin" block?

a  P1

c  P2

B. Answer the Following.

1 What is a servo motor?

b  P0

d  P3

2 What happens when the sensor value becomes ‘1’?

C. Apply Your Learning.

1 How does an automatic boom barrier enhance security and convenience at entry points?

2 What is the purpose of using automatic boom barriers at toll booths?

Experiment 5: Burglar Alarm with LED 6

Objective

Let’s do an experiment using a sound sensor and LEDs to show colours based on the sound level.

Background

Sound sensor

A sound sensor is used to detect noise in the environment and when the noise crosses a certain threshold the sensor sends a signal to the Maker Board which then triggers the LED lights and the buzzer to make a noise. The sensitivity of the sensor can be adjusted using a small screen on the blue hub on the sensor.

Things Around Us

Real-life examples include:

Circuit

• Connect the P0 pin of the Maker Board to the longer leg of the LED 1 with a resistor in between.

• Connect the GND pin of the Maker Board to the shorter leg of the LED 1.

• After connecting the positive leg of the LED to P0 and the negative leg of the LED 1 to GND, you will see the LED 1 flashing.

• Connect the P2 pin of the Maker Board to the longer leg of the LED 2 with a resistor in between.

1. Fire Safety System
2. Music Visualiser
3. Noise Pollution Indicator

• Connect the GND pin of the Maker Board to the shorter leg of the LED 2.

• You will see the LED 2 flashing.

• Connect the G of the Sound Sensor to the Gnd of the Maker Board.

• Connect the + of the Sound Sensor to the Vcc of the Maker Board.

• Connect the DO of the Sound Sensor to the P1 of the Maker Board.

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 will occur step by step.

3. Drag the configure pin block from the Hardware category and drop it inside the My Program block.

4. Select the P1 pin as Input

5. Drag the configure pin block from the Hardware category and drop it below the previous configure pin block.

6. Select the P0 pin as Output.

7. Again, drag the configure pin block from the Hardware category and drop it below the previous configure pin block.

8. Select the P2 pin as Output

9. Now, drag the repeat while block from the Loops category and drop it below the last configure pin block.

10. Click on the Variables category.

11. Click on the Create variable button. A pop-up box appears.

a. Enter a suitable variable name like "sound_sensor" in the new variable name pop-up box.

b. Click on the OK button. This will create a variable to store the data of the sound sensor value received from the sensor.

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

13. Then, drag the read status of pin block from the Hardware category and place it next to the set to block.

14. Set the value of the read status of pin block to P1.

15. Drag the if block from the Control category and place it below the set to block.

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

17. Drag the else block and place it below the if block in the pop-up box (refer to the image below).

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

19. Drag the equal operator block from the Control category and attach it to the if block.

20. Drag the sound_sensor block from the Variables category and drop it in the left value box of the equal operator block.

21. Drag the number block from the Math category and drop it inside the right value box.

22. Type "1’’ in place of 0. If the value of the sound_sensor variable is equal to 1, i.e., the sound sensor senses the sound, the blocks under the if block will be executed, otherwise the blocks under the else block will be executed.

23. Drag the clear display block from the Display category and drop it in the do part of the if block. Also drag the play tone of frequency block from the Sound category and drop it below the clear display block.

24. Set the frequency as 1000 Hz for 500 ms.

25. Drag two output pin value blocks from the Hardware category.

26. For the first block, select the P0 pin as "High".

27. For the second block, select the P2 pin as "Low".

28. Similarly, set the conditions for the different frequency and pin values as shown in the figure below.

29. Now, drag the show LEDS block from the Display category and drop it inside the else condition.

30. Assign any colour and pattern in the LED Matrix. Set the brightness to 100

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

32. Now, the program is ready to burn on the Maker Board.

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 pin is configured as an input to receive data from the sound sensor?

a  P0

c  P2

b  P1

d  P3

2 What variable name is created to store the sound sensor data?

a  sensor_level

c  sound_sensor

3 Why is the read status of pin block set to P1 in this program?

a  To turn on the LED

c To set up the alarm frequency

B. Answer the Following.

b  sound_level

d  noise_level

b To detect input from the sound sensor

d  To show an LED pattern

1 Why is it important to have both the if and else conditions in this program?

2 What happens when the sound sensor detects sound in this experiment?

C. Apply Your Learning.

1 Give a real-life example where a burglar alarm is used.

2 If you wanted to use this system in a library where sound levels should stay low, how would you adjust the frequency of the alarm tone and the LED brightness to ensure it does not disturb people but still alerts the staff?

Experiment 6: Automatic Rain Shed 7

Objective

Background

Rain Drop Sensor

• A sensor is a device that detects and responds to certain inputs from the physical environment. These inputs can include light, heat, motion, moisture, pressure, and other environmental factors.

• A water sensor brick is designed for detecting water. It can be used in various applications, such as sensing rainfall, monitoring water level, and detecting liquid leakage.

• This type of sensors can detect the presence, level, volume, or absence of water.

Servo Motor

• The servo motor is a special type of motor with a shaft that can move to a specific position and at a specific speed based on the received input.

• The servo motor has three main parts: a motor, a sensor, and a controller.

• The motor provides the mechanical power to move or rotate the shaft.

• The sensors measure the position and the speed of the shaft.

• The controller works like the brain of the servo motor. It tells the motor how much to move and in which direction.

Things Around Us

Let us make a project that uses a rain drop sensor to develop a smart window using servo motor to understand the concept of water sensors. Some of the real-life examples are:

Car wipers
Rain shed

• Connect the jumper cable wires to the water sensor.

• Connect the VCC of the water sensor and the red wire of the servo motor to the VCC of the Maker Board.

• Connect the GND of the water sensor and the brown wire of the servo motor to the GND of the Maker Board.

• Connect the orange wire of the servo motor to the P1 of the Maker Board.

• Connect the D0 of the water sensor to the P0 of the Maker Board.

• Connect the battery connector and the battery, and keep ready.

• Connect the positive terminal to the Vin.

• Connect the negative terminal to the Gnd.

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 configure pin block from the Hardware category and drop it inside the My Program block.

4. Set the P0 pin as Input.

5. Again, drag the configure pin block from the Hardware category and drop it below the previous configure pin block.

Rain Drop Sensor
Battery Pack
Maker Board
Servo Motor

7. Drag the repeat while block from the Loops category and drop it below the configure pin block. This block is set to true, by default.

8. Click on the Variables category, and then click on the Create variable button. A pop-up box appears. Enter a suitable variable name, such as "i_sensorvalue". Click on the OK button.

9. Now, drag the set to block inside the repeat while block and drag the read status block from the Hardware category and drop it as shown in the figure below.

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 to the pop-up box, and drop it below the if block. The else condition is executed when the condition is false.

13. Again, click on the settings icon to hide 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. Now, insert the "i_sensorvalue" variable block in the left part of the equal operator block.

16. Drag the number block from the Math category and drop it to the right part of the equal operator block. Type '1' in the text box of the number block.

20. Again, drag the show LEDS block from the Display category and drop it inside the else condition.

21. Assign any colour and pattern to the LED Matrix. Type '100' in the value box for brightness.

17. Now, drag the show LEDS block from the Display category and drop it inside the if condition.

18. Assign any colour or pattern to the LED Matrix. Type '100' in the value box for brightness.

19. Now, drag and drop the move servo PWM pin block from the Hardware category. The code will look like this.

22. Drag and drop the move servo PWM pin block from the Hardware category. Type '180' in the text part for the angle. The code will look like this.

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

24. Now, the program is ready to burn on the Maker Board.

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 What is the main function of a water sensor?

a  Measure temperature b  Detect the presence of water

c  Control servo motor speed

2 What is the role of the servo motor in this project?

d  Monitor light levels

a  Detect b Provide mechanical power to move the rain shed

c Provide powers to the water sensor

3 Which pin is configured as an input for the water sensor?

a  P1

b  To connect to the Maker Board

b  P0

c  VCC d  GND

B. Answer the Following.

1 What are the three main components of a servo motor?

2 How is the battery connected to the circuit?

C. Apply Your Learning.

1 If you want to add a buzzer that sounds when rain is detected, how would you integrate it into the circuit and program?

2 What troubleshooting steps would you take if the servo motor does not respond when water is detected?

Experiment 7: Calculator Using Functions with AI

Objective

Let us use the Maker Board to do some maths and make a calculator using AI speech recogniser mode. We will perform addition, subtraction, multiplication, and division operations on numbers depending upon user input. We will use a Maker Board to display the numbers.

Background

Artificial Intelligence

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 can think, act, and learn like humans. Machines possessing AI should be able to mimic human traits like making decisions, recognising patterns, predicting outcomes based on certain actions, learning, and improving on their own.

Natural Language Processing

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, and Google Translate.

Computer Vision

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

Things Around Us

Some real-life examples of NLP are:

Virtual Assistants
Language Translation Apps

Some real-life examples of computer vision are:

1. Face Recognition in Smartphones 2. Self-Driving Cars

Calculator Using Functions with AI: Using Speech Recognition Mode

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

• Recognising mathematical commands such as "add" and "subtract".

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

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

Let’s Code

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

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

3. Create three variables named number1, number2, and result, using the Variables category. Drag and drop the set to block for all three variables and set the values of these three variables to '0' using the number block from the Math category, as shown in the figure here.

4. Drag the repeat while block from the Loops category and drop it below the last set to block.

5. Create a variable named "voice" using the Variables category.

6. Drag and drop the set to block inside the repeat while block, select 'voice' from the drop-down list, and attach the get recognised speech block from the Speech Recognition category.

7. Now, drag the if block from the Control category and drop it below the set to block.

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

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

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

11. Create a function named "generate number1". To create a function, click on the Functions category and drag the to do something block. Replace the do something with the desired function name. The function will be created.

Note: Functions are not set within the code. They are placed separately in the workspace. You can reuse it by calling up the function name in your code.

12. Increase the value of the number1 variable by 1 to get the desired number using the + operator block from the Math category.

13. Display the value of the number1 variable using the show number block from the Display category and set the colour to green using the colour palette. Set the brightness to "100".

14. Now, drag the includes block from the Text category.

15. Drag the voice block from the Variables category and drop it in place of String1 of the includes block.

16. Rename the String2 as "generate number a" and call the function "generate number1".

Note: You can create a new function from an existing one by right-clicking and selecting "duplicate". Then you can change the function name and other values in the value box as per your requirements.

17. Similarly, create a function named "generate number2" and increase the value of the number2 variable value by 1 to get the desired number and then display it.

18. Drag the includes block from the Text category and attach it to the first else if block.

19. Drag the voice block from the Variables category and drop it in place of the String1.

20. Rename the String2 as "generate number b" and call the function "generate number2".

21. Create a function named "addition" and set the value of the variable result to the addition of number1 and number2 and show the result using the show number block.

22. Drag the includes block from the Text category and attach it to the second else if block.

23. Drag the voice block from the Variables category and drop it in place of String1.

24. Rename the String2 as "add" and call the function "addition".

25. Create a function named "subtraction" and set the value of the result to subtraction of number1 and number2 based on which number is greater. Show the result on the matrix using the if and else blocks. If the conditional statement of the if block is false, then the statement(s) of the else block will be executed.

26. You can get the else block by clicking on the settings icon of the if block.

27. A pop-up box appears. Drag the else block and drop it below the if block in the pop-up box. Click on the settings icon again to hide the pop-up box.

28. Drag the includes block from the Text category and attach it to the third else if block.

29. Drag the voice block from the Variables category and drop it in place of String1

30. Rename the String2 as "subtract" and call the function "subtraction".

31. Name your program, save it, and then compile it.

32. Now the program is ready to burn on the Maker Board.

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

33. Click on the Run button in the AI window.

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

35. Click on the microphone button in the AI window.

36. Give any command (generate number a, generate number b, add, or subtract).

37. Click the microphone button again and observe the output on the Maker Board.

Calculator Using Functions AI: Using Camera Capture Mode

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

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

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

• Each gesture then triggers specific actions within the game, such as generating num1, num 2, addition, and subtraction.

• This allows players to control the sprite with their hand movements.

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.

3. Create your model by selecting Handpose

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

5. Now, add the label name as 'Palm' and save it.

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

7. Now, click on the Plus sign on the top left corner and add another label, 'Fist'.

8. Similarly, add other labels such as 'ThumbsUp' and 'Peace'.

9. Now, click on Train Model button to train the AI on these hand poses. It will take a few minutes.

10. Add an appropriate model name and save it.

11. Test your model to check whether the gestures are working correctly, then download it.

12. You are now ready to write your code.

Let’s Code

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

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

3. Create three variables named number1, number2, and result, using the Variables category. Set the values of these variables to '0' using the number block from the Math category. Drag and drop the set to block for all three variables, as shown in the figure here.

4. Drag and drop the repeat while block from the Loops category.

5. Now, drag the if block from the Control category and drop it inside the repeat block.

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

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

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

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

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

11. Drag the Palm block from the AI category and drop it to the right part of the equal operator block.

12. Create a function named "generate number1". To create a function, click on the Functions category and drag the to do something block. Replace the do something with the "generate number1" name. The function will be created.

Note: Functions are not set within the code. They are placed separately in the workspace. You can reuse them by calling up the function name in your code.

13. Drag the set to block and drop it inside the to generate number1 block and increase the value of the number1 variable by 1 to get the desired number using the + operator block from the Math category.

14. Display the value of the number1 variable using the show number block from the Display category and set the colour to green from the colour palette and set the brightness to "100".

15. Now, call the function "generate number1" and drop it inside the do block.

Note: You can create a new function from an existing one by right-clicking and selecting "duplicate". Then you can change the function name and other values in the value box as per your requirements.

16. Similarly, create a function named "generate number2" and increase the value of the number2 variable value by 1 to get the desired number and then display it.

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

18. Now, drag the get detected AI label block from the AI category and drop it to the left of the equal operator block.

19. Drag and drop the Fist block to the right of the equal operator block.

20. Now, call the function "generate number2" and drop it inside the do block.

21. Create a function named "addition" and set the value of the variable result to the addition of number1 and number2 and show the result as shown in the figure here.

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

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

24. Drag and drop the ThumbsUp block to the right part of the equal operator block.

25. Now, call the function "addition" and drop it inside the do block.

26. Create a function named "subtraction" and set the value of the result to subtraction of number1 and number2 based on which number is greater. Show the result on the matrix using the if and else blocks.

27. If the conditional statement of the if block is false, then the statement(s) of the else block will be executed.

28. You can get the else block by clicking on the settings icon of the if block.

29. A pop-up box appears. Drag the else block and drop it below the if block in the pop-up box. Click on the settings icon again to hide the pop-up box.

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

31. Now, drag the get detected AI label block from the AI category and drop it to the left of the equal operator block.

32. Drag and drop the Peace block to the right of the equal operator block.

33. Now, call the function "subtraction" and drop it inside the do block.

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

35. Now the program is ready to burn on the Maker Board.

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

36. Observe the output on the Maker Board.

Scan QR code to view output

A. Tick () the Correct Option.

1 What gesture is used to generate number1 in this program?

a  Fist b  Palm

c  Peace d  ThumbsUp

2 What command is used to recognise the speech input in this code?

a  detect speech

c  recognise command

b  get recognised speech

d  voice command

3 What is the purpose of the "addition" function in this program?

a  To generate number1

c  To add number1 and number2

B. Answer the Following.

b  To generate number2

d  To display results

1 What is computer vision, and how is it applied in this project?

2 Why is it important to set the initial values of number1, number2, and the result to 0?

C. Apply Your Learning.

1 How would you modify the code to handle cases where users might say "plus" instead of "add"?

2 What steps would you take to create a function that shows the result of multiplying two numbers?

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.

In partnership with Avishkaar

ISBN 978-93-89789-35-5

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.