Finalized 0

Download as pdf or txt
Download as pdf or txt
You are on page 1of 100

IOT BASED SMART VACUUM CLEANER

A PROJECT REPORT

PHASE I

Submitted by

ROSHAN M (113219051025)
SAIKUMAR S Y (113219051026)
SRIHARISH P (113219051033)
VIBINKUMAR V (113219051038)

In partial fulfillment for the award of the degree


OF
BACHELOR OF ENGINEERING
IN

ELECTRICAL AND ELECTRONICS ENGINEERING

VELAMMAL ENGINEERING COLLEGE, CHENNAI-66.


(An Autonomous Institution, Affiliated to Anna University, Chennai)

NOVEMBER 2022

i
VELAMMAL ENGINEERING COLLEGE
CHENNAI - 66

BONAFIDE CERTIFICATE

Certified that this project report “SMART VACCUM CLEANER ROBOT

BASED AN IOT” is the bonafide work of ROSHAN M, SAIKUMAR S Y,

SRIHARISH P and VIBINKUMAR V who carried out at the project under my

supervision.

Signature Signature

Dr. S. UMAMAHESWARI Dr. K. SURESH KUMAR


PROFESSOR & HEAD ASSOCIATE PROFESSOR / EEE
Dept. Of. Electrical and Electronics Dept. Of. Electrical and Electronics
Velammal Engineering College Velammal Engineering College
Chennai - 600066 Chennai - 600066

ii
CERTIFICATE OF EVALUATION

COLLEGE NAME : VELAMMAL ENGINEERING COLLEGE


BRANCH : ELECTRICAL AND ELECTRONICS ENGINEERING
SEMESTER : VII

Name of the students Name of supervisor


Sl. No Title of the Project
who has done the project with designation
1 ROSHAN M
Dr. K SURESH
2 SAIKUMAR S Y SMART VACUUM KUMAR
CLEANER ROBOT ASSOCIATE
3 SRIHARISH P BASED ON IOT PROFESSOR
EEE
4 VIBINKUMAR V

This report of project work submitted by the above students in partial fulfillment for
the award of Bachelor of Electrical and Electronics Engineering Degree in Anna
University was evaluated and confirmed to be reports of the work done by the above
studentsand then assessed.

Submitted for Internal Evaluation held on........................

Internal Examiner External Examiner

iii
ABSTRACT

In recent years, people are becoming more carrier oriented and due to their
irregular working schedule, it becoming challenge to maintain both home and office
together especially for women. We have prepared a smart vacuum which has been
designed in advanced technology for automatic cleaning process. It also has a special
feature of security camera in it. This smart vacuum works by an IOT. We have a
smart vacuum in good working condition and it is tested. This saves lot of time and
cleans the surface better without human intervention.

KEYWORDS: IOT, Dust particles, ESP-32CAM.

iv
AKNOWLEDGEMENT

We express our sincere thanks to Shri. M.V. Muthuramalingam, Chairman and


Mr.M.V.M. Velmurugan, Chief Executive officer of Velammal Education trust for
their support during our project work.

We thank Dr. S. Satish Kumar, Principal, Velammal Engineering College for his
motivation and support during the course of the project.

We are very much grateful to Dr. R. Umamaheswari, Professor and Head,


Department of Electrical and Electronics Engineering, Velammal Engineering College
for the encouragement and useful suggestions during this work.

We are very much indebted to our Internal Guide, Dr. K. SureshKumar,


Associate Professor Department of Electrical and Electronics Engineering, Velammal
Engineering College for his admirable guidance and constant encouragement throughout
the project work.

We would like to extend our fullest gratitude to our project Coordinator, Dr.
M.Karthikeyan Assistant Professor III and project review committee for their
timely advice and successful grooming.

We take this opportunity to thank our parents, all faculty and staff of our
department for their kind during the course of work.

v
TABLE OF CONTENTS

CHAPTER TITLE PAGE NO:


NO:
ABSTRACT iv
ACKNOWLEDGEMENT v
TABLE OF CONTENTS vi
LIST OF FIGURES xi
1. INTRODUCTION 1
1.1 GENERAL 1
1.2 SCOPE OF THE PROJECT 1
1.3 EXISTING SYSTEM 1
1.3.1 Existing system dis-advantages 1
1.4 PROPOSED SYSTEM
1.4.1 Proposed system advantages 1
2
2. LITERATURE REVIEW 3
3. PROJECT DESCRIPTION 7
3.1 GENERAL 7
3.2 BLOCK DIAGRAM 7
3.3 MODULE NAME 7
3.4 MODULE DESCRIPTION 8
3.5 WORKING 10
3.6 HARDWARE DESCRIPTION 10

vi
3.6.1 ARDUINO 10
3.6.1.1 Introduction to Arduino 10
11
3.6.1.2 Why Arduino
12
3.6.1.3 Arduino UNO
13
3.6.1.4 Hardware
15
3.6.1.5 Programming
16
3.6.1.6 Power
17
3.6.1.7 Memory
17
3.6.1.8 Input and Output
19
3.6.1.9 Communication
20
3.6.1.10 Applications
20
3.6.2 12V BATTERY
21
3.6.3 INTERNET OF THINGS
22
3.6.4 INFRASTRUCTURE
3.6.4.1 Plug and play
integration 22

3.6.4.2 Infrastructure
Functionally 22

3.6.4.3 Physical location and


position 23

3.6.4.4 Security and Privacy


3.6.4.5 Data Management 23

3.6.5 ESP-12 BASED NODE MCU 23

3.6.6 ESP32-CAM 24

3.6.6.1 Introduction 28

vii
3.6.6.2 Working with the ESP-32 28
CAM
3.6.6.3 Examing the ESP-32 CAM 28
3.6.6.4 ESP-32 CAM
28
Specification
3.6.6.5 Camera 29

Specification
3.6.7 LCD (LIQUID CRYSTAL DISPLAY) 30

3.6.7.1 Pin Diagram 30


3.6.8 SERVOMOTOR 31
3.6.8.1 Specifications 32

3.6.8.2 Servo Mechanism 33

3.6.8.3 Working principle of 34


servomotor
3.6.8.4 Working of 35
servomotor
3.6.8.5 How to use a 36
servomotor
3.6.8.6 Background on 37
servo’s 37
3.6.8.7 Applications of servomotor 38
3.6.9 MOTOR DRIVER IC 39
3.6.9.1 H-Bridge Circuit 40

viii
3.6.9.2 Pin diagram of a L293D 41
motor driver IC controller
3.6.10 DIRECT CURRENT(DC) MOTOR 42
3.6.10.1 Advantages of DC motor
44
3.6.10.2 Connecting DC
motor with controller 45
3.6.11 SHUNT MOTOR
3.6.11.1 Advantages of shunt 45
motor
3.6.11.2 Applications of shunt 46
motor
3.6.12 ULTRASONIC SENSOR 46
3.6.12.1 Sound waves 46
3.6.12.2 Transducers for wave 46
propagation and particle
detection 47
3.6.12.3 Ultrasonic sensor
48
3.6.12.4 HC-SR04 Sensor
features
50
3.6.12.5 HC-SR04 Ultrasonic
sensor working
20
3.6.12.6 Applications
53
3.7 SOFTWARE REQUIREMENTS
53

ix
3.7.1 EMBEDDED C 53
3.7.2 EMBEDDED SYSTEM PROGRAMMING 54
3.7.3 BASIC EMBEDDED C PROGRAMMING
55
3.7.4 CHARCTERISTICS OF EMBEDDED
SYSTEM 57

3.7.5 DESIGNING OF AN EMBEDDED


SYSTEM 58

3.7.5.1 Basic structure of an embedded


system 58

3.7.5.2 Embedded system tools


and peripherals 59

3.7.5.3 Debugging tools in an


embedded system 60
3.7.5.4 Microcontroller starter kit 61
3.7.6 PERIPHERAL DEVICES IN
EMBEDDED SYSTEM 62
3.7.6.1 Criteria for
choosing microcontroller 63
3.7.7 ARDUINO SOFTWARE IDE
63
3.7.7.1 Writing sketches
64
3.7.7.2 Sketch book
3.7.7.3 Tabs, multiple files and
76
compilation

x
3.7.7.4 Libraries 76
3.7.7.5 Third-party
77
hardware
78
3.7.7.6 Serial monitor
3.7.7.7 Preferences 78

3.7.7.8 Language support 80

80

4. RESULT 81
4.1 OUTPUT 81
5. CONCLUSION 82
6. CHAPTER 6: FUTURE ENHANCEMENT 83
5.1 APPLICATIONS 83
5.2 FUTURE ENHANCEMENTS 83
5.3 ADVANTAGES 83
7. REFERENCES 84

xi
LIST OF FIGURES

FIGURE NO NAME OF THE FIGURE PAGE NO

3.1 BLOCK DIAGRAM 1

3.2 BLOCK DIAGRAM OF ROBOT 8


CONTROL
3.3 BLOCK DIAGRAM OF OBSTACLES 9
DETECTION
3.4 BLOCK DIAGRAM OF BLOWER 9

3.5 ARDUINO UNO 12

3.6 PI 18
N DIAGRAM (ATMEGA 168)

3.7 ESP-12E BASED NODE MCU 24

3.8 NODE MCU PIN CONFIGURATION 25

3.9 ESP-12E ARCHITECTURE 26

3.10 ESP 32 CAM 29

xii
3.11 SERVOMOTOR SG-90 32

3.12 H BRIDGE MOTOR CONTROL 40


CIRCUIT USING L293D IC
3.13 H-BRIDGE CIRCIUT 41

3.14 L293D IC PIN CONFIGURATION 41

3.15 BRUSHLESS DC MOTOR WORK 43

3.16 DC MOTOR 44

3.17 SHUNT MOTOR CIRCUIT 45

3.18 ULTRASONIC SENSOR 49

3.19 WORKING OF ULTRASONIC 51


SENSOR
3.20 ULTRASONIC SENSOR CIRCUIT 52

3.21 BLOCK DIAGRAM OF EMBEDDED 54


SYSTEM
3.22 BLOCK DIAGRAM OF EMBEDDED 55
C PROGRAMMING
DEVELOPMENT

xiii
3.23 BLOCK DIAGRAM 55
REPRESENTATION OF EMBEDDED
C PROGRAMING STEPS
3.24 ARDUINO IDE PAGE OVERVIEW 64

3.24 WRITING SKETCHES 65

3.25 CREATING NEW FILE 66

3.26 EDITING 69

3.27 SKETCH 71

3.28 TOOLS 71

3.29 HELP TOOL 75

3.30 SKETCH BOOK 76

3.31 LIBRARIES 78

3.32 SERIAL MONITOR 79

4.1 CONTROLLER FOR ROBOT 81

4.2 ESP-32 CAM PICTURE 82

xiv
LIST OF ABBREVIATIONS

S.NO ABBREVIATION EXPANSION


1. IOT INTERNET OF THINGS
2. IMU INERTIAL MEASUREMENT UNIT
3. LCD LIQUID CRYSTAL DISPLAY
4. ESP CAM ELECTRO SELECTIVE PATTERN
5. LED LIGHT EMITTING DIODE
6. IDE INTEGRATED DEVELOPMENT
ENVIRONMENT
7. ICSP IN-CIRCUIT SERIAL
PROGRAMMING
8. DFU DEVICE FIRMWARE UPDATE
9. USB UNIVERSAL SERIAL BUS
10. VIN VOLTAGE INPUT
11. ADC ANALOG TO DIGITAL
CONVERTER
12. TTL TIME TO LIVE
13. PWM PULSE-WIDTH MODULATION
14. SPL SYSTEM PROGRAMMING
LANGUAGE
15. AREF ANALOGUE REFERENCE
16. DDR DOUBLE DATA RATE
17. LVDS LOW VOLTAGE DIFFER-ENTIAL
SIGNALING
18. PCB PRINTED CIRCUIT BOARD

xv
19. ISP INTERNET SERVICE PROVIDER
20. LNA LOW NOISE AMPLIFIER
21. RTOS REAL TIME OPERATING SYSTEM
22. DAC DEVELOPMENT ASSISTANCE
COMMITTEE
23. ASIC APPLICATION-SPECIFIC
INTEGRATED CIRCUIT
24. GPIO GENERAL PURPOSE
INPUT/OUTPUT
25. FOTA FIRMWARE OVER-THE-AIR

xvi
xvii
CHAPTER 1
INTRODUCTION

1.1 GENERAL
Modern households are becoming more automated thereby delivering
convenience and reducing time spent on house chores. While vacuum cleaners
have made home cleaning easier, they are largely noisy and bulky for everyday
use. It is therefore to improve the technology of vacuum cleaning to reduce
these deficiencies. Here, we report the development of a compact and efficient
vacuum cleaner for potential office and home use. The developed vacuum
cleaner is disk-shaped, equipped with vacuuming and cleaning technology and
controlled by Arduino mega microcontroller. It sucks dirt via a retractable
dustbin on top of which a cooling fan is mounted, and two sweepers each driven
by a 3 V DC motor. The robot navigates via two motor shield controlled rear
wheels and a front caster wheel which also governs its turning. Four ultrasonic
sensors, placed at 90° apart, detect obstacles and subsequently help the robot
navigate.

1.2 SCOPE OF THE PROJECT


The project development Vacuuming is an environmentally green and cost-
effective way to remove dust, debris, and other harmful particles.

1.3 EXISTING SYSTEM


 In Existing method, they clean the dust for manually.

18
1.3.1 EXISTING SYSTEM DISADVANTAGES
 The total system is fully manual as per the human has to clean the dust.

1.4. PROPOSED SYSTEM


1. In proposed method, the dust will be cleaned will be automatically through the IOT
device.
2. The robot can be controlled through IoT.

1.4.1 PROPOSED SYSTEM ADVANTAGES


1. The cleaning process will be automatically.

2. It can be deployed to any remote location as it is controlled through IoT.

19
CHAPTER 2
LITERATURE REVIEW

TITTLE 1: A smart autonomous floor cleaner with an Android based controller.

AUTHOR: Anshu Prakash Murdan, Pawan Kumar Ramkissoon

YEAR:2020

DESCRIPTION

Commercial automatic cleaning robots for households are quite common


nowadays. However, a robot that provides cleaning as well as mopping functions,
while being autonomous as well as remote-controlled, is quite expensive. This paper
presents the design and implementation of a smart autonomous floor cleaner with an
Android-based controller. The implementation is based on an Arduino MEGA
microcontroller, a floor cleaner system and a mobile application with wireless
connectivity. The Android application features a secure user login system and
connects to the robot cleaner through Bluetooth. It can be used to control the robot
motion to guide it in a specific direction to vacuum or mop the floor. The user has
complete control over the robot either in the autonomous or remote-controlled mode.
The implemented cleaning system consists of five main blocks namely the power block
(rechargeable dc battery), the motor system (driving wheels, rotating brush, vacuum
fan, water pump), communication block (Bluetooth control, HC 06 Bluetooth
module) and software block (Android remote-controlled). Uponthe implementation
and testing of this prototype, it was observed that the robot works as programmed,
and is equipped with most of the functionalities of a household commercial state-of-
art cleaning robot.

20
TITTLE 2: Robotic Vacuum Cleaner Using Arduino with wi-fi

AUTHOR: P. B. Jarande., S. P. Murakar, N. S. Vast, N. P. Ubale, S. S. Saraf.

YEAR: 2018

DESCRIPTION

In last few years, robotic cleaners have taken major attention in robotics
research due to their effectiveness to helping humans or cleaning applications at
various areas in society. Generally, robotic cleaners are differentiating on their
cleaning expertise. Some products are based on obstacle avoidance using infrared
sensors while some uses laser mapping technique. Every cleaning mechanism of
robotic cleaners has its own pros and cons. Robots uses laser mapping are relatively
faster, less time consuming and energy efficient but costly, while obstacle avoidance-
based robots are relatively time consuming and less energy efficient due to random
cleaning but less costly. The prime objective of this work is to provide a substantial
solution to the problem of manufacturing robotic cleaner utilizing local resources
while keeping.

TITTLE 3: Autonomous Self-Reconfigurable Floor Cleaning Robot.

AUTHOR: RizuwanaParween, Manuel Vega Heredia, Madan Mohan Ray guru,


Raihan Enjikalayil Abdulkader, And Mohan Rajesh Elara

YEAR:2022

DESCRIPTION

The cleaning robots are going through some significant development in


recent years, driven by the greater market penetration and the demand for better
21
cleaning performance. However, most of the robots have problems covering the total
cleaning area given geometric limitations of the platforms in relation to the cleaning
stage, given furniture and architecture. In this paper, we describe the h-Tri-Hex
platform, which is a self- reconfigurable adaptive robot that attains three different
configurations. The change in configuration gives rise to variation in the kinematic
model, which in turn changes the behavior of robot locomotion. The change in
configuration and the robot position is evaluated using the measurements from the
on-board sensors like the encoders, LIDAR, and inertial measuring unit (IMU).
These data are then utilized to develop a new cascade control strategy for motion
control of h-Tri-Hex. The control cascade comprises of a robust backstepping controller
in the outer loop for tackling the varying kinematic and a conventional PID in the
inner loop for speed control. This cascade is appended by a PID controller, for
correcting the wheel orientation after each configuration change. The proposed
design assures asymptotic path tracking and satisfactory closed-loop performance,
which are validated through numerical simulations and experiments.

TITTLE 4: Sweepy – The Smart Floor Cleaner

AUTHOR: Varsha. P.H, Lavanya V, Meghana K, Rohan P S, Sneha R

YEAR: 2018

DESCRIPTION

The world today is governed by automation. When complex operations are


made automated to simplify tasks, the benefits of automation can also be tapped to
perform simple household tasks. One such task is cleaning. Cleaning, though
undermined for its nature of work, is extremely vital. Cleanliness begets a healthy life.

22
However, in the hustleand bustle in today’s world cleanliness has been neglected.
SWEEPY, the smart floor cleaner is both an autonomous and manual controlled
cleaning machine used to simplify and achieve the task of cleaning. By means of its
dry and wet modes all round cleanliness and hence good health is achieved.

TITTLE 5: Design of a Smart Vacuum Cleaner with Indoor Localization.

AUTHOR: JulideToprak, Pinar

YEAR:2019

DESCRIPTION

Cleaning houses is very difficult for people in terms of time and labor. The fact that
vacuum cleaners are wired and slow is not advantageous in terms of ease of use. For this
reason, many robot vacuum cleaners that can replace traditional vacuum cleaners have
started to appear on the market. In our project, we aimed to design and simulate a smart
vacuum cleaner. The smart vacuum cleaner will work with a map by detecting the
environment and obstacles around it.

23
CHAPTER 3

PROJECT DESCRIPTION

3.1 GENERAL

Household cleaning is a repetitive task carried out by number of people every


day. Hence there is a need of bringing revolution in the area of science and
technologies, which could help easily in repetitive tasks which we perform daily and
also giving consideration to theintensity of the labor required and improving qualities
to its optimum level. Existing vacuum cleaner systems equipped with limited suction
power. They are costly, complex. Vacuum cleaner was manual. There are already
several big bulky cleaning machines available in the market which is capable of
cleaning the remote area which is not in the reach. The need of designing new
technology based vacuum cleaner which could overcome the short coming of
existing vacuum cleaner also provide a new facilities of vacuuming sanitizing using
UV light. They need to be work manually because they were not automated.
Vacuuming is one of the most hated chores in existence.

3.2 BLOCK DIAGRAM


The block diagram of the project was shown in fig 3.1. The components are
divided into three modules.

3.3 MODULES NAME


 ROBOT CONTROL.
 OBSTACLES DETECTION.
 BLOWER.

24
12V BATTERY

LCD DISPLAY
ULTRASONIC
SENSOR (4)
IOT

BLOWER
MOTOR MOTOR
ARDUINO
UNO DRIVER

DC MOTOR (2)

SERVO
MOTOR (2)

ESP-32 CAM
VIDEO

Fig 3.1 Block Diagram

25
3.4 MODULE DESCRIPTION

 ROBOT CONTROL
In this section we are control the robot by DC motor. The DC motor is
used for movement of the robot. Motor driver is the controller of DC motor. The LCD
display will show the information. Here IOT is used to control our entire system of
robot. Fig 3.2shows the block diagram of Robot Control.

12V
BATTERY

LCD DISPLAY
MOTOR
DRIVER
ARDUINO
IOT
UNO
DC MOTOR -2

Fig 3.2 Block Diagram of Robot Control

 OBSTACLES DETECTION
In this section we use ultrasonic sensor, servomotor, lcd, ESP32 Cam.
Ultrasonicsensor used for detect the object. ESP 32Cam is used to locate the dust in our
place and servomotor is used to control the ESP32 Cam. LCD display all the
information. Fig 3.3shows the block diagram of Obstacles Detection.

26
12V
BATTERY

LCD DISPLAY

ULTRASONIC (4) SERVOMOTRO (2)


ARDUINO
UNO
ESP-32 CAM
VIDEO

Fig 3.3 Block Diagram of Obstacles Detection.

 BLOWER
In this section we use blower motor. The blower motor used to suck the
dusts when the ESP32 Cam locate the duct in our place. Fig 3.4 shows the block
diagram ofBlower

12V
BATTERY

ARDUINO
BLOWER
MOTOR UNO

Fig 3.4 Block Diagram of Blower

27
3.5 WORKING
In this proposed method, ARDUINO UNO microcontroller is used to interface
withthe sensors and to the communication devices. The IOT are used to control the
total entiresystem in this system by using the command. The distance of the obstacles
is detected using the ultrasonic sensors and the robot will be move by the command
from the IOT. The blower motor is used to in hell the dust to the dust container box.
The LCD are used to display updated information from the sensor.

3.6 HARDWARE DESCRIPTION


3.6.1 ARDUINO
3.6.1.1 Introduction to Arduino
Arduino is an open-source electronics platform based on easy-to-use
hardware and software. Arduino board 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 aset of instructions to the microcontroller on the board.

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.

8-bit boards to products

28
for IoT applications, wearable, 3D printing, and embedded environments. All
Arduino boards are completely open-source, empowering users to build them
independently and eventually adapt them to their particular needs. The software too,
is open-source, and it is growing through the contributions of users worldwide.

3.6.1.2 Why Arduino

 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
$50.

 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.


29
 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.

3.6.1.3 Arduino UNO

The UNO is the best board to get started with electronics and
coding. If this is your first experience tinkering with the platform, the UNO is
the most robust board you can start playing with. The UNO is the most used and
documented board of the whole Arduino family. Fid 3.5 shows the Arduino Uno

Fig 3.5 Arduino Uno

30
Arduino Uno is a microcontroller board based on the ATMEGA
328P (datasheet). It has 14 digital input/output pins (of which 6 can be used as
PWM outputs), 6 analog inputs, a 16 MHz quartz crystal, a USB connection,
a power
jack, an ICSP header and a reset button. It contains everything needed to
support
the microcontroller; simply connect it to a computer with a USB cable or power it with
an AC-to-DC adapter or battery to get started. You can tinker with your UNO without
worrying too much about doing something wrong, worst-case scenario you can replace
the chip for a few dollars and start over again.

Table 3.1 TECHNICAL SPECIFICATIONS:


Microcontroller ATMEGA 328P
Operating Voltage 5V
Input Voltage 7-12V
(recommended)
Input Voltage (limit) 6-20V
Digital I/O Pins 14 (of which 6 provide PWM output)
PWM Digital I/O Pins 6
Analog Input Pins 6
DC Current per I/O Pin 20 mA
DC Current for 3.3V Pin 50 mA
Flash Memory 32 KB (ATMEGA 328P) of which 0.5 KB used
by
boot loader
SRAM 2 KB (ATMEGA 328P)
EEPROM 1 KB (ATMEGA 328P)
Clock Speed 16 MHz

31
LED_BUILTIN 13
Length 68.6 mm
Width 53.4 mm
Weight 25 g

3.6.1.4 Hardware

Arduino is open-source hardware. The hardware reference designs are


distributed under a creative common Attribution Share-Alike 2.5 license and are available
on the Arduino website. Layout and production files for some versions of the hardware are
also available.

Although the hardware and software designs are freely available under copy
left licenses, the developers have requested the name Arduino to be exclusive to the official
product and not be used for derived works without permission. The official policy document on

use of the Arduino name emphasizes that the project is open to incorporating work by
others into the official product. Several Arduino-compatible products commercially
released have avoided the project name by using various names ending in -Duino. An early
Arduino board with an RS-232 serial interface (upper left) and an Atmel ATMEGA 8
microcontroller chip (black, lower right); the 14 digital I/O pins are at the top, the 6 analog
input pins at the lower right, and the power connector at the lower left.

Most Arduino boards consist of an Atmel 8-bit AVR microcontroller (ATMEGA 8,


ATMEGA 168, ATMEGA 328, ATMEGA 1280, ATMEGA 2560) with varying amounts of
flash memory, pins, and features. The 32-bit Arduino Due, based on theAtmel SAM3X8E was
introduced in 2012. The boards use single or double-row pins or female headers that
facilitate connections for programming and incorporation into other circuits. These may
connect with add-on modules termed shields. Multiple and possibly stacked shields may

32
be individually addressable via an I^2C serial bus. Most boards include a 5 V linear regulator
and a 16 MHz crystal oscillator or ceramic resonator. Some designs, such as the Lilypad, run at
8 MHz and dispense with the onboard voltage regulator due to specific form-factor restriction

3.6.1.5 Programming
The Arduino Uno can be programmed with the ( Arduino Software (IDE)).
Select "Arduino/Genuino Uno from the Tools >Board menu (according to the
microcontroller on your board). For details, see the reference and tutorials. The
ATMEGA 328 on the Arduino Uno comes preprogrammed with a boot loader that
allows you to upload new code to it without the use of an external hardware
programmer. It communicates using the original STK500 protocol (reference, C
header files).

You can also bypass the boot loader and program the microcontroller
through the ICSP (In-Circuit Serial Programming) header using Arduino ISP or similar;
see these instructions for details.
The ATMEGA 16U2 (or 8U2 in the rev1 and rev2 boards) firmware
source code is available in the Arduino repository. The ATMEGA 16U2/8U2 is

33
loaded with a DFU boot loader, which can be activated by:

 On Rev1 boards: connecting the solder jumper on the back of the board (near the
map of Italy) and then reseing the 8U2.

 On Rev2 or later boards: there is a resistor that pulling the 8U2/16U2 HWB line to
ground, making it easier to put into DFU mode.
You can then use Atmel's FLIP software (Windows) or the DFU
programmer (Mac OS X and Linux) to load a new firmware. Or you can use the ISP
header with an external programmer (overwriting the DFU boot loader).

3.6.1.6 Power
The Arduino Uno board can be powered via the USB connection or with
an external power supply. The power source is selected automatically. External (non-
USB) power can come either from an AC-to-DC adapter (wall-wart) or battery. The
adapter can be connected by plugging a 2.1mm center-positive plug into the board's
power jack. Leads from a battery can be inserted in the GND and Vin pin headers of
the POWER connector. The board can operate on an external supply from 6 to 20 volts.
If supplied with less than 7V, however, the 5V pin may supply less than five volts and
the board may become unstable. If using more than 12V, the voltage regulator may
overheat and damage the board. The recommended range is 7 to 12 volts.

The power pins are as follows:

 Vin. The input voltage to the Arduino/Genuino board when it's using an external power
source (as opposed to 5 volts from the USB connection or

34
other regulated power source). You can supply voltage through this pin, or,
if supplying voltage via the power jack, access it through this pin.

 5V. This pin outputs a regulated 5V from the regulator on the board. The board can
be supplied with power either from the DC power jack (7 - 12V), the USB connector
(5V), or the VIN pin of the board (7 -12V). Supplying voltage via the 5V or 3.3V pins
bypasses the regulator, and can damage your board. We don't advise it.

 3V3. A 3.3-volt supply generated by the on-board regulator. Maximum current draw
is 50 mA.

 GND. Ground pins.

 IOREF. This pin on the Arduino/Genuino board provides the voltage reference with
which the microcontroller operates. A properly configured shield can read the IOREF
pin voltage and select the appropriate power source or enable voltage translators on
the outputs to work with the 5V or 3.3V.

3.6.1.7 Memory
The ATMEGA 328 has 32 KB (with 0.5 KB occupied by the boot loader).
It also has 2 KB of SRAM and 1 KB of EEPROM (which can be read and written with
the EEPROM library).
3.6.1.8 Input and Output
See the mapping between Arduino pins and ATMEGA 328P ports. The
mapping for the ATMEGA 8, 168, and 328 is identical.
Note that this chart is for the DIP-package chip. The Arduino Mini is based
upon a smaller physical IC package that includes two extra ADC pins, which are not
available in the DIP-package Arduino implementations. Fig 3.6 shows the pin diagram of
(ATMEGA 168).
35
Fig 3.6 Pin Diagram (ATMEGA 168)

Each of the 14 digital pins on the Uno can be used as an input or output,
using pin Mode(), digital Write(), and digital Read() functions. They operate at
5 volts. Each pin can provide or receive 20 mA as recommended operating condition
and has an internal pull-up resistor (disconnected by default) of 20 -50k ohm. A
maximum of 40mA is the value that must not be exceeded on any I/O pin to avoid
permanent damage to the microcontroller.

In addition, some pins have specialized functions:


 Serial: 0 (RX) and 1 (TX). Used to receive (RX) and transmit (TX) TTL serial
data. These pins are connected to the corresponding pins of the ATMEGA 8U2
USB-to-TTL Serial chip.

 External Interrupts: 2 and 3. These pins can be configured to trigger an


36
interrupt on a low value, a rising or falling edge, or a change in value. See the
attach Interrupt () function for details.

 PWM: 3, 5, 6, 9, 10, and 11. Provide 8-bit PWM output with the Analog Write
() function.

 SPI: 10 (SS), 11 (MOSI), 12 (MISO), 13 (SCK). These pins support SPI


communication using the SPI library.

 LED: 13. There is a built-in LED driven by digital pin 13. When the pin is
HIGH value, the LED is on, when the pin is LOW, it's off.

 TWI: A4 or SDA pin and A5 or SCL pin. Support TWI communication using
the Wire library.

 AREF. Reference voltage for the analog inputs. Used with Analog
Reference ().

 Reset. Bring this line LOW to reset the microcontroller. Typically used to
add a reset button to shields which block the one on the board.

3.6.1.9 Communication

Arduino/Genuino Uno has a number of facilities for communicating with


a computer, another Arduino/Genuino board, or other microcontrollers. The
ATMEGA 328 provides UART TTL (5V) serial communication, which is available
on digital pins 0 (RX) and 1 (TX). An ATMEGA 16U2 on the board channels this
serial communication over USB and appears as a virtual com port to software on the
computer. The 16U2 firmware uses the standard USB COM drivers, and no external

37
driver is needed. However, on Windows, a .inf file is required. The Arduino Software
(IDE) includes a serial monitor which allows simple textual datato be sent to and from
the board. The RX and TX LEDs on the board will flash when data is being
transmitted via the USB-to-serial chip and USB connection to the computer

A Software Serial library allows serial communication on any of the


Uno's digital pins.

3.6.1.10 Applications
 Arduboy, a hand-held game console based on Arduino.
 Arduino me, a MIDI controller device that mimics the Mono-me.
 Ardupilot, drone software and hardware.
 Ardusat, a CubeSat based on Arduino.
 C-Stem Studio, a platform for hands-on integrated learning of computing, science,
technology, engineering, and mathematics (C-STEM) with robotics.
 Data loggers for scientific research.
 OBDuino, a trip computer that uses the on-board diagnostics interface found in most
modern cars.
 OPenEVSE an open-source electric vehicle charger.
 XOD, a visual programming language for Arduino.

3.6.2 12V BATTERY

A battery is a source of electric power consisting of one or more electrochemical


cells with external connections for powering electrical devices such as flashlights, mobile
phones and electric cars. When a battery is supplying electric power, its positive terminal
is the cathode and its negative terminal is the anode. The terminal marked negative is the
source of electrons that will flow through an external electric circuit to the positive
38
terminal. When a battery is connected to an external electric load, a redox reaction converts
high-energy reactants to lower-energy products, and the free-energy difference is delivered
to the external circuit as electrical energy. Historically the term "battery" specifically
referred to a device composed of multiple cell however the usage has evolved to include
devices composed of a single cell. Primary (single-use or “disposable") batteries are used
once and discarded, as the electrode materials are irreversibly changed during discharge;
a common example is the alkaline material used for flashlights and a multitude of portable
electronic devices. Secondary (rechargeable) batteries can be discharged and recharged
multiple times using an applied electric current; the original composition of the electrodes
can be restored by reverse current. Examples include the lead-acid batteries used in
vehicles and lithium-ion batteries used for portable electronics such as laptops and mobile
phones.

Batteries come in many shapes and sizes, from miniature cells used to power hearing
aids and wrist watches to small, thin cells used in smartphones, to large lead-acid batteries
or lithium-ion batteries in vehicles, and at the largest extreme, huge battery banks the size of
rooms that provide standby or emergency power for telephones exchanges and computer data
centers.

Batteries have much lower specific energy (energy per unit mass) than common fuels such
as gasoline. In automobiles, this is somewhat offset by the higher efficiency of electric
motors in converting electrical energy to mechanical work, compared to combustion
engines.

3.6.3 INTERNET OF THINGS

The internet of things (IoT) is the network of physical devices, vehicles, buildings
and other items embedded with electronics, software, sensors, actuators, and network
connectivity that enable these objects to collect and exchange data. In 2013 the Global
39
Standards Initiative on Internet of Things (IoT-GSI) defined the IoT as "the infrastructure
of the information society. The IoT allows objects to be sensed and controlled remotely
across existing network infrastructure, creating opportunities for more direct integration of
the physical world into computer-based systems, and resulting in improved efficiency,
accuracy and economic benefit. When IoT is augmented with sensors and actuators, the
technology becomes an instance of the more general class of cyber-physical systems,
which also encompasses technologies such as smart grids, smart homes, intelligent
transportation and smart cities. Each thing is uniquely identifiable through its embedded
computing system but is able to interoperate within the existing Internet infrastructure.
Experts estimate that the IoT will consist of almost 50 billion objects by 2020.

3.6.4 INFRASTRUCTURE

The Internet of Things will become part of the fabric of everyday life. It will
become partof our overall infrastructure just like water, electricity, telephone, TV and most
recently the Internet. Whereas the current Internet typically connects full-scale computers,
the Internet of Things will connect everyday objects with a strong integration into the
physical world.

3.6.4.1 Plug and Play Integration

If we look at IoT-related technology available today, there is a huge heterogeneity.


It is typically deployed for very specific purposes and the configuration requires significant
technical knowledge and may be cumbersome. To achieve a true Internet of Things we
need to move away from such small-scale, vertical application silos, towards a horizontal
infrastructure on which a variety of applications can run simultaneously.

40
3.6.4.2 Infrastructure Functionality

The infrastructure needs to support applications in finding the things required.


An application may run anywhere, including on the things themselves. Finding things is
not limited to the start-up time of an application. Automatic adaptation is needed whenever
relevant new things become available, things become unavailable or the status of things
changes. The infrastructure has to support the monitoring of such changes and the
adaptation that is required as a result of the changes.Physical Location and Position

As the Internet of Things is strongly rooted in the physical world, the notion
of physical location and position are very important, especially for finding things, but also
for deriving knowledge. Therefore, the infrastructure has to support finding things
according to location (e.g., geo-location-based discovery). Taking mobility into account,
localization technologies will play an important role for the Internet of Things and may
become embedded into the infrastructure of the Internet of Things.

3.6.4.3 Security and Privacy

In addition, an infrastructure needs to provide support for security and privacy


functions including identification, confidentiality, integrity, non-repudiation
authentication and authorization. Here the heterogeneity and the need for interoperability
among different ICT systems deployed in the infrastructure and the resource limitations of
IoT devices (e.g., Nano sensors) have to be taken into account.

3.6.4.4 Data Management

Data management is a crucial aspect in the Internet of Things. When considering a


worldof objects interconnected and constantly exchanging all types of information, the
volume of the generated data and the processes involved in the handling of those data
become critical. A long-term opportunity for wireless communications chip makers is the
41
rise of Machine-to-Machine (M2M) computing, which one of the enabling technologies
for Internet of Things. This technology spans abroad range of applications. While there is
consensus that M2M is a promising pocket of growth, analyst estimates on the size of the
opportunity diverge by a factor of four. Conservative estimates assume roughly 80 million
to 90 million M2M units will be sold in 2014, whereas more optimistic projections forecast
sales of 300 million units. Based on historical analyses of adoption curves for similar
disruptive technologies, such as portable MP3 players and antilock braking systems for cars, it
is believed that unit sales in M2M could rise by as much as a factor of ten over the next five
years, see Figure 2.29. There are many technologies and factors involved in the “data
management” within the IoT context. Some of the most relevant conceptswhich enable
us to understand the challenges and opportunities of data management are:
• Data Collection and Analysis
• Big Data
• Semantic Sensor Networking
• Virtual Sensors
• Complex Event Processing.

3.6.5 ESP-12E BASEDNODEMCU

The ESP8266 is the name of a micro controller designed by Espressif Systems. The
ESP8266 itself is a self-contained Wi-Fi networking solution offering as a bridge from
existing micro controller to Wi-Fi and is also capable of running self-contained
applications. This module comes with a built in USB connector and a rich assortment of
pin-outs. With a micro-USB cable, you can connect Node-MCU dev kit to your laptop and
flash it without any trouble, just like Arduino. It is also immediately breadboard friendly.
Fig 3.7 shows the Esp-12E Based Node MCU

42
Fig 3.7 ICEsp-12E Based Node MCU
ESP-12E Wi-Fi module is developed by Ai-thinker Team. core processor ESP8266 in
smaller sizes of the module encapsulates Ten silica L106 integrates industry-leading ultra-
low power 32-bit MCU micro, with the 16-bit short mode, Clock speed support 80 MHz,
160 MHz, supports the RTOS, integrated Wi-Fi MAC/BB/RF/PA/LNA, on-board antenna. The
module supports standard IEEE802.11 b/g/n agreement, complete TCP/IP protocol stack.
Users can use the add modules to an existing device networking, or building a separate
network controller. ESP8266 is high integration wireless SOCs, designed for space and
power constrained mobile platform designers, Fig 3.8 shows the Node MCU pin
configuration.

Fig 3.8Node MCU pin configuration


43
ESP8266EX offers a complete and self-contained Wi-Fi networking solution; it can be
used to host the application or to offload Wi-Fi networking functions from another
application processor. When ESP8266EX hosts the application, it boots up directly from
an external flash. In has integrated cache to improve the performance of the system in such
applications. Alternately, serving as a Wi-Fi adapter, wireless internet access can be added
to any micro controller-based design with simple connectivity (SPI/SDIO or I2C/UART
interface). ESP8266EX is among the most integrated Wi-Fi chip in the industry; it
integrates the antenna switches, RF balun, power amplifier, low noise receive amplifier,
filters, power management modules, it requires minimal external circuitry, and the entire
solution, including front-end module, is designed to occupy minimal PCB area.

Fig 3.9 shows the architecture of ESP-12E.

Fig 3.9ESP-12E Architecture


ESP8266EX also integrates an enhanced version of Ten silica’s L106 Diamond series 32-
bit processor, with on-chip SRAM, besides the Wi-Fi functionalities. ESP8266EX is often
integrated with external sensors and other application specific devices through its GPIOs;
codes for such applications are provided in examples in the SDK. Expressif Systems’
44
Smart Connectivity Platform (ESCP) demonstrates sophisticated system-level features
include fast sleep/wake context switching for energy-efficient VoIP, adaptive radio
biasing. For low-power operation, advance signal processing, and spur cancellation and
radio co-existence features for common cellular, Bluetooth, DDR, LVDS, LCD
interference mitigation.

Features
 802.11 b/g/n
 Integrated low power 32-bit MCU
 Integrated 10-bit ADC
 Integrated TCP/IP protocol stack
 Integrated TR switch, balun, LNA, power amplifier and matching network
 Integrated PLL, regulators, and power management units
 Supports antenna diversity
 Wi-Fi 2.4 GHz, support WPA/WPA2
 Support STA/AP/STA+AP operation modes
 Support Smart Link Function for both Android and iOS devices
 Support Smart Link Function for both Android and iOS devices
 SDIO 2.0, (H) SPI, UART, I2C, I2S, IRDA, PWM, GPIO
 STBC, 1x1 MIMO, 2x1 MIMO
 A-MPDU & A-MSDU aggregation and 0.4s guard interval
 Deep sleep power < 5uA
 Wake up and transmit packets in < 2ms
 Standby power consumption of < 1.0mW (DTIM3)
 +20dBm output power in 802.11b mode
 Operating temperature range -40C ~ 125C

45
3.6.6 ESP32 CAM

3.6.6.1 Introduction

The ESP32-CAM is a full-featured microcontroller that also has an integrated


videocamera and microSD card socket. It’s inexpensive and easy to use, and is perfect for
IoT devices requiring a camera with advanced functions like image tracking and
recognition. The sample software distributed by Espressif includes a sketch that allows
you to build a web-based camera with a sophisticated control panel. After you get the
hang of programming the device, you’ll find that it is very easy to use.
Not bad for a board that costs about ten dollars, including the camera!

3.6.6.2 Working with the ESP32-Cam

Using the ESP32-CAM is similar to using the ESP32 modules we looked at


previously, with one major difference. The ESP32-CAM board has no USB port, so you
can’t just connect it up to your computer and start loading programs.
Instead, you will need to add an external FTDI adapter. This is the same adapter you would use
programming an Arduino Pro Mini, so if you’ve worked with the Pro Mini then you
probably already have one of these.

3.6.6.3 Examining the ESP32-Cam

The ESP32-CAM module has fewer I/O pins than the previous ESP-32
module welooked at. Many of the GPIO pins are used internally for the camera and the
microSD cardport. Another thing missing from the ESP32-CAM module is a USB port. In
order to program this device, you’ll need to make use of an FTDI adapter. This will be
described further on in this article. Fig 3.10 shows the ESP 32 Cam diagram.

Here is the pinout of the ESP32-CAM Module:

46
Fig 3.10 ESP 32 Cam

One thing to note about this module is that it has components on both sides of the
printed circuit board. The “top” of the board has the connector for the camera module, as
well as the microSD (sometimes called “TF”) card socket. You’ll also note a square white
LED on the top of the module, this can act as a “flash” for illuminating the subject you are
trying to view with the camera. The underside of the circuit board has the ESP32-S module.
It also has a connector for an external antenna, as well as an internal antenna that is etched
onto the circuit board. I’ll explain how to use the external antenna shortly. Another key
component located underneath the board is the reset switch. Because there are so many
components on the bottom of the module you may find it easier not to use a solderless
breadboard when experimenting with the ESP32-CAM module. The use of jumpers with
female Dupont connectors is recommended.

3.6.6.4 ESP32-CAM Specifications

The ESP32-CAM is based upon the ESP32-S module, so it shares the same
specifications. It has the following features:
 802.11b/g/n Wi-Fi
 Bluetooth 4.2 with BLE
 UART, SPI, I2C and PWM interfaces
 Clock speed up to 160 MHz
47
 Computing power up to 600 DMIPS
 520 KB SRAM plus 4 MB PSRAM
 Supports WIFI Image Upload
 Multiple Sleep modes
 Firmware Over the Air (FOTA) upgrades possible
 9 GPIO ports
 Built-in Flash LED

3.6.6.5 Camera Specifications

The ESP32-CAM includes an OV2640 camera module. The device also supports
OV7670cameras. The OV2640 has the following specifications:
 2 Megapixel sensor
 Array size UXGA 1622×1200
 Output formats include YUV422, YUV420, RGB565, RGB555 and 8-bit compressed
data
 Image transfer rate of 15 to 60 fps

3.6.7 LCD (Liquid Crystal Display)

LCD screen is an electronic display module and find a wide range of applications.
A 16x2 LCD display is very basic module and is very commonly used in various devices
and circuits. These modules are preferred over seven segments and other multi segment
LEDs. The reasons being: LCDs are economical; easily programmable; have no limitation
of displaying special & even custom characters (unlike in sevensegments), animations
and so on.

A 16x2 LCD means it can display 16 characters per line and there are 2 such lines. In this

48
LCD each character is displayed in 5x7 pixel matrix. This LCD has two registers, namely,
Command and Data. The command register stores the command instructions given to the
LCD. A command is an instruction given to LCD to do a predefined task like initializing
it, clearing its screen, setting the cursor position, controlling display etc. The data register
stores the data to be displayed on the LCD. The data is the ASCII value of the character to
be displayed on the LCD. Click to learn more about internal structure of a LCD.

3.6.7.1 Pin Diagram

Table 3.2Pin Description:

Pin
Function Name
No
1 Ground (0V) Ground
2 Supply voltage; 5V (4.7V – 5.3V) Vcc
3 Contrast adjustment; through a variable resistor VEE
Selects command register when low; and data register when
4 Register Select
high

49
5 Low to write to the register; High to read from the register Read/write
6 Sends data to data pins when a high to low pulse is given Enable
7 DB0
8 DB1
9 DB2
10 DB3
8-bit data pins
11 DB4
12 DB5
13 DB6
14 DB7
15 Backlight VCC (5V) Led+
16 Backlight Ground (0V) Led-

3.6.8 SERVO MOTORS

Fig 3.11 Servo motor SG-90

50
A Servo Motor is a small device that has an output shaft. This shaft can be positioned to
specific angular positions by sending the servo a coded signal. As long as the coded
signal exists on the input line, the servo will maintain the angular position of the shaft.
If the coded signal changes, the angular position of the shaft changes. In practice, servos
are used in radio-controlled airplanes to position control surfaces like the elevators and
rudders. They are also used in radio-controlled cars, puppets, and of course, robots. Fig
3.11 shows the Servo motor SG-90 diagram.

Servo motors use feedback to determine the position of the shaft, you can control that
position very precisely. As a result, servo motors are used to control the position of
objects, rotate objects, move legs, arms or hands of robots, move sensors etc. with high
precision. Servo motors are small in size, and because they have built-in circuitry to
control their movement, they can be connected directly to an Arduino. Tiny and
lightweight with high output power. Servo can rotate approximately 180 degrees (90 in
each direction), and works just like the standard kinds but smaller. You can use any servo
code, hardware or library to control these servos. Good for beginners who want to make
stuff move without building a motor controller with feedback & gear box, especially
since it will fit in small places. It comes with3 horns (arms) and hardware.

3.6.8.1 Specifications

 Weight: 9 g
 Dimension: 22.2 x 11.8 x 31 mm approx.
 Stall torque: 1.8 kg. -cm
 Operating speed: 0.1 s/60 degree
 Operating voltage: 4.8 V (~5V)
 Dead band width: 10 µs
Temperature range: 0 ºC – 55 ºC
Most servo motors have the following three connections:

51
 Black/Brown ground wire.
 Red power wire (around 5V).
 Yellow or White PWM wire. 

In this experiment, we will connect the power and ground pins directly to the Arduino
5V and GND pins. The PWM input will be connected to one of the Arduino's digital
output pins

3.6.8.2 Servo Mechanism

It consists of three parts:

1. Controlled device
2. Output sensor
3. Feedback system

It is a closed loop system where it uses positive feedback system to control motion and
final position of the shaft. Here the device is controlled by a feedback signal generated by
comparing output signal and reference input signal. Here reference input signal is
compared to reference output signal and the third signal is produces by feedback system.
And this third signal acts as input signal to control device. This signal is present as long as
feedback signal is generated or there is difference between reference input signal and
reference output signal. So, the main task of servomechanism is to maintain output of a
system at desired value at presence of noises.

3.6.8.3 Working principle of Servo Motors

A servo consists of a Motor (DC or AC), a potentiometer, gear assembly and a


controllingcircuit. First of all, we use gear assembly to reduce RPM and to increase torque
of motor.Say at initial position of servo motor shaft, the position of the potentiometer knob

52
is suchthat there is no electrical signal generated at the output port of the potentiometer.
Now anelectrical signal is given to another input terminal of the error detector amplifier.
Now difference between these two signals, one comes from potentiometer and another
comes from other source, will be processed in feedback mechanism and output will be
provided in term of error signal. This error signal acts as the input for motor and motor starts
rotating. Now motor shaft is connected with potentiometer and as motor rotates so the
potentiometer and it will generate a signal. So as the potentiometer’s angular position
changes, its output feedback signal changes. After sometime the position of potentiometer
reaches at a position that the output of potentiometer is same as external signal provided.
At this condition, there will be no output signal from the amplifier to the motor input as
there is no difference between external applied signal and the signal generated at
potentiometer, and in this situation motor stops rotating.

Table 3.3 Wire configuration:

Wire Wire Color Description


Number
1 Brown Ground wire connected to the ground of the system

2 Red Powers the motor typically +5v is used

3 Orange PWM signal is given in through this wire to drive the


motor

3.6.8.4 Working of a Servo Motor

The servo motor has some control circuits and a potentiometer (a variable resistor,
aka pot) connected to the output shaft. In the picture above, the pot can be seen on the
right side of the circuit board. This pot allows the control circuitry to monitor the current
angleof the servo motor.

53
If the shaft is at the correct angle, then the motor shuts off. If the circuit finds that the
angle is not correct, it will turn the motor until it is at a desired angle. The output shaft of
the servo is capable of traveling somewhere around 180 degrees. Usually, it is somewhere
in the 210-degree range, however, it varies depending on the manufacturer. A normal
servo is used to control an angular motion of 0 to 180 degrees. It is mechanically not
capable of turning any farther due to a mechanical stop built on to the main output gear.

The power applied to the motor is proportional to the distance it needs to travel. So, if the
shaft needs to turn a large distance, the motor will run at full speed. If it needs to turn only
a small amount, the motor will run at a slower speed. This is called proportional control.

Selecting your Servo Motor

There are lots of servo motors available in the market and each one has its own
specialty and applications. The following two paragraphs will help you identify the right
type of servo motor for your project/system.

Most of the hobby Servo motors operates from 4.8V to 6.5V, the higher the voltage higher
the torque we can achieve, but most commonly they are operated at +5V. Almost all hobby
servo motors can rotate only from 0° to 180° due to their gear arrangement so make sure
you project can live with the half circle if no, you can prefer for a 0° to 360° motor or
modify the motor to make a full circle. The gears in the motors are easily subjected to wear
and tear, so if your application requires stronger and long running motors you can go with
metal gears or just stick with normal plastic gear.
Next comes the most important parameter, which is the torque at which the motor operates.
Again, there are many choices here but the commonly available one is the 2.5kg/cm torque
which comes with the Tower-pro SG90 Motor. This 2.5kg/cm torque means that the motor
can pull a weight of 2.5kg when it is suspended at a distance of 1cm.So, if you suspend the
load at 0.5cm then the motor can pull a load of 5kg similarly if yoususpend the load at 2cm

54
then can pull only 1.25. Based on the load which you use in the project you can select the
motor with proper torque. The below picture will illustrate the same.

3.6.8.5 How to use a Servo Motor

After selecting the right Servo motor for the project, comes the question how to use
it. Aswe know there are three wires coming out of this motor. The description of the same
is given on top of this page. To make this motor rotate, we have to power the motor with
+5Vusing the Red and Brown wire and send PWM signals to the orange color wire. Hence,
we need something that could generate PWM signals to make this motor work, this
something could be anything like a 555 Timer or other Microcontroller platforms like
Arduino, PIC, ARM or even a microprocessor like Raspberry Pie. Now, how to control the
direction of the motor? To understand that let us a look at the picture given in the datasheet.

From the picture we can understand that the PWM signal produced should have a
frequency of 50Hz that is the PWM period should be 20ms. Out of which the On-Time can
vary from 1ms to 2ms. So, when the on-time is 1ms the motor will be in 0° and when 1.5ms
the motor will be 90°, similarly when it is 2ms it will be 180°. So, by varying the on-time
from 1ms to 2ms the motor can be controlled from 0° to 180°

3.6.8.6 Background on Servos

Servos are motors that are used to accurately control physical movement. This is
because
they generally move to a position instead of continuously rotating. They are ideal for
making something rotate over a range of 0 to 180 degrees.

Servos are easy to connect to the Arduino and control, because the motor driver is built
into the servo. This means that the driver circuit to operate the motor is internally
constructed into the servo. So, we don't have to connect a driver circuit, since it already is
connected. Thus, all we do is connect the pins of the servo directly to the Arduino board
55
and program it, and that's all that needs to be done.

Internally, servo motors contain a small motor connected through gears to an output shaft.
The output shaft drives a servo arm and is also connected to a potentiometer to provide
position feedback to an internal control circuit.

Continuous rotation servos that have positional feedback disconnected can rotate
continuously clockwise and counterclockwise with some control over the speed. These
function like brushed motors, except that continuous rotation servos use the servo library
code instead of analog write and don't require a motor shield. The disadvantages are that
the speed and power choices are limited compared to external motors, and the precision of
speed control is usually not as good as with a motor shield (since the electronics is designed for
accurate positioning, not linear speed control).

3.6.8.7 Applications of the servo motor

 The servo motor is used in robotics to activate movements, giving the arm to its precise
angle.
 The Servo motor is used to start, move and stop conveyor belts carrying the productalong
with many stages. For instance, product labeling, bottling and packaging
 The servo motor is built into the camera to correct a lens of the camera to improve
out of focus images.
 The servo motor is used in solar tracking system to correct the angle of the panel sothat each
solar panel stays to face the sun The Servo motor is used in metal forming and cutting
machines to provide specific motion control for milling machines.
 The Servo motor is used in Textiles to control spinning and weaving machines, knitting
machines and looms
 The Servo motor is used in automatic door openers to control the door in public places like
supermarkets, hospitals and theatre

56
3.6.9 MOTOR DRIVER IC

Common DC gear head motors need current above 250mA. There are many
integrated circuits like ATMEGA 16 microcontrollers, 555 timer IC. To overcome this
problem, a motor control circuit is required, which can act as a bridge between the above
motors and ICs. There are various ways of making H-bridge motor control circuit such as
using transistor, relays and using L293D/L298.Fig 3.12 shows the H Bridge Motor
Control Circuit Using L293d IC pin diagram.

Fig 3.12 H Bridge Motor Control Circuit Using L293d IC

3.6.9.1 H-Bridge Circuit

An H bridge is an electronic circuit that allows a voltage to be applied across a load


in any direction. H-bridge circuits are frequently used in robotics and many other
applications toallow DC motors to run forward & backward. These motor control circuits
are mostly used in different converters like DC-DC, DC-AC, AC-AC converters and many
other types of power electronic convertor. In specific, a bipolar stepper motor is always driven
by a motor controller having two H-bridges. Fig 3.13 shows the H bridge circuit diagram.
57
Fig 3.13 H-Bridge Circuit

An H-bridge is fabricated with four switches like S1, S2, S3 and S4. When
the S1 and S4 switches are closed, then a positive voltage will be applied across the motor.
By opening the switches S1 and S4 and closing the switches S2 and S3, this voltage is
inverted, allowing invert operation of the motor.

3.6.9.2 Pin diagram of a L293D motor driver IC controller

Fig 3.14 L293D IC Pin Configuration


58

 Pin-1 (Enable 1-2): When the enable pin is high, then the left part of the IC willwork
otherwise it won’t work. This pin is also called as a master control pin.
 Pin-2 (Input-1): When the input pin is high, then the flow of current will be throughoutput
1
 Pin-3 (Output-1): This output-1 pin must be connected to one of the terminals of the motor
 Pin4 &5: These pins are ground pins
 Pin-6 (Output-2): This pin must be connected to one of the terminals of the motor.
 Pin-7 (Input-2): When this pin is HIGH then the flow of current will be thoughoutput
2
 Pin-8 (Vcc2): This is the voltage pin which is used to supply the voltage to the motor.
 Pin-16 (Vss): This pin is the power source to the integrated circuit.

 Pin-15 (Input-4): When this pin is high, then the flow of current will be through
output-4.
 Pin-14 (Output-4): This pin must be connected to one of the terminals of the motor
 Pin-12 & 13: These pins are ground pins
 Pin-11 (Output-3): This pin must be connected to one of the terminals of the motor.
 Pin-10 (Input-3): When this pin is high, then the flow of current will through output-3
Pin-9 (Enable3-4): When this pin is high, then the right part of the IC will work & when it
is low the right part of the IC won’t work. This pin is also called as a master control pin
for the right part of the IC. Fig 3.14 shows the L293D IC Pin Configuration

3.6.10 DIRECT CURRENT (DC) MOTOR

Almost every mechanical development that we see around us is accomplished


by an electric motor. Electric machines are a method of converting energy. Motors take
electrical energy and produce mechanical energy. Electric motors are utilized to power
59
hundreds of devices we use in everyday life.

Electric motors are broadly classified into two different categories: Direct
Current (DC) motor and Alternating Current (AC) motor. In this article we are going to
discuss about the DC motor and its working. And also, how a gear DC motors works.

A DC motor in electric motor that runs on direct current power. In any


electric motor, operation is dependent upon simple electromagnetism. A current carrying
conductor generates a magnetic field, when this is then placed in an external magnetic
field, it will encounter a force proportional to the current in the conductor and to the
strength of the external magnetic field. It is a device which converts electrical energy to
mechanical energy. It works on the fact that a current carrying conductor placed in a
magnetic field experiences a force which causes it to rotate with respect to its original
position. Practical DC Motor consists of field windings to provide the magnetic flux and
armature which acts as the conductor. Fig 3.15 shows the brushless dc motors work.

Fig 3.15 Brushless DC Motors work

The input of a brushless dc motor is current/voltage and its output is torque.


Understanding the operation of DC motor is very simple from a basic diagram is shown in
below. DC motor basically consist two main parts. The rotating part is called the rotor and
the stationary part is also called the stator. The rotor rotates with respect to the stator.

60
Fig 3.16 DC motor

The rotor consists of windings, the windings being electrically associated with the
commutator. The geometry of the brushes, commutator contacts and rotor windings are
such that when power is applied, the polarities of the energized winding and the stator
magnets are misaligned and the rotor will turn until it is very nearly straightened with the
stator’s field magnets. Fig 3.16 shows the dc motor

As the rotor reaches alignment, the brushes move to the next commutator
contacts and energize the next winding. The rotation reverses the direction of current
through the rotor winding, prompting a flip of the rotor’s magnetic field, driving it to keep
rotating.

3.6.10.1 Advantages of Dc motor

 Provide excellent speed control for acceleration and deceleration.


 Easy to understand design.
 Simple, cheap drive design.

3.6.10.2 Connecting DC motor with microcontroller

Microcontrollers can’t drive the motors directly. So, we need some kind of

61
drivers to control the speed and direction of motors. The motor drivers will act as
interfacing devices between microcontroller and motor. Motor drivers will act as current
amplifiers since they take a low current control signal and provide a high current signal.
This high current signal is used to drive the motors. Using L293D chip is the easy way for
controlling the motor using microcontroller. It contains two H-bridge driver circuits
internally. This chip is designed to control two motors. L293D has two sets of
arrangements where 1 set has input 1, input 2, output1, output 2, with enable pin while
other set has input 3, input 4, output 3, output 4 with other enable pin. Here is an example
of DC motor which is interfaced with L293D microcontroller.

3.6.11 SHUNT MOTOR

Shunt motors are shunt DC motors, where the field windings shunted to or
are connected in parallel to the armature winding of the motor. The shunt DC motor is
commonly used because of its best speed regulation. Also, hence both the armature
winding and the field windings are presented to the same supply voltage, however there
are discrete branches for the stream of armature current and the field current.
A shunt motor has somewhat distinctive working characteristics than a series
motor. Since the shunt field coil is made of fine wire, it cannot produce the large current
for starting like the series field. This implies that the shunt motor has extremely low
starting torque, which requires that the shaft load be quite little.

Fig 3.17 Shunt Motor Circuit

62
When voltage is applied to the shunt motor, a very low amount of current
flow through the shunt coil. The armature for the shunt motor is similar to the series motor
and it will draw current to produce a strong magnetic field. Due to the interaction of
magnetic field around armature and the field produced around the shunt field, the motor
starts to rotate. Like the series motor, when the armature begins to turn, it will produce
back EMF. The back EMF will cause the current in the armature to begin to diminish to a
very small level. The amount of current the armature will draw is directly related to the
size of the load when the motor reaches full speed. Since the load is generally small, the
armature current will be small. Fig 3.17 shows the shunt motor circuit diagram.

3.6.11.1 Advantages of Shunt Motor

 Simple control performance, resulting in a high level of flexibility for solving


complex drive problems
 High availability, therefore minimal service effort needed
 High level of electro-magnetic compatibility
 Very smooth running, therefore low mechanical stress of the overall system andhigh
dynamic control processes
 Wide control range and low speeds, therefore universally usable

3.6.11.2 Applications of Shunt Motor

Shunt DC motors are very suitable for belt-driven applications. This constant
speed motor is used in industrial and automotive applications such as machine tools and
winding/unwinding machines where great amount of torque precision is required.

63
3.6.12 ULTRASONIC SENSOR

3.6.12.1 Sound waves

Sound is a mechanical wave travelling through the mediums, which may be


a solid, or liquid or gas. Sound waves can travel through the mediums with specific
velocity depends on the medium of propagation. The sound waves which are having high
frequency reflect from boundaries and produces distinctive echo patterns.

Sound waves are having specific frequencies or number of oscillations per second.
Humans can detect sounds in a frequency range from about 20Hz to 20 KHz. However,
the frequency range normally employed in ultrasonic detection is 100 KHz to 50MHz. The
velocity of ultrasound at a particular time and temperature is constant in a medium.
W = C/F (or) W = CT

Where W = Wave length,

C = Velocity of sound in a medium,


F = Frequency of wave,
T=Time Period.

The most common methods of ultrasonic examination utilize either


longitudinal waves or shear waves. The longitudinal wave is a compression wave in
whichthe particle motion is in the same direction of the propagation wave. The shear
wave is a wave motion in which the particle motion is perpendicular to the direction
of propagation.Ultrasonic detection introduces high frequency sound waves into a
test object to obtain information about the object without altering or damaging it in
any way. Two values are measured in ultrasonic detection.

64
The amount of time, taking for the sound to travel through the medium and
amplitude of the received signal. Based on velocity and time thickness can be calculated.
Thickness of material = Material sound velocity X Time of Fight

3.6.12.2 Transducers for wave propagation and particle detection

For sending sound waves and receiving echo, ultrasonic sensors,


normally called transceivers or transducers will be used. They work on a principle
similar to radar that will convert electrical energy into mechanical energy in the form
of sound, and vice versa. The commonly used transducers are contact transducers,
angle beam transducers, delay line transducers, immersion transducers, and dual
element transducers. Contact transducers are typically used for locating voids and
cracks to the outside surface of a part as well as measuring thickness. Angle beam
transducers use the principle of reflection and mode conversion to produce refracted
shear or longitudinal waves in the test material.
Delay line transducers are single element longitudinal wave transducers
used in conjunction with a replaceable delay line. One of the reasons for choosing
delay line transducer is that near surface resolution can be improved. The delay
allows the element to stop vibrating before a return signal from the reflector can be
received.
The major advantages offered by immersion transducers over contact
transducers are Uniform coupling reduces sensitivity variations, Reduction in scan
time, and increases sensitivity to small reflectors.

3.6.12.3 Ultrasonic sensor

Ultrasonic detection is most commonly used in industrial applications to


detect hidden tracks, discontinuities in metals, composites, plastics, ceramics, and for
water level detection. For this purpose, the laws of physics which are indicating the
65
propagation of sound waves through solid materials have been used since ultrasonic
sensors using sound instead of light for detection. An ultrasonic sensor is an instrument
that measures the distance to an object using ultrasonic sound waves. An ultrasonic
sensor uses a transducer to send and receive ultrasonic pulses that relay back
information about an object’s proximity. High-frequency sound waves reflect from
boundaries to produce distinct echo patterns. Fig 3.18 shows the ultrasonic sensor.

Fig 3.18 Ultrasonic Sensor

When an electrical pulse of high voltage is applied to the ultrasonic transducer


it vibrates across a specific spectrum of frequencies and generates a burst of sound waves.
Whenever any obstacle comes ahead of the ultrasonic sensor the sound waves will reflect
back in the form of echo and generates an electric pulse. It calculates the time taken
between sending sound waves and receiving echo. The echo patterns will be compared
with the patterns of sound waves to determine detected signal’s condition.

Table 3.4 ULTRASONIC SENSOR PIN CONFIGURATION

PIN PIN NAME DESCRIPTION


NUMBER

66
1 Vcc The Vcc pin powers the sensor, typically with +5V

2 Trigger Trigger pin is an Input pin. This pin has to be kept


high for 10us to initialize measurement by sending
US wave.

3 Echo Echo pin is an Output pin. This pin goes high for a
period of time which will be equal to the time taken
for the US wave to return back to the sensor.

4 Ground This pin is connected to the Ground of the system.

HC-SR04 Sensor features


 Operating voltage: +5V.
 Theoretical Measuring Distance: 2cm to 450cm
 Practical Measuring Distance: 2cm to 80cm.
 Accuracy: 3mm.
 Measuring angle covered: <15°.
 Operating Current: <15Ma.
 Operating Frequency: 40Hz.

3.6.12.3 HC-SR04 ULTRASONIC SENSOR – WORKING

As shown above the HC-SR04 Ultrasonic (US) sensor is a 4-pin module,


whose pin names are Vcc, Trigger, Echo and Ground respectively. This sensor is a very
popular sensor used in many applications where measuring distance or sensing objects are
required. The module has two eyes like projects in the front which forms the Ultrasonic
transmitter and Receiver. The sensor works with the simple high school formula that

67
Distance = Speed × Time

The Ultrasonic transmitter transmits an ultrasonic wave, this wave travels in air and when
it gets objected by any material it gets reflected back toward the sensor this reflected wave
is observed by the Ultrasonic receiver module as shown in the picture below. Fig 3.19
shows the working of ultrasonic sensor.

Fig 3.19 Working of Ultrasonic Sensor

Now, to calculate the distance using the above formulae, we should know the
Speed and time. Since we are using the Ultrasonic wave, we know the universal speed of
US wave at room conditions which is 330m/s. The circuitry inbuilt on the module will
calculate the time taken for the US wave to come back and turns on the echo pin high for
that same particular amount of time, this way we can also know the time taken. Now simply
calculate the distance using a microcontroller or microprocessor. The working principle of
this module is simple. It sends an ultrasonic pulse out at 40kHz which travels through
the air and if there is an obstacle or object, it will bounce back to the sensor. By calculating
the travel time and the speed of sound, the distance can be calculated. Ultrasound is reliable
in any lighting environment and can be used inside or outside. Ultrasonic sensors can
68
handle collision avoidance for a robot, and being moved often, as long as it isn’t too fast.
Ultrasonics are so widely used, they can be reliably implemented in grain bin sensing
applications, water level sensing, drone applications and sensing cars at your local drive-
thru restaurant or bank Ultrasonic rangefinders are commonly used as devices to detect
a collision. Ultrasonic sensor module comprises of one transmitter and one receiver.

Fig 3.20 Ultrasonic Sensor Circuit

The transmitter can deliver 40 KHz ultrasonic sound while the maximum receiver is
designedto accept only 40 KHz sound waves. The receiver ultrasonic sensor that is kept
next to thetransmitter shall thus be able to receive reflected 40 KHz, once the module faces
any obstacle in front. Thus, whenever any obstacles come ahead of the ultrasonic module
it calculates the time taken from sending the signals to receiving them since time and distance
are related for sound waves passing through air medium at 343.2m/sec. Upon receiving
the signal MC program while executed displays the data i.e., the distance measured on an
LCD interfaced to the microcontroller in cm’s. Fig 3.20 shows the ultrasonic sensor circuit.
Characteristically, robotics applications are very popular but you’ll also find this product
to be useful in security systems or as an infrared replacement if so desired.

69
3.6.12.4 APPLICATIONS

 Used to avoid and detect obstacles with robots like biped robot, obstacle avoider
robot, path finding robot etc.
 Used to measure the distance within a wide range of 2cm to 400cm.
 Can be used to map the objects surrounding the sensor by rotating it.
 Depth of certain places like wells, pits etc. can be measured since the waves can
penetrate through water.

3.7 SOFTWARE REQUIREMENTS

3.7.1 EMBEDDED C

Embedded C is most popular programming language in software field for


developing electronic gadgets. Each processor used in electronic system is associated
withembedded software.

Embedded C programming plays a key role in performing specific function


by theprocessor. In day-to-day life we used many electronic devices such as mobile
phone, washing machine, digital camera, etc. These all-device working is based on
microcontroller that are programmed by embedded C. Fig 3.21 shows the Block
diagramof Embedded system
Let's see the block diagram representation of embedded system programming:

Fig 3.21 Block diagram of Embedded system


70
The Embedded C code written in above block diagram is used for blinking the LED
connected with Port0 of microcontroller.

In embedded system programming C code is preferred over other language. Due to the
following reasons:

 Easy to understand
 High Reliability
 Portability
 Scalability

3.7.2 EMBEDDED SYSTEM PROGRAMMING

3.7.3 Basic Declaration

Let's see the block diagram of Embedded C Programming development:

Fig 3.22 Block diagram of Embedded C Programming development

Function is a collection of statements that is used for performing a specific


task and acollection of one or more functions is called a programming language. Every
language isconsisting of basic elements and grammatical rules. The C language
programming isdesigned for function with variables, character set, data types, keywords,

71
expression andso on are used for writing a C program. Fig 3.22 shows the Block
diagram of EmbeddedC Programming development

The extension in C language is known as embedded C programming language. As


compared to above the embedded programming in C is also have some additional features
like data types, keywords and header file etc. is represented by #include<microcontroller
name.h>.

3.7.4 BASIC EMBEDDED C PROGRAMMING STEPS

Let's see the block diagram representation of Embedded C Programming Steps

Fig 3.23 Block diagram representation of Embedded C Programming steps


The microcontroller programming is different for each type of operating system.
Even though there are many operating system is existed such as Windows, Linux,
RTOS, etc. but RTOS has several advantages for embedded system development.
Fig 3.23 shows theBlock diagram representation of Embedded C Programming steps

EMBEDDED SYSTEMS

Embedded System is a system composed of hardware, application software and


realtime operating system. It can be small independent system or large combinational
system.

Our Embedded System tutorial includes all topics of Embedded System such
as characteristics, designing, processors, microcontrollers, tools, addressing modes,

72
assembly language, interrupts, embedded c programming, led blinking, serial
communication, lcd programming, keyboard programming, project implementation
etc.

SYSTEM

System is a way of working, organizing or performing one or many tasks


accordingto a fixed set of rules, program or plan.

It is an arrangement in which all the unit combined to perform a work together


by following certain set of rules in real time computation. It can also be defined as a
way of working, organizing or doing one or many tasks according to a fixed plan.

An Embedded System is a system that has software embedded into computer-


hardware, which makes a system dedicated for a variety of application or specific
part of an application or product or part of a larger system.

An embedded system can be a small independent system or a large


combinational system. It is a microcontroller-based control system used to perform
a specific task of
operation.

An embedded system is a combination of three major components:

 Hardware: Hardware is physically used component that is physically connected


with an embedded system. It comprises of microcontroller based integrated circuit,
power supply, LCD display etc.

 Application software: Application software allows the user to perform varieties of


application to be run on an embedded system by changing the code installed in an
73
embedded system.

 Real Time Operating system (RTOS): RTOS supervises the way an embedded
system work. It acts as an interface between hardware and application software which
supervises the application software and provide mechanism to let the processor run on
the basis of scheduling for controlling the effect of latencies.

3.7.5 CHARACTERISTICS OF EMBEDDED SYSTEM

 An embedded system is software embedded into computer hardware that


makes a system dedicated to be used for variety of application.
 Embedded system generally used for do specific task that provide real-time
output on the basis of various characteristics of an embedded system.
 Embedded system may contain a smaller part within a larger device that used
for serving the more specific application to perform variety of task using
hardware-software intermixing configuration.
 It provides high reliability and real-time computation ability.

Advantages

 Same hardware can be used in variety of application.


 Lesser power requirement
 Lower operational cost of system
 high performance and efficiency

Disadvantages

 Developing a system required more time. Due to functional complexity.


 Skilled engineers required because one mistake may result in destroying of
complete project.

74
3.7.6 DESIGNING OF AN EMBEDDED SYSTEM

3.7.5.1 BASIC STRUCTURE OF AN EMBEDDED SYSTEM

Let's see the block diagram shows the basic structure of an embedded system.

 Sensor: Sensor used for sensing the change in environment condition and it
generate the electric signal on the basis of change in environment condition.
Therefore, it is also called as transducers for providing electric input signal on the
basis of change in environment condition.

 A-D Converter: An analog-to-digital converter is a device that converts


analog electric input signal into its equivalent digital signal for further processing in
an embedded system.

 Processor & ASICs: Processor used for processing the signal and data to
execute desired set of instructions with high-speed of operation. Application specific
integrated circuit (ASIC) is an integrated circuit designed to perform task specific
operation inside an embedded system.

 D-A Converter: A digital-to-analog converter is a device that converts digital


electric input signal into its equivalent analog signal for further processing in an
embedded system.
 Actuators: Actuators is a comparator used for comparing the analog input
signal level to desired output signal level for providing the error free output from
the system.

3.DESIGN STEPS REQUIRED FOR THE DEVELOPMENT OF EMBEDDED SYSTEM:

Designing steps required for embedded system are different from the design process of

75
another electronic system.

Let's see a flow chart represent the design steps required in the development of an
embedded system

3.7.5.2 EMBEDDED SYSTEM TOOLS AND PERIPHERALS

Compiler

Compiler is used for converting the source code from a high-level programming
language to a low-level programming language. It converts the code written in high level
programming language into assembly or machine code. The main reason for conversion is
to develop an executable program.

Let's see the operations performed by compiler are:


 Code generation
 Code optimization
 Parsing
 Syntax direct translation
 Preprocessing

Cross-Compiler
If a program compiled is run on a computer having different operating system and
hardware configuration than the computer system on which a compiler compiled the
program, that compiler is known as cross-compiler.

De-compiler

A tool used for translating a program from a low-level language to high-level


language is called a de-compiler. It is used for conversion of assembly or machine code to
high-level programming language.

76
Assembler

Assembler is embedded system tool used for translating a computer instruction


written in assembly language into a pattern of bits which is used by the computer processor for
performing its basic operations. Assembler creates an object code by translating assembly
language instruction into set of mnemonics for representing each low-level machine
operation.

3.7.5.3 DEBUGGING TOOLS IN AN EMBEDDED SYSTEM

Debugging is a tool used for reducing the number of error or bugs inside a computer
program or an assembled electronic hardware.

Debugging of a compact subsystem is difficult because a small change in one


subsystem can create bugs in another system. The debugging used inside embedded
system differs in terms of their development time and debugging features.

Let's see the different debugging tools used in embedded system are

Simulators

Simulator is a tool used for simulation of an embedded system. Code tested


for microcontroller unit by simulating code on the host computer. Simulator is used
for modelthe behavior of the complete microcontroller in software.

Functions of simulators

Let's see the functions performed by simulator are:


 It defines the processing or processor device family with various version of
targetsystem.
 It monitors the detailed information of a source code and symbolic arguments as

77
theexecution goes for each single step of operation.
 It simulates the ports of target system for each single step of execution.
 It provides the working status of RAM.
 It monitors the response of system and determines the throughput.
 It provides the complete meaning of the present command.
 It monitors the detailed information of the simulator commands entered from
thekeyboard or selected from the menu.
 It facilitates synchronization of internal peripherals and delays.

3.7.5.4 MICROCONTROLLER STARTER KIT

For developing an embedded system-based project a complete microcontroller


starter kit is required. The major advantage of this kit over simulator is that they work
in real-time operating condition. Therefore, it allows the easy input/output functional
verification. Consider a microcontroller starter kit consists of: -

 Hardware Printed Circuit Board (PCB)


 In-System Programmer (ISP)
 Some embedded system tools like compiler, assembler, linker, etc. Sometimes,
there is a requirement of an Integrated Development Environment (IDE)

The above component available in microcontroller starter kit is completely enough


and thecheapest option available for developing simple microcontroller projects.

Emulators

An emulator is a software program or a hardware kit which emulates the


functions of one computer system into another computer system. Emulators have an
ability to support closer connection to an authenticity of the digital object.

It can also be defined as the ability of a computer program in electronic device

78
to emulate another program or device. It focusing on recreating the original computer
environment and helps a user to work on any type of application or operating system.

3.7.7 PERIPHERAL DEVICES IN EMBEDDED SYSTEMS

Communication of an embedded system with an outside environment is done


by using different peripheral devices as a combination with microcontroller.

Let's see the different peripheral devices in embedded system are: -

 Universal Serial Bus (USB)


 Networks like Ethernet, Local Area Network (LAN) etc.
 Multi Media Cards (SD Cards, Flash memory, etc.)
 Serial Communication Interface (SCI) like RS-232, RS-485, RS-422, etc.
 Synchronous Serial Communication Interface like SPI, SSC and ESSI
 Digital to Analog/ Analog to Digital (DAC/ADC)
 General Purpose Input/Output (GPIO)
 Debugging like In System Programming (ISP), In Circuit Serial
Programming (ICSP), BDM Port, etc.

3.7.6.1 CRITERIA FOR CHOOSING MICROCONTROLLER

Choosing a microcontroller is essential process in designing of embedded


system. While selecting a microcontroller, make sure that it meets the system need
and it must becost effective. We need to decide whether an 8-bit, 16-bit or 32-bit
microcontroller is bestsuitable for the computing needs of a task.

In addition to above, the following points need to be kept in mind while


selecting a microcontroller: -

 Speed: The operational speed of the microcontroller or the highest speed


microcontroller can support.
79
 Packaging: Packaging is important for improving the assembling, space and
prototyping of an end-product.

 RAM and ROM: On the basis of operation of embedded system and memory
need for storage data and programs the type of microcontroller required for designing
system is decided.

 Count of I/O pins: The number of input and output devices connected with the
system plays an essential role in choosing the type of microcontroller.

 Cost per unit: It is important in terms of final cost of the product in which the
microcontroller is to be used.

 Power consumption: Power consumption plays an important role for


maintaining the efficiency of an embedded system

3.7.8 ARDUINO SOFTWARE IDE

The Arduino Integrated Development Environment - or Arduino Software


(IDE) - contains a text editor for writing code, a message area, a text console, a toolbar
with buttons for common functions and a series of menus. It connects to the Arduino
and Genuino hardware to upload programs and communicate with them. Fig 3.24
shows the Arduino IDE page overview.

80
Fig 3.24 Arduino IDE page overview

3.7.7.1 WRITING SKETCHES

Programs written using Arduino Software (IDE) are called sketches. These sketches
are written in the text editor and are saved with the file extension. ino. The editor has
features for cutting/pasting and for searching/replacing text. The message area gives
feedback while saving and exporting and also displays errors. The console displays
text output by the Arduino Software (IDE), including complete error messages and
other information. The bottom right-hand corner of the window displays the
configured board and serial port.The toolbar buttons allow you to verify and upload
programs, create, open, and save sketches, and open the serial monitor. Fig 3.25
shows the writing sketches

81
Fig 3.25 Writing sketches

Additional commands are found within the five menus: File, Edit, Sketch, Tools,
and help. The menus are context sensitive, which means only those items relevant to
the work currently being carried out are available.
 New
Creates a new instance of the editor, with the bare minimum structure of a
sketch already in place.

 Open
Allows loading a sketch file browsing through the computer drives and folders.

 Open Recent
Provides a short list of the most recent sketches, ready to be opened.

 Sketchbook
Shows the current sketches within the sketchbook folder structure; clicking
on anyname opens the corresponding sketch in a new editor instance.

82
 Examples 
Any example provided by the Arduino Software (IDE) or library shows up in
this menu item. All the examples are structured in a tree that allows easy access by
topicor library.

 Close
Closes the instance of the Arduino Software from which it is clicked.

 Save
Saves the sketch with the current name. If the file hasn't been named before, a
namewill be provided in a "Save as." window.

 Save as
Allows saving the current sketch with a different name.
 Page Setup
It shows the Page Setup window for printing.

 Print
Sends the current sketch to the printer according to the settings defined in
PageSetup.

 Preferences
Opens the Preferences window where some settings of the IDE may be
customized, as the language of the IDE interface.

 Quit
Closes all IDE windows. The same sketches open when quit was chosen
will beautomatically reopened the next time you start the IDE. Fig 3.26 shows the
Editing.

83
EDIT

Fig 3.26 Editing

 Undo/Redo
Goes back of one or more steps you did while editing; when you go back, you
maygo forward with Redo.

 Cut
Removes the selected text from the editor and places it into the clipboard.

 Copy
Duplicates the selected text in the editor and places it into the clipboard.
84
 Copy for Forum
Copies the code of your sketch to the clipboard in a form suitable for posting
to the forum, complete with syntax coloring.

 Copy as HTML
Copies the code of your sketch to the clipboard as HTML, suitable for
embeddingin web pages.

 Paste
Puts the contents of the clipboard at the cursor position, in the editor.

 Select All
Selects and highlights the whole content of the editor.

 Comment/Uncomment
Puts or removes the // comment marker at the beginning of each selected line.

 Increase/Decrease Indent
Adds or subtracts a space at the beginning of each selected line, moving the
textone space on the right or eliminating a space at the beginning.

 Find
Opens the Find and Replace window where you can specify text to search
inside thecurrent sketch according to several options.

 Find Next
Highlights the next occurrence - if any - of the string specified as the search
itemin the Find window, relative to the cursor position.

85
 Find Previous
Highlights the previous occurrence - if any - of the string specified as the
search item in the Find window relative to the cursor position. Fig 3.27 shows the
Sketch

SKETCH:

Fig 3.27 Sketch


 Verify/Compile
Checks your sketch for errors compiling it; it will report memory usage for
codeand variables in the console area.

 Upload
Compiles and loads the binary file onto the configured board through the
86
configured Port.

 Upload Using Programmer


This will overwrite the boot loader on the board; you will need to use Tools >
Burn Boot loader to restore it and be able to Upload to USB serial port again.

 Export Compiled Binary


Saves a .hex file that may be kept as archive or sent to the board using other tools.

 Show Sketch Folder


Opens the current sketch folder.

 Include Library
Adds a library to your sketch by inserting #include statements at the start of
your code. For more details, see libraries below. Additionally, from this menu item
youcan access the Library Manager and import new libraries from .zip files.

 Add File
Adds a source file to the sketch (it will be copied from its current location).
The new file appears in a new tab in the sketch window. Files can be removed from
thesketch using the tab menu accessible clicking on the small triangle icon below
the serial monitor one on the right side of the toolbar.
 Auto Format
This format your code nicely: i.e., indents it so that opening and closing curly
braces line up, and that the statements inside curly braces are indented more.

 Archive Sketch
Archives a copy of the current sketch in .zip format. The archive is placed in
thesame directory as the sketch.

 Fix Encoding & Reload


Fixes possible discrepancies between the editor char map encoding and other
operating systems char maps.
87
 Serial Monitor
Opens the serial monitor window and initiates the exchange of data with any
connected board on the currently selected Port. This usually resets the board, if the
board supports Reset over serial port opening.

 Board
Select the board that you're using. See below for descriptions of the various
boards.

 Port
This menu contains all the serial devices (real or virtual) on your machine. It
should automatically refresh every time you open the top-level tools menu. Fig
3.29 shows the Tools.

Fig 3.28 Tools

88
 Programmer
For selecting a hardware programmer when programming a board or chip and
notusing the onboard USB-serial connection. Normally you won't need this, but if
you're burning a boot loader to a new microcontroller, you will use this.

 Burn Boot loader


The items in this menu allow you to burn a boot loader onto the
microcontroller onan Arduino board. This is not required for normal use of an
Arduino or Genuino board but is useful if you purchase a new AT mega
microcontroller (which normally comes without a boot loader). Ensure that you've
selected the correct board from the Boards menu before burning the boot loader on
the target board.

This command also set the right fuses.


Help

Here you find easy access to a number of documents that come with the Arduino
Software(IDE). You have access to Getting Started, Reference, this guide to the IDE

and other documents locally, without an internet connection. The documents are a
Fig 3.29 Help

89
local copy of theonline ones and may link back to our online website. Fig 3.29
shows the Help

 Find in Reference
This is the only interactive function of the Help menu: it directly selects the
relevant page in the local copy of the Reference for the function or command
under the cursor.

3.7.7.2 SKETCH BOOK

The Arduino Software (IDE) uses the concept of a sketchbook: a standard place to store
your programs (or sketches). The sketches in your sketchbook can be opened from the File
> Sketchbook menu or from the Open button on the toolbar. The first time you run the
Arduino software, it will automatically create a directory for your sketchbook. You can
view or change the location of the sketchbook location from with the Preferences dialog.
Fig 3.30 shows the Sketchbook.

Fig 3.30 Sketch book

Beginning with version 1.0,


files are saved with a .ino file extension. Previous versions use the. pde
extension. You may still open. pde named files in version 1.0 and later, the software
will automatically rename the extension to. ino.

3.7.7.3 TABS, MULTIPLE FILES, AND COMPILATION

Allows you to manage sketches with more than one file (each of which appears in its own
90
tab). These can be normal Arduino code files (no visible extension), C files (.c extension),
C++ files (.cpp), or header files (.h).

UPLOADING

Before uploading your sketch, you need to select the correct items from the Tools > Board
and Tools > Port menus. The boards are described below. On the Mac, the serial port is
probably something like /dev/tty. usbmodem241 (for an Uno or Mega2560 or
Leonardo) or /dev/tty.usbserial-1B1 (for a Duemilanove or earlier USB board), or
/dev/tty. USA19QW1b1P1.1 (for a serial board connected with a Key span USB-to-
Serial adapter). On Windows, it's probably COM1 or COM2 (for a serial board)
or COM4, COM5, COM7, or higher (for a USB board) - to find out, you look for
USB serial device in the port section of the Windows Device Manager. On Linux,
it should be /dev/ttyACMx, /dev/ttyUSBx or similar. Once you've selected the
correct serial port and board, press the upload button in the toolbar or select the
Upload item from the Sketch menu. Current Arduino boards will reset automatically
and begin the upload. With older boards (pre-Diecimila) that lack auto-reset, you'll
need to press the reset buttonon the board just before starting the upload. On most
boards, you'll see the RX andTX LEDs blink as the sketch is uploaded. The Arduino
Software (IDE) will display a message when the upload is complete, or show an
error.

When you upload a sketch, you're using the Arduino bootloader, a small
program that has been loaded on to the microcontroller on your board. It allows you
to upload codewithout using any additional hardware. The bootloader is active for a
few seconds when the board resets; then it starts whichever sketch was most recently
uploaded to the microcontroller. The boot loader will blink the on-board (pin 13)
LED when it starts (i.e., when the board resets).

91
3.7.7.4 LIBRARIES

Libraries provide extra functionality for use in sketches, e.g., working with hardware
or manipulating data. To use a library in a sketch, select it from the Sketch > Import
Library menu. This will insert one or more #include statements at the top of the
sketch and compile the library with your sketch. Because libraries are uploaded to the
board withyour sketch, they increase the amount of space it takes up. If a sketch no
longer needs a library, simply delete its #include statements from the top of your
code. Fig 3.31 shows the libraries

Fig 3.31 Libraries

There is a list of libraries in the reference. Some libraries are included with the
Arduino software. Others can be downloaded from a variety of sources or through
the Library Manager. Starting with version 1.0.5 of the IDE, you do can import a
library from a zip file and use it in an open sketch. See these instructions for installing
a third-party library.

3.7.7.5 THIRD-PARTY HARDWARE

Support for third-party hardware can be added to the hardware directory of


92
your sketchbook directory. Platforms installed there may include board definitions
(which appear in the board menu), core libraries, bootloaders, and programmer
definitions. To install, create the hardware directory, then unzip the third-party platform
into its own sub- directory. (Don't use "Arduino" as the sub-directory name or you'll
override the built-in Arduino platform.) To uninstall, simply delete its directory. For
details on creating packages for third-party hardware, see the Arduino IDE 1.5 3rd
party Hardware specification.

3.7.7.6 SERIAL MONITOR

This displays serial sent from the Arduino or Genuino board over USB or serial
connector. To send data to the board, enter text and click on the "send" button or
presenter. Choose the baud rate from the drop-down menu that matches the rate
passedto Serial. Begin in your sketch. Note that on Windows, Mac or Linux the
board will reset(it will rerun your sketch) when you connect with the serial monitor.
Please note that the Serial Monitor does not process control characters; if your sketch
needs a complete management of the serial communication with control characters,
you can use an externalterminal program and connect it to the COM port assigned to
your Arduino board.

You can also talk to the board from Processing, Flash, MaxMSP, etc. (see
the interfacing page for details). Fig 3.33 shows the Serial Monitor

93
Fig 3.33 Serial Monitor
3.7.7.7 PREFERENCES

Some preferences can be set in the preferences dialog (found under the
Arduino menu on the Mac, or File on Windows and Linux). The rest can be found
inthe preferences file, whose location is shown in the preference dialog.

3.7.7.8 LANGUAGE SUPPORT

Since version 1.0.1, the Arduino Software (IDE) has been translated into
30+ different languages. By default, the IDE loads in the language selected by your
operating system. (Note: on Windows and possibly Linux, this is determined by the
locale setting which controls currency and date formats, not by the language the
operating system is displayed in.)
If you would like to change the language manually, start the Arduino
Software (IDE) and open the Preferences window. Next to the Editor Language
there is a dropdown menu of currently supported languages. Select your preferred

94
language from the menu, and restart the software to use the selected language. If your
operating system language is not supported, the Arduino Software (IDE) will default
to English.
You can return the software to its default setting of selecting its language
based on your operating system by selecting System Default from the Editor
Language drop- down. This setting will take effect when you restart the Arduino
Software (IDE). Similarly, after changing your operating system's settings, you must
restart the Arduino Software (IDE) to update it to the new default language.

95
CHAPTER 4
RESULT

1.1 OUTPUT

Fig no: 4.1 Controller for robot

96
Fig no: 4.2 ESP-32 Cam picture

97
CHAPTER 5

CONCLUSION

In this project Smart Vacuum Cleaner has been implemented. It was works on
a pre- defined code inserted in Arduino UNO. Whenever RC car encounters any
obstacle,it turns to the side where the distance between obstacle and car is more. This
projecthelps collect the dust using a vacuum cleaner made using blower and batteries
without human intervention thereby reducing the hazards to human health and saves
a lot of time. This is a simple and cost-effective cleaner. However, there is no
detachable bag used in this project. Usage of such a bag may be better to remove
dust in a simple way.

98
CHAPTER 6

FUTURE ENHANCEMENT

6.1 APPLICATIONS

 Used to detect the dusts in the area and to hazards to human health.
 Identify the accurate locate dust.

6.2 FUTURE ENHANCEMENT

Future enhancement of the project is control and monitoring intelligent


vacuum cleaner for household purpose using python. The development of
autonomous vehicles becomes a hot topic due to the demand of the intelligent
transportation systems (ITS).

6.3 ADVANTAGES

 Simple design
 Control and monitoring the robot is easy
 Better dust detection and removal

99
CHAPTER 7

REFERENCES

1. A. Chandramouli and V. Sivachidambaranathan, “Extract Maximum Power from


PV System Employing MPPT with FLC Controller,” J. Elect. Eng. Automation, vol. 1, pp.
58-71, 2019.
2. A. S. Alghamdi, A. S. Bahaj, L. S. Blunden, and Y. Wu, “Dust removal from solar
PV modules by automated cleaning systems,” Energies, vol. 12, pp. 1-21, 2019.
3. H. Kawamoto, “Electrostatic cleaning equipment for dust removal from soiled solar
panels,” J. of Electrostatics, vol. 98, pp. 11-16, 2019.
4. J. Zorrilla-Casanova et al., “Analysis of dust losses in photovoltaic modules,”
World Renew. Energy Cong. 2011 – Sweden, Linköping, Sweden, May 8-11, 2011, pp.
2985-92.
5. K. P. Amber et al., “A self-cleaning device for pole mounted solar photovoltaic
installations,” Thermal Science, vol. 23, no. 2A, pp. 739- 49, 2019.
6. M. Mazumder et al., “Characterization of electrodynamic screen performance for
dust removal from solar panels and solar hydrogen generators,” IEEE Trans. Ind. Appl.,
vol. 49, no. 4, pp. 1793-1800, 2013.
7. N. Sugiartha et al., “Preliminary design and test of a water spray solar panel cleaning
system,” J. Physics: Conf. Series, vol. 1450, 012108, Feb. 2020.
8. Syafaruddin, F. A. Samman, Muslimin, and S. Latief, “Design of automatic control
for surface cleaning system of photovoltaic panel,” ICIC Express Letters, Part B: Appl.,
vol. 8, no. 11, pp. 1457-64, 2017.
9. Websitehttps://www.venturesolar.com/blog/the-importance-of-solarenergy/
[Accessed: 30- Oct.- 2020].
10. X. Liu, S. Yue, L. Lu, and J. Li, “Investigation of the Dust Scaling Behavior on
Solar Photovoltaic Panels,” J. Cleaner Production, 2021, 126391.
10
0

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy