You are on page 1of 115

Basic Top 10

Arduino Based Project


This book teaches how to make basic top 10 arduino based
projects. This book is for all those students who are just now
starting to make Arduino based projects. And then students can
make more advanced projects with the help of these projects.

Author
Vijay Verma
(Programmer & Projects Designer)
(I have been working on Arduino based projects for 5 years)

Dedication
This book is for all those students who want to learn how to
make Arduino based projects. And if you want to make
projects based on your ideas, then all of them can take help
of this book. With the help of this book, from 8 class
students to 12 class students, it can get the basic knowledge
of Arduino projects. This book is also for all those students.
Those who either doing engineering or want to do
engineering (Electronics Engineering, Electronics
Communication Engineering, Computer Science Engineering,
Information Technology Engineering). This book will help
them to complete their basic for all of them. After reading this
book and using all its formulas, you will found the increment
in your knowledge, And I can say this with conviction.
Note- This book is for all those students who are just
starting work on Arduino
Introduction
In this book, ten basic projects of Arduino have been taught
to make. With the help of which students will be able to
complete their base. And with the help of these projects,
students can also design projects based on their ideas. And
you can submit the projects you have created in school and
college and also in exhibition. The program of all these ten
basic projects has also been taught to make, so that you can
develop the program further on the basis of your ideas.

Projects List –
1- How to Make Blind Man Object Sensing Shoes
2- How to Make Line Follower Robotic Car
3- Safe Distance Maintain Car to Avoid Accident
4- How to Make Voice Control Home Automation System
5- How to Make IR Remote Control Car
6- How to Make Four Way Traffic Light System
7- How to Make Automatic Open & Close Dustbin
8- How to Make Temperature & Humidity Monitoring System
9- How to Make Mobile Control Home Automation
10- How to Make Mobile Control Notice Board
1- How To Make Blind man Object Sensing
Shoes
Blind man Shoes is an innovative shoe designed for visually disabled people
for improved navigation. We here propose an advanced blind man shoe that
allows visually challenged people to navigate with ease using advanced
technology. The blind man shoe is integrated with ultrasonic sensor along
with light and water sensing. Our proposed project first uses ultrasonic
sensors to detect obstacles ahead using ultrasonic waves. On sensing
obstacles the sensor passes this data to the microcontroller. The
microcontroller then processes this data and calculates if the obstacle is
close enough. If the obstacle is not that close the circuit does nothing. If the
obstacle is close the microcontroller sends a signal to sound a buzzer. In this
way, this shoe helps the blind person to locate an object.
“Which components will be required to make this device, first we see
their details.”
Components List and Detail-

1- Arduino UNO-
The Arduino UNO is an open-source microcontroller board based on
the Microchip ATmega328P microcontroller and developed by
Arduino.cc. The board is equipped with sets of digital and analog
input/output (I/O) pins that may be interfaced to various expansion
boards (shields) and other circuits. The board has 14 Digital pins, 6
Analog pins, and programmable with the Arduino IDE (Integrated
Development Environment) via a type B USB cable. It can be powered
by a USB cable or by an external 9 volt battery, though it accepts
voltages between 7 and 20 volts. It is also similar to the Arduino Nano
and Leonardo. The Uno board is the first in a series of USB Arduino
boards, and the reference model for the Arduino platform. The
ATmega328 on the Arduino Uno comes preprogrammed with a
bootloader that allows uploading new code to it without the use of an
external hardware programmer. It communicates using the original
STK500 protocol. The Uno also differs from all preceding boards in
that it does not use the FTDI USB-to-serial driver chip. Instead, it uses
the Atmega16U2 (Atmega8U2 up to version R2) programmed as a
USB-to-serial converter.
2- Ultrasonic Sensor-
Ultrasonic transducers or ultrasonic sensors are a type of acoustic
sensor divided into three broad categories: transmitters, receivers and
transceivers. Transmitters convert electrical signals into ultrasound,
receivers convert ultrasound into electrical signals, and transceivers
can both transmit and receive ultrasound.
In a similar way to radar and sonar, ultrasonic transducers are used in
systems which evaluate targets by interpreting the reflected signals.
For example, by measuring the time between sending a signal and
receiving an echo the distance of an object can be calculated. Passive
ultrasonic sensors are basically microphones that detect ultrasonic
noise that is present under certain conditions.

3- Jumper wire-
A jump wire (also known as jumper wire, or jumper) is an electrical
wire, or group of them in a cable, with a connector or pin at each end
(or sometimes without them – simply "tinned"), which is normally used
to interconnect the components of a breadboard or other prototype or
test circuit, internally or with other equipment or components, without
soldering.

4- Buzzer-
A buzzer or beeper is an audio signalling device, which may be
mechanical, electromechanical, or piezoelectric (piezo for short).
Typical uses of buzzers and beepers include alarm devices, timers, and
confirmation of user input such as a mouse click or keystroke.

5- LED-
A light-emitting diode (LED) is a two-lead semiconductor light source.
It is a p–n junction diode that emits light when activated. When a
suitable current is applied to the leads, electrons are able to recombine
with electron holes within the device, releasing energy in the form
of photons. This effect is called electroluminescence, and the color of
the light (corresponding to the energy of the photon) is determined by
the energy band gap of the semiconductor. LEDs are typically small
(less than 1 mm2) and integrated optical components may be used to
shape the radiation pattern.

6- Switch -
A simple on-off switch: The two terminals are either connected
together or disconnected from each other. An example is a light switch.
A simple on-off switch. The two terminals are normally disconnected
(open) and are closed when the switch is activated.

7- 9volt Battery-
The nine-volt battery, or 9-volt battery, is a common size of battery that
was introduced for the early transistor radios. ... Most nine-
volt alkaline batteries are constructed of six individual 1.5 V LR61
cells enclosed in a wrapper.
8- 9volt Battery Cap-
Plug the battery clip onto a standard 9V battery and connect the other
end to any device that needs 9V. The Connector leads are polarity
color coded, Red and Black. Features: ... Assures safe secure use,
reduces the potential of short circuits and prevents tampering
with battery contacts.

9- Small Plastic Box-


10- Shoes-

11- Fevi Kwik


Create A Program for Arduino-
Now, we make a program of Arduino to operate this device.
And we will make the program as well as understand it.

Through this program, we will turn LED and Buzzer on and off with
the help of Ultrasonic Sensor. In this program, we will set a distance
value of the ultrasonic sensor, according to this program, if an object
comes within that distance value in front of the ultrasonic sensor in
the project, then LED and Buzzer will become ON. In this program,
we first write the declaration statement, that is, we select the PIN for
LED and Buzzer and Sensor. That is, let's define. Here we will
define two pins for ultrasonic sensors. One for the Triger pin and one
for the echo pin where the trigger pin will be the output pin. And the
echo pin will be the input pin. Like we have to connect the LED on
the number 13 pin in the Arduino. So we will write for LED - int LED
= 13;. And to connect Buzzer to the 7 number pin in the Arduino. So
we will write for Buzzer- int Buzzer = 7; Now we have to connect
the sensor's trigger and echo pin to the Arduino. So we will connect
the trigger pin to pin number 4 of Arduino. And connect the echo pin
to Arduino's pin number 5. So for the trigger pin we will write- int
trigPin = 4; And for echo pin we will write int int echoPin = 5; So
we have declared the variables for LED, Buzzer and sensor.
Ultrasonic sensor works on duration and distance. So to store its
duration and distance, we also have to declare a variable. So we will
write for the duration- long duration; And will write for distance- int
distance; Ultrasonic sensors emit sound waves. And these waves are
reflected by the object that is inside our distance value and when
these waves are reflected, it makes the echo pin high. Then LED and
Buzzer become ON. The value of sensors is only in the count of 0 and
1 i.e. 0 means Low (LOW) state and 1 means HIGH state. Now after
this we go to void setup (). Now we will complete the void setup part
of this program, so in this, we have to first see how many components
we are using in our program. And how many components have been
declared variable like we have just used three components in this
program. LED, Buzzer and Ultrasonic sensor then we will write the
pin mode statement. So for the LED, we keep the pin output
(OUTPUT). So we will write the pinMode statement for LED -
pinMode(LED,OUTPUT); We will also write the pinMode statement
for Buzzer- pinMode (Buzzer, OUTPUT); And we will also write the
pinMode statement for the Ultrasonic Sensor but it has two pins, the
trigger pin and the echo pin in which the trigger pin works in the
output mode and the echo pin works in the input mode. Then we will
write the Pinmode statement for the trigger pin.-
pinMode(trigPin,OUTPUT); And for the echo pin, PinMode will
write the statement - pinMode (echoPin, INPUT); After this, we have
to set the baud rate in the program for the speed at which data is to be
communicated to our Arduino and system via USB. Use the serial
begin (Serial.begin) command to set the baud rate. What we want to
keep the baud rate in our program, we will know from our Arduino
software itself and according to the baud rate given in the software,
we keep the baud rate in our program. Now we will write the baud
rate in our program- Serial.begin(9600); And all the statements that
we have written in void setup will all be written within curly bracket
{.....} Now we will write the program in void loop, in this we will
also program curly bracket {..... } Inside it, we will keep the trigger
pin as low (LOW) for the first 2 microseconds, then see what
statement we will write for it.

After this, we will keep the trigger pin high for 10 microseconds and
will be lowered again (LOW). Now, let us see how this statement
will be written.

Now understand why this is written. digitalWrite () is a function /


command This function is used to write a higher or lower value to a
digital pin. If the pin is configured as an OUTPUT with pinmod (), its
voltage will be set to this value. In this, the trigger pin emitted sound
waves for up to 10 microseconds and then these waves were reflected
from an object when it comes back. The echo pin goes high. In this the
pulseIn () function is used to detect the value of the echo pin. The
value of is LOW. Or HIGH. And this is equal to duration. Then we
calculate the distance with the help of duration. Now we write these
statements.

Now we will do a loop of ifelse. And in the condition of if, we will


set the value of distance at which distance we have to detect an
object, then we have written in the block with if.- if (distance <= 25);
This means if the object placed in front of the ultrasonic sensor is
placed 25 centimeter apart or less than the sensor, then the echo pin
will be high. Then LED and buzzer will become ON. And if the
object is placed more than 25 centimeter distance from the sensor.
Then then the block with else runs, then the LED and buzzer remain
off. So we will first write a statement of the block containing if.
Which you have already learned from the program and how to write
it. Then we will write-

Now we will write the statement of the else block.

After this, if we have to find out that the object we are detecting with
the help of ultrasonic is at a distance from the ultrasonic sensor. So
for this we will write the command Serial.println (). And inside its
parenthesis, if we write (distance), then we will see how we write
this statement.- Serial.println(distance);
And if we want to print that distance value, then for this we will write
the command Serial.print (). And inside its parenthesis we will write
("Distance:"). You know that if we want to print anything, we write it
in double court, so we have written the distance in double court. Now
we write this statement- Serial.print(“Distance:”) In this way our
program becomes complete. Now we make the complete program.

Program-
int LED = 13;
int Buzzer = 7;
int trigPin = 4;
int echoPin = 5;
// defines variables
long duration;
int distance;
void setup() {
pinMode(trigPin, OUTPUT); // Sets the trigPin as an Output
pinMode(echoPin, INPUT); // Sets the echoPin as an Input
pinMode(LED, OUTPUT);
pinMode(Buzzer,OUTPUT);
Serial.begin(9600); // Starts the serial communication
}
void loop() {
// Clears the trigPin
digitalWrite(trigPin, LOW);
delayMicroseconds(2);

// Sets the trigPin on HIGH state for 10 micro seconds


digitalWrite(trigPin, HIGH);
delayMicroseconds(10);
digitalWrite(trigPin, LOW);
// Reads the echoPin, returns the sound wave travel time in
microseconds
duration = pulseIn(echoPin, HIGH);
// Calculating the distance
distance= duration*0.034/2;
if (distance <=25){
digitalWrite(LED, HIGH);
digitalWrite(Buzzer,HIGH);
}
else{
digitalWrite(LED, LOW);
digitalWrite(Buzzer,LOW);
}
// Prints the distance on the Serial Monitor
Serial.print("Distance: ");
Serial.println(distance);
}
Now we see the circuit diagram of this project. How will
Arduino and LED, Buzzer, and Ultrasonic Sensor connect.
Circuit Diagram-
Circuit Diagram-

1- Circuit
2- Circuit

3- Circuit-
We have written the program in the Arduino IDE, after that we take an
Arduino UNO board. And connect USB to your Arduino board and
connect it to your computer or laptop, then we will open our program in
Arduino IDE and we see many further options in this IDE. So there is an
option at the top, Tools (Tools) will click on it. So further many options
will be seen and the board will be written in one place in these options
and will click on it. Then we will see more options, in which we have to
click according to our board. Just like we are using the Arduino UNO
board right now, we will click on the Arduino UNO itself. If we used
another board, we would click on it. And as soon as we select the
Arduino UNO board, then our board will be selected. After this, we
click on Tools again. So many options will appear again and port will
be written in one place in this option and click on it. Then we will see
the port number, it will start with COM (COM) like - COM1, COM2,
COM3, COM4, etc. Clicking on it, the port will also be selected, after
which we see the Scatch option on the screen. If you click on it, we will
see Verify option at the top, and if you click on it, we will know that
there is no error in our program. When we come to know that our
program is correct, then we will click on Scatch again and this time the
option coming in it will click on the option of another number i.e.
Upload. Then in some time the program will be uploaded to Arduino.
And the program for which we had designed will start working, that is,
when an object in front of the ultrasonic sensor is at a distance of 25 s or
so, the ultrasonic sensor will detect it and then the LED and Buzzer will
be ON and this loop will continue in this way . Now we can use this
project according to its working in any way.
2- How To Make Line Follower Robotic Car-
Line follower is an autonomous robot which follows either black line in
white are or white line in black area. Robot must be able to detect
particular line and keep following it. ... Process: Based on the inputs
received, microcontroller decide what change (if any) needs to be made to
the robots speed and direction.
“Which components will be required to make this device, first we see
their details.”
Components List and Detail-

1- Arduino UNO-
The Arduino UNO is an open-source microcontroller board based on
the Microchip ATmega328P microcontroller and developed by
Arduino.cc. The board is equipped with sets of digital and analog
input/output (I/O) pins that may be interfaced to various expansion
boards (shields) and other circuits. The board has 14 Digital pins, 6
Analog pins, and programmable with the Arduino IDE (Integrated
Development Environment) via a type B USB cable. It can be powered
by a USB cable or by an external 9 volt battery, though it accepts
voltages between 7 and 20 volts. It is also similar to the Arduino Nano
and Leonardo. The Uno board is the first in a series of USB Arduino
boards, and the reference model for the Arduino platform. The
ATmega328 on the Arduino Uno comes preprogrammed with a
bootloader that allows uploading new code to it without the use of an
external hardware programmer. It communicates using the original
STK500 protocol. The Uno also differs from all preceding boards in
that it does not use the FTDI USB-to-serial driver chip. Instead, it uses
the Atmega16U2 (Atmega8U2 up to version R2) programmed as a
USB-to-serial converter.
2- IR Sensor-
IR sensor is an electronic device, that emits the light in order to
sense some object of the surroundings. An IR sensor can measure
the heat of an object as well as detects the motion. Usually, in
the infrared spectrum, all the objects radiate some form of thermal
radiation.

3- L298N Motor Driver-


This L298N Motor Driver Module is a high power motor
driver module for driving DC and Stepper Motors. This module
consists of an L298 motor driver IC and a 78M05 5V
regulator. L298N Module can control up to 4 DC motors, or 2
DC motors with directional and speed control.

4- BO Motor-
DC motor (BO) Battery Operation. Dc motor converts electrical
energy into mechanical energy. Why DC gear motor used in
robot Motor control circuit. DC MOTOR concept is where gears
reduce the speed of the vehicle but increase its torque is known as
gear reduction.

5- Motor Wheel-
This is 65mm Robot Wheel for BO Motor (Yellow). The wheel is
made up of high-quality rubber which gives maximum traction
while operating. The wheel is strong and sturdy as it features a
nylon reinforced plastic rim.

6- Wheel Rounder-

7- Jumper wire-
A jump wire (also known as jumper wire, or jumper) is an electrical
wire, or group of them in a cable, with a connector or pin at each end
(or sometimes without them – simply "tinned"), which is normally used
to interconnect the components of a breadboard or other prototype or
test circuit, internally or with other equipment or components, without
soldering.

8- Switch-
A simple on-off switch: The two terminals are either connected
together or disconnected from each other. An example is a light switch.
A simple on-off switch. The two terminals are normally disconnected
(open) and are closed when the switch is activated.

9- 9volt Battery-
The nine-volt battery, or 9-volt battery, is a common size of battery that
was introduced for the early transistor radios. ... Most nine-
volt alkaline batteries are constructed of six individual 1.5 V LR61
cells enclosed in a wrapper.
10- 9volt Battery Cap-
Plug the battery clip onto a standard 9V battery and connect the other
end to any device that needs 9V. The Connector leads are polarity
color coded, Red and Black. Features: ... Assures safe secure use,
reduces the potential of short circuits and prevents tampering
with battery contacts.

Create A Program for Arduino-


Now, we make a program of Arduino to operate this device.
And we will make the program as well as understand it.

//Line Follower Robot Using Arduino and L298N Motor


Driver
int IN1 = 5;
int IN2 = 4;
int IN3 = 3;
int IN4 = 2;
int motorSpeed = 0;
//Define IR1 and IR2 Sensors
int IR1 = A0;
int IR2 = A1;

//Define Sensors Values


int IR1Val = analogRead(IR1);
int IR2Val = analogRead(IR2);

void setup() {
pinMode(IN1, OUTPUT);
pinMode(IN2, OUTPUT);

pinMode(IN3, OUTPUT);
pinMode(IN4, OUTPUT);
Serial.begin(9600);
}

void Trial()
{
digitalWrite(IN1, HIGH);
digitalWrite(IN2, LOW);
digitalWrite(IN3, HIGH);
digitalWrite(IN4, LOW);
}

void loop () {
if (analogRead(IR1)<150){
digitalWrite(IN1, HIGH);
digitalWrite(IN2, LOW);
}

else {
digitalWrite(IN1, LOW);
digitalWrite(IN2, HIGH);
digitalWrite(IN3, HIGH);
digitalWrite(IN4, LOW);
}

if(analogRead(IR2)<150){
digitalWrite(IN3, HIGH);
digitalWrite(IN4, LOW);

else {
digitalWrite(IN1, HIGH);
digitalWrite(IN2, LOW);

digitalWrite(IN3, LOW);
digitalWrite(IN4, HIGH);

}
Serial.print(analogRead(IR1));
Serial.print("");
Serial.println(analogRead(IR2));

Circuit Diagram-
Now we see the circuit diagram of this project. And by looking at this
circuit, we will make connections to all these components.
We have written the program in the Arduino IDE, after that we take an
Arduino UNO board. And connect USB to your Arduino board and connect
it to your computer or laptop, then we will open our program in Arduino
IDE and we see many further options in this IDE. So there is an option at
the top, Tools (Tools) will click on it. So further many options will be
seen and the board will be written in one place in these options and will
click on it. Then we will see more options, in which we have to click
according to our board. Just like we are using the Arduino UNO board
right now, we will click on the Arduino UNO itself. If we used another
board, we would click on it. And as soon as we select the Arduino UNO
board, then our board will be selected. After this, we click on Tools
again. So many options will appear again and port will be written in one
place in this option and click on it. Then we will see the port number, it
will start with COM (COM) like - COM1, COM2, COM3, COM4, etc.
Clicking on it, the port will also be selected, after which we see the Scatch
option on the screen. If you click on it, we will see Verify option at the
top, and if you click on it, we will know that there is no error in our
program. When we come to know that our program is correct, then we will
click on Scatch again and this time the option coming in it will click on the
option of another number i.e. Upload. Then in some time the program will
be uploaded to Arduino. And the program for which we had designed will
start working.
3- Safe Distance Maintain Car to Avoid
Accident-
The Road Code says that the driver must keep a safe distance between
his/her vehicle and the vehicle in front in order to avoid collision if
the car in front brakes or stops. The safe distance corresponds to
the distance covered by the vehicles in at least 2 seconds.
“Which components will be required to make this device, first we see
their details.”
Components List and Detail-

1- Arduino UNO-
The Arduino UNO is an open-source microcontroller board based on
the Microchip ATmega328P microcontroller and developed by
Arduino.cc. The board is equipped with sets of digital and analog
input/output (I/O) pins that may be interfaced to various expansion
boards (shields) and other circuits. The board has 14 Digital pins, 6
Analog pins, and programmable with the Arduino IDE (Integrated
Development Environment) via a type B USB cable. It can be powered
by a USB cable or by an external 9 volt battery, though it accepts
voltages between 7 and 20 volts. It is also similar to the Arduino Nano
and Leonardo. The Uno board is the first in a series of USB Arduino
boards, and the reference model for the Arduino platform. The
ATmega328 on the Arduino Uno comes preprogrammed with a
bootloader that allows uploading new code to it without the use of an
external hardware programmer. It communicates using the original
STK500 protocol. The Uno also differs from all preceding boards in
that it does not use the FTDI USB-to-serial driver chip. Instead, it uses
the Atmega16U2 (Atmega8U2 up to version R2) programmed as a
USB-to-serial converter.

2- Ultrasonic Sensor-
Ultrasonic transducers or ultrasonic sensors are a type of acoustic
sensor divided into three broad categories: transmitters, receivers and
transceivers. Transmitters convert electrical signals into ultrasound,
receivers convert ultrasound into electrical signals, and transceivers
can both transmit and receive ultrasound.
In a similar way to radar and sonar, ultrasonic transducers are used in
systems which evaluate targets by interpreting the reflected signals.
For example, by measuring the time between sending a signal and
receiving an echo the distance of an object can be calculated. Passive
ultrasonic sensors are basically microphones that detect ultrasonic
noise that is present under certain conditions.

3- L298N Motor Driver-


This L298N Motor Driver Module is a high power motor
driver module for driving DC and Stepper Motors. This module
consists of an L298 motor driver IC and a 78M05 5V
regulator. L298N Module can control up to 4 DC motors, or 2
DC motors with directional and speed control.
4- BO Motor-
DC motor (BO) Battery Operation. Dc motor converts electrical
energy into mechanical energy. Why DC gear motor used in
robot Motor control circuit. DC MOTOR concept is where gears
reduce the speed of the vehicle but increase its torque is known as
gear reduction.

5- Motor Wheel-
This is 65mm Robot Wheel for BO Motor (Yellow). The wheel is
made up of high-quality rubber which gives maximum traction
while operating. The wheel is strong and sturdy as it features a
nylon reinforced plastic rim.

6- Wheel Rounder-

7- Jumper wire-
A jump wire (also known as jumper wire, or jumper) is an electrical
wire, or group of them in a cable, with a connector or pin at each end
(or sometimes without them – simply "tinned"), which is normally used
to interconnect the components of a breadboard or other prototype or
test circuit, internally or with other equipment or components, without
soldering.

8- Switch-
A simple on-off switch: The two terminals are either connected
together or disconnected from each other. An example is a light switch.
A simple on-off switch. The two terminals are normally disconnected
(open) and are closed when the switch is activated.

9- 9volt Battery-
The nine-volt battery, or 9-volt battery, is a common size of battery that
was introduced for the early transistor radios. ... Most nine-
volt alkaline batteries are constructed of six individual 1.5 V LR61
cells enclosed in a wrapper.
10- 9volt Battery Cap-
Plug the battery clip onto a standard 9V battery and connect the other
end to any device that needs 9V. The Connector leads are polarity
color coded, Red and Black. Features: ... Assures safe secure use,
reduces the potential of short circuits and prevents tampering
with battery contacts.

Create A Program for Arduino-


Now, we make a program of Arduino to operate this device.
And we will make the program as well as understand it.

#define trigpin 2 // digital pin 4


#define echopin 3 // digital pin 3
int val;

int nb;
int in1 = 4;
int in2 = 5;
int in3 = 6;
int in4 = 7;

float distancem;
void setup()
{
Serial.begin(9600);
pinMode(trigpin, OUTPUT);
pinMode(echopin, INPUT);
pinMode(in1, OUTPUT);
pinMode(in2, OUTPUT);
pinMode(in3, OUTPUT);
pinMode(in4, OUTPUT);
delay(1000);
}

void loop()
{
int duration, distance;
digitalWrite(trigpin, HIGH);

delayMicroseconds(1000);
digitalWrite(trigpin, LOW);

duration = pulseIn(echopin,HIGH);

distance = ( duration / 2) / 29.1;


Serial.println("inches:");
Serial.println(distance);

distance = map(distance, 0 , 197, 0 , 255 );

if(Serial.available()>0)
{

int data= Serial.read();

if(data=='R')

digitalWrite(4,HIGH);

digitalWrite(5,LOW);

digitalWrite(6,HIGH);

digitalWrite(7,LOW);

else if(data=='L')

digitalWrite(4,LOW);

digitalWrite(5,HIGH);

digitalWrite(6,LOW);

digitalWrite(7,HIGH);

}else if(data=='F'){

digitalWrite(4,LOW);

digitalWrite(5,HIGH);
digitalWrite(6,HIGH);

digitalWrite(7,LOW);

}else if(data=='B'){

digitalWrite(4,HIGH);

digitalWrite(5,LOW);

digitalWrite(6,LOW);

digitalWrite(7,HIGH);
}

if( (distance < 0) )


{
distance = 0;
} else
if( (distance >= 0) && (distance <= 40) )
{
digitalWrite(in1, LOW);
digitalWrite(in2, LOW);
digitalWrite(in3, LOW);
digitalWrite(in4, LOW);
}else
if( distance > 40 )
{
digitalWrite(in1, HIGH);
digitalWrite(in2, LOW);
digitalWrite(in3, LOW);
digitalWrite(in4, HIGH);
}

Circuit Diagram-
Now we see the circuit diagram of this project. And by looking at this
circuit, we will make connections to all these components.
We have written the program in the Arduino IDE, after that we take an
Arduino UNO board. And connect USB to your Arduino board and connect
it to your computer or laptop, then we will open our program in Arduino
IDE and we see many further options in this IDE. So there is an option at
the top, Tools (Tools) will click on it. So further many options will be
seen and the board will be written in one place in these options and will
click on it. Then we will see more options, in which we have to click
according to our board. Just like we are using the Arduino UNO board
right now, we will click on the Arduino UNO itself. If we used another
board, we would click on it. And as soon as we select the Arduino UNO
board, then our board will be selected. After this, we click on Tools
again. So many options will appear again and port will be written in one
place in this option and click on it. Then we will see the port number, it
will start with COM (COM) like - COM1, COM2, COM3, COM4, etc.
Clicking on it, the port will also be selected, after which we see the Scatch
option on the screen. If you click on it, we will see Verify option at the
top, and if you click on it, we will know that there is no error in our
program. When we come to know that our program is correct, then we will
click on Scatch again and this time the option coming in it will click on the
option of another number i.e. Upload. Then in some time the program will
be uploaded to Arduino. And the program for which we had designed will
start working.
4- How To Make Voice Control Home
Automation System-
This Project is about interfacing a Bluetooth module with Arduino and
android mobile to activate lights and fan in a room using voice control.This
is a project for a voice controlled home automation system to control
appliances with your voice through an Android app. An Arduino UNO board
is used for controlling the relay through which an appliance is switched
on/off.

Note - To control this system you will need an application and you will find
this application in the Play Store.
(And the name of this application is: Arduino Voice Control )
“Which components will be required to make this device, first we see
their details.”
Components List and Detail-

1- Arduino UNO-
The Arduino UNO is an open-source microcontroller board based on
the Microchip ATmega328P microcontroller and developed by
Arduino.cc. The board is equipped with sets of digital and analog
input/output (I/O) pins that may be interfaced to various expansion
boards (shields) and other circuits. The board has 14 Digital pins, 6
Analog pins, and programmable with the Arduino IDE (Integrated
Development Environment) via a type B USB cable. It can be powered
by a USB cable or by an external 9 volt battery, though it accepts
voltages between 7 and 20 volts. It is also similar to the Arduino Nano
and Leonardo. The Uno board is the first in a series of USB Arduino
boards, and the reference model for the Arduino platform. The
ATmega328 on the Arduino Uno comes preprogrammed with a
bootloader that allows uploading new code to it without the use of an
external hardware programmer. It communicates using the original
STK500 protocol. The Uno also differs from all preceding boards in
that it does not use the FTDI USB-to-serial driver chip. Instead, it uses
the Atmega16U2 (Atmega8U2 up to version R2) programmed as a
USB-to-serial converter.
2- 4Channel 5volt Relay Kit-
This is a 5V 4-channel relay interface board, and each channel
needs a 15-20mA driver current. It can be used to control various
appliances and equipment with large current. It is equiped with
high-current relays that work under AC250V 10A or DC30V 10A.
It has a standard interface that can be controlled directly by
microcontroller.

3- Bluetooth Module HC-05-


HC-05 module is an easy to use Bluetooth SPP (Serial Port
Protocol) module, designed for transparent wireless serial
connection setup.
Serial port Bluetooth module is fully qualified Bluetooth
V2.0+EDR (Enhanced Data Rate) 3Mbps Modulation with
complete 2.4GHz radio transceiver and baseband. It uses CSR
Bluecore 04-External single chip Bluetooth system with CMOS
technology and with AFH(Adaptive Frequency Hopping Feature).
It has the footprint as small as 12.7mmx27mm. Hope it will
simplify your overall design/development cycle.

4- 5volt,2amp Charger-

With this charger, we will power the Arduino board

5- Jumper wire-
A jump wire (also known as jumper wire, or jumper) is an electrical
wire, or group of them in a cable, with a connector or pin at each end
(or sometimes without them – simply "tinned"), which is normally used
to interconnect the components of a breadboard or other prototype or
test circuit, internally or with other equipment or components, without
soldering.

6- Wire-
down to the wire (not comparable) (idiomatic) At the very end of a
process or project, especially one with a fast-approaching deadline.
He was almost done with the paper, but tomorrow's due date meant it
would be down to the wire.
7- Bulb Holder-
A bulb holder is a device that holds a bulb. The bulb holder is
where the bulb fits. The image below shows a bulb holder from a
ceiling light. The bulb fits into the bulb holder, the bulb holder 'holds'
the bulb.

8- 12volt DC Fan-

9- 5pin Socket-
Create A Program for Arduino-
Now, we make a program of Arduino to operate this device.
And we will make the program as well as understand it.

String voice;
int Relay1 = 2;
int Relay2 = 3 ;
int Relay3 = 4;
int Relay4 = 5;
void Relay1On(){
digitalWrite (Relay1, LOW);
}
void Relay1Off(){
digitalWrite (Relay1, HIGH);
}
void Relay2On(){
digitalWrite (Relay2, LOW);
}
void Relay2Off(){
digitalWrite (Relay2, HIGH);
}
void Relay3On(){
digitalWrite (Relay3, LOW);
}
void Relay3Off(){
digitalWrite (Relay3, HIGH);
}
void Relay4On(){
digitalWrite (Relay4, LOW);
}
void Relay4Off(){
digitalWrite (Relay4, HIGH);
}
void allon() {
digitalWrite (Relay1, LOW);
digitalWrite (Relay2, LOW);
digitalWrite (Relay3, LOW);
digitalWrite (Relay4, LOW);
}
void alloff() {
digitalWrite (Relay1, HIGH);
digitalWrite (Relay2, HIGH);
digitalWrite (Relay3, HIGH);
digitalWrite (Relay4, HIGH);
}
void setup() {
Serial.begin(9600);
pinMode(Relay1, OUTPUT);
pinMode(Relay2, OUTPUT);
pinMode(Relay3, OUTPUT);
pinMode(Relay4, OUTPUT);
}
void loop() {
while(Serial.available()) {
delay(10);
char c=Serial.read();
if(c=='#')
{break; }
voice += c;
}
if (voice.length() > 0) {
Serial.println(voice);
if (voice == " on" || voice == " Alexa switch on")
{
allon() ;
}
else if (voice == " off" || voice=="Alexa switch off")
{
alloff() ;
}
else if(voice =="light" || voice =="Alexa light on"){
Relay1On();
}
else if(voice =="light off" || voice =="Alexa light off"){
Relay1Off();
}
else if(voice =="TV" || voice =="Alexa TV on"){
Relay2On();
}
else if( voice =="switch off TV" || voice =="Alexa TV off" ){
Relay2Off();
}
else if(voice =="AC" || voice =="Alexa AC on"){
Relay3On();
}
else if(voice =="switch off AC" || voice =="Alexa AC off"){
Relay3Off();
}
else if(voice =="fan" || voice =="Alexa fan on"){
Relay4On();
}
else if(voice =="switch off fan" || voice =="Alexa fan off"){
Relay4Off();
}
voice="";
}
}

Circuit Diagram-
Now we see the circuit diagram of this project. And by looking at this
circuit, we will make connections to all these components.

Circuit-1
Circuit-2

We have written the program in the Arduino IDE, after that we take an
Arduino UNO board. And connect USB to your Arduino board and connect
it to your computer or laptop, then we will open our program in Arduino
IDE and we see many further options in this IDE. So there is an option at
the top, Tools (Tools) will click on it. So further many options will be
seen and the board will be written in one place in these options and will
click on it. Then we will see more options, in which we have to click
according to our board. Just like we are using the Arduino UNO board
right now, we will click on the Arduino UNO itself. If we used another
board, we would click on it. And as soon as we select the Arduino UNO
board, then our board will be selected. After this, we click on Tools
again. So many options will appear again and port will be written in one
place in this option and click on it. Then we will see the port number, it
will start with COM (COM) like - COM1, COM2, COM3, COM4, etc.
Clicking on it, the port will also be selected, after which we see the Scatch
option on the screen. If you click on it, we will see Verify option at the
top, and if you click on it, we will know that there is no error in our
program. When we come to know that our program is correct, then we will
click on Scatch again and this time the option coming in it will click on the
option of another number i.e. Upload. Then in some time the program will
be uploaded to Arduino. And the program for which we had designed will
start working.

5- How To Make IR Remote Control Car-

Here we are building the remote controlled car using the simple IR
remote or tv remote control. An IR remote control sends some
modulated IR signal to the receiver. The receiver IR receives the
signal and demodulates it. After demodulation and some noise filtering
the input signal is extracted.
“Which components will be required to make this device, first we see
their details.”
Components List and Detail-

1- Arduino UNO-
The Arduino UNO is an open-source microcontroller board based on
the Microchip ATmega328P microcontroller and developed by
Arduino.cc. The board is equipped with sets of digital and analog
input/output (I/O) pins that may be interfaced to various expansion
boards (shields) and other circuits. The board has 14 Digital pins, 6
Analog pins, and programmable with the Arduino IDE (Integrated
Development Environment) via a type B USB cable. It can be powered
by a USB cable or by an external 9 volt battery, though it accepts
voltages between 7 and 20 volts. It is also similar to the Arduino Nano
and Leonardo. The Uno board is the first in a series of USB Arduino
boards, and the reference model for the Arduino platform. The
ATmega328 on the Arduino Uno comes preprogrammed with a
bootloader that allows uploading new code to it without the use of an
external hardware programmer. It communicates using the original
STK500 protocol. The Uno also differs from all preceding boards in
that it does not use the FTDI USB-to-serial driver chip. Instead, it uses
the Atmega16U2 (Atmega8U2 up to version R2) programmed as a
USB-to-serial converter.

2- L298N Motor Driver-


This L298N Motor Driver Module is a high power motor
driver module for driving DC and Stepper Motors. This module
consists of an L298 motor driver IC and a 78M05 5V
regulator. L298N Module can control up to 4 DC motors, or 2
DC motors with directional and speed control.
3- IR Receiver TSOP1738-
TSOP1738 is an IR receiver with an amplifier that acts as a switch
and converter within a circuit. It has one input and output which only
acts on the base of the input IR signal. The basic purpose
of TSOP1738 is to convert the IR signal to electric signals.
... TSOP1738 operates on 38KHz IR frequency.

4- Two Motor 200RPM-


200 RPM 12V DC geared motors widely use for robotics
applications. Very easy to use and available in standard size.
... DC Geared motors with robust metal gearbox for heavy-duty
applications, available in the wide RPM range and ideally suited for
robotics and industrial applications.

5- Two Motor Wheel-

6- Wheel Rounder-
7- Jumper wire-
A jump wire (also known as jumper wire, or jumper) is an electrical
wire, or group of them in a cable, with a connector or pin at each end
(or sometimes without them – simply "tinned"), which is normally used
to interconnect the components of a breadboard or other prototype or
test circuit, internally or with other equipment or components, without
soldering.

8- Switch-
A simple on-off switch: The two terminals are either connected
together or disconnected from each other. An example is a light switch.
A simple on-off switch. The two terminals are normally disconnected
(open) and are closed when the switch is activated.

9- 12volt Battery-
Create A Program for Arduino-
Now, we make a program of Arduino to operate this device.
And we will make the program as well as understand it.

First we will upload this program in Arduino and with the help of this
program we can get the decode value of the buttons of any IR remote. when
we press any button on the IR remote in front of the IR receiver, the IR
decode value of that button will appear on the Arduino software serial
monitor. Then we will paste the decode value of these buttons in the next
program. And then we will upload that program, then the car will be
controlled by the same button on the remote whose decode value we wrote
in the program.

1-
Program-

#include <IRremote.h>
int RECV_PIN = 6;//pin 6 of arduino to data pin of ir receiver
IRrecv irrecv(RECV_PIN);
decode_results IR_code;
void setup()
{
Serial.begin(9600);
irrecv.enableIRIn(); // Start the receiver
}
void loop()
{
if (irrecv.decode(&IR_code))
{
Serial.println(IR_code.value, HEX);
irrecv.resume( ); // Receive the next value
delay(1000);

}
}

“We will copy the value from the serial monitor and paste it into
the program at all the places where the decode value will be
required in this program. And then we will upload this program
in Arduino.”

2- Program-
#include <IRremote.h>

int lm=6;//pin 9 of arduino to pin 7 of l293d


int lmr=7;//pin 8 of arduino to pin 2 of l293d
int rm=8;//pin 10 of arduino to pin 10 of l293d
int rmr=9;//pin 11 of arduino to pin 15 of l293d

int RECV_PIN = 11;//pin 11 of arduino to data pin of ir receiver


IRrecv irrecv(RECV_PIN);
decode_results results;

void setup()
{
pinMode(lm,OUTPUT);
pinMode(lmr,OUTPUT);
pinMode(rm,OUTPUT);
pinMode(rmr,OUTPUT);
Serial.begin(9600);
irrecv.enableIRIn(); // Start the receiver
}

void loop()
{
if (irrecv.decode(&results))
{
Serial.println(results.value, HEX);
irrecv.resume(); // Receive the next value
}
//bot moves front
if(results.value==0xFF18E7)
{
digitalWrite(lm,LOW);
digitalWrite(lmr,HIGH);
digitalWrite(rm,HIGH);
digitalWrite(rmr,LOW);
}
//bot moves back
if(results.value==0xFF4AB5)
{
digitalWrite(lm,HIGH);
digitalWrite(lmr,LOW);
digitalWrite(rm,LOW);
digitalWrite(rmr,HIGH);
}
//bot moves left
if(results.value==0xFF10EF)
{
digitalWrite(lm,LOW);
digitalWrite(lmr,HIGH);
digitalWrite(rm,HIGH);
digitalWrite(rmr,HIGH);
}
//bot moves right
if(results.value==0xFF5AA5)
{
digitalWrite(lm,HIGH);
digitalWrite(lmr,HIGH);
digitalWrite(rm,HIGH);
digitalWrite(rmr,LOW);
}
//bot stops
if(results.value==0xFF38C7)
{
digitalWrite(lm,HIGH);
digitalWrite(lmr,HIGH);
digitalWrite(rm,HIGH);
digitalWrite(rmr,HIGH);
}
}

Circuit Diagram-
Now we see the circuit diagram of this project. And by looking at this
circuit, we will make connections to all these components.
We have written the program in the Arduino IDE, after that we take an
Arduino UNO board. And connect USB to your Arduino board and connect
it to your computer or laptop, then we will open our program in Arduino
IDE and we see many further options in this IDE. So there is an option at
the top, Tools (Tools) will click on it. So further many options will be
seen and the board will be written in one place in these options and will
click on it. Then we will see more options, in which we have to click
according to our board. Just like we are using the Arduino UNO board
right now, we will click on the Arduino UNO itself. If we used another
board, we would click on it. And as soon as we select the Arduino UNO
board, then our board will be selected. After this, we click on Tools
again. So many options will appear again and port will be written in one
place in this option and click on it. Then we will see the port number, it
will start with COM (COM) like - COM1, COM2, COM3, COM4, etc.
Clicking on it, the port will also be selected, after which we see the Scatch
option on the screen. If you click on it, we will see Verify option at the
top, and if you click on it, we will know that there is no error in our
program. When we come to know that our program is correct, then we will
click on Scatch again and this time the option coming in it will click on the
option of another number i.e. Upload. Then in some time the program will
be uploaded to Arduino. And the program for which we had designed will
start working.

6- How To Make Four Way Traffic Light


System-
Traffic lights alternate the right of way accorded to users by
illuminating lamps or LEDs of standard colours (red, amber (yellow),
and green) following a universal colour code. In the typical sequence
of colour phases:
The green light allows traffic to proceed in the direction denoted, if it
is safe to do so and there is room on the other side of the
intersection. The amber light warns that the signal is about to change
to red. In a number of countries – among them the United Kingdom – a
phase during which red and yellow are displayed together indicates
that the signal is about to change to green Actions required by drivers
on a yellow light vary, with some jurisdictions requiring drivers to
stop if it is safe to do so, and others allowing drivers to go through
the intersection if safe to do so.
A flashing amber indication is a warning signal. In the United
Kingdom, a flashing amber light is used only at pelican crossings, in
place of the combined red–amber signal, and indicates that drivers
may pass if no pedestrians are on the crossing.
The red signal prohibits any traffic from proceeding.
A flashing red indication is treated as a stop sign.

“Which components will be required to make this device, first we see


their details.”
Components List and Detail-

1- Arduino UNO-
The Arduino UNO is an open-source microcontroller board based on
the Microchip ATmega328P microcontroller and developed by
Arduino.cc. The board is equipped with sets of digital and analog
input/output (I/O) pins that may be interfaced to various expansion
boards (shields) and other circuits. The board has 14 Digital pins, 6
Analog pins, and programmable with the Arduino IDE (Integrated
Development Environment) via a type B USB cable. It can be powered
by a USB cable or by an external 9 volt battery, though it accepts
voltages between 7 and 20 volts. It is also similar to the Arduino Nano
and Leonardo. The Uno board is the first in a series of USB Arduino
boards, and the reference model for the Arduino platform. The
ATmega328 on the Arduino Uno comes preprogrammed with a
bootloader that allows uploading new code to it without the use of an
external hardware programmer. It communicates using the original
STK500 protocol. The Uno also differs from all preceding boards in
that it does not use the FTDI USB-to-serial driver chip. Instead, it uses
the Atmega16U2 (Atmega8U2 up to version R2) programmed as a
USB-to-serial converter.

2- LEDs-
A light-emitting diode (LED) is a two-lead semiconductor light
source. It is a p–n junction diode that emits light when activated.
When a suitable current is applied to the leads, electrons are able to
recombine with electron holes within the device, releasing energy in
the form of photons. This effect is called electroluminescence, and
the color of the light (corresponding to the energy of the photon) is
determined by the energy band gap of the semiconductor. LEDs are
typically small (less than 1 mm2) and integrated optical components
may be used to shape the radiation pattern.

3- Jumper wire-
A jump wire (also known as jumper wire, or jumper) is an electrical
wire, or group of them in a cable, with a connector or pin at each end
(or sometimes without them – simply "tinned"), which is normally used
to interconnect the components of a breadboard or other prototype or
test circuit, internally or with other equipment or components, without
soldering.

4- 5volt,2Amp Adaptor-

With this charger, we will power the Arduino board

Create A Program for Arduino-


Now, we make a program of Arduino to operate this device.
And we will make the program as well as understand it.
Program-
int Lane1[] = {13,12,11}; // Lane 1 Red, Yellow and Green
int Lane2[] = {10,9,8};// Lane 2 Red, Yellow and Green
int Lane3[] = {7,6,5};// Lane 3 Red, Yellow and Green
int Lane4[] = {4,3,2};// Lane 4 Red, Yellow and Green

void setup()
{
for (int i = 0; i < 3; i++)
{
pinMode(Lane1[i], OUTPUT);
pinMode(Lane2[i], OUTPUT);
pinMode(Lane3[i], OUTPUT);
pinMode(Lane4[i], OUTPUT);
}
for (int i = 0; i < 3; i++)
{
digitalWrite(Lane1[i], LOW);
digitalWrite(Lane2[i], LOW);
digitalWrite(Lane3[i], LOW);
digitalWrite(Lane4[i], LOW);
}

void loop()
{
digitalWrite(Lane1[2], HIGH);
digitalWrite(Lane3[0], HIGH);
digitalWrite(Lane4[0], HIGH);
digitalWrite(Lane2[0], HIGH);
delay(7000);
digitalWrite(Lane1[2], LOW);
digitalWrite(Lane3[0], LOW);
digitalWrite(Lane1[1], HIGH);
digitalWrite(Lane3[1], HIGH);
delay(3000);
digitalWrite(Lane1[1], LOW);
digitalWrite(Lane3[1], LOW);
digitalWrite(Lane1[0], HIGH);
digitalWrite(Lane3[2], HIGH);
delay(7000);
digitalWrite(Lane3[2], LOW);
digitalWrite(Lane4[0], LOW);
digitalWrite(Lane3[1], HIGH);
digitalWrite(Lane4[1], HIGH);
delay(3000);
digitalWrite(Lane3[1], LOW);
digitalWrite(Lane4[1], LOW);
digitalWrite(Lane3[0], HIGH);
digitalWrite(Lane4[2], HIGH);
delay(7000);
digitalWrite(Lane4[2], LOW);
digitalWrite(Lane2[0], LOW);
digitalWrite(Lane4[1], HIGH);
digitalWrite(Lane2[1], HIGH);
delay(3000);
digitalWrite(Lane4[1], LOW);
digitalWrite(Lane2[1], LOW);
digitalWrite(Lane4[0], HIGH);
digitalWrite(Lane2[2], HIGH);
delay(7000);
digitalWrite(Lane1[0], LOW);
digitalWrite(Lane2[2], LOW);
digitalWrite(Lane1[1], HIGH);
digitalWrite(Lane2[1], HIGH);
delay(3000);
digitalWrite(Lane2[1], LOW);
digitalWrite(Lane1[1], LOW);
}
Circuit Diagram-
Now we see the circuit diagram of this project. And by looking at this
circuit, we will make connections to all these components.
We have written the program in the Arduino IDE, after that we take an
Arduino UNO board. And connect USB to your Arduino board and connect
it to your computer or laptop, then we will open our program in Arduino
IDE and we see many further options in this IDE. So there is an option at
the top, Tools (Tools) will click on it. So further many options will be
seen and the board will be written in one place in these options and will
click on it. Then we will see more options, in which we have to click
according to our board. Just like we are using the Arduino UNO board
right now, we will click on the Arduino UNO itself. If we used another
board, we would click on it. And as soon as we select the Arduino UNO
board, then our board will be selected. After this, we click on Tools
again. So many options will appear again and port will be written in one
place in this option and click on it. Then we will see the port number, it
will start with COM (COM) like - COM1, COM2, COM3, COM4, etc.
Clicking on it, the port will also be selected, after which we see the Scatch
option on the screen. If you click on it, we will see Verify option at the
top, and if you click on it, we will know that there is no error in our
program. When we come to know that our program is correct, then we will
click on Scatch again and this time the option coming in it will click on the
option of another number i.e. Upload. Then in some time the program will
be uploaded to Arduino. And the program for which we had designed will
start working.

7- How To Make Automatic Open & Close


Dustbin-
Dustbins (or Garbage bins, Trash Cans, whatever you call them) are small
plastic (or metal) containers that are used to store trash (or waste) on a
temporary basis. They are often used in homes, offices, streets, parks etc.
to collect the waste.In some places, littering is a serious offence and hence
Public Waste Containers are the only way to dispose small waste.Usually,
it is a common practice to use separate bins for collecting wet or dry,
recyclable or non-recyclable waste. In this project, I have designed a
simple system called Smart Dustbin using Arduino, Ultrasonic Sensor and
Servo Motor, where the lid of the dustbin will automatically open itself
upon detection of human hand.
“Which components will be required to make this device, first we see
their details.”
Components List and Detail-

1- Arduino UNO-
The Arduino UNO is an open-source microcontroller board based on
the Microchip ATmega328P microcontroller and developed by
Arduino.cc. The board is equipped with sets of digital and analog
input/output (I/O) pins that may be interfaced to various expansion
boards (shields) and other circuits. The board has 14 Digital pins, 6
Analog pins, and programmable with the Arduino IDE (Integrated
Development Environment) via a type B USB cable. It can be powered
by a USB cable or by an external 9 volt battery, though it accepts
voltages between 7 and 20 volts. It is also similar to the Arduino Nano
and Leonardo. The Uno board is the first in a series of USB Arduino
boards, and the reference model for the Arduino platform. The
ATmega328 on the Arduino Uno comes preprogrammed with a
bootloader that allows uploading new code to it without the use of an
external hardware programmer. It communicates using the original
STK500 protocol. The Uno also differs from all preceding boards in
that it does not use the FTDI USB-to-serial driver chip. Instead, it uses
the Atmega16U2 (Atmega8U2 up to version R2) programmed as a
USB-to-serial converter.

2- Ultrasonic Sensor-
Ultrasonic transducers or ultrasonic sensors are a type of acoustic
sensor divided into three broad categories: transmitters, receivers and
transceivers. Transmitters convert electrical signals into ultrasound,
receivers convert ultrasound into electrical signals, and transceivers
can both transmit and receive ultrasound.
In a similar way to radar and sonar, ultrasonic transducers are used in
systems which evaluate targets by interpreting the reflected signals.
For example, by measuring the time between sending a signal and
receiving an echo the distance of an object can be calculated. Passive
ultrasonic sensors are basically microphones that detect ultrasonic
noise that is present under certain conditions.
3- Servo Motor-
A servomotor is a rotary actuator or linear actuator that allows for
precise control of angular or linear position, velocity and
acceleration. It consists of a suitable motor coupled to a sensor for
position feedback. It also requires a relatively sophisticated
controller, often a dedicated module designed specifically for use
with servomotors. Servomotors are not a specific class of motor
although the term servomotor is often used to refer to a motor
suitable for use in a closed-loop control system.

4- Jumper wire-
A jump wire (also known as jumper wire, or jumper) is an electrical
wire, or group of them in a cable, with a connector or pin at each end
(or sometimes without them – simply "tinned"), which is normally used
to interconnect the components of a breadboard or other prototype or
test circuit, internally or with other equipment or components, without
soldering.
5- 5volt,2amp Adaptor-

With this charger, we will power the Arduino board

Create A Program for Arduino-


Now, we make a program of Arduino to operate this device.
And we will make the program as well as understand it.

Program-
#include <Servo.h> //servo library

Servo servo;

int trigPin = 5;

int echoPin = 6;
int servoPin = 7;

int led= 10;

long duration, dist, average;

long aver[3]; //array for average

void setup() {

Serial.begin(9600);

servo.attach(servoPin);

pinMode(trigPin, OUTPUT);

pinMode(echoPin, INPUT);

servo.write(0); //close cap on power on

delay(1000);

servo.detach();

void measure() {

digitalWrite(10,HIGH);

digitalWrite(trigPin, LOW);

delayMicroseconds(5);

digitalWrite(trigPin, HIGH);

delayMicroseconds(15);

digitalWrite(trigPin, LOW);
pinMode(echoPin, INPUT);

duration = pulseIn(echoPin, HIGH);

dist = (duration/2) / 29.1; //obtain distance

void loop() {

for (int i=0;i<=2;i++) { //average distance

measure();

aver[i]=dist;

delay(10); //delay between measurements

dist=(aver[0]+aver[1]+aver[2])/3;

if ( dist<50 ) {

//Change distance as per your need

servo.attach(servoPin);

delay(1);

servo.write(0);

delay(3000);

servo.write(150);

delay(1000);
servo.detach();

Serial.print(dist);

Circuit Diagram-
Now we see the circuit diagram of this project. And by looking at this
circuit, we will make connections to all these components.

We have written the program in the Arduino IDE, after that we take an
Arduino UNO board. And connect USB to your Arduino board and connect
it to your computer or laptop, then we will open our program in Arduino
IDE and we see many further options in this IDE. So there is an option at
the top, Tools (Tools) will click on it. So further many options will be
seen and the board will be written in one place in these options and will
click on it. Then we will see more options, in which we have to click
according to our board. Just like we are using the Arduino UNO board
right now, we will click on the Arduino UNO itself. If we used another
board, we would click on it. And as soon as we select the Arduino UNO
board, then our board will be selected. After this, we click on Tools
again. So many options will appear again and port will be written in one
place in this option and click on it. Then we will see the port number, it
will start with COM (COM) like - COM1, COM2, COM3, COM4, etc.
Clicking on it, the port will also be selected, after which we see the Scatch
option on the screen. If you click on it, we will see Verify option at the
top, and if you click on it, we will know that there is no error in our
program. When we come to know that our program is correct, then we will
click on Sketch again and this time the option coming in it will click on the
option of another number i.e. Upload. Then in some time the program will
be uploaded to Arduino. And the program for which we had designed will
start working.
8- How To Make Temperature & Humidity
Monitoring System-

Through this System we will print Temperature and Humidity on


Liquid Crystal Display, for this we will use DHT11 sensor. So we first
get to know about DHT11 sensor. If we use this system in the public
place, then we will know the temperature and familiarity of that place.
“Which components will be required to make this device, first we see
their details.”
Components List and Detail-

1- Arduino UNO-
The Arduino UNO is an open-source microcontroller board based on
the Microchip ATmega328P microcontroller and developed by
Arduino.cc. The board is equipped with sets of digital and analog
input/output (I/O) pins that may be interfaced to various expansion
boards (shields) and other circuits. The board has 14 Digital pins, 6
Analog pins, and programmable with the Arduino IDE (Integrated
Development Environment) via a type B USB cable. It can be powered
by a USB cable or by an external 9 volt battery, though it accepts
voltages between 7 and 20 volts. It is also similar to the Arduino Nano
and Leonardo. The Uno board is the first in a series of USB Arduino
boards, and the reference model for the Arduino platform. The
ATmega328 on the Arduino Uno comes preprogrammed with a
bootloader that allows uploading new code to it without the use of an
external hardware programmer. It communicates using the original
STK500 protocol. The Uno also differs from all preceding boards in
that it does not use the FTDI USB-to-serial driver chip. Instead, it uses
the Atmega16U2 (Atmega8U2 up to version R2) programmed as a
USB-to-serial converter.
2- LCD Display-
An LCD is an electronic display module that uses liquid
crystal to produce a visible image. The 16×2 LCD display is a
very basic module commonly used in DIYs and circuits.
The 16×2 translates o a display 16 characters per line in 2 such
lines. In this LCD each character is displayed in a 5×7 pixel
matrix.

3- 10k Preset-
A preset is a passive variable resistor that is used to vary the
voltage and current in the circuit as per need. This is a three
terminal PCB mount friendly device which gives variable
voltage from center pin in the range of voltage difference applied
on the two outer pins, as it is rotated.

4- DHT11 Sensor-
The DHT11 is a basic, ultra low-cost digital temperature and
humidity sensor. It uses a capacitive humidity sensor and a
thermistor to measure the surrounding air, and spits out a digital
signal on the data pin (no analog input pins needed). Its fairly
simple to use, but requires careful timing to grab data.
5- Jumper wire-
A jump wire (also known as jumper wire, or jumper) is an electrical
wire, or group of them in a cable, with a connector or pin at each end
(or sometimes without them – simply "tinned"), which is normally used
to interconnect the components of a breadboard or other prototype or
test circuit, internally or with other equipment or components, without
soldering.

6- 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.
Create A Program for Arduino-
Now, we make a program of Arduino to operate this device.
And we will make the program as well as understand it.
Program-
#include <dht.h>
#include <LiquidCrystal.h>
int RS = 12, E = 11, D4 = 5, D5 = 4, D6 = 3, D7 = 2;
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
dht DHT;
#define DHT11_PIN 7
void setup(){
lcd.begin(16, 2);
Serial.begin(9600);
}
void loop(){
int chk = DHT.read11(DHT11_PIN);
lcd.setCursor(0,0);
lcd.print("Temp: ");
lcd.print(DHT.temperature);
lcd.print((char)223);
lcd.print("C");
lcd.setCursor(0,1);
lcd.print("Humidity: ");
lcd.print(DHT.humidity);
lcd.print("%");
delay(1000);
}

Circuit Diagram-
Now we see the circuit diagram of this project. And by looking at this
circuit, we will make connections to all these components.

We have written the program in the Arduino IDE, after that we


take an Arduino UNO board. And connect USB to your Arduino
board and connect it to your computer or laptop, then we will
open our program in Arduino IDE and we see many further
options in this IDE. So there is an option at the top, Tools
(Tools) will click on it. So further many options will be seen
and the board will be written in one place in these options and
will click on it. Then we will see more options, in which we
have to click according to our board. Just like we are using the
Arduino UNO board right now, we will click on the Arduino
UNO itself. If we used another board, we would click on it. And
as soon as we select the Arduino UNO board, then our board
will be selected. After this, we click on Tools again. So many
options will appear again and port will be written in one place
in this option and click on it. Then we will see the port number,
it will start with COM (COM) like - COM1, COM2, COM3,
COM4, etc. Clicking on it, the port will also be selected, after
which we see the Scatch option on the screen. If you click on it,
we will see Verify option at the top, and if you click on it, we
will know that there is no error in our program. When we come
to know that our program is correct, then we will click on Scatch
again and this time the option coming in it will click on the
option of another number i.e. Upload. Then in some time the
program will be uploaded to Arduino. And for which we had
made the program, that work will start, that is, when we turn on
the power in the circuit, then the temperature and Humidity will
start to be printed on the LCD, now we can use this project
according to its working in any way.
9- How To Make Mobile Control Home
Automation-
Through this System, we will create a Bluetooth control home
automation system. In this, we will control the relay via mobile. In this
processing we will pair between the Bluetooth Module HC-05 and the
Bluetooth of the mobile and then operate the relay with the help of an
Android app.
Note - To control this system you will need an application and you will find
this application in the Play Store.
(And the name of this application is: Arduino Bluetooth Control Device )

“Which components will be required to make this device, first we see


their details.”
Components List and Detail-
1- Arduino UNO-
The Arduino UNO is an open-source microcontroller board based on
the Microchip ATmega328P microcontroller and developed by
Arduino.cc. The board is equipped with sets of digital and analog
input/output (I/O) pins that may be interfaced to various expansion
boards (shields) and other circuits. The board has 14 Digital pins, 6
Analog pins, and programmable with the Arduino IDE (Integrated
Development Environment) via a type B USB cable. It can be powered
by a USB cable or by an external 9 volt battery, though it accepts
voltages between 7 and 20 volts. It is also similar to the Arduino Nano
and Leonardo. The Uno board is the first in a series of USB Arduino
boards, and the reference model for the Arduino platform. The
ATmega328 on the Arduino Uno comes preprogrammed with a
bootloader that allows uploading new code to it without the use of an
external hardware programmer. It communicates using the original
STK500 protocol. The Uno also differs from all preceding boards in
that it does not use the FTDI USB-to-serial driver chip. Instead, it uses
the Atmega16U2 (Atmega8U2 up to version R2) programmed as a
USB-to-serial converter.

2- 4Channel 5volt Relay Kit-


This is a 5V 4-channel relay interface board, and each channel
needs a 15-20mA driver current. It can be used to control various
appliances and equipment with large current. It is equiped with
high-current relays that work under AC250V 10A or DC30V 10A.
It has a standard interface that can be controlled directly by
microcontroller.

3- Bluetooth Module HC-05-


HC-05 module is an easy to use Bluetooth SPP (Serial Port
Protocol) module, designed for transparent wireless serial
connection setup.
Serial port Bluetooth module is fully qualified Bluetooth
V2.0+EDR (Enhanced Data Rate) 3Mbps Modulation with
complete 2.4GHz radio transceiver and baseband. It uses CSR
Bluecore 04-External single chip Bluetooth system with CMOS
technology and with AFH(Adaptive Frequency Hopping Feature).
It has the footprint as small as 12.7mmx27mm. Hope it will
simplify your overall design/development cycle.
4- 5volt,2Amp Charger

With this charger, we will power the Arduino board

5- Jumper wire-
A jump wire (also known as jumper wire, or jumper) is an electrical
wire, or group of them in a cable, with a connector or pin at each end
(or sometimes without them – simply "tinned"), which is normally used
to interconnect the components of a breadboard or other prototype or
test circuit, internally or with other equipment or components, without
soldering.
6- Wire-
down to the wire (not comparable) (idiomatic) At the very end of a
process or project, especially one with a fast-approaching deadline.
He was almost done with the paper, but tomorrow's due date meant it
would be down to the wire.

7- Bulb Holder-
A bulb holder is a device that holds a bulb. The bulb holder is
where the bulb fits. The image below shows a bulb holder from a
ceiling light. The bulb fits into the bulb holder, the bulb holder 'holds'
the bulb.

8- Plug-
Create A Program for Arduino-
Now, we make a program of Arduino to operate this device.
And we will make the program as well as understand it.
Program-
#include <EEPROM.h>
String inputs;
#define relay1 2 //Connect relay1 to pin 9
#define relay2 3 //Connect relay2 to pin 8
#define relay3 4 //Connect relay3 to pin 7
#define relay4 5 //Connect relay4 to pin 6

void setup()
{
Serial.begin(9600); //Set rate for communicating with phone
pinMode(relay1, OUTPUT); //Set relay1 as an output
pinMode(relay2, OUTPUT); //Set relay2 as an output
pinMode(relay3, OUTPUT); //Set relay1 as an output
pinMode(relay4, OUTPUT); //Set relay2 as an output
digitalWrite(relay1, LOW); //Switch relay1 off
digitalWrite(relay2, LOW); //Swtich relay2 off
digitalWrite(relay3, LOW); //Switch relay1 off
digitalWrite(relay4, LOW); //Swtich relay2 off
}

void loop()
{
while(Serial.available()) //Check if there are available bytes to read
{
delay(10); //Delay to make it stable
char c = Serial.read(); //Conduct a serial read
if (c == '#'){
break; //Stop the loop once # is detected after a word
}
inputs += c; //Means inputs = inputs + c
}
if (inputs.length() >0)
{
Serial.println(inputs);

if(inputs == "A")
{
digitalWrite(relay1, LOW);
}
else if(inputs == "a")
{
digitalWrite(relay1, HIGH);
}
else if(inputs == "B")
{
digitalWrite(relay2, LOW);
}
else if(inputs == "b")
{
digitalWrite(relay2, HIGH);
}
else if(inputs == "C")
{
digitalWrite(relay3, LOW);
}
else if(inputs == "c")
{
digitalWrite(relay3, HIGH);
}
else if(inputs == "D")
{
digitalWrite(relay4, LOW);
}
else if(inputs == "d")
{
digitalWrite(relay4, HIGH);
}
inputs="";
}
}
Circuit Diagram-
Now we see the circuit diagram of this project. And by looking at this
circuit, we will make connections to all these components.

Circuit-1

Circuit-2
We have written the program in the Arduino IDE, after that we take an
Arduino UNO board. And connect USB to your Arduino board and connect
it to your computer or laptop, then we will open our program in Arduino
IDE and we see many further options in this IDE. So there is an option at
the top, Tools (Tools) will click on it. So further many options will be
seen and the board will be written in one place in these options and will
click on it. Then we will see more options, in which we have to click
according to our board. Just like we are using the Arduino UNO board
right now, we will click on the Arduino UNO itself. If we used another
board, we would click on it. And as soon as we select the Arduino UNO
board, then our board will be selected. After this, we click on Tools
again. So many options will appear again and port will be written in one
place in this option and click on it. Then we will see the port number, it
will start with COM (COM) like - COM1, COM2, COM3, COM4, etc.
Clicking on it, the port will also be selected, after which we see the Scatch
option on the screen. If you click on it, we will see Verify option at the
top, and if you click on it, we will know that there is no error in our
program. When we come to know that our program is correct, then we will
click on Scatch again and this time the option coming in it will click on the
option of another number i.e. Upload. Then in some time the program will
be uploaded to Arduino. And the program for which we had designed will
start working.

10- How To Make Bluetooth Control Notice


Board-
In this modern world where everything is digitalised, why not
conventional Notice board gets a new look.So, lets make a Bluetooth
controlled Notice Board which is very simple.This setup can be used
in place of static notice board like in colleges/institutes,
Hospital/clinics to denote patient serial numbers and how you may
use it (DO NOT DISTURB indicator!!!).
Note - To control this system you will need an application and you will find
this application in the Play Store.
(And the name of this application is: HC-05 Bluetooth Remote-Student )

“Which components will be required to make this device, first we see


their details.”
Components List and Detail-

1- Arduino UNO-
The Arduino UNO is an open-source microcontroller board based on
the Microchip ATmega328P microcontroller and developed by
Arduino.cc. The board is equipped with sets of digital and analog
input/output (I/O) pins that may be interfaced to various expansion
boards (shields) and other circuits. The board has 14 Digital pins, 6
Analog pins, and programmable with the Arduino IDE (Integrated
Development Environment) via a type B USB cable. It can be powered
by a USB cable or by an external 9 volt battery, though it accepts
voltages between 7 and 20 volts. It is also similar to the Arduino Nano
and Leonardo. The Uno board is the first in a series of USB Arduino
boards, and the reference model for the Arduino platform. The
ATmega328 on the Arduino Uno comes preprogrammed with a
bootloader that allows uploading new code to it without the use of an
external hardware programmer. It communicates using the original
STK500 protocol. The Uno also differs from all preceding boards in
that it does not use the FTDI USB-to-serial driver chip. Instead, it uses
the Atmega16U2 (Atmega8U2 up to version R2) programmed as a
USB-to-serial converter.

2- Bluetooth Module HC-05-


HC-05 module is an easy to use Bluetooth SPP (Serial Port
Protocol) module, designed for transparent wireless serial
connection setup.
Serial port Bluetooth module is fully qualified Bluetooth
V2.0+EDR (Enhanced Data Rate) 3Mbps Modulation with
complete 2.4GHz radio transceiver and baseband. It uses CSR
Bluecore 04-External single chip Bluetooth system with CMOS
technology and with AFH(Adaptive Frequency Hopping Feature).
It has the footprint as small as 12.7mmx27mm. Hope it will
simplify your overall design/development cycle.

3- LCD Display-
An LCD is an electronic display module that uses liquid
crystal to produce a visible image. The 16×2 LCD display is a
very basic module commonly used in DIYs and circuits.
The 16×2 translates o a display 16 characters per line in 2 such
lines. In this LCD each character is displayed in a 5×7 pixel
matrix.
4- 10k Preset-
A preset is a passive variable resistor that is used to vary the
voltage and current in the circuit as per need. This is a three
terminal PCB mount friendly device which gives variable
voltage from center pin in the range of voltage difference applied
on the two outer pins, as it is rotated.

5- Jumper wire-
A jump wire (also known as jumper wire, or jumper) is an electrical
wire, or group of them in a cable, with a connector or pin at each end
(or sometimes without them – simply "tinned"), which is normally used
to interconnect the components of a breadboard or other prototype or
test circuit, internally or with other equipment or components, without
soldering.

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

7- 5volt,2Amp Charger-

With this charger, we will power the Arduino board


Create A Program for Arduino-
Now, we make a program of Arduino to operate this device.
And we will make the program as well as understand it.
Program-
#include<LiquidCrystal.h>
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
void setup()
{
lcd.begin(16, 2);
Serial.begin(9600);
}
void loop()
{
if (Serial.available())
{
delay(100);
lcd.clear();
while (Serial.available() > 0)
{
lcd.write(Serial.read());
}
}
}
Circuit Diagram-
Now we see the circuit diagram of this project. And by looking at this
circuit, we will make connections to all these components.

We have written the program in the Arduino IDE, after that we take an
Arduino UNO board. And connect USB to your Arduino board and connect
it to your computer or laptop, then we will open our program in Arduino
IDE and we see many further options in this IDE. So there is an option at
the top, Tools (Tools) will click on it. So further many options will be
seen and the board will be written in one place in these options and will
click on it. Then we will see more options, in which we have to click
according to our board. Just like we are using the Arduino UNO board
right now, we will click on the Arduino UNO itself. If we used another
board, we would click on it. And as soon as we select the Arduino UNO
board, then our board will be selected. After this, we click on Tools
again. So many options will appear again and port will be written in one
place in this option and click on it. Then we will see the port number, it
will start with COM (COM) like - COM1, COM2, COM3, COM4, etc.
Clicking on it, the port will also be selected, after which we see the Scatch
option on the screen. If you click on it, we will see Verify option at the
top, and if you click on it, we will know that there is no error in our
program. When we come to know that our program is correct, then we will
click on Scatch again and this time the option coming in it will click on the
option of another number i.e. Upload. Then in some time the program will
be uploaded to Arduino. And the program for which we had designed will
start working.
Note-

With the help of all the projects you have learned to


make from this book, try to make more projects and all
the components or sensors can be controlled from
Arduino, then you should make a program for them.

You might also like