Professional Documents
Culture Documents
1 www.stemrobo.com
Activity-1
PBL kit is a Project based learning kit. In the PBL kit there are some Input
and Output devices are connected which can be controlled by Arduino.
Arduino contains a micro controller which controls the working of these input
output devices.
2 www.stemrobo.com
Electronic Explorer Kit Components:
3 www.stemrobo.com
3. Seven Segment Display Module
A seven segment display is the most basic
electronic display device that can display digits
from 0-9. They find wide application in devices
that display numeric information like digital
clocks, radio, microwave ovens, electronic
meters etc. The name 7 segment comes from
the fact that the display has 7 separate LED
segments.
It is of two types.
Common Anode.
Common Cathode
Applications:
Counters
It is used in traffic lights
Used in Digital clocks
Used in Timer, Lift.
4. RGB LED
RGB is a special kind of LED. There are total 4 pins,
one pin for each color respectively and last one is
common pin. The RGB led is an additive color model
in which the primary colors red, green and blue light
are added together in a single package.
RGB is of two types:
Common Anode: Common Leg
Positive.
Common Cathode: Common Leg
Negative.
Applications:
For lightning different color
combination.
Indicating of the charging status devices like Laptop, Phones
etc.
4 www.stemrobo.com
5. LCD Module
Liquid crystal display(LCD) is one of
the device which can be easily
interfaced with Arduino for
displaying the Arduino. There are
two types: graphical and character
LCD. Also based upon the size of
the LCD, there are different types:
16x2 character LCD(16
columns and 2 rows)
20x4 character LCD(20
columns and 4 rows)
The 16x2 LCD has a total of 16 pins out of which eight of the pins are data lines
(pins 7-14), two are for power and ground (pins 1 and 16), three are used to
control the operation of LCD (pins 4-6), and one is used to adjust the LCD screen
brightness (pin 3). The remaining two pins (15 and 16) power the backlight.
Applications:
6. Buzzer
A buzzer or beeper is an audio signaling device
which may be mechanical, electromechanical or
piezoelectric .Typical uses of buzzers and
beepers include alarm devices, timers and
confirmation of user input such as a mouse click
or keystroke.
Applications:
Alarm Devices
Door bells
Computers
Timers
5 www.stemrobo.com
7. Ultrasonic Sensor
Ultrasonic sensor generates high
frequency sound waves and evaluates
the echo which is received back by the
sensor, measuring the time interval
between sending the signal and
receiving the echo to determine the
distance to an object. It is useful in
automatic distance measurement in
normal and difficult environments
particularly suitable for environments
where optical sensors are unusable
such as smoke, dust and similar and it
gives very accurate, stable and can be used over large ranges.
Applications: It can be used to detect or measure the following things:
Distance
Level
Diameter
Presence
Position
6 www.stemrobo.com
9. IR Sensor
An infrared sensor is an electronic
device, that emits in order to sense
some aspects of the surroundings. An
IR sensor can measure the heat of an
object as well as detects the motion.
These types of sensors measures only
infrared radiation, rather than emitting it
that is why it is called as a passive IR
sensor.
Applications:
For detecting obstacle.
For distinguishing between white & black
10. Switch
Switches are really simple components. When you
press a button or flip a lever, they connect two
contacts together so that electricity can flow
through them.
Applications:
On/Off control
User input
7 www.stemrobo.com
11. Motor Shield
Motor driver module or motor shied is
used to run different types of motors in
which motor driving IC(L293D) is being
used. It allows you to drive two DC motor
from your Arduino board, controlling
Speed & direction of each motor.
Applications:
Robotics
CNC machines
Radar System
13. DC Motor
A motor is an electrical machine which converts electrical energy into mechanical
energy. The principle of working of motor of a DC motor is that whenever a
current carrying conductor is placed in magnetic field, it experiences a
mechanical force.
8 www.stemrobo.com
Digital pin number for interfacing modules with Arduino:
Note: Single digital pin is being used for multiple modules so care should
be taken while interfacing different modules at same time so that sensors
doesn’t disturbs the working of each other.
9 www.stemrobo.com
Activity-2
LED Pattern: Pattern can be defined as manner or sequence in which group of LED
is operated. Group of LED’s are switched On & Off at same time to form different LED
patterns. Digital pin number 2 to 10 is dedicated for LED matrix.
Select
this
option
Select LED block on the left and drag it to right side. Select the pin on which we
have connected a LED.
Repeat above step 5 times for defining different LED’s & connect them to respective
pins.
10 www.stemrobo.com
Code:
1..Select forever
from Control
11 www.stemrobo.com
Running LED Pattern:
Code:
12 www.stemrobo.com
Output:
Learning outcome: Students learnt about interfacing of LED matrix & how to
develop logics for making different type of patterns.
DIY Task:
13 www.stemrobo.com
Activity-3
RGB LED:
These LEDs have 3 tiny LEDs of 3 primary colors (red, green, and blue) where a
terminal is common for all. Some have common positive terminal (anode) and
some have common negative terminal (cathode). When different voltage is
applied to different LEDs, they make a mixture and produce several thousands of
colors.
Rather than having 6 leads (a cathode and anode for each LED) it has only 4 one
pin for each color, and one common pin.
Types of RGB LED:
Common Anode: Common Leg Positive
Common Cathode: Common Leg Negative.
Select
this
option
Select RGB LED block on the left and drag it to right side. Select the pin on which
we have connected a LED.
14 www.stemrobo.com
Color of the LED Command
Red 00FFFF
Blue FF00FF
Green FFFF00
Magenta 0000FF
Yellow 00FF00
Cyan FF0000
White 000000
Code:
Select “forever” block from control option (yellow color block) on the left top of the
screen & drag it to coding area.
Whatever task we place in forever block it is going to get executed again & again.
Select setcolor block from output section (blue color block) & place it inside forever
block.
Write the Hex value in that block as mentioned in table above.
Repeat above step for all other color patterns.
15 www.stemrobo.com
Output:
Learning outcome: Students learnt about interfacing of RGB LED & how to make
different color patterns.
DIY Task:
16 www.stemrobo.com
Activity-4
LCD: A liquid-crystal display (LCD) is a flat panel display, electronic visual display,
or video display that uses the light modulating properties of liquid. Liquid crystals do
not emit light directly. LCDs are available to display arbitrary images (as in a general-
purpose computer display) or fixed images which can be displayed or hidden, such as
preset words, digits, and 7-segment displays as in a digital clock.
It is a 16*2(16 columns & 2 rows) LCD i.e. max to max 32 characters can be
displayed on it at a time, 16 characters in each row respectively.
Hardware Description: 4 pins are for data, one is for enable & one is for RS.
Select
this
option
Select LCD block on the left and drag it to right side. Select the pins on which we
have connected a LCD.
17 www.stemrobo.com
LCD Pin Pin Number(Arduino)
RS Pin 13
EN Pin 12
D4 Pin 5
D5 Pin4
D6 Pin 3
D7 Pin 2
Code:
Select
forever from
Control
Select “forever” block from control option (yellow color block) on the left top of the
screen & drag it to coding area.
Whatever task we place in forever block it is going to get executed again & again.
Select printLine block from output section (blue color block) & place it inside forever
block.
Whatever you want to display on LCD write it in block.
Repeat above step for whatever you want to display.
Upload the code & connect the desired module to respective place on Arduino
shield.
18 www.stemrobo.com
Output:
Learning outcome: Students learnt about interfacing of LCD & how to print on it.
DIY Task:
19 www.stemrobo.com
Activity-5
Push button: The pushbutton is a component that connects two points in a circuit
when you press it. The example turns on the buzzer when we press the button. We can
connect our pushbutton normally in 2 ways when dealing with electronics.
Active High
Active Low
Buzzer: an electrical device that makes a buzzing noise and is used for signaling.
Hardware Description:
Select
these
options
Select button & speaker block on the left and drag it to right side. Select the pin on
which we have connected a button & buzzer.
20 www.stemrobo.com
Hardware Pin Number
Active High Pushbutton Pin 12
Active Low Pushbutton Pin 13
Buzzer Pin 2
Code:
Select “forever” block from control option (yellow color block) on the left top of the
screen & drag it to coding area.
After that select “if “ block from control (yellow color block).If condition is used to
check whether button is pressed or not.
Select buttonPressed block from input section (purple color block) & place it inside
forever block.
Select the playNote block from output section (blue color block) & place it inside if
block i.e. if button is pressed buzzer will start buzzing & on releasing button it will
stop buzzing.
Repeat above step for using multiple pushbuttons.
Upload the code & connect the desired module to respective place on Arduino
shield.
21 www.stemrobo.com
Learning outcome: Students learnt about interfacing of pushbutton & buzzer.Also
learnt about how to use “if ” condition in logics.
DIY Task:
1. Interfacing both the pushbuttons at same time perform two different operations
on basis of it.
22 www.stemrobo.com
Activity-6
Seven Segment Display: A SSD is a form of electronic display device used for
displaying decimal numerals that is an alternative to the more complex dot matrix
displays.
Seven Segment Display are widely used in digital clocks, electronic meters, basic
calculators and other electronic devices that display numerical information.
There are 2 Seven Segment Display.
Hardware Description: 8 pins are for data, two pins are for SSD selection.
Select
this
option
Select LED block on the left and drag it to right side. Select the pin on which we
have connected a LED.
23 www.stemrobo.com
Repeat above step 8 times for defining different LED’s & connect them to respective
pins.
Code:
1..Select forever
from Control
Select “forever” block from control option (yellow color block) on the left top of the
screen & drag it to coding area.
Whatever task we place in forever block it is going to get executed again & again.
Select pinMode from setup section (dark blue color) & define pin 7 as output. For
operating seven segments.
Select setLED block from output section (blue color block) & place it inside forever
block.
24 www.stemrobo.com
Select the name of the LED & switch it on or off according our logic for displaying a
number.
Repeat above step for all other declared LED’s.
Upload the code & connect the desired module to respective place on Arduino
shield.
Output:
Hardware Description: 8 pins are for data, two pins are for SSD selection.
Select
this
option
25 www.stemrobo.com
Code:
DIY Task:
26 www.stemrobo.com
Activity-7
Seven Segment Display: A SSD is a form of electronic display device used for
displaying decimal numerals that is an alternative to the more complex dot matrix
displays.
Seven Segment Display are widely used in digital clocks, electronic meters, basic
calculators and other electronic devices that display numerical information.
There are 2 Seven Segment Display.
Multiplexing is where different display devices are not turned on at the same time, but
the electronics and the persistence of vision combine to make the viewer believe the
entire display is continuously active.
Hardware Description: 8 pins are for data, two pins are for SSD selection.
Select
this
option
27 www.stemrobo.com
Select LED block on the left and drag it to right side. Select the pin on which we
have connected a LED.
Repeat above step 8 times for defining different LED’s & connect them to respective
pins.
Select “forever” block from control option(yellow color block) on the left top of the
screen & drag it to coding area.
Whatever task we place in forever block it is going to get executed again & again.
Select pinMode from setup section(dark blue color) & define pin 6 & 7 as output. For
operating seven segments.
28 www.stemrobo.com
Select setLED block from output section(blue color block) & place it inside forever
block.
Select the name of the LED & switch it on or off according our logic for displaying a
number.
Repeat above step for all other declared LED’s.
Output:
Hardware Description: 8 pins are for data, two pins are for SSD selection.
Select
this
option
29 www.stemrobo.com
Code:
30 www.stemrobo.com
Output:
Learning outcome: Students learnt about multiplexing of SSD & displaying two
different numbers on it.
DIY Task:
31 www.stemrobo.com
Activity-8
Hardware Description: We have used LDR module & LCD on which we will be
displaying ADC value. As light intensity increasing reading from sensor increases as light
intensity decreases reading from sensor decreases.
Select LCD block from the left and drag it to right side. Select the pin on which we
have connected a LCD.
We don’t need to select any block for LDR as it will be on coding part.
Connect LDR module & LCD module to the respective slots on the shield.
32 www.stemrobo.com
Code:
33 www.stemrobo.com
Display message on LCD on the basis of light intensity:
Code:
Select
variable
from here
34 www.stemrobo.com
Select pinMode block from setup(dark blue color).Select the pin and define it as
input.
Select “forever” block from control option (yellow color block) on the left top of the
screen & drag it to coding area.
Whatever task we place in forever block it is going to get executed again & again.
Declare a new variable, name it as “a”(by clicking on variable orange color block)&
store value of sensor in it by inserting analogRead block in that variable block(as
shown in the code).
Select printLine block from output(blue color) & print variable “a” on LCD. By
selecting “a” orange color block & placing it in printLine block.
Select if block from control section(yellow color) & use greater than operator for
setting condition i.e. if condition is true print some message on LCD else do
something else.(follow as shown in code)
This will display reading from sensor on the LCD in the first line & in second line a
message will be displayed.
35 www.stemrobo.com
Output:
Learning outcome: Students learnt about LDR & its interfacinf & how to develop
small project on basis of it.
DIY Task:
36 www.stemrobo.com
Activity-9
IR Sensor:
An IR sensor is a device that detects IR radiation falling on it. An IR sensor
consists of two parts, the emitter circuit and the receiver circuit. This is
collectively known as photo-coupler.
The emitter is an IR LED and the detector is an IR LED. The photo-diode’s
resistance and output voltage change in proportion to the IR light received. This
is the underlying working principle of the IR sensor.
Out of digital pin 12 & 13 we can use any one for taking input
from IR sensor.
Select LED block on the left and drag it to right side. Select the pin on which we
have connected a LED.
37 www.stemrobo.com
Code:
Select “pinMode” block from setup option(dark blue color), select the pin as pin 13 &
select mode as input.
Select “forever” block from control option(yellow color block) on the left top of the
screen & drag it to coding area.
Whatever task we place in forever block it is going to get executed again & again.
Select “if” block from control option(yellow color block) & inside it inside forever
loop.
Select the equality operator(green color block) for checking the condition and place
it in if block.( as shown above)
Select the digitalRead block from input option(violet color) & place it inside equality
block and compare it with 1.
Value of IR sensor will be equal to 1 if an obstacle is detected else it will
be 0.
LED will switch on if condition is true else it will remain off.
38 www.stemrobo.com
Output:
LED on IR
sensor will
get on if it
detects
something.
DIY Task:
1. Try switching on different LEDs when obstacle is detected & when it is not.
39 www.stemrobo.com
Activity-10
Motor driver module : Motor driver module is used to run different types of
motors in which motor driving IC(L293D) is being used.
Select
this
option
Select Motor option from the left and drag it to code screen.
Select pins in that block either as 6 & 7 or 8 & 9.
40 www.stemrobo.com
Code:
We can change the speed of the fan by using motorSpeed block (blue color block).
We can also change the direction of rotation of motor by interchanging the pins
define in hardware section.
41 www.stemrobo.com
Automatic fan/hand dryer: (IR sensor & Motor driver)
Code:
Select
pinMode
from
here
Select pinMode block from setup(dark blue color).Select the pin and define it as
input & output as shown above.
Select “forever” block from control option (yellow color block) on the left top of the
screen & drag it to coding area.
Whatever task we place in forever block it is going to get executed again & again.
In “if” block we will be checking the status of sensor whether anything is detected
or not(as shown in the code).
If sensor detects something fan will get switched on by setting one pin HIGH &
other pin LOW else fan will remain off by keeping both the pins on same value.
42 www.stemrobo.com
Output:
DIY Task:
43 www.stemrobo.com