0% found this document useful (0 votes)
2 views

Grade 6 Coding and Robotics

The document outlines a coding curriculum for students, focusing on fundamental concepts such as variables, conditional logic, and loops. It includes a detailed index of activities and chapters that engage students in practical coding scenarios, from understanding variables to implementing conditionals in programs. The curriculum aims to enhance computational thinking and problem-solving skills through interactive projects and quizzes.

Uploaded by

bharat
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

Grade 6 Coding and Robotics

The document outlines a coding curriculum for students, focusing on fundamental concepts such as variables, conditional logic, and loops. It includes a detailed index of activities and chapters that engage students in practical coding scenarios, from understanding variables to implementing conditionals in programs. The curriculum aims to enhance computational thinking and problem-solving skills through interactive projects and quizzes.

Uploaded by

bharat
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 47

educobot.

com 1
CODING INDEX
CHAPTER NO. CHAPTER NAME PAGE NO.

1 Building On Your Coding Adventure 5

2 Understanding Variables 6

3 Add in Birds Activity 8


4 Fun with Math Activity 9

5 Master Chef– Pizza Activity 9

6 Wonders of the World Activity 10

7 Plants in Our Garden Activity 11

8 Quiz Time (Variables) 12

9 Coding Control: The Role of Conditionals 14

10 Doctor and Patient Activity 17

11 Stay Fit Activity 18

12 Farm Attendance Activity 18

13 Police on Patrol Activity 19

14 Spaceship Story Activity 20

15 Quiz Time (Conditionals) 21

16 Understanding Loops 22

17 Clothing Store Activity 24

educobot.com 2
CODING INDEX

CHAPTER NO. CHAPTER NAME PAGE NO.

18 Phases of the Moon Activity 25

19 Decimal Shooter Activity 26

20 Chocolate Fever Activity 27

21 Quiz Time (Loops) 28

educobot.com 3
ROBOTICS INDEX

CHAPTER NO. CHAPTER NAME PAGE NO.

1 Revision Of Basics 29
Introduction To LDR (Light Dependent
2 31
Resistor)
3 Introduction To Transistor 33
Smart Streetlights: Automating with LDR
4 35
and LED
Touchless Doorbell: IR Sensor-Activated
5 38
Buzzer

6 Motion Alter: Triggering Buzzer with IR 40

7 Servo Motor: Programming Motion 41

Automated Railway Crossing: Motion-


8 42
Triggered Gate Control

Color Detection: Black And White With


9 44
IR Sensor

Touch Sensor: Activating LED With


10 45
Touch Sensor

educobot.com 4
Building On Your Coding Adventure

Welcome back, coders! In Grade 5, you dove into the world of coding, creating algorithms for things like traffic signals
and magic shows, navigating mazes using coordinates, and even programming toy vending machines and police chas-
es! You learned how to think like a programmer and bring your ideas to life with code. This year, we're going to build on
those exciting experiences and learn some fundamental coding concepts that will unlock even more possibilities.

You've already laid a fantastic foundation. Now, we're going to learn the core building blocks that make programs truly
powerful: variables, conditional logic, and loops.
What We'll Explore This Year:
Remember those engaging projects from Grade 5? This year, we'll learn the underlying principles that make those
kinds of programs possible:

• Variables: Storing and Changing Information: Variables are like con-


tainers that hold information our programs can use. We can store
numbers, words, and all sorts of data, and even change that data as
the program runs. Imagine programming a game where the score
changes – that's variables in action! This year, you'll use variables to
program scenarios like sending birds to their nest or serving pizza on
a plate, where the information (bird, pizza) is tracked by variables.
• Conditional Logic: Making Decisions: Conditional logic (if/then/
else) allows our programs to make decisions. "If" something is true,
"then" the program does one thing; "else," it does something else. This
is how we create programs that respond to different situations. You'll
use conditions to determine if a patient needs medication or if a
sports enthusiast has reached their target number of skips.

• Loops: Repeating Actions: Loops let us repeat instructions automatically.


Imagine the planets orbiting the sun – they follow the same path over and
over again. A loop in coding is similar; it makes a set of instructions run re-
peatedly until a certain condition is met. Instead of writing the same code
over and over, we can use a loop to make something happen many times.
This is essential for creating animations, games, and programs that perform
repetitive tasks. You'll use loops to program a shopkeeper showing options
until the buyer finds the right size or to create a maths game that continues
until the player wins or loses. Just like the planets keep orbiting, the code
inside a loop keeps running!

Here's what you'll be doing:

• Building on Your Foundation: We'll start with a quick review of the coding concepts you already know.

• Mastering New Concepts: We'll learn the ins and outs of variables, conditional logic, and loops.

• Creating Exciting Projects: We'll use these new skills to build even more sophisticated projects:

 Games with dynamic gameplay and scoring.


 Simulations that model complex processes.
 Programs that automate tasks.
• Developing Computational Thinking: We'll continue to strengthen our computational thinking skills – learning to
break down problems, design solutions, and think logically like programmers.

Get ready to take your coding skills to the next level! This year is all about mastering variables, con-
ditional logic, and loops, and using them to create even more amazing things. Let's code!

educobot.com 5
Understanding Variables

2.1 What will you learn In this chapter?

• What are Variables?


• How to name a Variable?
• Commonly used data types
• Performing activities based on Variables.

2.2 What are Variables?

Variables are like containers or boxes in programming that store information. This information can be numbers, text, or
other data. The value inside a variable can change as the program runs, which is why it's called a "variable."

For example: W h e n you water the plant daily, the size of


the plan increases and eventually it turns into a tree. S o here
the size of the plant is considered to be a variable.

2.3 Naming Variables

As we have understood till now, variables are basically like nouns in a program-
ming language. Every variable in a program is unique. To identify these variables
uniquely, user needs to allocate them a unique name. This name acts as an iden-
tifier for that variable. In programming, a user is not allowed to use the same
name of a variable more than once. Naming variables make it to easier to call
them while performing operations. The name of a variable also suggests what
information the variable contains

Lets refer to an example for better understanding of variables

If variable named as "a" is equal to 2 and variable named as "b" is equal to 2,performing add operation on "a" and "b"
is going to result into an output as "4".

2.4 Data types in Variables


When you create a variable in programming, it stores data. But not all data is the same—some data can be numbers,
some can be text, and some can be true/false values. The type of data that a variable hold is called a data type.
Let us now understand what are the common data types that we can use in programming:

• Integer

• Floating-point number

• Character

• String

• Boolean

educobot.com 6
Integer Data Type
Integer data type variables store integer values only. They store whole numbers which have zero, positive and
negative values but not decimal values. Multiple programming languages support different syntax to declare an
Integer variable. If a user tries to create an integer variable and assign it a non-integer value, the program returns
an error.
Variables of the integer data type are only capable of holding single values. These variables are not capable of
holding a long list of values.

Example of declaring (naming) an Integer variable:

age = 25
print(age)

Floating-Point Number Data Type


Floating-point numbers are used to store decimal values. They hold real numbers with decimal values. Depending
on the programming language, the syntax to declare floating point variable changes.

Example of declaring (naming) an floating-point


number variable:

price = 19.99
print(price)

Character Data Type

Character type variables are used to store character values. Syntax of declaring a character variable is specific to the
programming language that you are using. If a user tries to create a character variable and assign it with a non-
character value, the program will throw an error. The character data type is the smallest data type in programming.
Any character values can be declared as a char variable.

Example of declaring (naming) an character varia-


ble:

a = ‘w’
print(a)

String Data Type


To extend the character data type, a user may have a requirement to store and perform an operation on a sequence
of characters. In such cases, the String data type is present to fit the gap. The String data type stores value in a se-
quence of characters i.e. in String format.

Example of declaring (naming) an character varia-


ble:

a = ‘I am a String Variable’
print(a)

educobot.com 7
Boolean Data Type
There is a subtype of Integer Data Type called "Boolean Data Type", which stores values in Boolean type only i.e.
"true" or "false".

Example of declaring (naming) an Boolean variable:

is_sunny = True
print(is_sunny)

Note: In some programming languages like python, there is no command to declare variables. A variable is
created the moment you first assign a value to it.

Example of declaring (naming) variables in Python

a=5
b= “Hello”

If you want to specify the data type of variable this can be done using casting.
Example: y = str(7)
z = int(7)
a = float(7)
y will be saved as ‘7’
z will be saved as 7
a will be saved as 7.0

2.5 Activities based on Variables.

1 ADD IN THE BIRDS

Task: In this lesson, we will use variables to add the right number of birds to the empty nest.
Applying variable concepts in a simple coding scenario

Since there are two nests whose value needs to be added


up for the final answer, there will be two variables too. In the
first nest, since there are already 3 birds, we don't add more;
that's why we initialize it to 0, but in this nest, 2 birds need to
be added to get a total of 5; that's why we will initialize it to 2.

No w that you have finalized the variable to send that


specific number of birds in the nest we will use this block.
After the code is complete we will run and check the
working of it.

educobot.com 8
2 FUN WITH MATHS

Task: Students use variables to per-


form mathematical operations and
manipulate data. learning how to
use variables in mathematical con-
texts.

This is the Variable block that will help you select


the mathematical operator that will complete the
equation.

This is the Variable block that will help you to


select the empty nest and the number of birds
to be sent in that nest that will complete the
equation.

Once you are ready with the operator and the


number of birds in the appropriate nest this block
will execute the code and send those many
numbers of birds to complete the equation.

3 MASTER CHEF-PIZZA

Task: Students use multiple variables to store fractions and code to serve pizza according to
a brief. learning to use multiple variables and apply them in a more complex scenario.

educobot.com 9
his is the variable block that will help the computer
store the count of pizza slices that need to be served
on plate 1 from plate 3. Since 2 slices are needed to
be served on plate 1, the variable is assigned to 2.

The other 4 slices need to be placed on plate 2, hence


the second variable comes into play and initializes the
value to 4 as per the instruction.

Lastly, once the pizza slices are divided as per the in-
struction, we will use a serving block to distribute the
slices on plates 1 and 2.

4 WONDERS OF THE WORLD

What are Coordinates?

Coordinates in coding are like instructions that


tell the computer where to place or move
something on the screen. Think of it like a
treasure map—you need to know the exact
spot to find the treasure, right? Coordinates
help the computer find that exact spot.

How do Coordinates Work?


2D Coordinates (X, Y):
• X tells you how far to go left or right (horizontal).
• Y tells you how far to go up or down (vertical).
• Example: (4, 3) means 4 steps to the right and 3 steps
up.

The task: The task is to place the monuments on their respectively country with help of
blocks.applying coding logic to a geographical context.

educobot.com 10
Select the country name and enter its x
and y coordinates using this block.

This block will help you select the mon-


ument name and in which country it
should be placed.

55 TRAFFIC LIGHT
PLANTS IN OUR GARDEN

The task: In this lesson find the coordinates of the plants and water them appropriately
with relevant wait time. Combining coordinate concepts with timing and coding.

educobot.com 11
In this block select the appro-
priate stage of the plant and
also mention the coordinates
of it

In this block select the appro-


priate stage of the plant and
also mention the coordinates
of it

Wait block provides an inter-


val between 2 codes where
after watering the first plant
wait for a few seconds and
then water the next.

Congratulations on finishing the


current level!

If you are reading this, it means you have successfully completed this level. It's
time to attempt a test lesson (Perfect Salad in your portal). Please read the instruc-
tions carefully on the portal’s test lesson instruction card and complete the test to
unlock the next level. Keep up the great work, and all the best!

QUIZ TIME
Q1. What is a variable in programming?
A type of food

A container to store data

A video game character

A programming error

educobot.com 12
Q2. What type of data can a variable store?
Numbers

Text (words)

True/False values

All of the above

Q3. What will be the value of z after this code


x = 10
z= x+5

10

15

20

Q4. Where is the point (0, 0) usually located on a grid?


Top-left corner

Bottom-right corner

The center (origin)

Outside the grid

Q5. Which of the following data type is used to store decimal values?
Integer

Float

Boolean

String

SHORT ANSWER QUESTIONS


Q1. Can variable store text? Name the data type that stores text.
Q2.Name two data types that a variable holds.
Q3.What are Coordinates?
Q4. Can we declare two variables in a program with the same name?

educobot.com 13
Coding Control: The Role of
Conditionals
3.1 What will you learn In this chapter?

• What are conditions and how to apply them in


real life
• What are different types of operators?
• How to combine multiple operators?
• Performing activities based on Conditionals.

2.2 What are Conditionals?


In coding, conditionals are like decision-making tools. They
help the program make choices based on certain condi-
tions—just like how we make decisions in our daily life!

For example, imagine you're deciding whether to go outside


based on the weather:

• If it is night, then you go to sleep.


• Else (if it's not night), you stay awake.

In coding, we use something called an if statement to make


similar choices.

What is an IF Statement?
An if statement tells the program, "Check this condition, and if it's true, do this." If the condition is false, the program
skips over it and moves on:

For example:

if temperature > 30:

print("It's hot! Let's go to the beach!")

Here’s what’s happening:

• The program checks if the temperature is more than 30 degrees.


• If the answer is yes (true), it will print: "It's hot! Let's go to the beach!"

What is an Else Statement?


An else statement works with the if statement. It gives the program something to do if the condition is false.

For example:

if temperature > 30

print("It's hot! Let's go to the beach!") else:

print("It's not hot. Let's stay inside.")

Now, if the temperature is not over 30, it will print: "It's not hot. Let's stay inside."

educobot.com 14
What is an Elif Statement?
If you want to check multiple conditions, you can use elif (short for "else if"). This helps you check for more than one
condition.

For example:

if temperature > 30:

print("It's hot! Let's go to the beach!")

elif temperature > 20:

print("It's warm! Let's go for a walk.")


else:

print("It's cold. Stay inside!")

Here:

• First, it checks if the temperature is above 30 (hot).


• If not, it checks if it's above 20 (warm).
• If both conditions are false, it assumes the temperature is cold and says to stay inside.

2.3 Logical Operators and Its Types


Logical operators work like Boolean variables and return either TRUE or FALSE.
The three most important logical operators are AND, OR and NOT

2.4 AND Operator


AND operator is used to determine if two or more conditions are true. If all the conditions are true, the AND oper-
ator returns TRUE. If any one of the conditions fail, the AND operator returns FALSE. In some programming lan-
guages AND operator is denoted by “&&” symbol.
For example - you should go to bed only after you have completed your homework and the time is past 8 PM.
Here, if we want to derive the logical operation from this scenario, we have the following conditions:
Condition 1: Have you completed homework?
Condition 2: Is the time past 8 PM?
Decision: Should you go to bed?
Based on this we can write the below pseudo code:

IF (Homework completed) AND (Time is past 8 PM)


THEN
Go to bed
ELSE
Do not go to bed

Having this example in mind, let us now see how this is different from OR operator.

educobot.com 15
2.5 OR Operator

The OR operator is used to determine if either one of two or more conditions is TRUE. If any of the condition is
true, the OR operator returns TRUE. If all the conditions fail, the OR operator simply returns FALSE. In some pro-
gramming languages OR operator is denoted by “||” symbol.
For example - We should carry an umbrella when either it is sunny, or it is raining. Otherwise, we should not carry
it. Like the previous example, if we want to derive the logical operation from this scenario, we have the following
conditions:
Condition 1: Is it sunny outside?
Condition 2: Is it raining outside?
Decision: Should we carry an umbrella?
The pseudocode for this will look like below:

IF (It is sunny outside) OR (It is raining outside)


THEN
Carry an umbrella
ELSE
Do not carry an umbrella

Let us now look at the NOT operator.

2.6 NOT Operator


We use the NOT operator to reverse or negate a condition. If the condition is true, NOT will return false and vice ver-
sa. In some programming languages NOT operator is denoted by “!” symbol.
For example, you can go to play only if it is not raining, otherwise, you must stay indoors. Unlike the previous exam-
ples, here we have only one condition.
Condition: Is it raining?
Decision: Go out to play?
The pseudocode for this will look like below:

IF NOT (It is raining)


THEN
Go out to play
ELSE
Stay indoors

2.7 Combining Logical Operator


Sometimes, we need to combine different logical opera-
tors to create a complex expression. Imagine your library
is open on Monday between 10 AM to 12 PM OR on
Wednesday between 3 PM to 5 PM.

IF (Day == Monday AND (Time >= 10 AM AND Time <=12


PM)) OR (Day == Wednesday AND (Time >= 3PM AND Time
<= 5 PM))
THEN
Library Open
ELSE
Library Closed

educobot.com 16
2.8 Relational Operators
In our previous example, we got introduced to some relational operators like greater than equals (>=), equals (==),
and less than equals (<=).
Let us now look at the full list of relational operators.

2.9 Activities based on Conditionals

1 DOCTOR AND PATIENT

Task: In this lesson, The doctor examines the patients, and only those with fever are
given medicine. applying conditional logic to a medical scenario.

This is the variable block where patient’s temperature is stored since it will vary for different
patients.

This is the condition block that will check whether


the patient’s temperature is above 39 or not.

This block will display the text on the screen


showing the conversation between doctor
and patient.

Based on the condition which action to be performed will


be decided by these blocks.

educobot.com 17
STAY FIT
2
The task: Program a bot to guide someone to skip and stay healthy. Implement specific
jump counts and rest periods using conditional logic. applying conditional logic to control a
timed physical activity.

This code will help the girl jump 40 times. When the
jump count reaches 20, the character says "Take rest"
and waits for 5 seconds before continuing. After each
jump, the jump count increases by 1, with a short 0.2-
second pause between jumps.

3 FARM ATTENDANCE

The task: The Farm girl is taking attendance of the animals, she will randomly call out
for the animal and the animal will respond with their sound. applying conditional logic to
create a dynamic interactive program.

educobot.com 18
This code runs 5 times. Each time, it says "Next is,"
randomly picks an animal (like pigs, hens, chicks,
sheep, or cow), and makes that animal's sound. After
the sound, it waits for 2 seconds before repeating.

4 POLICE ON PATROL

Task: Police are monitoring the city using drones, using the conditional statement help

police to track down and catch the thief. Applying conditional logic to a tracking scenario.

This code represents a surveillance system that operates as follows:

1. Start surveillance is initiated.


2. The process repeats 3 times:
• Show footage.
• Wait for 4 seconds to analyze the footage.
• If the system detects contact with a Robber:
• It catches the robber, announces "robber caught", and ends all processes
immediately.
• Else, if no robber is detected:
• The system moves to the next street to continue surveillance.

If the robber is caught in any iteration, the process stops entirely. If not caught after
3 attempts, the surveillance ends automatically.

educobot.com 19
5 SPACESHIP STORY

The task: Help a rocket reach a planet and destroy approaching meteorites using condi-
tional statement. Applying conditional logic in a game-like environment.

This is the forever loop that will


repeat the command endlessly
until a stop function is given.

If the rocket touches the meteorite the After reaching the planet this
rocket will blast and the game will be block will end the game.
over

educobot.com 20
Congratulations on finishing the
current level!

If you are reading this, it means you have successfully completed this level. It's
time to attempt a test lesson (Catch the Fish in your portal). Please read the instruc-
tions carefully on the portal’s test lesson instruction card and complete the test to
unlock the next level. Keep up the great work, and all the best!

QUIZ TIME

Q1. Which of the following is a logical operator


AND

OR

NOT

All Of the Above

Q2. Which operator is used if the statement evaluates true only if only
one of the expressions is true

AND

OR

NOT

None Of The Above

Q3. What is the purpose of a conditional statement?


To repeat code

To store data

To make decisions

To create functions

educobot.com 21
Q4. Which keyword is used to check another condition if the first one is
false?
else if

elif

elseif

ifelse

Q5. Which of the following is NOT a comparison operator?


==

!=

>

AND

SHORT ANSWER QUESTIONS


Q1. What are different types of operators?
Q2. Explain with example on how to combine different operators.
Q3. What does the and logical operator do?

Understanding Loops

4.1 What will you learn In this chapter?

• What are loops?


• Types of loops?
• Concept of nested loops.
• Perform activities based on loops.

4.2 Introduction to Loops.

There are many tasks in our day to day life which we repeat at specific intervals, like eating meals, taking a bath,
going to school etc. There is a very similar concept to this in programming where we need to repeat certain lines
of code at specific interval or till specified condition is met.

educobot.com 22
In programming, repetition of a line or a block of code is also known as iteration. A loop is an algorithm which exe-
cutes a block of code multiple times till the time a specified condition is met. Therefore, we can say that a loop
iterates a block of code multiple times till the time mentioned condition is satisfied.

4.3 Types of Loops.

FOR Loop
When to Use: When you know how many times you want to repeat something.

How It Works:

• Start by initializing a counter (e.g., i = 0).


• Check a condition (e.g., i < 5).
• If the condition is true, it executes the code inside the loop.
• After that, it updates the counter (e.g., i = i + 1) and checks the condition again.
• It keeps repeating until the condition becomes false.

Example

for i in range(5):
print("Hello!")

This will print "Hello!" five times.

WHILE Loop

When to Use: When you don’t know exactly how many times the loop should run. It runs as long as the condition is
true.
How It Works:
• First, it checks the condition.
• If the condition is true, it executes the code.
• It keeps checking the condition after every loop.
• When the condition becomes false, the loop stops.

Example:

i=0

while i < 5:

print("Hello!")

i += 1

This also prints "Hello!" five times.

4.4 Nested Loop


Any loop in program may contain another loop inside it. When there is a loop inside another loop, it is called a nest-
ed loop. How it works is that first success condition of outer loop triggers the inner loop which runs and reaches
completion. This combination of loops inside loop is helpful while working with requirements where user wants to
work of multiple conditions simultaneously. There is no restriction on how many loops can be nested inside a loop.
To understand the concept of Nested loops better, consider an example of an Analogue clock. An analogue clock
has one hand as the nested loop and every full rotation knocks the minute hand on by one etc. We can take this
even further to say that clocks are just a form of the counting system. This is how nested loops work in real life.

educobot.com 23
4.5 Activities based on Loops

1 CLOTHING STORE

Task: Help your customer select the best size and style of clothing. The buyer tries differ-
ent sizes until the right fit is found. Applying loops to a product selection process.

UNDERSTANDING CODE

This a nested loop which runs the


instruction inside the instruction for a
specified number of time.

This block allows the user to mention the string


which can we displayed on the screen.

This block will help to check the condition and


make the decision accordingly. For e.g.: if the answer
is yes than buy the dress else see other option.

The wait block will set an interval between


customers.

educobot.com 24
2 PHASES OF THE MOON

Task: Simulate the phases of the moon using loops and conditional statements. combining
loops and conditional logic to create a simulation.

UNDERSTANDING CODE

This code simulates the moon phases over two cycles of 30 days each. It starts with day 1
and increments daily. On specific days (1, 4, 6, 9, 12, 13, 17, 22, 26, and 30), it displays the cor-
responding moon phase. The loop repeats twice, with a short delay (0.2 seconds) for each
day.

1. Repeat (2) times : Runs the entire moon phase cycle twice.
2. Set [day] to 1 : Starts with day 1.
3. Wait (0) seconds : Placeholder with no delay.
4. Repeat (30) times : Runs the loop for 30 days, simulating one full lunar cycle.
5. IF Checks if the current day matches a specific moon phase day:
• Day 1 New Moon
• Day 4 : Waxing Crescent
• Day 6 : First Quarter
• Day 9 : Waxing Gibbous
• Day 12 : Full Moon
• Day 13 : Waning Gibbous
• Day 17 : Third Quarter
• Day 22 : Waning Crescent
• Day 26 : New Moon
• Day 30 : New Moon

Change [day] by 1 : Increases the day count by 1 after each cycle.


Wait (0.2) seconds : Adds a short delay before moving to the next day.

After 30 days, the process repeats once more.

educobot.com 25
3 DECIMAL SHOOTER

Task: In this lesson, Shoot pearls with decimal numbers to match a target number. This
game uses loops, conditional statements, touch sensing, and variables.

UNDERSTANDING CODE

This condition block has a touch event in it which will


check that on which pearl the user is targeting.

The variable block stores the value of ran-


domly generated decimal targeted number.

This condition will check if the total is


greater than the targeted number and if
it is it will say Oop’s Wrong and the game
will end.

This condition will check if the targeted


number and the total is equal.

educobot.com 26
4 CHOCOLATE FEVER

Task: Compare customer shirt color and wrap chocolates in matching wrappers. Customers
have a limited wait time. This activity involves touch sensing, conditional statements, and
comparisons.

This code represents a chocolate-serving game where the player must serve choco-
lates to customers before their patience runs out.

Breakdown of the Blocks:


1. Display Customers to be served on screen : Shows the number of customers
left to be served.
2. Repeat forever : Continuously runs the game logic.
3. Show the customer : Displays a new customer waiting for chocolate.
4. If I touch Chocolate : Pick up the chocolate : Detects when the player picks
up the chocolate.
5. If I touch Wrapper : Wrap the chocolate : Detects when the chocolate is
wrapped.
6. If Wrapped chocolate touches Customer : Serve the chocolate : Serves the
wrapped chocolate to the customer.
7. If any customer patience bar becomes 0
8. Say "You have failed to serve all customers"
9. End all : If a customer's patience runs out, the game ends with a failure mes-
sage.
10. If Customers to be served = 0
11. Say "You have served all your customers!"
12. End all : If all customers are served, the game ends with a success message.

Congratulations on finishing the current


level!

If you are reading this, it means you have successfully completed this level. It's time to at-
tempt a test lesson (Bowling Alley and Luggage Weight Checker in your portal). Please read
the instructions carefully on the portal’s test lesson instruction card and complete the test
to unlock the next level. Keep up the great work, and all the best!

educobot.com 27
QUIZ TIME
Q1. What does Loop mean?
To make decision

To repeat something

To change the value

To find the position

Q2. Which of the following loops will execute only if the condition is true?

For Loop

While Loop

Both A and B

None of the Above

Q3. Which loop is best used when you don’t know how many times you need

For Loop

While Loop

Both A and B

None of the Above

Q4. How many times will the following loop execute?


for i in range(4):
print(i)
4

Q5. Which loopSHORT


is best forANSWER
iterating overQUESTIONS
a known number of elements?
For Loop
Q1. What is the purpose of a while loop in programming?
While Loop
Q2. Define Loop and Nested Loop in programming.
Do-While Loop
Q3. What is an infinite loop? Can you provide an example?
None of the Above

educobot.com 28
REVISION OF BASICS

Activity: In this activity, you will be introduced to the breadboard, an essential tool used to build and test
electronic circuits. You’ll learn how to connect various electronic components such as LEDs, resistors, and
transistors to the breadboard. The best part is that you won’t need to solder anything—everything can be
connected temporarily, which makes it easy to experiment with different setups. You’ll also discover how to
place components on the breadboard and how to make proper connections to complete a circuit.

Bread Board Buzzer


1 4

2 5

3 6

educobot.com 29
Bread Board LED with Resistor Process

1 4

2 5

3 6

educobot.com 30
7 8

Learning Outcome: By the end of this activity, you will have a good understanding of how to use a
breadboard to create simple circuits. You will know how to connect components correctly and
how to troubleshoot basic problems. This hands-on experience will be the first step in mastering
electronics and circuit design, preparing you for more advanced projects in the future!

INTRODUCTION TO LDR

Activity: Build a circuit on a breadboard using an LDR, resistor, and LED to detect
light. The LED will turn ON in darkness (when no light falls on the LDR) and turn OFF in
bright light, demonstrating light-based automation.

1 3

2 4

educobot.com 31
5 8

6 9

7 10

Learning Outcome: Students will understand how an LDR works to detect


light intensity and how sensors can control devices like LEDs in response
to environmental changes. This activity introduces the concept of light
sensing and its practical applications in automation.

educobot.com 32
INTRODUCTION TO TRANSISTOR

Activity: Students will build a circuit on a breadboard using a transistor as a switch to control an
LED. When the input signal to the transistor’s base is high (e.g., from a button or sensor), the
transistor will allow current to flow, turning the LED ON. If the signal is low, the LED will remain OFF.

educobot.com 33
Learning Outcome: Students will understand how a transistor functions as a switch
and its role in controlling circuits, introducing them to basic concepts of amplification
and signal control in electronics.

educobot.com 34
SMART STREETLIGHTS:AUTOMATING WITH LDR

Activity: In this activity, students will assemble a mini streetlight model using MDF parts and three
PCBs: an LDR PCB, an LED PCB, and a power supply PCB. They will connect the components with a
9V battery. The LDR will sense the surrounding light levels, and when it detects darkness, it will
trigger the LED to light up, simulating an automated streetlight system that turns on at night.

MATERIALS NEEDED

STEP 1

X1 X1 X1 X2

STEP 2

X1 X1 X2

educobot.com 35
STEP 3

X1 X2

STEP 4

X1
X2
X2

STEP 5

X1 X1

X1 X2

STEP 6

X2

educobot.com 36
STEP 7

X2

STEP 8

X2

STEP 9

X1

Learning Outcome: Students will learn how light sensors (LDR) can control an LED based on environmental light
levels. They will understand how to integrate a power supply and components like the LDR and LED into a simple cir-
cuit to create an automated system. This activity teaches the fundamentals of sensors, automation, and energy-
efficient solutions like smart streetlights.

educobot.com 37
TOUCHLESS DOORBELL: IR SENSOR-ACTIVATED BUZZER

Activity: In this activity, students will assemble a hut model and integrate an IR sensor PCB, a
power supply PCB, and a buzzer module. The IR sensor will be placed at the door, and when a
person approaches and interrupts the infrared beam, the sensor will activate the buzzer, simulating
a touchless doorbell. The power supply PCB will provide the necessary power for the circuit.

MATERIALS NEEDED

STEP 1

X1 X1 X2

STEP 2

X1 X2

educobot.com 38
STEP 3

X1 X1

X2 X3

STEP 4

X1
X2

X1

STEP 5

X1 X2

educobot.com 39
INSERT THE BUZZER IN THE SLOT GIVEN
STEP 6

X1 X2

STEP 7

X1

Learning Outcome: Students will learn how infrared (IR) sensors can detect motion
and trigger an action (like activating a buzzer). They will gain hands-on experience
with sensor-based circuits and understand how touchless technology works. This
activity also helps students explore automation and basic circuit assembly, building
their skills in electronics and sensor applications.

MOTION ALTER:TRIGERRING BUZZER WITH IR

Activity: In this activity, students will connect an IR sensor to the ESP32


mounted on the eduCOBOT shield. Using block-based programming, they
will configure the system so that when motion is detected by the IR sensor,
the buzzer on the eduCOBOT shield will be triggered. This activity will help
students understand how sensors can be used in combination with micro-
controllers to automate responses, like sound alerts.

educobot.com 40
Learning Outcome: Students will learn how to connect an IR sensor to the ESP32 and
program it to trigger an action (buzzer) when motion is detected. They will understand
how sensors can provide input to a microcontroller and how the microcontroller can
process that input to activate an output device like a buzzer. This activity helps devel-
op skills in sensor integration, microcontroller programming, and automation systems.

SERVO MOTOR: PROGRAMMING MOTION

Activity: In this activity, students will program a servo motor using the ESP32. Using
block-based programming, they will control the position of the servo by programming
it to rotate to specific angles. Students will learn how to manipulate the servo’s move-
ment through code, experimenting with different angle positions to understand how
the motor responds.

This code con-


trols a servo mo-
tor connected to
pin D23, moving it
between 90 de-
grees and 0 de-
grees repeatedly
with a 1-second
delay between
each movement.

educobot.com 41
Learning Outcome: Students will learn how to use the eduCOBOT shield to control a servo motor,
programming it to rotate to specified angles. They will gain an understanding of how servos work,
how to control their position via code, and how this concept is applied in robotics and automation.
This activity builds foundational skills in motor control and introduces the basics of precise move-
ment in engineering projects.

AUTOMATED RAILWAY CROSSING:


MOTION-TRIGERRED GATE CONTROL

Activity: In this activity, students will create a small railway crossing model using a servo motor, IR
sensor, and the eduCOBOT shield. The servo motor will control the crossing gate, and the IR
sensor will detect motion, simulating the approach of a train. When the sensor detects motion, it
will trigger the servo to close the gates, simulating the automatic closing of a railway crossing. The
microcontroller will be mounted on the eduCOBOT shield and programmed on Innovator.

MATERIALS NEEDED

STEP 1

X1 X1

X1 X4

educobot.com 42
STEP 2

X1 X1 X2

X1 X1

Use long screws to attach the servo motor securely to the designated cutout.

STEP 3

X1 X1 X1

STEP 4

X1 X2

educobot.com 43
STEP 5

X1

Learning Outcome: Students will learn how to integrate an IR sensor with a servo motor to auto-
mate the operation of a gate based on motion detection. They will gain experience in program-
ming the microcontroller using Innovator, exploring the practical application of sensors, motors,
and automation. This activity reinforces concepts of sensor-based control systems and introduces
students to real-world applications in traffic management and safety systems.

COLOR DETECTION: BLACK AND


WHITE WITH IR SENSOR

Activity: In this activity, students will use an IR sensor and LED PCB to detect black and
white surfaces. The microcontroller, mounted on the eduCOBOT shield, will be
programmed using Innovator to distinguish between the two colors based on the reflection
of infrared light. When the IR sensor detects a black surface (which absorbs more IR light), it
will trigger one response (e.g., turning on the LED), and when it detects a white surface
(which reflects more IR light), it will trigger a different response (e.g., turning off the LED).

educobot.com 44
Learning Outcome: Students will learn how IR sensors can be used for color
detection by measuring the amount of infrared light reflected from different surfaces.
They will understand how to program a microcontroller to make decisions based on
sensor input, controlling outputs such as LEDs. This activity introduces students to
basic sensor-based decision-making and the use of IR technology for practical
applications like object detection and sorting.

TOUCH SENSOR: ACTIVATING


LED WITH TOUCH SENSOR
Activity: In this activity, students will explore how a touch sensor PCB works by
programming it with a microcontroller mounted on the eduCOBOT shield using the
Innovator platform. When the touch sensor is touched, the microcontroller will detect
the input and trigger the LED to turn on. This hands-on activity will help students
understand the working principle of touch sensors and how they can be used to
control outputs such as LEDs.

educobot.com 45
Learning Outcome: Students will learn how IR sensors can be used for color detec-
tion by measuring the amount of infrared light reflected from different surfaces. They
will understand how to program a microcontroller to make decisions based on sensor
input, controlling outputs such as LEDs. This activity introduces students to basic sen-
sor-based decision-making and the use of IR technology for practical applications
like object detection and sorting.

educobot.com 46
MRP | 47 Pages |

Mumbai: 6th Floor, 288 Shiv Sadan S V Road,

Bandra West, Mumbai, Maharashtra 400050

www.educobot.com

[email protected]

+91-7278517851

Published By Kritrima Prajna Innovations Pvt Ltd, Mumbai

You might also like