0% found this document useful (0 votes)
24 views9 pages

05 - Arduino Implementation

The document discusses implementing a PIR motion sensor on an Arduino development board. It provides an overview of Arduino Uno, variants of Arduino products, and describes the PIR motion sensor, circuit diagram, and programming. It also discusses sensors supported by Arduino and the objectives of PIR motion sensors.

Uploaded by

manthanstd
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
Download as pdf or txt
0% found this document useful (0 votes)
24 views9 pages

05 - Arduino Implementation

The document discusses implementing a PIR motion sensor on an Arduino development board. It provides an overview of Arduino Uno, variants of Arduino products, and describes the PIR motion sensor, circuit diagram, and programming. It also discusses sensors supported by Arduino and the objectives of PIR motion sensors.

Uploaded by

manthanstd
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
Download as pdf or txt
Download as pdf or txt
You are on page 1/ 9

Vishwakarma Government Engineering College

Department of Instrumentation and Control Engineering

PRACTICAL NO: 05

AIM:- To Implement PIR based Motion sensor on Arduino development board.

OBJECTIVES:
1. Overview of Arduino Uno Module

2. Variants of Arduino products

3. PIR Motion Sensor

4. Circuit diagram and Operation

5. Program

Introduction
The progressive development in fabrication technology offer best microcontrollers to user community.
The race has been started for producing 4 bit microcontrollers to 32 bits, 64 bits, 128 bits and still
continues. Almost all microcontrollers are embedded with peripheral supports like communication,
Timers, Memory, I/O modules and data conversion etc to enhances its operation capabilities. During
the late 1980 to 2010 embedded microcontrollers based development and design tools implemented to
various domains including aerospace to navigation system and it has captured 80% of markets. The
limitations of all these embedded controllers are the need of knowledge of sophisticated codes and
programming methods, cost as well as the barrier of paid source platform.
Arduino is an open-source electronics platform based on easy-to-use hardware and software. Arduino
boards are able to read inputs - light on a sensor, a finger on a button, or a Twitter message - and turn it
into an output - activating a motor, turning on an LED, publishing something online. You can tell your
board what to do by sending a set of instructions to the microcontroller on the board. To do so you use
the Arduino programming language (based on Wiring), and the Arduino Software (IDE), based
on Processing.

43 | P a g e
3161716: Industry 4.0
Vishwakarma Government Engineering College
Department of Instrumentation and Control Engineering

Over the years Arduino has been the brain of thousands of projects, from everyday objects to complex
scientific instruments. A worldwide community of makers - students, hobbyists, artists, programmers,
and professionals - has gathered around this open-source platform, their contributions have added up to
an incredible amount of accessible knowledge that can be of great help to novices and experts alike.
Arduino was born at the Ivrea Interaction Design Institute as an easy tool for fast prototyping, aimed at
students without a background in electronics and programming. As soon as it reached a wider
community, the Arduino board started changing to adapt to new needs and challenges, differentiating
its offer from simple 8-bit boards to products for IoT applications, wearable, 3D printing, and
embedded environments.
Why Arduino?
Thanks to its simple and accessible user experience, Arduino has been used in thousands of different
projects and applications. The Arduino software is easy-to-use for beginners, yet flexible enough for
advanced users. It runs on Mac, Windows, and Linux. Teachers and students use it to build low cost
scientific instruments, to prove chemistry and physics principles, or to get started with programming
and robotics. Designers and architects build interactive prototypes, musicians and artists use it for
installations and to experiment with new musical instruments. Makers, of course, use it to build many
of the projects exhibited at the Maker Faire, for example. Arduino is a key tool to learn new things.
Anyone - children, hobbyists, artists, programmers - can start tinkering just following the step by step
instructions of a kit, or sharing ideas online with other members of the Arduino community.

Fig-1: Arduino UNO Board

44 | P a g e
3161716: Industry 4.0
Vishwakarma Government Engineering College
Department of Instrumentation and Control Engineering
Benefits of Arduino
There are many other microcontrollers and microcontroller platforms available for physical computing.
Parallax Basic Stamp, Netmedia's BX-24, Phidgets, MIT's Handyboard, and many others offer similar
functionality. All of these tools take the messy details of microcontroller programming and wrap it up
in an easy-to-use package. Arduino also simplifies the process of working with microcontrollers, but it
offers some advantage for teachers, students, and interested amateurs over other systems:
 Inexpensive - Arduino boards are relatively inexpensive compared to other microcontroller
platforms. The least expensive version of the Arduino module can be assembled by hand, and even the
pre-assembled Arduino modules cost less than Rs.800.
 Cross-platform - The Arduino Software (IDE) runs on Windows, Macintosh OSX, and Linux
operating systems. Most microcontroller systems are limited to Windows.
 Simple, clear programming environment - The Arduino Software (IDE) is easy-to-use for
beginners,
yet flexible enough for advanced users to take advantage of as well. For teachers, it's conveniently
based on the Processing programming environment, so students learning to program in that
environment will be familiar with how the Arduino IDE works.
 Open source and extensible software - The Arduino software is published as open source
tools, available for extension by experienced programmers. The language can be expanded through
C++ libraries, and people wanting to understand the technical details can make the leap from Arduino
to the AVR C programming language on which it's based. Similarly, you can add AVR-C code directly
into your Arduino programs if you want to.
 Open source and extensible hardware - The plans of the Arduino boards are published under
a Creative Commons license, so experienced circuit designers can make their own version of the
module, extending it and improving it. Even relatively inexperienced users can build the breadboard
version of the module in order to understand how it works and save money.
Variants
a) Entry Level

Get started with Arduino using Entry Level products: easy to use and ready to power your first creative
projects. These boards and modules are the best to start learning and tinkering with electronics and
coding. Examples are Arduino UNO, Arduino NANO etc

45 | P a g e
3161716: Industry 4.0
Vishwakarma Government Engineering College
Department of Instrumentation and Control Engineering
b) Enhanced Features

Experience the excitement of more complex projects choosing one of the boards with advanced
functionalities, or faster performances. Examples are UNO Wi-Fi Rev2, Arduino Mega etc.

c) Internet of Things

Make connected devices easily with one of these IoT products and open your creativity with the
opportunities of the World Wide Web. These boards are compatible with the Arduino Cloud which
allows collecting data in dashboards, control devices from a mobile app and update firmware over a
network connection. Examples are Arduino NANO RP2040 CONNECT.

Arduino Uno Development Board

These development boards are basically circuits comprising a programmable microcontroller and
peripherals that allow the user to interact with the outside world through output elements like LEDs,
motors, LCD screens, touch screens, and even the internet. So let’s say you wish to make a device that
responds to some input (Temperature, Light, Motion or just lines of code) through outputs like motors,
information (on a screen), lights, etc. then you can do it with an Arduino board. An Arduino board can
be interfaced with any electronic input device and also with any electronic output device in some way.
In short, the possibilities of things you could do with an Arduino is endless

Fig-2: Available Functions of Arduino Uno Development Board

46 | P a g e
3161716: Industry 4.0
Vishwakarma Government Engineering College
Department of Instrumentation and Control Engineering

IoT development board supported Sensor

Sensors play a crucial role in automation in making the system intellectual. Different types of sensors
are available as per the suitability and applications; some of them are produced in mass and available in
the market at affordable costs. Sensors are vital components of Industry 4.0, allowing several
transitions such as changes in positions, length, height, external and dislocations in industrial
production facilities to be detected, measured, analyzed, and processed. Smart factories will also
enhance sustainability by tracking real-time output, and automated control systems will minimize
potential factory maintenance costs. The ease with which an Arduino can obtain sensor values is one of
the features that make it so useful. Following are the list of sensors which supported Arduino
development board.

 Light sensor

 Motion sensor

 Temperature sensor

 Magnetic fields sensor

 Gravity sensor

 Humidity sensor

 Moisture sensor

 Vibration sensor

 Pressure sensor

 Electrical fields sensor

 Sound sensor

 Position sensor

Objective of PIR Motion Sensors

PIR- Passive Infrared Sensors are the sensors which are most widely used for casual surveillance. Due to their
high ended sensitivity and area of detection PIR sensors are popular in security. PIR sensors are excellent in
human and animal detection. They are mostly used in triggering an intruder alarm and activate household

47 | P a g e
3161716: Industry 4.0
Vishwakarma Government Engineering College
Department of Instrumentation and Control Engineering
appliances upon the presence of a human. However, the output from the sensor is proportional to several
temporal relationships between an object in the field of view of the sensor, the sensitivity of the sensor, PIR lens
features, and the environmental heat conditions.

A typical PIR Sensor looks like the one shown in the figure-3 below. To connect with external devices,
it has only three pins namely VCC, Digital OUT (Data) and GND. T he brain of the PIR Sensor Module is
the BISS0001 PIR Motion Detector IC. Near this IC, we have two potentiometers, one for adjusting the
Sensitivity and the other is for adjusting the delay time. Using Sensitivity Adjust, we can control the range
of field of view up to 7 meters. Using the Delay Time Adjust, we can control the duration for which the
Digital Out will stay HIGH when a moving object is detected.

Fig-3: PIR Sensor

PIR Sensors are complicated than most other sensors. PIR Motion Sensor may seem simple when
implemented as all we need to do is check for a HIGH signal on the Digital Out Pin of the Sensor
whenever motion is detected. Since the Digital Out Pin of the PIR Sensor is either HIGH or LOW
based on the movement detected, you can build a simple circuit to test the PIR Sensor. The circuit
shown in figure-2 consists of a PIR Sensor and an LED. When the PIR Sensor detects motions, the
LED turns ON. The duration for which the LED is ON can be adjusted with the help of Delay Adjust
POT.

Fig-4: Testing of PIR Sensor


48 | P a g e
3161716: Industry 4.0
Vishwakarma Government Engineering College
Department of Instrumentation and Control Engineering

PIR Motion sensing using Arduino

Fig-5: Circuit Diagram of PIR Motion sensor using Arduino

Components Required

 Arduino UNO

 PIR Sensor

 5V Buzzer

 Breadboard

 Connecting Wires

 Power Supply

The design of the PIR Motion Sensor using Arduino is very simple. The PIR Sensor Module has three
pins: VCC, Digital Out and GND. Connect VCC and GND to +5V and GND respectively. Then
connect the Digital Out Pin of the PIR sensor to the digital I/O pin 8 of Arduino.

As we need to indicate the detection of motion by the sensor, connect a buzzer to Pin 11 of the Arduino.

Working of Arduino PIR Sensor Motion Detector

The working of this project is very simple. When the system is powered on, the Arduino waits for the
PIR Sensor to be calibrated. The calibration period is set to 10 seconds and during this time, there
should be no movements in front of the PIR Sensor. After the calibration, the PIR Sensor will be ready
to detect any movement in front of it. If the PIR Sensor detects any movements, its Digital Out pin,
which is connected to Pin 8 of Arduino, will become HIGH. Arduino will detect this HIGH Signal and
49 | P a g e
3161716: Industry 4.0
Vishwakarma Government Engineering College
Department of Instrumentation and Control Engineering
activates the buzzer.
Code
1 int buzzer = 11;

2 int sensor = 8;

3 int led = 13;

4 void setup()

5 {

6 pinMode(buzzer, OUTPUT);

7 pinMode(sensor, INPUT);

8 pinMode(led, OUTPUT);

9
10 digitalWrite(buzzer,LOW);

11 digitalWrite(sensor,LOW);

12
13 digitalWrite(led,LOW);

14
15 while(millis()<13000)

16 {

17 digitalWrite(led,HIGH);

18 delay(50);

19 digitalWrite(led,LOW);

20 delay(50);

21 }

22 digitalWrite(led,HIGH);

23
24 }

25
26 void loop()

27 {

28 if(digitalRead(sensor)==HIGH)

29 {

30 digitalWrite(buzzer,HIGH);

31 delay(3000);

32 digitalWrite(buzzer,LOW);

33 while(digitalRead(sensor)==HIGH);

34 }

35
36 }

50 | P a g e
3161716: Industry 4.0
Vishwakarma Government Engineering College
Department of Instrumentation and Control Engineering

Applications

 Arduino PIR Sensor Interface can be implemented in a wide range of project but the important
one is the Motion Detection System.

 A variety of Home Security Systems can be implemented using Arduino and PIR Sensor.

Conclusion:

Assignment:
1. Describe the function of each GPIO Pin of Arduino board

51 | P a g e
3161716: Industry 4.0

You might also like