Finalized 0
Finalized 0
Finalized 0
A PROJECT REPORT
PHASE I
Submitted by
ROSHAN M (113219051025)
SAIKUMAR S Y (113219051026)
SRIHARISH P (113219051033)
VIBINKUMAR V (113219051038)
NOVEMBER 2022
i
VELAMMAL ENGINEERING COLLEGE
CHENNAI - 66
BONAFIDE CERTIFICATE
supervision.
Signature Signature
ii
CERTIFICATE OF EVALUATION
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.
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.
iv
AKNOWLEDGEMENT
We thank Dr. S. Satish Kumar, Principal, Velammal Engineering College for his
motivation and support during the course of the project.
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
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.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
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
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
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
3.6 PI 18
N DIAGRAM (ATMEGA 168)
xii
3.11 SERVOMOTOR SG-90 32
3.16 DC MOTOR 44
xiii
3.23 BLOCK DIAGRAM 55
REPRESENTATION OF EMBEDDED
C PROGRAMING STEPS
3.24 ARDUINO IDE PAGE OVERVIEW 64
3.26 EDITING 69
3.27 SKETCH 71
3.28 TOOLS 71
3.31 LIBRARIES 78
xiv
LIST OF ABBREVIATIONS
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.
18
1.3.1 EXISTING SYSTEM DISADVANTAGES
The total system is fully manual as per the human has to clean the dust.
19
CHAPTER 2
LITERATURE REVIEW
YEAR:2020
DESCRIPTION
20
TITTLE 2: Robotic Vacuum Cleaner Using Arduino with wi-fi
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.
YEAR:2022
DESCRIPTION
YEAR: 2018
DESCRIPTION
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.
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
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
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
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
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
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.
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.
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.
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.
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
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.
31
LED_BUILTIN 13
Length 68.6 mm
Width 53.4 mm
Weight 25 g
3.6.1.4 Hardware
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.
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.
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.
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.
PWM: 3, 5, 6, 9, 10, and 11. Provide 8-bit PWM output with the Analog Write
() function.
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
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
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.
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.
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.
40
3.6.4.2 Infrastructure Functionality
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.
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.
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 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.
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.
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
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
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.
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-
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
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.
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.
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.
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.
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°
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).
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.
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.
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
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.
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.
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.
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.
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.
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
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
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
66
1 Vcc The Vcc pin powers the sensor, typically with +5V
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.
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.
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.
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.1 EMBEDDED C
In embedded system programming C code is preferred over other language. Due to the
following reasons:
Easy to understand
High Reliability
Portability
Scalability
71
expression andso on are used for writing a C program. Fig 3.22 shows the Block
diagram of EmbeddedC Programming development
EMBEDDED SYSTEMS
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
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.
Advantages
Disadvantages
74
3.7.6 DESIGNING 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.
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.
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
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.
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
76
Assembler
Debugging is a tool used for reducing the number of error or bugs inside a computer
program or an assembled electronic hardware.
Let's see the different debugging tools used in embedded system are
Simulators
Functions of simulators
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.
Emulators
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.
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.
80
Fig 3.24 Arduino IDE page overview
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
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:
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.
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.
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.
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.
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.
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.
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
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.
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.
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
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.3 ADVANTAGES
Simple design
Control and monitoring the robot is easy
Better dust detection and removal
99
CHAPTER 7
REFERENCES