0% found this document useful (0 votes)
12 views60 pages

KT1300

The document outlines various Arduino projects, including components, circuit connections, and coding instructions for each project. It details the specifications of the ATmega328P microcontroller and provides a list of required hardware for each project. Additionally, it includes links to video tutorials and code resources for further guidance.

Uploaded by

22bph101
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)
12 views60 pages

KT1300

The document outlines various Arduino projects, including components, circuit connections, and coding instructions for each project. It details the specifications of the ATmega328P microcontroller and provides a list of required hardware for each project. Additionally, it includes links to video tutorials and code resources for further guidance.

Uploaded by

22bph101
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/ 60

Page | 1

S.No. Project Name Pg.


No.
Know your components 3-10
1 Blink Led 11-13
2 PWM (Pulse width Modulation) 14-17
3 Traffic Light 18-20
4 Led Chasing Effect 21-23
5 Button Controlled Led 24-26
6 Passive Buzzer 27-29
7 RGB Led 30-32
8 Photo resistor or LDR 33-35
9 Analog Value Reading 36-38
10 Control Led using SN74HC595 Shift Register IC 39-42
11 Turn On/Off led using LDR 43-46
12 Turn on buzzer and led when light emits on LDR 47-49
13 Control RGB led using Push Button to change 50-52
colour
14 Blink Leds in series pattern 53-55
15 Capacitance Meter 56-59

Video Tutorial:
Check our Playlist for all Projects:
https://www.youtube.com/watch?v=461FVSn15OQ&list=PLeZjSVeikamNu
NH8pT5JPKDfhOWMcQaEM

Page | 2
Microcontroller ATmega328P – 8 bit AVR family
microcontroller
Operating Voltage 5V
Recommended Input 7-12V
Voltage
Input Voltage Limits 6-20V
Analog Input Pins 6 (A0 – A5)
Digital I/O Pins 14 (Out of which 6 provide PWM output)
DC Current on I/O Pins 40 mA
DC Current on 3.3V Pin 50 mA
Flash Memory 32 KB (0.5 KB is used for Bootloader)
SRAM 2 KB
EEPROM 1 KB
Frequency (Clock 16 MHz
Speed)

Page | 3
Pin Description

Pin Category Pin Name Details


Power Vin, 3.3V, 5V, GND Vin: Input voltage to Arduino
when using an external
power source.
5V: Regulated power supply
used to power
microcontroller and other
components on the board.
3.3V: 3.3V supply generated
by on-board voltage
regulator. Maximum current
draw is 50mA.
GND: ground pins.
Reset Reset Resets the microcontroller.
Analog Pins A0 – A5 Used to provide analog
input in the range of 0-5V
Input/output Digital Pins 0 - 13 Can be used as input or
Pins output pins.
Serial 0 (Rx), 1(Tx) Used to receive and transmit
TTL serial data.
External 2, 3 To trigger an interrupt.
Interrupts
PWM 3, 5, 6, 9, 11 Provides 8-bit PWM output.
SPI 10 (SS), 11 (MOSI), Used for SPI communication.
12 (MISO) and 13
(SCK)
Inbuilt LED 13 To turn on the inbuilt LED.
TWI A4 (SDA), A5 (SCA) Used for TWI communication.
AREF AREF To provide reference
voltage for input voltage.

Software

Arduino IDE (Integrated Development Environment) is required to


program the Arduino Uno board. Arduino IDE 1.8.5 (Programmable
Platform for Arduino Boards)
Click to download the software:

Page | 4
https://www.arduino.cc/en/Main/Software

Breadboard
A breadboard is a solderless device for temporary prototype with
electronics and test circuit designs. Most electronic components in
electronic circuits can be interconnected by inserting their leads or
terminals into the holes and then making connections through wires
where appropriate. The breadboard has strips of metal underneath
the board and connect the holes on the top of the board. The metal
strips are laid out as shown below. Note that the top and bottom rows
of holes are connected horizontally and split in the middle while the
remaining holes are connected vertically.

Note how all holes in the selected row are connected together, so the
holes in the selected column. The set of connected holes can be
called a node:

Page | 5
To interconnect the selected row (node A) and column (node B) a
cable going from any hole in the row to any hole in the column is
needed:
Now the selected column (node B) and row (node A) are
interconnected:

Breadboard used are different in sizes, you will get only


one size breadboard.

LED
The “Light Emitting Diode” or LED as it is more commonly called, is
basically just a specialized type of diode as they have very similar
electrical characteristics to a PN junction diode. This means that an
LED will pass current in its forward direction but block the flow of current
in the reverse direction. Flat Sport must be connected to GROUND.

Page | 6
Resistor

A resistor is a passive electrical component with the primary function


to limit the flow of electric current. Resistors have two leads, there is
no polarity for a resistor and hence can be connected in both
directions.

10K Potentiometer

NOTE: You can connect VCC and GND on either first or third terminal
of potentiometer. It is variable resistor which has no polarity. By default,
GND Pin has 0Ω Value and VCC Pin has 10KΩ Value.

Active VS Passive Buzzer


An active buzzer will generate a tone using an internal oscillator, so
all that is needed is a DC voltage. A passive buzzer requires an AC
signal to make a sound. It is like an electromagnetic speaker, where a
Page | 7
changing input signal produces the sound, rather than producing a
tone automatically.
• Operating Voltage: 3.5-5.5V AC (Alternating current)
• Rated Voltage: 5Vac
• Current Consumption: 25mA
• Resonant Frequency: 2300500Hz

HC595 shift Register IC


• Wide Supply Voltage Range from 2.0V to 6.0V
• Sinks or sources 8mA at VCC = 4.5V
• CMOS low power consumption
• Schmitt Trigger Action at All Inputs
• Inputs accept up to 6.0V
• ESD Protection Tested per JESD 22

Page | 8
RGB Led

LDR
An LDR is a component that has a (variable) resistance that changes
with the light intensity that falls upon it. This allows them to be used in
light sensing circuits.

LDR has no polarity just like a resistor. The resistance of LDR can be
very easily measured by just connecting the two terminals of LDR to a
Multimeter & set the Multimeter on resistance Mode.

Tactile Push Button Switch

• Rating - 50 mA x 12 V DC
• Contact resistance: 100M ohm max
• Proof voltage: 250 V AC for 1 min
• Insulation resistance: 100M ohm min/100 V DC
• Temperature: -30~+70 Degrees

Page | 9
It works like a switch. By pushing down on the button, it creates a
connection between the terminals allowing electricity to flow. When you
release the electricity can no longer flow.

Capacitor
The Electrolytic Capacitors which is used to store the charge, have
polarity. Meaning they have a positive and negative pin. The pin
which is long is the positive pin and the pin which is short is the
negative pin.

Page | 10
Components Included
• Arduino Uno with USB cable – 1
• Arduino Uno Case -1
• Breadboard 830 pt. – 1
• Jumper wire (male to male) – 40pcs
• Single stand wire 1mt -1
• Led (red, white, Blue, Green & yellow) – 5 pcs each
• 10 K potentiometer – 1
• 10 K trim pot – 1
• Tactile switch – 5
• B-10 Passive Buzzer – 1
• RGB Led – 1
• LDR – 2
• SN74HC595N Shift register IC -1
• Capacitor (47 µf – 1, 100 µf -1 & 4.7 µf – 1)
• Resistor (220 R, 10KΩ, 270Ω, 330Ω, 470Ω & 1KΩ) – 10 pcs each

NOTE –

1. Breadboard used in projects are different in size, you will get 830
pt. breadboard
2. 9v Battery with snapper used for external power supply which is
not included in kit
3. You can add any colour of led in project which have different
voltage drop so we have added different resistors.

Page | 11
Project 1
LED Blinking

In this project we are going to connect an LED to one of the digital


pins rather than using LED13, which is soldered to the board.

Hardware Required

• Red M5 LED - 1
• 220Ω resistor - 1
• Breadboard 830 Points - 1
• Jumper wires (Male to Male) – 40 pcs
• Arduino Uno with USB Cable - 1

Page | 12
• 9V Battery – 1 (Not included in Kit)
• Snapper with DC Jack – 1(Not included in Kit)

Circuit Connection

• Connect positive leg of LED with Digital Pin 12 of Arduino Uno via
220-ohm resistor to avoid high current damaging the LED.
• Connect negative leg of LED with GND of Arduino Uno.

Code

Click here to see the code or copy the link:


https://docs.google.com/document/d/e/2PACX1vQteNdoCnr7EB0G1vaYtsB8qH
QS5Ee3fYFpc-KBQmkHK-YWLyeLNLk_PrpL3iI-C1kAdTmVuiPhZcfP/pub

Working and Output

After downloading this program, in the experiment, you will see the LED
connected to pin 12 turning on and off, with an interval approximately
one second.

Page | 13
Project 2
PWM (Pulse Width Modulation)

PWM (Pulse Width Modulation) is a process used to encode analog


signal level into digital ones. The voltage or current is fed to analog
load (the device that uses power) by repeated pulse sequence being
ON or OFF.

PWM has many applications: lamp brightness regulating, motor speed


regulating, sound making, etc. The following are the three basic

Page | 14
parameters of PMW:

Hardware Required

• 10K Potentiometer - 1
• Red M5 LED - 1
• 220Ω resistor - 1
• Breadboard 830 points - 1
• Jumper wires (Male to Male) - 40 pcs
• Arduino Uno with USB Cable – 1
• 9V Battery – 1 (Not included in Kit)
• Snapper with DC Jack – 1
NOTE: Here, 9V Battery is used as external power supply.

Page | 15
Circuit Connection

• First, attach the LED on the Breadboard.


• Connect GND of Arduino with Breadboard to make further GND
connections.
• Connect positive terminal of LED with the Digital Pin 6 of the Arduino
Uno.
• Connect negative terminal of LED with the GND rail of the
Breadboard via 220Ω resistor.
• Then, attach the 10K Potentiometer on the Breadboard.
• Connect the VCC of the Potentiometer with the 5V Pin of the Arduino
Uno.
• Connect GND of Potentiometer with GND rail of the Breadboard.
• Connect Signal Pin of the Potentiometer with the Analog Pin A1 of
the Arduino Uno.

Working and Output

Welcome to the Arduino Based project in which we have used the

Page | 16
analogWrite (PWM interface, analog value) function. In this project, we
will read the analog value of the potentiometer and assign the value
to PWM port, so there will be corresponding change to the brightness
of the LED. One final part will be displaying the analog value on the
screen. You can consider this as the "analog value reading" project
adding the PWM analog value assigning part. After downloading the
program, when we rotate the potentiometer knob, we can see changes
of the displaying value, also obvious change of the LED brightness on
the breadboard.

Code

https://docs.google.com/document/d/e/2PACX-
1vSJbymNrROk993xB1n8vN_CTL1Tg1dnzmfDFFljqQB5NRfY8NU98LGBbYvtdjd
H9d_9cHWVnfIaeWJ4/pub

Page | 17
Project 3
Traffic Light

In this project we will make traffic lights using 3 LEDs with different color
other than 1 LED and make them work accordingly.

Hardware Required

• Breadboard 830 points - 1


• Arduino Uno with USB Cable – 1
• Single stand wire 2mt – 1

Page | 18
• M5 LED (Red, Yellow, Green) – 1 pcs each
• 220Ω resistor – 3
• Jumper wires (Male to Male) – 40 pcs
NOTE: Here, we have used Breadboard 830 points in the project.

Circuit Connection

• Attach the three LEDs on the Breadboard.


• Connect GND of Arduino with the Breadboard for further GND
Connections.
• Connect negative terminals of LEDs with the GND rail of the
Breadboard via 220Ω resistor.
• Connect positive terminal of Red LED with the Digital Pin 10 of the
Arduino Uno.
• Connect positive terminal of Yellow LED with the Digital Pin 9 of the
Arduino Uno.

Page | 19
• Connect positive terminal of Green LED with the Digital Pin 8 of the
Arduino Uno.

Working and Output

Welcome to the Arduino Based Project which consists of the LEDs for
making a simulation of traffic lights, the blinking time of each LED should
be the same with those in traffic lights system. In program, we use Arduino
delay () function to control delay time.

So, when the uploading process is completed, we can see traffic lights
of our own design.

The green light will be on for 5 seconds, and then off., followed by the
yellow light blinking for 3 times, and then the red light on for 5 seconds,
forming a cycle. And the Cycle repeats.

Code

https://docs.google.com/document/d/e/2PACX-
1vT_1qUrh4Z3vPsJfbBHgO4rBGTBWv4wjq9Lt6jw06XTkmohzbefK6FJYBztXo8dUk
HP53xdQAee8Brh/pub

Page | 20
Project 4
LED Chasing Effect

We often see billboards composed of colorful LEDs. They are constantly


changing to form various effects. In this Project, we compile a program
to simulate chase effect.

Hardware Required

• Jumper wires (Male to Male) – 40 pcs


• White LED – 3
• 220Ω resistor – 6

Page | 21
• Arduino Uno with USB Cable – 1
• LED - 3
• Breadboard 830 points – 1
• 9V Battery – 1 (Not included in Kit)
• Snapper with DC Jack – 1
NOTE: Here, 9V Battery is used as external power supply

Circuit Connection

• Attach the six LEDs on the Breadboard.


• Connect the GND of Arduino Uno with the Breadboard to make
further GND connections.

• Connect negative terminals of all the LEDs with the GND rail of the
Breadboard via 220Ω resistor.

Page | 22
• Connect the Positive terminals of all the LED with Arduino Uno as
follows:
LED Arduino Uno
• LED 1 -> Digital Pin 2
• LED 2 -> Digital Pin 3
• LED 3 -> Digital Pin 4
• LED 4 -> Digital Pin 5
• LED 5 -> Digital Pin 6
• LED 6 -> Digital Pin 7

Working and Output

Welcome to the Arduino Based LED Chasing Effect Project. In this


particular project, the LED’s blink by sequence in a series pattern.

Code

https://docs.google.com/document/d/e/2PACX-1vQ-
V_6qk3FCVBMmufW6QeWDcWdsqrYgsSRRxAfF8TSxCiR5XAwaCNZCxLzs5
K4akzL0JA-z1Scvke8X/pub

Page | 23
Project 5
Button Controlled LED

In this experiment, we will try to use the input function, which is to read
the output value of device connecting to it. We use 1 button and 1
LED using both input and output for the I/O function. When it's
pressed, the circuit is in closed (conducting) state.

Hardware Required

• Arduino Uno with USB Cable - 1

Page | 24
• Tactile switch - 1 (You can use simple tactile switch received
in kit)
• LED - 1
• 220Ω resistor – 2
• 10KΩ resistor - 2
• Breadboard 830 Points – 1
• Jumper wires (Male to Male) – 40 pcs
• 9V Battery – 1 (Not included in Kit)
• Snapper with DC Jack – 1
Circuit Connection

• Attach the Push Button and LED on the Breadboard.


• Connect the Pin 5V of the Arduino Uno with the Breadboard for
further 5V power supply connections.
• Connect GND of the Arduino Uno with the Breadboard for further
GND connections.
• Connect the first leg of Push Button with 5V rail of Breadboard.

Page | 25
• Connect 10KΩ resistor on the second leg of the Push Button.
• Connect Digital Pin 7 of Arduino Uno with the second leg of Push
Button via 10KΩ resistor (one leg).
• Connect the other leg of resistor with GND rail of the Breadboard.
• Connect positive terminal of LED with Digital Pin 11 of Arduino uno.
• Connect negative terminal of LED with the GND rail of Breadboard
via 220Ω resistor.

Working and Output

Welcome to the Arduino Based Project which consists of Push Button


and LED’s. When the button is pressed, the LED will be on. In this
program, we add a statement of judgment. Here, we have used if ()
statement. When we press the button, pin 7 will output high level.
We can program pin 11 to output high level and turn on the LED. When
pin 7 outputs low level, pin 11 also outputs low level and the LED
remains off. When the button is pressed, LED is on, otherwise, LED remains
off. After the above process, the button controlled LED experiment is
completed. The simple principle of this experiment is widely used in a
variety of circuit and electric appliances. You can easily come across
it in your everyday life. One typical example is when you press a certain
key of your phone, the backlight will be on.

Code

https://docs.google.com/document/d/e/2PACX1vQSWc9N5ySQJzzcMLKT9dlnI
xfVu0_J2g-Sb-FGjcTnkT3sQ8aJKy5Gu6DKMw2s7E7vbdm7unH3xZi/pub

Page | 26
Project 6
Passive Buzzer

The buzzer we introduced here is a passive buzzer. It cannot be


actuated by itself, but by external pulse frequencies. Different
frequencies produce different sounds.

Hardware Required

• Breadboard 830 points - 1


• Passive buzzer - 1
• Arduino Uno with USB Cable - 1

Page | 27
• Jumper wires (Male to Male) – 40 pcs
• 9V Battery – 1 (Not included in Kit)
• Snapper with DC Jack – 1
NOTE: Here, 9V Battery is used as external power supply.

Circuit Connection

• First, attach the passive Buzzer on the Breadboard.


• Connect the Digital Pin 8 of Arduino Uno with the positive terminal
of the passive Buzzer.
• Connect the GND of Arduino Uno with the negative terminal of the
passive Buzzer.

Working and Output

Page | 28
Welcome to the Arduino Based Project which consists of Passive Buzzer
which differs from Active Buzzer in some measures. Its functionality is
being described here.

The Passive Buzzer is the slightly shorter one, with the electronics
exposed on the bottom. You have to send it an AC "sound signal" via
the Arduino. The Arduino needs to generate the "tone". Can create
music. It takes processor-time to generate the sound so other processes
might slow down. Notice it does not matter which leg you use for
positive or negative. The pin can be connected to a passive piezo
buzzer or other speaker to play tones.
Only one tone can be generated at a time. If a tone is already playing
on a different pin, the call to tone () will have no effect. If the tone is
playing on the same pin, the call will set its frequency. After
downloading the program, the buzzer experiment is completed.

Code

https://docs.google.com/document/d/e/2PACX-1vSjKd0MOPOuC26aF14-
NGEcqO8YUZykitQIdi-p1uCs3d9C02P7h--Uz7FZzJTwnPhM4sEhOtR57vUg/pub

Page | 29
Project 7
RGB LED

RGB LED or Tricolour principle to display various colours are being


described here. PWM controlling ports to display full colour.

Hardware Required

• Arduino Uno with USB Cable – 1


• RGB LED – 1
• Jumper wire (Male to Male) – 40 pcs
• 220Ω resistor – 4

Page | 30
• Breadboard 830 points – 1
• 9V Battery – 1 (Not included in Kit)
• Snapper with DC Jack – 1
NOTE: Here, 9V Battery is used as external power supply.

Circuit Connection

• Attach RGB LED on the Breadboard.Connect GND of Arduino Uno


with Breadboard for making further GND connections.
• Connect the First (Red) Pin of the RGB LED with the Digital Pin 11 of
the Arduino Uno via 220Ω resistor.
• Connect GND of RGB LED with Breadboard GND rail.
• Connect the Third (Green) Pin of the RGB LED with the Digital Pin 10
of the Arduino Uno via 220Ω resistor.
• Connect the Third (Blue) Pin of the RGB LED with the Digital Pin 9 of
the Arduino Uno via 220Ω resistor.

Working and Output

Welcome to the Arduino Based RGB LED Project. White light can be
produced by mixing different colored lights together

Page | 31
the most common method is to use the primary colors red, green and
blue (RGB). As this mechanism involves the blending and diffusion of
different colors, this approach is little used for the production of white
lighting due to the tendency of it to have a slight tint or hue.
Nevertheless, this method is particularly interesting for effect
applications because of the flexibility of mixing different colors.

In principle, most perceivable colors can be produced by mixing


different amounts of three primary colors, and this makes it possible to
produce precise dynamic color control as well. Utilizing the DMX
control protocol, it is actually possible to achieve a color palate of
over 16 million shades!

Each color scale it is possible to select 256 levels or shades of that


color. If you have three primary colors and each one can have 256
different shades, then by mixing them together you can mathematically
generate 16.7 million different colors. 255 x 255 x 255 = 16,581,375.
RGB LED controllers work on a much simpler principal. They alter the
power on each of the three channels (red, green and blue) to create
a specific color mix. Directly copy the code into Arduino IDE, and click
upload .wait a few seconds, you can see a full-color LED.
Code

https://docs.google.com/document/d/e/2PACX-
1vSL9vEEGhe016oFPdiQbuBQAh-
3cFFSdaFGssIvKjIM3MS2xXUJgLolzUsv_pxsrrBhTdqERKbXow3z/pub

Page | 32
Project 8
Photo Resistor or LDR

In this Project, we will work on Photo resistor (Photovaristor) which


includes the photoelectric effect of semiconductor. Photovaristor is
commonly applied in the measurement of light and light control.

Hardware Required

• Arduino Uno with USB Cable - 1


• Breadboard 830 points – 1
• Photo resistor or LDR – 1

Page | 33
• LED - 1
• 10KΩ resistor – 1
• 220Ω resistor – 1
• Jumper wire (Male to Male) – 40 pcs
• 9V Battery – 1 (Not included in kit)
• Snapper with DC Jack – 1
NOTE: 9V Battery is used as external power supply.

Circuit Connection

• Attach LED and LDR on the Breadboard.


• Connect GND of Arduino Uno with Breadboard to make further GND
connections.
• Connect 5V Pin of Arduino Uno with Breadboard for further 5V
power supply connections.
• Connect positive terminal of LED with the Digital Pin 11 of the
Arduino Uno.

Page | 34
• Connect negative terminal of LED with the GND rail of Breadboard
via 220Ω resistor.
• Connect the one leg of LDR with the 5V power supply rail of
Breadboard via 10KΩ resistor on one end and connect other end
with the Analog Pin A0 of Arduino Uno.
• Connect other leg of the LDR with the GND rail of Breadboard.
Working and Output

Welcome to the Arduino Based LDR Project which is based on


the photoelectric effect of semiconductor. Its basic working principle is
that if the incident light is intense, its resistance reduces; if the incident
light is weak, the resistance increases. Photo varistor is commonly
applied in the measurement of light, light control and photovoltaic
conversion (convert the change of light into the change of electricity).
Photo varistor is an element that changes its resistance as light strength
changes. So we will need to read the analog values. We can refer to
the PWM experiment, replacing the potentiometer with photo varistor.
When there is change in light strength, there will be corresponding
change on the LED. After the connection, let's begin the program
compilation process. The program is similar to the one of PWM. After
downloading the program, you can change the light strength around
the photo varistor and see corresponding brightness change of the
LED. Photo varistors has various applications in our everyday life. You
can make other interesting interactive projects base on this one.

Code

https://docs.google.com/document/d/e/2PACX-
1vSojp59CSWMgtJ6htaTOSmUPjdXDgI94o_s6Nx_JAbaNogptVAvrp1Wo7dxOT
yljTuwOeRGgrbbYc8J/pub

Page | 35
Project 9
Analog Value Reading

This project is for learning of analog I/O interfaces. On an Arduino,


there are 6 analog interfaces numbered from 0 to 5 and can also be
used as digital ones numbered as 14-19.

Hardware Required

• Arduino Uno with USB Cable – 1


• Jumper wire (Male to Male) – 40 pcs
• Breadboard 830 points – 1
• 10K Potentiometer – 1
• LED – 1

Page | 36
• 9V Battery – 1 (Not included in Kit)
• Snapper with DC Jack – 1
NOTE: Here, 9V Battery is used as external power supply.

Circuit Connection

• Attach 10K Potentiometer on the Breadboard.


• Connect GND of Arduino Uno with GND of Potentiometer.
• Connect Pin 5V of Arduino Uno with VCC of Potentiometer.
• Connect Pin Signal of Potentiometer with the Analog Pin A0 of
Arduino Uno.
• Connect positive terminal of LED with Digital Pin 13 of Arduino Uno.
• Connect negative terminal of LED with GND of Arduino Uno.

Working and Output

Welcome to the Arduino Based Project which consists of 10K


Potentiometer. Here, we will convert the resistance value of
the potentiometer to analog ones and display it on the screen. We use
the analog interface 0. The A/D acquisition of Arduino 328 is in 10 bits,
so the value it reads is among 0 to 1023.

First, we need to set the baud rate in voidsetup (). Displaying the value

Page | 37
is a communication between Arduino and PC, so the baud rate of the
Arduino should match the one in the PC's software set up. Otherwise,
the display will be messy codes or no display at all. In lower right corner
of Arduino software monitor window, there is a button for baud rate
set up. The set up here needs to match one in the program. The
statement in the program is Serial.begin(); enclosed is the baud rate
value, followed by statement for displaying. You can use Serial.print()
or Serial.println () statement. The sample program uses built-in LED
connected to pin 13. Each time device reads a value, LED blinks.
When you rotate potentiometer knob, you can see displayed value
changes. The reading of analog value is a very common function since
most sensors output analog value.

Code

https://docs.google.com/document/d/e/2PACX1vQKcOXUyZn6VjOZN6E
LsUSnrha1LgswoZJ4JCZhZHXsN_XH1xn4dSh34uT19hpx9BMmQ8IF8s
8Pg2F/pub

Page | 38
Project 10
Control LEDs using SN74HC595 Shift register IC

74HC595 is a combination of 8-digit shifting register, memorizer and


equipped with tri-state output. We will use it to control 8 LEDs. It takes
8 I/O for an Arduino to control 8 LEDs. So, to save port resources, we
use 74HC595 to reduce no. of ports it needs.

Hardware Required

• Arduino Uno with USB Cable – 1


• Breadboard 830 points – 1

Page | 39
• Blue LED – 4
• White LED – 4
• Jumper wire (Male to Male) – 40 pcs
• 220Ω resistors – 8
• SN74HC595N IC Shift Register – 1
• 9V Battery – 1 (Not included in Kit)
• Snapper with DC Jack - 1
NOTE: Here, 9V Battery is used as external power source.

Circuit Connection

• Attach the 74HC595 on the Breadboard.


• Attach 8 LED’s with the Breadboard.
• Connect the GND of Arduino Uno with Breadboard for further GND
connections.
• Connect Pin 5V of Arduino with Breadboard for further 5V power
supply connections
• Connect negative terminals of LED’s with GND rail of Breadboard via
220Ω resistor.
• Connect positive terminal of LED 1 with Pin Q7 of 74HC595 via
Breadboard.
• Connect positive terminal of LED 2 with Pin Q6 of 74HC595 via
Breadboard.
• Connect positive terminal of LED 3 with Pin Q5 of 74HC595 via
Breadboard.
• Connect positive terminal of LED 4 with Pin Q4 of 74HC595 via
Breadboard extended circuit.
• Connect positive terminal of LED 5 with Pin Q3 of 74HC595 via
Breadboard extended circuit.
• Connect positive terminal of LED 6 with Pin Q2 of 74HC595 via
Breadboard extended circuit.
• Connect positive terminal of LED 7 with Pin Q1 of 74HC595 via
Breadboard extended circuit.
• Connect positive terminal of LED 8 with Pin Q0 of 74HC595 via
Breadboard extended circuit.
• Connect VCC of 74HC595 with 5V power supply rail of
Breadboard.
• Connect Pin DS (DATA) of 74HC595 with Digital Pin 2 of Arduino
Uno.

Page | 40
• Connect Pin ST_CP (RCLK) of 74HC595 with Digital Pin 4 of Arduino
Uno.
• Connect Pin SH_CP (SRCLK) of 74HC595 with Digital Pin 5 of Arduino
Uno.
• Connect Pin MR (SRCLR) of 74HC595 with 5V rail of Breadboard.

Page | 41
Working and Output

Welcome to the Arduino Based Project which consists of 74HC595.


Here, it is used to save the use of ports given in the Arduino Uno. It is
8-bit serial-in, serial or parallel-out shift register with output latches; 3-
state.
You can use it to control 8 outputs at a time while only taking up a
few pins on your microcontroller.

Code

https://docs.google.com/document/d/e/2PACX1vREjJmoW4YoMN8tS
HbA_kNawl_T7jHUH1pAmINpgGst5DpcuQCteUW5Oh4I2SIEgGHx08
mlx-VCeC/pub

Page | 42
Project 11
Turn LED ON/OFF using LDR

In this particular project, we will turn LED ON/OFF using LDR.

Hardware Required

• Arduino Uno with USB Cable – 1


• Breadboard 830 points – 1
• LED – 2
• LDR – 2
• 10KΩ resistor – 2

Page | 43
• Jumper wire (Male to Male) – 40 pcs
• Single stand wire 2mt – 1
• 9V Battery – 1 (Not included in Kit)
• Snapper with DC Jack - 1
NOTE: Here, 9V Battery is used as external power supply.

Circuit Connection

• Attach the two LDR and LED on the Breadboard.


• Connect GND of Arduino Uno with Breadboard for further GND
connections.
• Connect Pin 3.3V of the Arduino Uno with Breadboard for further
3.3V power supply connections.
• Connect one terminal of both LDR 1 and LDR 2 with GND rail of
Breadboard.
• Connect both the negative terminal of LED’s with GND rail.
• Connect positive terminal of LED1 with Pin 13 of Arduino Uno.

Page | 44
• Connect other terminal of LDR1 with Analog Pin A0 with one end of
10KΩ resistor & connect other end of 10KΩ resistor with 3.3V power
supply rail of Breadboard as shown in image below.
• Connect other terminal of LDR 1 with Analog Pin A1 with one end of
10KΩ resistor and connect other end of 10KΩ resistor with 3.3V
power supply rail of Breadboard as shown in image below.
• Connect the positive terminal of LED 2 with Digital Pin 11 of Arduino
Uno.

Working and Output

Welcome to the Arduino Based Project which consists of LDR and LED’s.
Here, LDR is used to turn LED ON/OFF. In this project LDR is being used
as a switch. Each time you cover the photocell, the LED (or whatever)
is turned on (if it's off) or off (if it's on).
The main functionality of circuit is being described below. When the
Light is given on photocell of LDR 1, then LED 1 turns ON. And when
Light is being given on photocell of LDR 2, then LED 2 turns OFF.
Following are the outputs of both the LDR’s.

Output 1:

Page | 45
Output 2:

Output 3:

Code

https://docs.google.com/document/d/e/2PACX-1vRm5WvB-
JMjLMgTso0BuNyYz0jcpC2SeopTR7i_etaN3ucOKd9DU4k4qOhzvbmfd
PcemVK7L78fDOEU/pub

Page | 46
Project 12
Control the speed of led pattern using 10k Potentiometer

In this Led Chaser Project, we will control the speed of LEDs using 10K
potentiometer so you can drive multiple LEDs at once.

Hardware Required

• Arduino uno with USB cable - 1


• LED (RED & BLUE) – 5 pieces each
• Resistor 220 ohm– 10 pcs

Page | 47
• Potentiometer 10 k – 1
• Breadboard 400 points - 1
• Jumper wires (male to male) – 40 pieces
• Mini breadboard 170 points – 1
• 9v battery with DC jack – 1

Circuit Description

• Connect all the LEDs on breadboard.


• LEDs (+) leg from left side of breadboard are connected to the
Arduino digital pin number (0,1,2,3,4,5,6,7) via 220-ohm resistor.
• Led's (-) leg are connected to the ground.
• Potentiometer’s 1st leg is connected to the Arduino’s 5v pin.
• Potentiometer’s 2nd leg is connected to the Arduino’s pin no analog
pin A0.
• Potentiometer’s 3rd leg is connected to the Arduino’s GND.
• Arduino’s GND pin connected to the resistor GND

Page | 48
Code
Click to see the code or copy the link:
https://drive.google.com/file/d/1Q4A31wkM-
udisyy1hCgyG9Mw696NnEE0/view?usp=sharing

In an LED code, we took 1000 ms as delay between HIGH & LOW,


means an LED remains 1 second HIGH & 1 second LOW. In this example,
Arduino takes the voltage form the center leg of pot & converts it to
digital form (0 - 5 to 0 - 1023). So, when we rotate the nob of the pot
to 0V, we are actually decrease the time between HIGH & LOW & when
we rotate the nob of the pot to 5V, we are actually increase the time
between HIGH & LOW. Simple but effective way to control blinking
speed of an LED.
After uploading the code. Unplug the Arduino cable and connect 9v
battery power supply.

Output
Here we control the speed of led using the 10k potentiometer. In this
circuit we using 8 led control over the potentiometer that we rotate
the knob of potentiometer from positive to negative that speed
variation in rail of led.

Page | 49
Project 13
Control a RGB led using push button to change colour

In this video we will change the colour of RGB led using push button.
On every pressed button we will see the new colour.

Hardware Required

• Arduino Uno with USB cable – 1


• Breadboard 840 points – 1

Page | 50
• Push button – 4
• RGB led – 1
• Single stand wire 2m - 1
• Jumper wire male to male – 40 pieces
• Resistor 270 ohm -3

Circuit Description

• First You Need Three Push Button Fixed on Bread Board Now Pin No
2 Of Push Button All Are Gnd And Pin 3of Push Button Are Connected
to Arduino Uno Pin No 5,6,7
• Push Button 1, 2, 3 Now All Push Button Connected to Arduino Uno.
• Make Gnd Rail on Bread Board to Connect to Common Gnd To
Circuit.
• Now We Connect the Rgb Led, First Put 270 Ohm Resistance In
Between Arduino Connection A Led Shown Given Above in Circuit
Diagram Led Pin No 2 Is Connect to Gnd, And Pin No 1 Connect to
Arduino Pin No 11.

Page | 51
• Pin 3 Connect To Arduino Pin No 10.
• Pin 4 Connect To Arduino Pin No 9.
• Here All The Connections Setup Now Upload The Code.

Code
Click here to see the code or copy the link:
https://drive.google.com/open?id=0BxpdhMRymue7bUFvSmR2X0NPQms

Working

• To start with, all the LEDs will be off. If you press and hold one of the
buttons, then the LED will gradually get brighter. The color will be
red for the top button, green for the middle one and blue for the
bottom button.
• When you have got enough of one color, try pressing another
button and see how they mix together.
• If you want to start over, then press the reset button on the Arduino.
This is the red button, next to the USB connector.

Page | 52
Project 14
Blink leds in Series pattern

Hardware Required

• Arduino Uno with USB cable - 1


• LED - 5
• Breadboard 400 points - 1
• Single stand Wire 2m - 1
• Jumper wires (male to male) – 40 pieces each

Page | 53
• Battery snapper with DC jack -1

Circuit Connection

• Connect 3 led on breadboard


• From left side 1st led’s positive leg connected to Arduino’s pin no 13
and led’s 2nd leg to Ground.
• 2nd led's positive leg connected to Arduino’s pin no 12 and led 2nd
leg is GND.
• 3rd led's positive leg connected to Arduino’s pin no 11 and led 2nd
leg is GND.
• Connect Arduino’s GND to breadboard GND to make further
negative connection.
• Upload the code given below

Output
Upload the code and you will see three led’s glow in a series pattern
.

Page | 54
Code
Click to see the code or copy the link:
https://docs.google.com/document/d/e/2PACX-1vQBi5O4bnFaTroXMhaeULOR-
Ga9pEw4uwzrXvLipoY42hDKfcgSd4Gy9K_Vs4JPEP8DeeLTGKsQ-B45/pub

Page | 55
Project 15
Capacitance meter

In this project we will make a capacitor meter in which by using


Arduino’s digital pin and serial monitor we can measure unknown
capacitor’s value.

This is calculation-based technique by charging and discharging


capacitor through unknown value resistor and by calculating the time
delay. We can measure unknown capacitance value in farad.

Page | 56
Hardware Required

• Arduino Uno with USB Cable – 1


• 400 Pt Breadboard -1
• Male to Male Jumper wires – 10 pcs
• Resistor (220 ohm – 2 & 10K – 2)
• Capacitor (47 µf and 100 µf) – 1pc

(You can use the 9v battery for the external use which is not included in
this kit.)

Circuit Connection

• Attach 10 KΩ resistor to the breadboard


• Connect one of the terminals of 10 KΩ resistor to the digital pin 13
of Arduino Uno.
• Connect another terminal of 10 KΩ with a terminal of 220 Ω resistor

Page | 57
• Connect this junction point to the analog pin A0 of Arduino Uno
• Another terminal of 220 Ω resistor to the Digital pin 11 of Uno.
• Connect positive pin of any Electrolyte capacitor to the junction point
of 10 KΩ and 220 Ω resistor.
• Connect GND pin of capacitor to the GND rail on the breadboard.
• Connect GND pin of Arduino Uno to the GND rail on the Breadboard.

NOTE: Here Digital pin 13 used as charge pin for capacitor and digital
pin 11 as discharge pin. The time constant output fed into analog pin
A0.
Here 220-ohm resistor and wires connected to pin 11 are not necessary
but recommended as it speeds up the discharging rate.

Code

Click to see the code


https://drive.google.com/open?id=14AdRa68X4ZKxRrEtV0uKzihjyO2Z92
qi

or
Scan the QR code

Output

After uploading the code, Open the serial monitor you can see the value
of measured capacitance.

Page | 58
The first Value is how long it took the capacitor to reach 63.2 of its total
charge. the second value is the calculated capacitance in either in
“Nano” or “µf”.
This circuit is most accurate for capacitance value between 1 µf to 3500
µf.

Page | 59
Page | 60

You might also like