Grade 6 Coding and Robotics
Grade 6 Coding and Robotics
com 1
CODING INDEX
CHAPTER NO. CHAPTER NAME PAGE NO.
2 Understanding Variables 6
16 Understanding Loops 22
educobot.com 2
CODING INDEX
educobot.com 3
ROBOTICS INDEX
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
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:
• 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:
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
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."
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
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".
• 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.
age = 25
print(age)
price = 19.99
print(price)
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.
a = ‘w’
print(a)
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".
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.
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
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
educobot.com 8
2 FUN WITH MATHS
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.
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.
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.
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
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 programming error
educobot.com 12
Q2. What type of data can a variable store?
Numbers
Text (words)
True/False values
10
15
20
Bottom-right corner
Q5. Which of the following data type is used to store decimal values?
Integer
Float
Boolean
String
educobot.com 13
Coding Control: The Role of
Conditionals
3.1 What will you learn In this chapter?
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:
For example:
if temperature > 30
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:
Here:
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:
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.
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.
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.
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.
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
OR
NOT
Q2. Which operator is used if the statement evaluates true only if only
one of the expressions is true
AND
OR
NOT
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
!=
>
AND
Understanding 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.
FOR Loop
When to Use: When you know how many times you want to repeat something.
How It Works:
Example
for i in range(5):
print("Hello!")
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
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
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
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
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.
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
Q2. Which of the following loops will execute only if the condition is true?
For Loop
While Loop
Both A and B
Q3. Which loop is best used when you don’t know how many times you need
For Loop
While Loop
Both A and B
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.
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
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.
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.
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.
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.
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.
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.
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 |
www.educobot.com
+91-7278517851