0% found this document useful (0 votes)
62 views90 pages

Major Report Batch-9

The document describes a project report on a smart phone operated multipurpose agricultural robotic vehicle called AgriBot. The report details the design and implementation of AgriBot, which can be controlled using a smartphone to perform agricultural tasks. AgriBot uses various sensors like LDR, moisture sensor and DHT-11 to detect environmental conditions. It is also equipped with components like Arduino, Bluetooth, DC motors, relays and L293D motor driver for control and actuation. The report provides specifications and working of each component used in AgriBot. It also discusses the software used for programming and controlling AgriBot through a smartphone.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
62 views90 pages

Major Report Batch-9

The document describes a project report on a smart phone operated multipurpose agricultural robotic vehicle called AgriBot. The report details the design and implementation of AgriBot, which can be controlled using a smartphone to perform agricultural tasks. AgriBot uses various sensors like LDR, moisture sensor and DHT-11 to detect environmental conditions. It is also equipped with components like Arduino, Bluetooth, DC motors, relays and L293D motor driver for control and actuation. The report provides specifications and working of each component used in AgriBot. It also discusses the software used for programming and controlling AgriBot through a smartphone.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 90

Project Stage II Report on

SMART PHONE OPERATED MULTIPURPOSE AGRICULTURAL


ROBOTIC VEHICLE-AGRIBOT
Submitted to

Jawaharlal Nehru Technological University, Hyderabad


in partial fulfillment of the
academic requirements for the award of Degree of
BACHELOR OF TECHNOLOGY
in
ELECTRONICS AND COMMUNICATION ENGINEERING

by

G. SRAVANI 18L51A0407
K.V.S. SRAVANI 18L51A0414
K. MAMATHA 18L51A0417
P. RISHITHA 18L51A0428
Under the guidance of

Ms. K. Bhagya Lakshmi

Assistant Professor

Department of Electronics and Communication Engineering

SHADAN WOMEN’S COLLEGE OF ENGINEERING AND TECHNOLOGY

Affiliated to Jawaharlal Nehru Technological University Hyderabad,

2021 - 2022
i
CERTIFICATE

This is to certify that the Industry Oriented Major Project report titled, “Smart Phone
Operated Multipurpose Agricultural Robotic vehicle” is being submitted by “G. SRAVANI Hall
Ticket No 18L51A0407, K.V.S.SRAVANI Hall Ticket No 18L51A0414, K.MAMATHA Hall
Ticket No 18L51A0417 and P. RISHITHA Hall Ticket No 18L51A0428” in partial fulfillment of
the requirements for the award of the degree of Bachelor of Technology in Electronics and
Communication Engineering to Jawaharlal Nehru Technological University Hyderabad, is a
record of Bonafide work carried out by them.
The contents presented in this project report have been verified and are found to be satisfactory.

Signature of the Guide Head of the Department


Ms.K. BHAGYA LAKSHMI Dr. M.A. KHADER KHAN
Department of electronics and Department of electronics and
Communication engineering communication engineering
Shadan women’s college of engineering Shadan women’s college of engineering
And technology, Hyderabad-500004 and technology, Hyderabad -500004

Submitted for JNTUH Industry Oriented Major Project work Viva-Voce Examination held on
-

Internal Examiner External Examiner

Principal

ii
ACKNOWLEDGEMENT

The success and final outcome of this project required a lot of guidance and assistance
from many people and we are extremely privileged to have got this all along the completion
of our project. All that we have done is only due to such supervision and assistance and we
would not forget to thank them.

We respect and thank Mr. Mohammed Shah Alam Rasool Khan, Chairman, Dr.
Zehra Khan, Joint Secretary and Mr. Rahman Sharif, Director of Shadan Educational
Society for providing us an opportunity to do the project work and giving us all support to
complete the project duly.

We are extremely thankful to Dr. K. Palani, B.E, M.E, Ph. D, Principal and
Dr. P. Hima Bindu, Vice Principal for providing us nice support and encouragement
throughout the completion of this project work.

We would not forget to remember our Head of the Department Dr. M.A. Khader Khan
for his encouragement and more over for his timely support and guidance till the completion of
our project work.

We heartily thank our internal project guide, Ms. K. Bhagya Lakshmi, Assistant
Professor, Electronics and Communication Engineering Department for her guidance and
suggestions during this project work.

We are thankful to and fortunate enough to get constant encouragement, support and
guidance from all Teaching staffs of Electronics and Communication Engineering Department
which helped us in successfully completing our project work

We would like to express our gratitude towards our parents for their kind co-operation
and encouragement which help us in completion of this project.

G. SRAVANI 18L51A0407
K.V.S. SRAVANI 18L51A0414
K. MAMATHA 18L51A0417
P. RISHITHA 18L51A0428

iii
DECLARATION
We hereby declare that the Industry Oriented Major Project report titled, “Smart
Phone Operated Multipurpose Agricultural Robotic Vehicle”, is a record of work done by
us and submitted to the Department of Electronics and Communication Engineering, Shadan
Women’s College of Engineering and Technology, Hyderabad in partial fulfillment of
academic requirements for the award of Degree of Bachelor of Technology degree in
Electronics and Communication Engineering, under Jawaharlal Nehru Technological
University Hyderabad, Hyderabad.

No part of the thesis is copied from books, journals or Internet and wherever the portion
is taken; the same has been duly referred in the text. The reported results are based on the
project work entirely done by us and not copied from any other source.

Also, we declare that the matter embedded in this thesis has not been submitted by any
students in full or partial thereof for the award of any degree/diploma of any other institution
or University previously.

G. SRAVANI 18L51A0407
K.V.S. SRAVANI 18L51A0414
K. MAMATHA 18L51A0417
P. RISHITHA 18L51A0428

iv
v
INDEX
Chapter TOPIC Page No.
No.
Abstract ix
List of Figures x
List of Tables xii
1 INTRODUCTION 1
1.1 General 1
1.2 Existing System 2
1.3 Disadvantages Of Existing System 2
1.4 Proposed System 3
1.5 Advantages Of Proposed System 3

2 LITERATURE SURVEY 4

3 PROJECT DESCRIPTION 6
3.1 General Introduction to Embedded System 6
3.2 Block Diagram 14
3.3 Modules 15
3.3.1 ARDUINO 15
3.3.2 Digital 17
3.3.3 Analog 18
3.3.4 Output signal 20
3.3.5 Input signal 21
3.3.6 Software Tips 26

3.4 LIGHT DEPENDENT RESISTOR(LDR) 27


3.4.1 Construction of Photocell 27
3.4.2 Characteristics of LDR 28
3.4.3 Types of LDR 29
3.4.4 Working of LDR 29
3.4.5 Applications 30

3.5 MOISTURE SENSOR 31


3.5.1 Specifications 31
3.5.2 Working of Sensor 31

3.6 BLUETOOTH 32
3.6.1 Pin Description 33
3.6.2 Specifications 38

vi
3.6.3 Applications 38

3.7 RELAY 39
3.7.1 Working of Relay 40

3.8 DC MOTOR 43
3.8.1 Working of Motor 43
3.8.2 Types of Motors 45
3.8.3 Applications 46

3.9 L293D 46
3.9.1 Concept 47
3.9.2 Working of L293D 48

3.10 DHT-11 50
3.10.1 Working of DHT-11 51
3.10.2 Specifications 52
3.10.3 Applications 53

3.11 MQ-7 53
3.11.1 Working of Motor 53

3.12 SERVO MOTOR 55


3.12.1 Working of Motor 55
3.12.2 Applications 59

3.13 LIGHT EMITTING DIODE(LED) 60

3.14 WATER PUMP 61


3.14.1 Specifications 61

3.15 ROBO SETUP 62


4 SOFTWARE SPECIFICATIONS 63
4.1 ARDUINO IDE SOFTWARE 63
4.2 Introduction 63
4.3 Software Overview 64
4.4 STEPS 68

5 IMPLEMENTATION
5.1 WORKING OPERATION 70
5.2 STEPS
6 CONCLUSION
6.1 Future Scope 73

vii
REFERENCECES 75

APPENDIX 76
Code of a Smart Phone Operated Multipurpose Agricultural
Robotic Vehicle

viii
ABSTRACT

SMART PHONE OPERATED MULTIPURPOSE


AGRICULTURAL ROBOTIC VEHICLE - AGRIBOT

The Project focuses on the design, development, and construction of a


robot that can dig soil, close mud, and spray water, as well as the robot's entire
system. Works with both solar and battery power More than a quarter of
Agriculture is the primary source of income for the majority of the world's
people. Occupation, and the autonomous development in recent years There has
been a surge in interest in agricultural vehicles. The Through the use of an IR
sensor, the vehicle is controlled by a relay switch. The user can engage with the
robot through language input. is well-known to the majority of individuals.
These robots have a number of advantages. are data input operations that do not
require the use of one's hands. In the field of science, A concept for an
agricultural autonomous vehicle has been developed. Designed in order to look
into the possibility of having several little autonomous machines.

ix
List of Figures
S. No Figure Name of the Figure Page
No. No
1 3.1 Overview of Embedded System Architecture 11
2 3.2 Block Diagram of Embedded System 12
3 3.3 Block Diagram of AGRIBOT 14
4 3.4 Arduino UNO 15
5 3.5 Mini and Lilypad Arduino 16
6 3.6 Pin Configuration of Arduino 22
7 3.7 Structure and Symbol of LDR 27
8 3.8 LDR 28
9 3.9 Circuit diagram of LDR 30
10 3.10 Moisture Sensor 31
11 3.11 Bluetooth Module 33
12 3.12 Serial Interface of Bluetooth 34
13 3.13 Pin Configuration of Bluetooth 37
14 3.14 Relay 39
15 3.15 Structure of Relay 40
16 3.16 Circuit diagram of Relay 40
17 3.17 Pin diagram of Relay 41
18 3.18 DC Motor 43
19 3.19 Circuit diagram of Motor 45
20 3.20 Pin diagram of L293D 47
21 3.21 Circuit diagram of L293D 48
22 3.22 Diagram of geared DC Motor 49
23 3.23 DHT-11 Sensor 50
24 3.24 Pin diagram of DHT-11 52
25 3.25 Gas Sensor 53
26 3.26 Servo Motor 55
27 3.27 Parts of Servo Motor 57
28 3.28 Pulse diagram of Motor 58

x
29 3.29 LED 60
30 3.30 Water Pump 61
31 3.31 Robo Setup 62
32 4.1 Arduino IDE: Default Window 64
33 4.2 Arduino IDE: Board setup Procedure 65
34 4.3 Arduino IDE: Com Port Setup 66
35 4.4 Arduino IDE: Loading Blink Sketch 67
36 4.5 Arduino IDE: Output Window 67
37 5.1 Smart phone controlled Agricultural Robot for 71
automatic irrigation system

xi
List of Tables

S. No Figure Name of the Table Page


No. No

1 3.1 Pin Configuration Table for Bluetooth Module 33


2 3.2 Commands Table for Bluetooth Module 36

xii
CHAPTER 1

INTRODUCTION
1.1 GENERAL

Agriculture is India's backbone. Agriculture has a long history in India,


dating back to the Indus Valley Civilization and even earlier in some parts of
Southern India.

India is now the world's second-largest producer of agricultural


products. Special vehicles play an important role in a variety of industries,
including industrial, medical, and military applications. In the agricultural field,
the special vehicle field is gradually expanding its productivity. In India's
agricultural sector, growing input costs, a scarcity of qualified labour, a shortage
of water resources, and crop monitoring are all key issues. Automation
technologies were applied in agriculture to solve these issues. Agriculture
automation may be able to help farmers save time and effort. Vehicles are being
developed for ploughing, leveling, and other tasks., and the spraying of water
All of these tasks have yet to be completed with a single vehicle. The robots in
this project are being designed to concentrate in an effective manner and to
conduct operations autonomously. The proposed concept uses a vehicle to do
tasks like sloughing, seeding, mud leveling, and water spraying. These functions
can be combined and executed in a single vehicle.

1
1.2 EXISTING SYSTEM

Figure 1 - Block diagram of Existing system

This agribot is controlled by a PIC 16F877A microcontroller. The


impediments are detected using an infrared sensor. The moisture content of the
soil is detected using a soil moisture sensor. We can obtain information on the
operation of the agribot via Bluetooth. The robot's movement on the ground is
controlled by a motor driver. Pumping motors are used to transport water to
agricultural fields.

1.3 DISADVANTAGES OF EXISTING SYSTEM

• Time taking process


• Less accurate output
.

2
1.4 PROPOSED SYSTEM

Figure 2 - Block diagram of Proposed system

1.5 ADVANTAGES OF PROPOSED SYSTEM

• Suitable For Agriculture field


• Sensors identifies moisture and temperature of the soil
• Requirement of manual labor is less
• Cost is Low
• Eco friendly device

3
CHAPTER 2
LITERATURE SURVEY

The robotics field is progressively increasing its productivity in


agriculture field. Some of the major problems in the Indian agriculture field are
growing input expenses, availability of skilled labors, lack of water resources
and crop monitoring. To conquer these problems, the automation technologies
make a use of robots in agriculture. The automation technology in the agriculture
can help farmers to reduce their efforts and hard work.

[1] K Durga Sowjanya, R Sindhu, M Parijatham, K Srikanth, P Bhargav


discuses on the look, design and model of the autonomous agriculture robot. The
main motive is to decrease the labor force and provide efficient way for it. It
implements the use of Microcontroller and Bluetooth technology and helps in
digging the soil, seeding, leveling the soil and then water spraying over the soil.
The paper highlights how the robot can be controlled using just a simple Android
app. The advantages of such simple model is that it is compact, lightweight and
economic for the farmers also.

[2] Akhila Gollakota and M. B. Srinivas has termed the indigenous agriculture
robot as “Agribot”. India is a major agriculture boosted economic country and
so such machines are necessary for the farmers to work faster in the fields. The
model consists of a PSoC controller to operate the components of the motor and
it performs the functions like ploughing the soil, seedling and covering the soil
over. The paper shows how PSoC controller can display over many parameters
and is an alternative to the Arduino microcontroller. The advantage of this model
is that it will improve the accuracy and efficiency of operations in the farms.

[3] Saurabh Umarkar and Anil Karwankar underline the effect of unavailability
of skilled workers in the farming occupation and use of machinery is very vast.
So, it presents a design and development of a robot which will perform the
functions of ploughing, seed sowing and also to detect obstacles in the way. The
result of this model shows how the seeds are placed in the field at different

4
intervals. The advantage of such model is that it increases productivity in the
farm and also operates on a renewable energy source of solar power.

[4] Shivaprasad B S, Ravishankara M N, B N Shoba has highlighted how the


design and implementation of seed sowing and fertilizers take place. The model
uses many sensors and apart from Arduino it also uses Raspberry Pi for
communication purposes. The model can sense the moisture, pH level and
humidity of soil and can provide fertilizer spraying accordingly. This will help
the farmers in fertilizer spraying and will help them look over various parameters
about soil.

[5] Swati D. Sambare, S.S. Belsare has described over the whole process of seed
sowing technology. The dispensing mechanism uses ARM module and is
connected to PC using Zig Bee module. The paper explains how various seeds
can be dispensed and sowed through the robot accordingly. This can help the
farmers in seed sowing purpose in the fields.

Also, many other research papers helped us to understand the different


aspects highlighted by the research on the agricultural robot. Robot's basic
terminology, its function and use, all the process were written and experimented
in this research paper. We have developed the system on paper to help us to
make this robot successful in operation. Three mechanisms are implemented in
the designing of the robot. This work also throws light on the future scope of
robots.

5
CHAPTER 3
PROJECT DESCRIPTION

3.1 GENERAL INTRODUCTION TO EMBEDDED SYSTEM


Embedded systems are designed to do some specific tasks rather than be a
general-purpose computer for multiple tasks. Some also have real time
performance constraints that must met, for reason such as safety and usability;
others may have low or no performance requirements, allowing the system
hardware to be simplified to reduce costs.

An embedded system is not always a separate block very often it is physically


built in to the device it is controlling. The software written for embedded systems
is often called firmware, and is stored in read only memory or flash convector
chips rather than a disk drive. It often runs with limited computer hardware
resources: small or no keyboard, screen and little memory.

To perform any application in the embedded system we require


microprocessor and microcontroller. In the microprocessor an external memory is
connected which increases the size of the microprocessor and multiple operations
are being performed by the microprocessor but whereas in the microprocessor the
memory is inbuilt and also, we can use this controller only for the specific
applications where the speed is increased so most probably microcontrollers are
used in the different applications in the embedded systems rather than
microprocessor.

Accounting, software development and so on. In contrast, the software in the


embedded systems in an embedded system can be defined as a computing device
that does a specific focused job. Appliances such as the air-conditioner, VCD
player, DVD player, printer, fax machine, mobile phone etc. are examples of
embedded systems. Each of these appliances will have a processor and special
hardware to meet the specific requirement of the application along with the
embedded software that is executed by the processor for meeting that specific

6
requirement. The embedded software is also called “firm ware”. The
desktop/laptop computer is a general-purpose computer. You can use it for a
variety of applications such as playing games, word processing, s always fixed
listed below: Embedded systems do a very specific task; they cannot be
programmed to do different things. Embedded systems have very limited
resources, particularly the memory. Generally, they do not have secondary storage
devices such as the CDROM or the floppy disk. Embedded systems have to work
against some deadlines. A specific job has to be completed within a specific time.
In some embedded systems, called real-time systems, the deadlines are stringent.
Missing a deadline may cause a catastrophe-loss of life or damage to property.
Embedded systems are constrained for power. As many embedded systems
operate through a battery, the power consumption has to be very low. Some
embedded systems have to operate in extreme environmental conditions such as
very high temperatures and humidity.

Application Areas
Nearly 99 per cent of the processors manufactured end up in embedded
systems. The embedded system market is one of the highest growth areas as these
systems are used in very market segment- consumer electronics, office
automation, industrial automation, biomedical engineering, wireless
communication, data communication, telecommunications, transportation,
military and so on.

Consumer appliances
At home we use a number of embedded systems which include digital
camera, digital diary, DVD player, electronic toys, microwave oven, remote
controls for TV and air-conditioner, VCO player, video game consoles, video
recorders etc. Today’s high-tech car has about 20 embedded systems for
transmission control, engine spark control, air-conditioning, navigation etc. Even
wristwatches are now becoming embedded systems. The palmtops are powerful
embedded systems using which we can carry out many general-purpose tasks such
as playing games and word processing.

7
Office Automation
The office automation products using embedded systems are copying
machine, fax machine, key telephone, modem, printer, scanner etc.

Industrial Automation
Today a lot of industries use embedded systems for process control. These
include pharmaceutical, cement, sugar, oil exploration, nuclear energy, electricity
generation and transmission. The embedded systems for industrial use are
designed to carry out specific tasks such as monitoring the temperature, pressure,
humidity, voltage, current etc., and then take appropriate action based on the
monitored levels to control other devices or to send information to a centralized
monitoring station. In hazardous industrial environment, where human presence
has to be avoided, robots are used, which are programmed to do specific jobs. The
robots are now becoming very powerful and carry out many interesting and
complicated tasks such as hardware assembly.

Medical Electronics
Almost every medical equipment in the hospital is an embedded system.
This equipment includes diagnostic aids such as ECG, EEG, blood pressure
measuring devices, X-ray scanners; equipment used in blood analysis, radiation,
colonoscopy, endoscopy etc. Developments in medical electronics have paved
way for more accurate diagnosis of diseases.

Computer Networking
Computer networking products such as bridges, routers, Integrated
Services Digital Networks (ISDN), Asynchronous Transfer Mode (ATM), X.25
and frame relay switches are embedded systems which implement the necessary
data communication protocols. For example, a router interconnects two networks.
The two networks may be running different protocol stacks. The router’s function
is to obtain the data packets from incoming pores, analyze the packets and send
them towards the destination after doing necessary protocol conversion. Most
networking equipment’s, other than the end systems (desktop computers) we use
to access the networks, are embedded systems.

8
Telecommunications
In the field of telecommunications, the embedded systems can be
categorized as subscriber terminals and network equipment. The subscriber
terminals such as key telephones, ISDN phones, terminal adapters, web cameras
are embedded systems. The network equipment includes multiplexers, multiple
access systems, Packet Assemblers Dissemblers (PADs), sate11ite modems etc.
IP phone, IP gateway, IP gatekeeper etc. are the latest embedded systems that
provide very low-cost voice communication over the Internet.

Wireless Technologies
Advances in mobile communications are paving way for many interesting
applications using embedded systems. The mobile phone is one of the marvels of
the last decade of the 20th century. It is a very powerful embedded system that
provides voice communication while we are on the move. The Personal Digital
Assistants and the palmtops can now be used to access multimedia service over
the Internet. Mobile communication infrastructure such as base station controllers,
mobile switching centers are also powerful embedded systems.

Instrumentation
Testing and measurement are the fundamental requirements in all
scientific and engineering activities. The measuring equipment we use in
laboratories to measure parameters such as weight, temperature, pressure,
humidity, voltage, current etc. are all embedded systems. Test equipment such as
oscilloscope, spectrum analyzer, logic analyzer, protocol analyzer, radio
communication test set etc. are embedded systems built around powerful
processors. Thank to miniaturization, the test and measuring equipment are now
becoming portable facilitating easy testing and measurement in the field by field-
personnel.

Security
Security of persons and information has always been a major issue. We
need to protect our homes and offices; and also, the information we transmit and

9
store. Developing embedded systems for security applications is one of the most
lucrative businesses nowadays. Security devices at homes, offices, airports etc. for
authentication and verification are embedded systems. Encryption devices are
nearly 99 per cent of the processors that are manufactured end up in~ embedded
systems. Embedded systems find applications in every industrial segment-
consumer electronics, transportation, avionics, biomedical engineering,
manufacturing, process control and industrial automation, data communication,
telecommunication, defense, security etc. Used to encrypt the data/voice being
transmitted on communication links such as telephone lines. Biometric systems
using fingerprint and face recognition are now being extensively used for user
authentication in banking applications as well as for access control in high security
buildings.

Finance
Financial dealing through cash and cheques are now slowly paving way for
transactions using smart cards and ATM (Automatic Teller Machine, also
expanded as Any Time Money) machines. Smart card, of the size of a credit card,
has a small micro-controller and memory; and it interacts with the smart card
reader! ATM machine and acts as an electronic wallet. Smart card technology has
the capability of ushering in a cashless society. Well, the list goes on. It is no
exaggeration to say that eyes wherever you go, you can see, or at least feel, the
work of an embedded system.

Overview of Embedded System Architecture


Every embedded system consists of custom-built hardware built around a
Central Processing Unit (CPU). This hardware also contains memory chips onto
which the software is loaded. The software residing on the memory chip is also
called the ‘firmware’. The embedded system architecture can be represented as a
layered architecture as shown in Fig 3.1 The operating system runs above the
hardware, and the application software runs above the operating.

10
Figure 3.1 Overview of Embedded System Architecture

The same architecture is applicable to any computer including a desktop


computer. However, there are significant differences. It is not compulsory to
have an operating system in every embedded system. For small appliances such
as remote-control units, air conditioners, toys etc., there is no need for an
operating system and you can write only the software specific to that application.
For applications involving complex processing, it is advisable to have an
operating system. In such a case, you need to integrate the application software
with the operating system and then transfer the entire software on to the memory
chip. Once the software is transferred to the memory chip, the software will
continue to run for a long time you don’t need to reload new software.

Now, let us see the details of the various building blocks of the hardware
of an embedded system. As shown in Fig 3.2 the building blocks are;
· Central Processing Unit (CPU)
· Memory (Read-only Memory and Random-Access Memory)
· Input Devices
· Output devices
· Communication interfaces
· Application-specific circuitry

11
Figure 3.2 Block Diagram of Embedded System

Central Processing Unit (CPU)

The Central Processing Unit (processor, in short) can be any of the


following: microcontroller, microprocessor or Digital Signal Processor (DSP). A
micro-controller is a low-cost processor. Its main attraction is that on the chip
itself, there will be many other components such as memory, serial communication
interface, analog-to digital converter etc. So, for small applications, a micro-
controller is the best choice as the number of external components required will
be very less. On the other hand, microprocessors are more powerful, but you need
to use many external components with them. D5P is used mainly for applications
in which signal processing is involved such as audio and video processing.

Memory
The memory is categorized as Random-Access Memory (RAM) and Read
Only Memory (ROM). The contents of the RAM will be erased if power is
switched off to the chip, whereas ROM retains the contents even if the power is
switched off. So, the firmware is stored in the ROM. When power is switched on,
the processor reads the ROM; the program is program is executed.

Input Devices
12
Unlike the desktops, the input devices to an embedded system have very
limited capability. There will be no keyboard or a mouse, and hence interacting
with the embedded system is no easy task. Many embedded systems will have a
small keypad-you press one key to give a specific command. A keypad may be
used to input only the digits. Many embedded systems used in process control do
not have any input device for user interaction; they take inputs from sensors or
transducers 1’fnd produce electrical signals that are in turn fed to other systems.

Output Devices
The output devices of the embedded systems also have very limited
capability. Some embedded systems will have a few Light Emitting Diodes
(LEDs) to indicate the health status of the system modules, or for visual indication
of alarms. A small Liquid Crystal Display (LCD) may also be used to display.

Communication Interfaces
The embedded systems may need to, interact with other embedded
systems at they may have to transmit data to a desktop. To facilitate this, the
embedded systems are provided with one or a few communication interfaces such
as RS232, RS422, RS485, Universal Serial Bus (USB), and IEEE 1394, Ethernet
etc.

Application-Specific Circuitry

Sensors, transducers, special processing and control circuitry may be


required fat an embedded system, depending on its application. This circuitry
interacts with the processor to carry out the necessary work. The entire hardware
has to be given power supply either through the 230 volts main supply or through
a battery. The hardware has to design in such a way that the power consumption
is minimized.

13
3.2 BLOCK DIAGRAM

Figure 3.3 Block diagram of smart phone multipurpose agricultural robot

The block diagram of multipurpose agricultural robot is shown in the


Fig 3.3. The Arduino is used in this Agribot. LDR sensor used to detect the light
levels of photoconductivity when light falls on it. Soil moisture sensor is used to
detect the moisture content in the soil. Through Bluetooth we can able to get the
information about the working of Agribot. DHT-11 sensor is used here to
monitor the humidity variation of the environment and This is a digital sensor
which measures the humidity value in percentage format. Relay used to detect
only a low-power signal which can be used to control a circuit. Motor is used to
make the robot move on the ground. Servo motor is made up of DC motor which
is controlled by a variable resistor (potentiometer) and some gears. The Robot
Car Kit 01 is a kit that can act as a basic framework for a car/robot in this we can
simply add components mentioned below Fig 3.3, and Pumping motor work is
to pump the water to the agricultural field.

14
3.3 MODULES
3.3.1 ARDUINO
The Arduino Uno is an open-source microcontroller board based on the
Microchip ATmega328P microcontroller and developed by Arduino.cc.
The board is equipped with sets of digital and analog input/output pins that
may be interfaced to various expansion boards and other circuits.

Figure 3.4 ARDUINO UNO

These boards as shown in the Fig 3.4 below use the same micro-
controller, just in a different package. The Lilypad is designed for use with
conductive thread instead of wire and the Arduino Mini is simply a smaller
package without the USB, Barrel Jack and Power Outs.

15
Figure 3.5 Arduino Lilypad and Arduino Mini

It depends on what you want to do with it really. There are two different
purposes outlined above for the voltage divider as shown in the Fig 3.5, we will
go over both. If you wish to use the voltage divider as a sensor reading device
first you need to know the maximum voltage allowed by the analog inputs you
are using to read the signal. On an Arduino this is 5V. So, already we know the
maximum value we need for Vout. The Vin is simply the amount of voltage
already present on the circuit before it reaches the first resistor. You should be
able to find the maximum voltage your sensor outputs by looking on the
Datasheet, this is the maximum amount of voltage your sensor will let through
given the voltage in of your circuit. Now we have exactly one variable left, the
value of the second resistor. Solve for R2 and you will have all the components
of your voltage divider figured out! We solve for R1's highest value because a
smaller resistor will simply give us a smaller signal which will be readable by
our analog inputs.
Powering an analog Reference is exactly the same as reading a sensor except
you have to calculate for the Voltage Out value you want to use as the analog
Reference.

All of the electrical signals that the Arduino works with are either Analog
or Digital. It is extremely important to understand the difference between these
two types of signals and how to manipulate the information these signals
represent.

16
3.3.2 DIGITAL SIGNALS

An electronic signal transmitted as binary code that can be either the


presence or absence of current, high and low voltages or short pulses at a
particular frequency.

Humans perceive the world in analog, but robots, computers and circuits
use Digital. A digital signal is a signal that has only two states. These states can
vary depending on the signal, but simply defined the states are ON or OFF, never
in between.

In the world of Arduino, Digital signals are used for everything with the
exception of Analog Input. Depending on the voltage of the Arduino the ON or
HIGH of the Digital signal will be equal to the system voltage, while the OFF
or LOW signal will always equal 0V. This is a fancy way of saying that on a 5V
Arduino the HIGH signals will be a little under 5V and on a 3.3V Arduino the
HIGH signals will be a little under 3.3V.

To receive or send Digital signals the Arduino uses Digital pins # 0 - #


13. You may also setup your Analog In pins to act as Digital pins. To set up
Analog In pins as Digital pins use the command: pin Mode (pin Number, value);
where pin Number is an Analog pin (A0 – A5) and value is either INPUT or
OUTPUT. To setup Digital pins use the same command but reference a Digital
pin for pin Number instead of an Analog In pin. Digital pins default as input, so
really you only need to set them to OUTPUT in pin Mode. To read these pins
use the command: digital Read (pin Number); where pin Number is the Digital
pin to which the Digital component is connected. The digital Read command
will return either a HIGH or a LOW signal. To send a Digital signal to a pin use
the command: digital Write (pin Number, value); where pin Number is the
number of the pin sending the signal and value is either HIGH or LOW.

The Arduino also has the capability to output a Digital signal that acts
as an Analog signal, this signal is called Pulse Width Modulation (PWM).

17
Digital Pins # 3, # 5, # 6, # 9, # 10 and #11 have PWM capabilities. To output a
PWM signal use the command: analog Write (pin Number, value); where pin
Number is a Digital Pin with PWM capabilities and value is a number between
0 (0%) and 255 (100%). For more information on PWM see the PWM
worksheets or S.I.K. circuit 12.

THINGS TO REMEMBER ABOUT DIGITAL:


▪ Digital Input/Output uses the Digital pins, but Analog In pins can be
used as Digital
▪ To receive a Digital signal use: digital Read (pin Number);
▪ To send a Digital signal use: digital Write (pin Number, value);
▪ Digital Input and Output are always either HIGH or LOW

All of the electrical signals that the Arduino works with are either
Analog or Digital. It is extremely important to understand the difference
between these two types of signals and how to manipulate the information these
signals represent.

3.3.3 ANALOG SIGNALS


Humans perceive the world in analog. Everything we see and hear is a
continuous transmission of information to our senses. The temperatures we
perceive are never 100% hot or 100% cold, they are constantly changing
between our ranges of acceptable temperatures. (And if they are out of our
range of acceptable temperatures then what are we doing there?) This
continuous stream is what defines analog data. Digital information, the
complementary concept to Analog, estimates analog data using only ones and
zeros.

In the world of Arduino an Analog signal is simply a signal that can be


HIGH (on), LOW (off) or anything in between these two states. This means an
Analog signal has a voltage value that can be anything between 0V and 5V
(unless you mess with the Analog Reference pin). Analog allows you to send
output or receive input about devices that run at percentages as well as on and

18
off. The Arduino does this by sampling the voltage signal sent to these pins and
comparing it to a voltage reference signal (5V). Depending on the voltage of
the Analog signal when compared to the Analog Reference signal the Arduino
then assigns a numerical value to the signal somewhere between 0 (0%) and
1023 (100%). The digital system of the Arduino can then use this number in
calculations and sketches.

To receive Analog Input the Arduino uses Analog pins # 0 - # 5. These


pins are designed for use with components that output Analog information and
can be used for Analog Input. There is no setup necessary, and to read them use
the command: analog Read (pin Number); where pin Number is the Analog In
pin to which the Analog component is connected. The analog Read command
will return a number including or between 0 and 1023.

The Arduino also has the capability to output a digital signal that acts
as an Analog signal, this signal is called Pulse Width Modulation (PWM).
Digital Pins # 3, # 5, # 6, # 9, # 10 and #11 have PWM capabilities. To output
a PWM signal use the command: Write (pin Number, value); where pin
Number is a Digital Pin with PWM capabilities and value is a number between
0 (0%) and 255 (100%). On the Arduino UNO PWM pins are signified by a ~
sign. For more information on PWM see the PWM worksheets or S.I.K. circuit
12.

THINGS TO REMEMBER ABOUT ANALOG:

▪ Analog Input uses the Analog In pins, Analog Output uses the PWM
pins
▪ To receive an Analog signal use: analog Read (pin Number);
▪ To send a PWM signal use: analog Write (pin Number, value);
▪ Analog Input values range from 0 to 1023 (1024 values because it uses
10 bits, 210)
▪ PWM Output values range from 0 to 255 (256 values because it uses 8
bits, 28)

19
▪ All of the electrical signals that the Arduino works with are either input
or output. It is extremely important to understand the difference between
these two types of signals and how to manipulate the information these
signals represent.

3.3.4 OUTPUT SIGNALS


Output to the Arduino pins is always Digital, however there are two
different types of Digital Output; regular Digital Output and Pulse Width
Modulation Output (PWM). Output is only possible with Digital pins # 0 - #
13. The Digital pins are preset as Output pins, so unless the pin was used as an
Input in the same sketch, there is no reason to use the pin Mode command to set
the pin as an Output. Should a situation arise where it is necessary to reset a
Digital pin to Output from Input use the command: pin Mode (pin Number,
OUTPUT); where pin Number is the Digital pin number set as Output. To send
a Digital Output signal use the command: digital Write (pin Number, value);
where pin Number is the Digital pin that is outputting the signal and value is the
signal. When outputting a Digital signal value can be either HIGH (On) or LOW
(Off). analog Write (pin Number, value); where pin Number is a Digital Pin with
PWM capabilities and value is a number between 0 (0%) and 255 (100%). For
more information on PWM see the PWM worksheets or S.I.K. circuit 12.

Output can be sent to many different devices, but it is up to the user to


figure out which kind of Output signal is needed, hook up the hardware and then
type the correct code to properly use these signals.

THINGS TO REMEMBER ABOUT OUTPUT:


• Output is always Digital.
• There are two kinds of Output: regular Digital or PWM (Pulse Width
Modulation).
• To send an Output signal use analog Write (pin Number, value); (for
analog) or digital Write (pin Number, value); (for digital).
• Output pin mode is set using the pin Mode command: pin Mode (pin
Number, OUTPUT);

20
• Regular Digital Output is always either HIGH or LOW.
• PWM Output varies from 0 to 255.

All of the electrical signals that the Arduino works with are either input
or output. It is extremely important to understand the difference between these
two types of signals and how to manipulate the information these signals
represent.

3.3.5 INPUT SIGNALS


Analog Input enters your Arduino through the Analog In pins # 0 - # 5.
These signals originate from analog sensors and interface devices. These analog
sensors and devices use voltage levels to communicate their information instead
of a simple yes (HIGH) or no (LOW). For this reason, you cannot use a digital
pin as an input pin for these devices. Analog Input pins are used only for
receiving Analog signals. It is only possible to read the Analog Input pins so
there is no command necessary in the setup () function to prepare these pins for
input. To readtheAnalogInput pins use the command: analog Read (pin
Number);

where pin Number is the Analog Input pin number. This function will
return an Analog Input reading between 0 and 1023. A reading of zero
corresponds to 0 Volts and a reading of 1023 corresponds to 5 Volts. These
voltage values are emitted by the analog sensors and interfaces. If you have an
Analog Input that could exceed Vcc + .5V you may change the voltage that 1023
corresponds to by using the Aref pin. This pin sets the maximum voltage
parameter your Analog Input pins can read. The Aref pin's preset value is 5V.
Digital Input can enter your Arduino through any of the Digital Pins # 0 - # 13.
Digital Input signals are either HIGH (On, 5V) or LOW (Off, 0V).

Because the Digital pins can be used either as input or output you will
need to prepare the Arduino to use these pins as inputs in your setup () function.
To do this type the command: pin Mode (pin Number, INPUT); Inside the curly
brackets of the setup () function where pin Number is the Digital pin number
you wish to declare as an input. You can change the pin Mode in the loop ()

21
function if you need to switch a pin back and forth between input and output,
but it is usually set in the setup () function and left untouched in the loop ()
function. To read the Digital pins set as inputs use the command: digital Read
(pin Number); where pin Number is the Digital Input pin number. Input can
come from many different devices, but each device's signal will be either Analog
or Digital, it is up to the user to figure out which kind of input is needed, hook
up the hardware and then type the correct code to properly use these signals.

Figure 3.6 Pin configuration of ARDUINO

X1:
DE-9 serial connector, used to connect computer (or other devices)
using RS-232 standard. Needs a serial cable, with at least 4 pins connected: 2,
3, 4 and 5. Works only when JP0 is set to 2-3 position.

DC1:
2.1 mm. power jack, used to connect external power source. Centre
positive. Voltage Regulator Works with regulated +7 to +20 volts DC (9v. to
12v. is recommended). It is possible to alternatively connect external power
using 9v. pin or 5v. pin. (See POWER PINOUT).

22
ICSP:
2x3 pin header Used to program Atmega with bootloader. The number
1 on both sides of the board indicates cable pin1 position. Used to upload
sketches on Atmega ICs without bootloader (available only in Arduino IDE
versions 0011 and 0012).

JP0
3 pins jumper When in position 2-3, this jumper enables serial
connection (through X1 connector) to/from computer/devices. Use this as
default position. When in position 1-2, it disables serial communication, and
enables external pull-down resistors on pin0 (RX) and pin1 (TX). Use this only
to prevent noise on RX (that seems incoming data to Atmega), that sometimes
makes sketch not starting. When removing this jumper, serial communication is
disabled, and pin0 and pin1 work as a normal (floating) digital pin. Useful when
more digital pins are needed, but only when serial communication is not
necessary. External pull-down/pull-up resistor is required.

JP4
2 pins jumper When in position 1-2, this jumper enables auto reset
feature, useful when uploading a sketch to Arduino, resetting Atmega
automatically. It makes unnecessary to press reset button (S1) when uploading
sketches. Be sure that computer COM Port speed is set to 19200bps otherwise
auto reset will not work properly. If removed, disables auto reset feature. Very
useful to prevent undesired Atmega reset when using sketches that needs serial
communication. Auto reset works with DTR pulse on serial pin4. Sometimes
Arduino senses a DTR pulse when connecting X1 (serial connector) and some
software’s sends a DTR pulse when it starts or when it closes, that makes
Atmega reset when not desired.

S1
Tactile button This button resets Atmega, to restart uploaded sketch or
to prepare Arduino to receive a sketch through serial connector (when auto reset
is not active).

23
LEDS
Indicative leds POWER led Turns on when Arduino is powered through
DC1, +9v. pin or +5v. pin. RX led Blinks when receiving data from
computer/device through serial connection. TX led Blinks when sending data to
computer/device through serial connection. L led This led is connected to digital
pin13 with a current limiter resistor (that doesn’t affect pin13). Useful to test
sketches. It is normal to blink when boot loading too.

POWER PINOUT
6 pin headers

RST pin
Makes Atmega reset when connected to GND. Useful for Shield Boards,
or to connect external reset.

NC pin
This pin is not connected in Arduino S3v3. Arduino Diecimila has a 3.3
volts pin in the same position.

+9v. pin
When Arduino DC1 is powered (with battery or DC adaptor), this pin is
used as Vout, with the same voltage supplied on DC1 (see DC1), minus 0,7
volts. The total supplied current depends on external power source capacity
When Arduino DC1 is not powered, +9v. pin can be used as Vin, connecting it
to a external regulated power source (+7 to +20 volts) and connecting 0v. pin to
external power source GND.

+5v. pin
This can be used as Vout, supplying +5 volts. +5v. pin When Arduino
DC1 is powered (with battery or DC adaptor), +5v. pin supplies +5 volts as a
Vout pin. The total supplied current depends on Voltage Regulator (7805
supplies up to 1A). This applies only to +5v. pin: Atmega in/out pins only
supplies max. 40mA on each pin. When Arduino DC1 is not powered, this pin
can be used as Vin, connecting it to a regulated +5v. and connecting 0v. pin to

24
power source GND. In this case, +9v. pin is inactive. 0v. pin (GND) Two 0v.
pins between +5v. and +9v. / One.

0v. pin
Beside AREF pin. When Arduino DC1 is powered, 0v. pin supplies 0
volts reference (GND) for +5v. pin and +9v. pin. When DC1 is not powered,
and Arduino is powered through +5v. pin or +9v. pin, 0v. pin must be used as
GND reference, connecting it to the external power source GND.

GND pin
See 0v. pin (GND).

AREF pin
The AREF can be set to AVcc (default), internal 2.56 volts (Atmega8),
internal 1.1 volts (Atmega168), or external AREF. In case of AVcc or internal
AREF, AREF pin can be used to attach na external capacitor to decouple the
signal, for better noise performance. In case of external AREF, AREF pin is
used to attach the external reference voltage. Remember that it is necessary to
change de fuses (wiring’s file), and re-upload sketch, before connecting
external voltage to AREF.

25
3.3.6 SOFTWARE TIPS
When boot loading an Atmega8 chip with Arduino 0010, there is a
command (-i800) that makes bootloader delay 10 minutes. So, if you need to use
bootloader, use command line instead of IDE, removing “–i800” command and
adding “–F” command, or use Arduino 0007 IDE. To upload sketches Arduino
0010 works fine.

ARDUINO S3v3 NEW FEATURES


• Full compatible with Shield Boards (Version 2 is the only Arduino Board
not compatible with Shield Boards because of ICSP header wrong
position, and tall components);
• AVcc LP filter to reduce noise level on ADC;
• Auto reset feature;
• Auto reset enable/disable jumper, to avoid not desired reseting;
• Arduino Diecimila compatible reset pin;
• Pin13 onboard led, with current limiter resistor;
• TX and RX onboard leds;
• Power led with appropriate current limiter resistor (less 20mA of
consumption);
• Jumper to disable serial communication and to enable RX external pull
down resistor, to avoid “RX floating error”. This feature allows to use
digital pin0 and pin1 as a normal pin, when serial communication is not
needed;
• All similar components (diodes, transistors, leds, capacitors) has the
same board orientation (to makes easier to mount with less mistakes);
• No wires between pads, more space between wires, larger wires, larger
pads (better for etching, soldering and drilling, with no short circuits,
soldering bridges or open wires in corrosion);
• Only 3 wire bridges;
• Electrolytic capacitor (in serial to TTL circuit) changed to bipolar type
(to avoid inverted voltage problem when serial cable is not connected);
• All jumpers are right angle type, to allow Shield Boards use.

26
3.4 LIGHT DEPENDENT RESISTOR (LDR)

A Light Dependent Resistor (LDR) or a photo resistor is a device


whose resistivity is a function of the incident electromagnetic radiation. Hence,
they are light sensitive devices. They are also called as photo conductors, photo
conductive. They are made up of semiconductor materials having high
resistance. There are many different symbols used to indicate an LDR, one of
the most commonly used symbols is shown in the Fig 3.7. The arrow indicates
light falling on it.

Figure 3.7 Basic structure and symbol of LDR

3.4.1 CONSTRUCTION OF A PHOTOCELL

The structure of a light dependent resistor consists of a light sensitive


material which is deposited on an insulating substrate such as ceramic. The
material is deposited in zigzag pattern in order to obtain the desired resistance
and power rating. This zigzag area separates the metal deposited areas into two
regions. Then the ohmic contacts are made on the either side of the area. The
resistances of these contacts should be as less as possible to make sure that the
resistance mainly changes due to the effect of light only. Materials normally
used are cadmium sulphide, cadmium selenide, indium antimonide and
cadmium sulphonide. The use of lead and cadmium is avoided as they are
harmful to the environment.

27
3.4.2 CHARACTERISTICS OF LDR

LDR’s are light dependent devices whose resistance is decreased when


light falls on them and that is increased in the dark. When a light dependent
resistor is kept in dark, its resistance is very high. This resistance is called as
dark resistance. It can be as high as 1012 Ω and if the device is allowed to absorb
light its resistance will be decreased drastically. If a constant voltage is applied
to it and intensity of light is increased the current starts increasing. Fig 3.8 below
shows resistance vs. illumination curve for a particular LDR.

Figure 3.8 LDR

LDR CHARACTERISTICS

Photocells or LDR’s are non-linear devices. There sensitivity varies with


the wavelength of light incident on them. Some photocells might not at all
response to a certain range of wavelengths. Based on the material used different
cells have different spectral response curves.

When light is incident on a photocell it usually takes about 8 to 12 ms


for the change in resistance to take place, while it takes one or more seconds for
the resistance to rise back again to its initial value after removal of light. This
phenomenon is called as resistance recovery rate. This property is used in audio
compressors.

Also, LDR’s are less sensitive than photo diodes and phototransistor. (A
photo diode and a photocell (LDR) are not the same, a photo-diode is a pn

28
junction semiconductor device that converts light to electricity, whereas a
photocell is a passive device, there is no pn junction in this nor it “converts”
light to electricity).

3.4.3 TYPES OF LIGHT DEPENDENT RESISTORS

Based on the materials used they are classified as:

• Intrinsic photo resistors (Un doped semiconductor): These are made of


pure semiconductor materials such as silicon or germanium. Electrons
get excited from valance band to conduction band when photons of
enough energy fall on it and number charge carriers is increased.
• Extrinsic photo resistors: These are semiconductor materials doped with
impurities which are called as dopants. Theses dopants create new
energy bands above the valence band which are filled with electrons.
Hence this reduces the band gap and less energy is required in exciting
them. Extrinsic photo resistors are generally used for long wavelengths.

3.4.4 WORKING PRINCIPLE OF LDR

A light dependent resistor works on the principle of photo conductivity.


Photo conductivity is an optical phenomenon in which the materials
conductivity is increased when light is absorbed by the material. When light falls
i.e., when the photons fall on the device, the electrons in the valence band of the
semiconductor material are excited to the conduction band. These photons in the
incident light should have energy greater than the band gap of the semiconductor
material to make the electrons jump from the valence band to the conduction
band. Hence when light having enough energy strikes on the device, more and
more electrons are excited to the conduction band which results in large number
of charge carriers. The result of this process is more and more current starts
flowing through the device when the circuit is closed and hence it is said that the
resistance of the device has been decreased.

29
Figure 3.9 Circuit diagram of LDR

3.4.5 APPLICATIONS OF LDR:

• Camera light meter


• Street lamps
• Alarm clock
• Burglar alarm circuits
• Light intensity meters
• Clock radios
• Light beam alarms
• Reflective smoke alarms
• Outdoor clocks.

30
3.5 MOISTURE SENSOR

The moisture sensor detects the wetness or dryness of the soil.


Based on the dryness value of the soil the controller controls the pump.

Figure 3.10 Moisture Sensor

The Moisture sensor is used to measure the water content (moisture) of


soil. When the soil is having water shortage, the module output is at high level,
else the output is at low level. This sensor reminds the user to water their plants
and also monitors the moisture content of soil. It has been widely used in
agriculture, land irrigation and botanical gardening.

3.5.1 SPECIFICATIONS
• Working Voltage:5V
• Working Current:<20mA
• Interface type: Analog
• Working Temperature:10°C~30°C

3.5.2 WORKING PRINCIPLE OF MOISTURE SENSOR

The Soil Moisture Sensor uses capacitance to measure dielectric


permittivity of the surrounding medium. In soil, dielectric permittivity is a
function of the water content. The sensor creates a voltage proportional to the

31
dielectric permittivity, and therefore the water content of the soil. The sensor
averages the water content over the entire length of the sensor. There is a 2 cm
zone of influence with respect to the flat surface of the sensor, but it has little or
no sensitivity at the extreme edges. The Soil Moisture Sensor is used to measure
the loss of moisture over time due to evaporation and plant uptake, evaluate
optimum soil moisture contents for various species of plants, monitor soil
moisture content to control irrigation in greenhouses and enhance bottle biology
experiments.

ADVANTAGES:
• Very accurate with calibration.
• Larger measurement zone of influence than capacitance probes.
• Not affected by salinity unless it is greater than 9dS/m.

DISADVANTAGES:
• Only covers a small sensing area.
• Requires good contact between the soil and the sensor.
• Installation requires care to ensure there are no air gaps.
• Larger sensitivity to temperature, clay content and air gaps than other
sensor types.

3.6 HC-05 BLUETOOTH MODULE

HC-05 is a Bluetooth module which is designed for wireless


communication. This module can be used in a master or slave configuration.
HC-05 module is an easy-to-use Bluetooth SPP (Serial Port Protocol) module,
designed for transparent wireless serial connection setup. Serial port Bluetooth
module is fully qualified Bluetooth V2.0+EDR (Enhanced Data Rate) 3Mbps
Modulation with complete 2.4GHz radio transceiver and baseband Through
which one can build wireless Personal Area Network (PAN). It uses frequency-
hopping spread spectrum (FHSS) radio technology to send data over air. It uses
serial communication to communicate with devices. It communicates with
microcontroller using serial port (USART).

32
Figure 3.11 Bluetooth Module

3.6.1 PIN DESCRIPTION

Table 3.1 Pin Configuration table for Bluetooth Module

Pin
Pin No Description
Name
Enable / This pin is used to toggle between Data Mode (set low) and
1
Key AT command mode (set high). By default, it is in Data mode

2 Vcc Powers the module. Connect to +5V Supply voltage

3 Ground Ground pin of module, connect to system ground.

TX – Transmits Serial Data. Everything received via Bluetooth will


4
Transmitter be given out by this pin as serial data.

RX – Receive Serial Data. Every serial data given to this pin will be
5
Receiver broadcasted via Bluetooth

The state pin is connected to on board LED, it can be used as


6 State
feedback to check if Bluetooth is working properly.

Indicates the status of Module

• Blink once in 2 sec: Module has entered Command


Mode
7 LED
• Repeated Blinking: Waiting for connection in Data
Mode
• Blink twice in 1 sec: Connection successful in Data
Mode

Used to control the Key/Enable pin to toggle between Data


8 Button
and command Mode

33
HC-05 module information

• HC-05 has red LED which indicates connection status, whether the
Bluetooth is connected or not. Before connecting to HC-05 module this
red LED blinks continuously in a periodic manner. When it gets
connected to any other Bluetooth device, its blinking slows down to two
seconds.
• This module works on 3.3 V. We can connect 5V supply voltage as well
since the module has on board 5 to 3.3 V regulator.
• As HC-05 Bluetooth module has 3.3 V level for RX/TX and
microcontroller can detect 3.3 V level, so, no need to shift transmit level
of HC-05 module. But we need to shift the transmit voltage level from
microcontroller to RX of HC-05 module.

Bluetooth communication between Devices

• E.g., Send data from Smartphone terminal to HC-05 Bluetooth module


and see this data on PC serial terminal and vice versa.
• To communicate smartphone with HC-05 Bluetooth module,
smartphone requires Bluetooth terminal application for transmitting and
receiving data. You can find Bluetooth terminal applications for android
and windows in respective app. store.

Figure 3.12 Serial Interface

34
So, when we want to communicate through smartphone with HC-05
Bluetooth module, connect this HC-05 module to the PC via serial to USB
converter. Before establishing communication between two Bluetooth devices,
1st we need to pair HC-05 module to smartphone for communication.

HC-05 Default Settings

• Default Bluetooth Name: “HC-05”


• Default Password: 1234 or 0000
• Default Communication: Slave
• Default Mode: Data Mode
• Data Mode Baud Rate: 9600, 8, N, 1
• Command Mode Baud Rate: 38400, 8, N, 1
• Default firmware: LINVOR

Pair HC-05 and smartphone:

1. Search for new Bluetooth device from your phone. You will find
Bluetooth device with “HC-05” name.
2. Click on connect/pair device option; default pin for HC-05 is 1234 or
0000.

3. After pairing two Bluetooth devices, open terminal software (e.g.,


Teraterm, Realterm etc.) in PC, and select the port where we have
connected USB to serial module. Also select default baud rate of 9600
bps.

4. In smart phone, open Bluetooth terminal application and connect to


paired device HC-05.

5. It is simple to communicate, we just have to type in the Bluetooth


terminal application of smartphone. Characters will get sent wirelessly
to Bluetooth module HC-05. HC-05 will automatically transmit it
serially to the PC, which will appear on terminal. Same way we can send
data from PC to smartphone.

Command mode

• When we want to change settings of HC-05 Bluetooth module like


change password for connection, baud rate, Bluetooth device’s name etc.

35
• To do this, HC-05 has AT commands.
• To use HC-05 Bluetooth module in AT command mode, connect “Key”
pin to High (VCC).
• Default Baud rate of HC-05 in command mode is 38400bps.
• To send these commands, we have to connect HC-05 Bluetooth module
to the PC via serial to USB converter and transmit this command
through serial terminal of PC.

Table 3.2 Commands of Bluetooth Module

Command Description Response


AT Checking communication OK

Set Password
AT+PSWD=XXXX OK
e.g. AT+PSWD=4567

Set Bluetooth Device


Name
AT+NAME=XXXX OK
e.g. AT+NAME=MyHC-
05

AT+UART=Baud Change Baud rate


rate, stop bit, parity OK
bit e.g. AT+UART=9600,1,0

+Version: XX
OK
Respond version no. of
AT+VERSION?
Bluetooth module
e.g. +Version: 2.0
20130107 OK

Parameters:
device type,
Send detail of setting
AT+ORGL module mode,
done by manufacturer
serial parameter,
passkey, etc.

Where to use HC-05 Bluetooth module

The HC-05 is a very cool module which can add two-way (full-duplex)
wireless functionality to your projects. You can use this module to communicate

36
between two microcontrollers like Arduino or communicate with any device
with Bluetooth functionality like a Phone or Laptop. There are many android
applications that are already available which makes this process a lot easier. The
module communicates with the help of USART at 9600 baud rate hence it is
easy to interface with any microcontroller that supports USART. We can also
configure the default values of the module by using the command mode. So if
you looking for a Wireless module that could transfer data from your computer
or mobile phone to microcontroller or vice versa then this module might be the
right choice for you. However, do not expect this module to transfer multimedia
like photos or songs; you might have to look into the CSR8645 module for that.

How to Use the HC-05 Bluetooth module


The HC-05 has two operating modes, one is the Data mode in which it
can send and receive data from other Bluetooth devices and the other is the AT
Command mode where the default device settings can be changed. We can
operate the device in either of these two modes by using the key pin as explained
in the pin description.

It is very easy to pair the HC-05 module with microcontrollers because


it operates using the Serial Port Protocol (SPP). Simply power the module with
+5V and connect the Rx pin of the module to the Tx of MCU and Tx pin of
module to Rx of MCU as shown in the figure below

Figure 3.13 Pin configuration of Bluetooth Module

During power up the key pin can be grounded to enter into Command
mode, if left free it will by default enter into the data mode. As soon as the
module is powered you should be able to discover the Bluetooth device as “HC-
05” then connect with it using the default password 1234 and start

37
communicating with it. The name password and other default parameters can be
changed by entering into the inputs.

3.6.2 SPECIFICATIONS

• Serial Bluetooth module for Arduino and other microcontrollers


• Operating Voltage: 4V to 6V (Typically +5V)
• Operating Current: 30mA
• Range: <100m
• Works with Serial communication (USART) and TTL compatible
• Follows IEEE 802.15.1 standardized protocol
• Uses Frequency-Hopping Spread spectrum (FHSS)
• Can operate in Master, Slave or Master/Slave mode
• Can be easily interfaced with Laptop or Mobile phones with Bluetooth
• Supportedbaud rate: 9600,19200,38400,57600,115200,230400,460800.

3.6.3 APPLICATIONS

1. Wireless communication between two microcontrollers

2. Communicate with Laptop, Desktops and mobile phones

3. Data Logging application

4. Consumer applications

5. Wireless Robots

6. Home Automation

38
3.7 RELAY

What is a relay?

A relay is an electromagnetic switch that is used to turn on and turn off


a circuit by a low power signal, or where several circuits must be controlled by
one signal.

Figure 3.14 RELAY

Why is a relay used?

The main operation of a relay comes in places where only a low-power


signal can be used to control a circuit. It is also used in places where only one
signal can be used to control a lot of circuits. The application of relays started
during the invention of telephones. They played an important role in switching
calls in telephone exchanges.

They were also used in long distance telegraphy. They were used to
switch the signal coming from one source to another destination. After the
invention of computers, they were also used to perform Boolean and other
logical operations. The high-end applications of relays require high power to be
driven by electric motors and so on. Such relays are called contactors

39
Figure 3.15 Structure of Relay

3.7.1 WORKING

It works on the principle of an electromagnetic attraction. When the


circuit of the relay as shown in the below Fig 3.16 senses the fault current, it
energizes the electromagnetic field which produces the temporary magnetic
field.

Figure 3.16 Circuit diagram of Relay

This magnetic field moves the relay armature for opening or closing the
connections. The small power relay has only one contact, and the high-power
relay has two contacts for opening the switch.

40
The inner section of the relay is shown in the Fig 3.17 below. It has an
iron core which is wound by a control coil. The power supply is given to the coil
through the contacts of the load and the control switch. The current flow through
the coil produces the magnetic field around it.
Due to this magnetic field, the upper arm of the magnet attracts the lower arm.
Hence close the circuit, which makes the current flow through the load. If the
contact is already closed, then it moves oppositely and hence opens the contacts.

Relay Basics

The basics for all the relays are the same. Take a look at a 4 – pin relay
shown in the below Fig 3.17. There are two colors shown. The green color
represents the control circuit and the red color represents the load circuit. A small
control coil is connected onto the control circuit. A switch is connected to the
load. This switch is controlled by the coil in the control circuit. Now let us take
the different step that occurs in a relay.

Figure 3.17 Pins of Relay

As shown in the circuit, the current flowing through the coils represented
by pins 1 and 3 causes a magnetic field to be aroused. This magnetic field causes
the closing of the pins 2 and 4. As soon as the current flow stops through pins 1
and 3, the relay switch opens and thus the open circuit prevents the current flow
through pins 2 and 4. Thus the relay becomes de-energized and thus in off
position.

41
Pole and Throw

Relays have the exact working of a switch. So, the same concept is also
applied. A relay is said to switch one or more poles. Each pole has contacts that
can be thrown in mainly three ways. They are

• Normally Open Contact (NO) – NO contact is also called a make contact.


It closes the circuit when the relay is activated. It disconnects the circuit when
the relay is inactive.

• Normally Closed Contact (NC) – NC contact is also known as break


contact. This is opposite to the NO contact. When the relay is activated, the
circuit disconnects. When the relay is deactivated, the circuit connects.

• Change-over (CO) / Double-throw (DT) Contacts – This type of


contacts are used to control two types of circuits. They are used to control a NO
contact and also a NC contact with a common terminal. According to their type
they are called by the names break before make and make before break contacts.

Relays can be used to control several circuits by just one signal. A relay
switches one or more poles, each of whose contacts can be thrown by energizing the
coil. Relays are also named with designations like

• Single Pole Single Throw (SPST) – The SPST relay has a total of four
terminals. Out of these two terminals can be connected or disconnected. The
other two terminals are needed for the coil to be connected.

• Single Pole Double Throw (SPDT) – The SPDT relay has a total of five
terminals. Out of these two are the coil terminals. A common terminal is also
included which connects to either of two others.

42
• Double Pole Single Throw (DPST) – The DPST relay has a total of six
terminals. These terminals are further divided into two pairs. Thus, they can act
as two SPST’s which are actuated by a single coil. Out of the six terminals two
of them are coil terminals.

• Double Pole Double Throw (DPDT) – The DPDT relay is the biggest of all. It
has mainly eight relay terminals. Out of these two rows are designed to be
change over terminals. They are designed to act as two SPDT relays which are
actuated by a single coil.

3.8 DC MOTOR AND L293D DRIVER

A machine that converts DC electrical power into mechanical power is


known as a Direct Current motor. DC motor working is based on the principle
that when a current carrying conductor is placed in a magnetic field, the
conductor experiences a mechanical force.

Figure 3.18 DC MOTOR

3.8.1 WORKING PRINCIPLE OF A DC MOTOR

An electric motor is an electrical machine which converts electrical


energy into mechanical energy. The basic working principle of a DC motor is:
"whenever a current carrying conductor is placed in a magnetic field, it
experiences a mechanical force". The direction of this force is given by
Fleming's left-hand rule and its magnitude is given by F = BIL. Where, B =

43
magnetic flux density, I = current and L = length of the conductor within the
magnetic field.

Fleming's left-hand rule:

If we stretch the first finger, second finger and thumb of our left hand to
be perpendicular to each other, and the direction of magnetic field is represented
by the first finger, direction of the current is represented by the second finger,
then the thumb represents direction of the force experienced by the current
carrying conductor.

When armature windings are connected to a DC supply, an electric


current sets up in the winding. Magnetic field may be provided by field winding
(electromagnetism) or by using permanent magnets. In this case, current
carrying armature conductors experience a force due to the magnetic field,
according to the principle stated above.

Commutator is made segmented to achieve unidirectional torque.


Otherwise, the direction of force would have reversed every time when the
direction of movement of conductor is reversed in the magnetic field.

Back EMF

According to fundamental laws of nature, no energy conversion is


possible until there is something to oppose the conversion. In case of generators
this opposition is provided by magnetic drag, but in case of dc motors there is
back emf.

When the armature of a motor is rotating, the conductors are also


cutting the magnetic flux lines and hence according to the Faraday's law of
electromagnetic induction, an emf induces in the armature conductors. The
direction of this induced emf is such that it opposes the armature current (I ).
a

The circuit diagram below illustrates the direction of the back emf and

44
armature current. Magnitude of the Back emf can be given by emf equation of
a DC generator.

Figure 3.19 Circuit diagram of DC Motor

Significance of back emf:

Magnitude of back emf is directly proportional to speed of the motor.


Consider the load on a dc motor is suddenly reduced. In this case, required torque
will be small as compared to the current torque. Speed of the motor will start
increasing due to the excess torque. Hence, being proportional to the speed,
magnitude of the back emf will also increase. With increasing back emf armature
current will start decreasing. Torque being proportional to the armature current,
it will also decrease until it becomes sufficient for the load. Thus, speed of the
motor will regulate.

On the other hand, if a dc motor is suddenly loaded, the load will cause
decrease in the speed. Due to decrease in speed, back emf will also decrease
allowing more armature current. Increased armature current will increase the
torque to satisfy the load requirement. Hence, presence of the back emf makes a
dc motor ‘self-regulating’.

3.8.2 TYPES OF DC MOTORS

DC motors are usually classified on the basis of their excitation configuration,


as follows -

• Separately excited (field winding is fed by external source)

45
• Self-excited -

• Series wound (field winding is connected in series with


the armature)
• Shunt wound (field winding is connected in parallel with
the armature)
• Compound wound -
• Long shunt
• Short shunt

3.8.3 APPLICATIONS OF A DC MOTOR

It depends on the type of DC motor, which applications are ideal.


Generally speaking, the following applications are common:

• Cranes
• Conveyors
• Pumps
• Fans
• Machine tools
• Air compressors
• Toys
• Motor starters in cars

3.9 L293D

L293D is a typical Motor driver or Motor Driver IC which allows DC


motor to drive on either direction. L293D is a 16-pin IC which can control a set
of two DC motors simultaneously in any direction. It means that you can control
two DC motor with a single L293D IC. Dual H-bridge Motor Driver integrated
circuit (IC).

The l293d can drive small and quiet big motors as well, check the
Voltage Specification at the end.

46
3.9.1 CONCEPT OF L293D

It works on the concept of H-bridge. H-bridge is a circuit which allows


the voltage to be flown in either direction. As you know voltage need to change
its direction for being able to rotate the motor in clockwise or anticlockwise
direction, hence H-bridge IC are ideal for driving a DC motor.

In a single L293D chip there are two h-Bridge circuit inside the IC which
can rotate two dc motor independently. Due its size it is very much used in
robotic application for controlling DC motors. Given Fig 3.20 below is the pin
diagram of a L293D motor controller.

Figure 3.20 Pin diagram of L293D

47
3.9.2 WORKING OF L293D IC

`Figure 3.21 Circuit diagram of L293D IC

• L293D motor driver IC contains two H-bridge circuit inside it, which may
also use Darlington transistor some times for current amplification.
• Let we understand this H-bridge circuit, in case 1, when logic ‘1’ apply to
transistor T1 and T4, motor starts rotating in clockwise direction due to
circuit complete and current flows through it as shown by blue indication.
• In case 2, we apply logic ‘1’ to transistor T2 and T3, so motor starts rotating
in anti-clockwise direction due to circuit complete and direction of current
flows through it is shown by green indication.
• As I mentioned that logic ‘1’ apply to T1 & T4 or T2 & T3 is just for
simplicity cause this transistor is hard wired inside IC so you just need to
take care of pin-out and apply logic to IC’s pin directly and carried out your
work.

48
How simple or geared DC motor work with microcontroller?

Figure 3.22 Diagram of geared DC motor

• As you can see on above Fig 3.22, understanding of motor is simple as seen.
• Motor rotates in the direction of higher potential to lower potential.
• Here we make this diagram as simple as we can, cause easy understanding
(not use L293D IC).

Why 4 grounds in the IC?

The motor driver IC deals with heavy currents. Due to so much current
flow the IC gets heated. So, we need a heat sink to reduce the heating. Therefore,
there are 4 ground pins. When we solder the pins on PCB, we get a huge metallic
area between the grounds where the heat can be released.

Voltage Specification

VCC is the voltage that it needs for its own internal operation 5v; L293D
will not use this voltage for driving the motor. For driving the motors, it has a
separate provision to provide motor supply VSS (V supply). L293d will use this
to drive the motor. It means if you want to operate a motor at 9V then you need
to provide a Supply of 9V across VSS Motor supply. The maximum voltage for
VSS motor supply is 36V.

49
It can supply a max current of 600mA per channel. Since it can drive
motors Up to 36v hence you can drive pretty big motors with this l293d.

VCC pin 16 is the voltage for its own internal Operation. The maximum
voltage ranges from 5v and up to 36v.

3.10 DHT-11

This sensor is used here to monitor the humidity variation of the


environment where the crops are cultivated. This is a digital sensor and measures
the humidity value in percentage format.

Figure 3.23 DHT-11 Sensor

DHT11 humidity and temperature sensor is available as a sensor and as


a module as shown in Fig 3.23. The difference between this sensor and module
is the pull-up resistor and a power-on LED. DHT11 is a relative humidity
sensor. To measure the surrounding air this sensor uses a thermistor and a
capacitive humidity sensor.

DHT11 is a low-cost digital sensor for sensing temperature and


humidity. This sensor can be easily interfaced with any micro-controller such
as Arduino, Raspberry Pi etc.… to measure humidity and temperature
instantaneously.

50
3.10.1 WORKING

DHT11 sensor consists of a capacitive humidity sensing element and a


thermistor for sensing temperature. The humidity sensing capacitor has two
electrodes with a moisture holding substrate as a dielectric between them.
Change in the capacitance value occurs with the change in humidity levels. The
IC measure, process this changed resistance values and change them into digital
form.

For measuring temperature this sensor uses a Negative Temperature


coefficient thermistor, which causes a decrease in its resistance value with
increase in temperature. To get larger resistance value even for the smallest
change in temperature, this sensor is usually made up of semiconductor ceramics
or polymers.

The temperature range of DHT11 is from 0 to 50 degree Celsius with a


2-degree accuracy. Humidity range of this sensor is from 20 to 80% with 5%
accuracy. The sampling rate of this sensor is 1Hz.i.e., it gives one reading for
every second. DHT11 is small in size with operating voltage from 3 to 5 volts.
The maximum current used while measuring is 2.5mA.

DHT11 sensor has four pins- VCC, GND, Data Pin and a not connected
pin. A pull-up resistor of 5k to 10k ohms is provided for communication between
sensor and micro-controller.

HUMIDITY (DHT11):

• DHT11 uses only one wire for communication. The voltage levels with
certain time value defines the logic one or logic zero on this pin.
• The communication process is divided in three steps, first is to send
request to DHT11 sensor then sensor will send response pulse and then
it starts sending data of total 40 bits to the microcontroller.

51
• After sending 40-bit data, DHT11 sensor sends 54us low level and then
goes high. After this DHT11 goes in sleep mode.

DHT11 vs DHT22

Two versions of the DHT sensor, they look a bit similar and have the
same pinout, but have different characteristics and specifications:

3.10.2 SPECIFICATIONS OF DHT11

• Ultra-low cost
• 3 to 5V power and I/O
• 2.5mA max current use during conversion (while requesting data)
• Good for 20-80% humidity readings with 5% accuracy
• Good for 0-50°C temperature readings ±2°C accuracy
• No more than 1 Hz sampling rate (once every second)
• Body size 15.5mm x 12mm x 5.5mm
• 4 pins with 0.1" spacin

Figure 3.24 Pin diagram of DHT-11

52
3.10.3 APPLICATIONS

This sensor is used in various applications such as measuring humidity


and temperature values in heating, ventilation and air conditioning systems.
Weather stations also use these sensors to predict weather conditions. The
humidity sensor is used as a preventive measure in homes where people are
affected by humidity. Offices, cars, museums, greenhouses and industries use
this sensor for measuring humidity values and as a safety measure.

3.11 MQ-7 / GAS SENSOR

Ideal sensor is shown in the Fig 3.25 below use to detect the presence of
a dangerous LPG leak in your car or in a service station, storage tank
environment. This unit can be easily incorporated into an alarm unit, to sound
an alarm or give a visual indication of the LPG concentration. The sensor has
excellent sensitivity combined with a quick response time. The sensor can also
sense iso-butane, propane, LNG and cigarette smoke.

Fig 3.25 Gas Sensor

3.11.1 WORKING OF SENSOR

The ability of a Gas sensor to detect gases depends on the chemiresister


to conduct current. The most commonly used chemiresistor is Tin Dioxide
(SnO2) which is an n-type semiconductor that has free electrons (also called as
donor). Normally the atmosphere will contain more oxygen than combustible
gases. The oxygen particles attract the free electrons present in SnO2 which
pushes them to the surface of the SnO2. As there are no free electrons available

53
output current will be zero. The below gif shown the oxygen molecules (blue
colour) attracting the free electrons (black color) inside the SnO2 and preventing
it from having free electrons to conduct current.

When the sensor is placed in the toxic or combustible gases environment,


this reducing gas (orange color) reacts with the adsorbed oxygen particles and
breaks the chemical bond between oxygen and free electrons thus releasing the
free electrons. As the free electrons are back to its initial position they can now
conduct current, this conduction will be proportional the amount of free
electrons available in SnO2, if the gas is highly toxic more free electrons will be
available.

FEATURES
• High Sensitivity
• Detection Range: 100 - 10,000 ppm iso-butane propane
• Fast Response Time: <10s
• Heater Voltage: 5.0V
• Dimensions: 18mm Diameter, 17mm High excluding pins, Pins - 6mm
High

APPLICATIONS

• Used in industries to monitor the concentration of the toxic gases.


• Used in households to detect an emergency incident.
• Used at oil rig locations to monitor the concentration of the gases those
are released.
• Used at hotels to avoid customers from smoking.
• Used in air quality check at offices.
• Used in air conditioners to monitor the CO2 levels.
• Used in detecting fire.
• Used to check concentration of gases in mines.
• Breath analyzer.

54
3.12 SERVO MOTOR

A servo motor is a rotary actuator or a motor that allows for a


precise control in terms of the angular position, acceleration, and velocity.
Basically, it has certain capabilities that a regular motor does not have.
Consequently, it makes use of a regular motor and pairs it with a sensor for
position feedback.

Figure 3.26 Servo motor

3.12.1 WORKING

Servo motor works on the PWM (Pulse Width Modulation) principle,


which means its angle of rotation, is controlled by the duration of pulse applied
to its control PIN. Basically, servo motor is made up of DC motor which is
controlled by a variable resistor (potentiometer) and some gears.

Mechanism of servomotor:

Basically, a servo motor is a closed-loop servomechanism that uses


position feedback to control its motion and final position. Moreover, the input
to its control is a signal (either analogue or digital) representing the position
commanded for the output shaft.

The motor is incorporating some type of encoder to provide position and


speed feedback. In the simplest case, we measure only the position. Then the
measured position of the output is compared with the command position, the
external input to controller. Now if the output position differs from that of the

55
expected output, an error signal generates. This then causes the motor to rotate
in either direction, as per need to bring the output shaft to the appropriate
position. As the position approaches, the error signal reduces to zero. Finally,
the motor stops.

The very simple servomotors can position only sensing via a


potentiometer and bang-bang control of their motor. Further the motor always
rotates at full speed. Though this type of servomotor doesn’t have many uses in
industrial motion control, however it forms the basis of simple and cheap servo
used for radio control models.
Servomotors also find uses in optical rotary encoders to measure the speed of
output shaft and a variable-speed drive to control the motor speed. Now this,
when combined with a PID control algorithm further allows the servomotor to
be in its command position more quickly and more precisely with less
overshooting

Working of servomotors

Servo motors control position and speed very precisely. Now a


potentiometer can sense the mechanical position of the shaft. Hence it couples
with the motor shaft through gears. The current position of the shaft is converted
into electrical signal by potentiometer, and is compared with the command input
signal. In modern servo motors, electronic encoders or sensors sense the position
of the shaft
We give command input according to the position of shaft. If the
feedback signal differs from the given input, an error signal alerts the user. We
amplify this error signal and apply as the input to the motor; hence the motor
rotates. And when the shaft reaches to the require position error signal become
zero, and hence the motor stays standstill holding the position.

The command input is in form of electrical pulses as the actual input to


the motor is the difference between feedback signal (current position) and
required signal, hence speed of the motor is proportional to the difference

56
between the current position and required position. The amount of power require
by the motor is proportional to the distance it needs to travel.

Figure 3.27 Parts of Servo motor

Controlling Servo Motor:

All motors have three wires coming out of them. Out of which two will
be used for Supply (positive and negative) and one will be used for the signal
that is to be sent from the MCU.

Servo motor is controlled by PWM (Pulse with Modulation) which is


provided by the control wires. There is a minimum pulse, a maximum pulse and
a repetition rate. Servo motor can turn 90 degrees from either direction form its
neutral position. The servo motor expects to see a pulse every 20 milliseconds
(ms) and the length of the pulse will determine how far the motor turns. For
example, a 1.5ms pulse will make the motor turn to the 90° position, such as if
pulse is shorter than 1.5ms shaft moves to 0° and if it is longer than 1.5ms than
it will turn the servo to 180°.

Servo motor works on PWM (Pulse width modulation) principle,


means its angle of rotation is controlled by the duration of applied pulse to its
Control PIN. Basically, servo motor is made up of DC motor which is

57
controlled by a variable resistor (potentiometer) and some gears. High speed
force of DC motor is converted into torque by Gears. We know that WORK=
FORCE X DISTANCE, in DC motor Force is less and distance (speed) is high
and in Servo, force is High and distance is less. Potentiometer is connected to
the output shaft of the Servo, to calculate the angle and stop the DC motor on
required angle.

Figure 3.28 Pulse diagram of motor

Servo motor can be rotated from 0 to 180 degree, but it can go up to 210
degrees, depending on the manufacturing. This degree of rotation can be
controlled by applying the Electrical Pulse of proper width, to its Control pin.
Servo checks the pulse in every 20 milliseconds. Pulse of 1 ms (1 millisecond)
width can rotate servo to 0 degree, 1.5ms can rotate to 90 degree (neutral
position) and 2 ms pulse can rotate it to 180 degree.

All servo motors work directly with your +5V supply rails but we have
to be careful on the amount of current the motor would consume, if you are
planning to use more than two servo motors a proper servo shield should be
designed.

58
3.12.2 APPLICATIONS:
1. Robotics: At every joint of the robot, we connect a servomotor. Thus, giving
the robot arms its precise angle.
2. Conveyor belts: servo motors move, stop, and start conveyor belts carrying
product along to various stages, for example, in product packaging/ bottling, and
labeling.
3. Camera auto focus: A highly precise servo motor build into the camera
corrects a camera lens to sharpen out of focus images.
4. Solar tracking system: Servo motors adjust the angle of solar panels
throughout the day and hence each panel continues to face the sun which results
in harnessing maximum energy from sunup to sundown.

Advantages:

• If a heavy load is placed on the motor, the driver will increase the current to
the motor coil as it attempts to rotate the motor. Basically, there is no out-of-
step condition.
• High-speed operation is possible.

Disadvantages:

• Since the servomotor tries to rotate according to the command pulses, but
lags behind, it is not suitable for precision control of rotation.
• Higher cost.
• When stopped, the motor’s rotor continues to move back and forth one pulse,
so that it is not suitable if you need to prevent vibration

59
3.13 LED

A Light Emitting Diode (LED) is a semiconductor device, which can


emit light when an electric current passes through it. To do this, holes from p-
type semiconductors recombine with electrons from n-type semiconductors to
produce light as shown in below Fig 3.29, The wavelength of the light emitted
depends on the bandgap of the semiconductor material. Harder materials with
stronger molecular bonds generally have wider bandgaps. Aluminum Nitride
semiconductors are known as ultra-wide bandgap semiconductors.

Figure 3.29 LED

Advantages:

• The LED are smaller in sizes, and they can be stacked together to form
numeric and alphanumeric display in the high-density matrix.

• The intensity of the light output of the LED depends on the current flows
through it. The intensity of their light can be controlled smoothly.

• The LED are available which emits light in the different colours like red,
yellow, green and amber.

60
3.14 WATER PUMP

This DC 3-6 V Mini Micro Submersible Water Pump is a low cost, small
size Submersible Pump Motor which can be operated from a 2.5 ~ 6V power
supply. It can take up to 120 liters per hour with a very low current consumption
of 220mA. Just connect tube pipe to the motor outlet, submerge it in water and
power it.

Make sure that the water level is always higher than the motor. The dry
run may damage the motor due to heating and it will also produce noise.

Figure 3.30 Water Pump

3.14.1 SPECIFICATION:

• DC 3v to 6v submersible pump

• micro mini submersible water pump 3v to 6v

• DC water pump for DIY

• DC pump for HOBBY kit

61
3.15 ROBO SETUP

Figure 3.31 Robo setup

The Robot Car Kit 01 is a kit that can act as a basic framework for a
car/robot. Simply add extra components, such as a power source (rechargeable
battery, batteries) and a controller, such as an Arduino with a motor controller.

Technical data:
• Current when idle: 160 - 200 mA
• Speed when idle: 90 - 300 rpm (10% tolerance)
• Torque: 800 - 1200 gf/cm and min

Included with delivery:


• Battery holder for (4x 1.5 V AA batteries)
• 4x geared motor (6.5 x 2 x 2 cm
• Acrylic body
• 4x rubberized wheels (diameter 6 cm)
• Spacers, fixing materials

62
CHAPTER 4

SOFTWARE SPECIFICATION

4.1 ARDUINO IDE SOFTWARE


The Arduino IDE is an open-source software, which is used to write and
upload code to the Arduino boards. The IDE application is suitable for different
operating systems such as Windows, Mac OS X, and Linux. It supports the
programming languages C and C++. Here, IDE stands for Integrated
Development Environment.

4.2 General Introduction


Arduino IDE is an open-source software, designed by Arduino.cc and
mainly used for writing, compiling & uploading code to almost all Arduino
Modules. It is an official Arduino software, making code compilation too easy
that even a common person with no prior technical knowledge can get their feet
wet with the learning process. It is available for all operating systems i.e. MAC,
Windows, Linux and runs on the Java Platform that comes with inbuilt functions
and commands that play a vital role in debugging, editing and compiling the
code.

A range of Arduino modules available including Arduino Uno, Arduino


Mega, Arduino Leonardo, Arduino Micro and many more.
Each of them contains a microcontroller on the board that is actually programmed
and accepts the information in the form of code.
The main code, also known as a sketch, created on the IDE platform will
ultimately generate a Hex File which is then transferred and uploaded in the
controller on the board. The IDE environment mainly contains two basic parts:
Editor and Compiler where former is used for writing the required code and later
is used for compiling and uploading the code into the given Arduino Module.
This environment supports both C and C++ languages.

63
4.3 SOFTWARE OVERVIEW

Download Arduino Integrated Design Environment (IDE) here (Most


recent version: 1.6.5): https://www.arduino.cc/en/Main/Software, This is the
Arduino IDE once it’s been opened. It opens into a blank sketch where you can
start programming immediately. First, we should configure the board and port
settings to allow us to upload code. Connect your Arduino board to the PC via
the USB cable as shown in below Fig 4.1.

Figure 4.1 Arduino IDE Default Window

Board Setup
You have to tell the Arduino IDE what board you are uploading to. Select the
Tools pull down menu and go to Board. This list is populated by default with
the currently available Arduino Boards that are developed by Arduino. If you
are using an Uno or an Uno-Compatible Clone (ex. Funduino, Sain Smart, IEIK,
etc.), select Arduino Uno as shown in below Fig 4.2.

64
Figure 4.2 Arduino IDE: Board Setup Procedure

COM Port Setup


If you downloaded the Arduino IDE before plugging in your Arduino
board, when you plugged in the board, the USB drivers should have installed
automatically. The most recent Arduino IDE should recognize connected boards
and label them with which COM port they are using. Select the Tools pulldown
menu and then Port.Here it should list all open COM ports, and if there is a
recognized Arduino Board, it will also give it’s name. Select the Arduino board
that you have connected to the PC. If the setup was successful, in the bottom
right of the Arduino IDE, you should see the board type and COM number of
the board you plan to program. Note: the Arduino Uno occupies the next
available COM port; it will not always be COM3.

65
Figure 4.3 Arduino IDE: COM Port Setup

At this point shown in above Fig 4.3, your board should be set up for
programming, and you can begin writing and uploading code.

Uploading Blink
One common procedure to test whether the board you are using is
properly set up is to upload the “Blink” sketch. This sketch is included with all
Arduino IDE releases and can be accessed by the File pull-down menu and going
to Examples, 01. Basics, and then select Blink. Standard Arduino Boards include
a surface-mounted LED labeled “L” or “LED” next to the “RX” and “TX”
LEDs, that is connected to digital pin 13. This sketch will blink the LED at a
regular interval, and is an easy way to confirm if your board is set up properly
and you were successful in uploading code. Open the “Blink” sketch and press
the “Upload” button in the upper-left corner to upload “Blink” to the board as
shown in the below Fig 4.5.

66
Figure 4.4 Arduino IDE: Loading Blink Sketch

Figure 4.5 Arduino IDE Output

67
4.4 STEPS TO WRITE AN ASSEMBLY LANGUAGE
PROGRAM IN ARDUINO IDE AND HOW TO COMPILE IT

1. Download and install (https://www.arduino.cc/en/Main/Software)


2. Plug in your Arduino Board
3. Select the proper board in the IDE (Tools>Boards>Arduino Uno)
4. Select the proper COM port (Tools>Port>COMx (Arduino Uno))
5. Open the “Blink” sketch (File>Examples>Basics>01.Blink)
6. Press the Upload button to upload the program to the board
7. Confirm that your board is working as expected by observing LED
Arduino has lots of community support and documentation. Your best
bet when running into unexpected problems is to search online for help. You
should be able to find a forum where someone had the same problem you are
having, and someone helped them fix it. If you don’t find results, try modifying
your search, or post on the Arduino forums.

My board isn’t listed under devices and is not recognized by


IDE:
▪ Double-check that you are using the correct COM port.
▪ Make sure that your Arduino Board is plugged into the computer.
▪ The IDE says “Uploading…” after pressing the upload button, but most
likely, this means that the ATMega328p chip is not programmed with
the Arduino firmware. If you have a separate working Uno available, you
can program the unprogrammed chip using this guide and a few jumper
cables: https://www.arduino.cc/en/Tutorial/ArduinoISP
▪ If you don’t have a separate Arduino available, let me know and I can
use an Atmel Programmer to upload the firmware.
▪ There may be hardware damage if you had the board plugged into USB
and external power at the same time. You may have to replace the chip
if this is the case.
▪ Error Message: avrdude: stk500_recv (): programmer is not responding
▪ nothing is happening.

68
▪ Double-check that you have the correct board selected in the Tools
menu.
▪ Depending on the size of your program, it may take a few seconds to
upload. If you feel like it is taking too long, it may be encountering an
error and you can try unplugging and plugging in the Arduino board.

69
CHAPTER 5
IMPLEMENTATION

5.1 WORKING OPERATION

This agriculture robot has two modes one is auto mode another is a
manual mode in manual this set with help of switch button in manual it works
with Bluetooth (HC -05) signals, in auto mode it works with Help of IR sensor
in front of the robot for making a grid pattern seed sowing, In this agriculture
robot project we are using Arduino UNO as motherboard which will control the
robot driving motors and seed dispenser servo. entire project runs on 12V lead-
acid battery

Agriculture Robot which is controlled over Bluetooth protocol using an


Android App. The Android App consists of five buttons for movement of robot.
The actions that would be performed by the robot are Forward, Backward, Right,
Left and Stop. It also consists of list picker for selecting Bluetooth device
connected to the robot. Once the Android application establishes a secure
connection with the robot then the app is ready for controlling the actions of
robot. The robot is capable of Digging, Sowing, Watering and Soil Levelling.
Digging is done using Motor Drill. Sowing action will be performed using Servo
Motor for lock mechanism. Watering will be done by Pump Motor. Levelling is
done using Flat leveler. The Android App has a button for Starting all these
processes. The robot has sensors like soil sensor, water level sensor. The sensor
values are automatically senses and shows on the App. The temperature and
humidity sensor are used for measuring the temperature and humidity in the
surrounding of the robot. The water sensor is used for detecting the water level.
The soil moisture sensor is used to sense the moisture content of the soil. The
robot works in two modes. In the first mode the robot performs actions such as
ploughing, sowing, watering and soil levelling along with movement of robot.
In the second mode the robot performs only watering action by sensing the soil
moisture content. First mode of operation is used in the initial stages while the
second mode of operation is used after the initial stage when the robot only needs

70
to water the field. The sensor data can also be manually updated by the in-app
Refresh button.

Fig. 5.1 Smart phone controlled Agricultural Robot for automatic irrigation system

This is made of acrylic sheet and connected to the dc motor. A circuit


has been constructed using the pcb board to connect all of the components and
control the entire agricultural operation. The key part we use is a microcontroller
called an ATmega328p, which is also known as an ARDUINO. The circuit
includes a DC MOTOR that can drive two DC motors at the same time, as well
as a power supply circuit that includes a voltage regulator to regulate power from
5 to 12 volts and solar panels to power the Agribot. The Arduino Uno is a
microcontroller that we used to perform multitasking with logical programming.
For irrigation, we used a different sprinkler system. It connects to a humidity
sensor that senses soil moisture.

71
5.2 THE STEPS OF THE IMPLEMENTATION
1. Enter the length
2. Enter the width
3. Select the mode
4. Microcontroller inputs
5. Algorithm executed

Rest once the execution is completed the farmers give the dimensions
of area or field as an input the total travelling area of robot is fixed. Once we
enter the dimensions, robot start working in the field once the robot reaches at
the end then it turns to 1800 degree and start working by using Arduino,
dimensions are taken or entered directly, after entering the dimension, then it
asks the modes and work accordingly.

BENEFITS
Some benefits helpful to farmers: The cost is cheap and it is affordable
to all farmers. It helps to all classes of people specially to helps poor people as
well as middle class people. It is fully autonomous. Farmers are not need to
present in farm land. It runs through battery so it not harms the farm land. It
works faster than the human’s efforts and save time. It is fully an automatic
robot which works on open architecture, does a lot of work in farms it reduces
human labor. The systems observe the different environmental conditions and
takes accordingly which human can’t do accurately.

USES OF AGRICULTURAL ROBOT’S

• Nursery planting
• Crop seeding
• Crop monitoring and analysis
• Fertilizing and irrigation
• Crop weeding and spraying
• Autonomous tractors
• Thinning and pruning
• Picking and harvesting hole on the shaft to digging dirt.

72
CHAPTER 6

CONCLUSION

We concluded from our analysis of reference articles that the farm robot
is capable of performing numerous agricultural chores in the field, but that it
will require some adaptation. So, in this study, a multipurpose farm robot is
presented to perform various agricultural tasks such as plugging, seed sowing,
mud levelling, and water spraying. The projected outcome demonstrates that this
robot is implemented to perform as intended and also provides farmers with a
cost-effective solution. This robot is expected to assist farmers in increasing the
efficiency and accuracy of agricultural operations.

6.1 FUTURE SCOPE


The main aim of our project is to design, development and the
fabrication of the robot which can dig the soil, leveler to close the mud and
sprayer to spray water, Robotics is playing a significant role in agricultural
production and management. There is a need for autonomous and time saving
technology in agriculture to have efficient farm management. The researchers
are now focusing towards different farming operational parameters to design
autonomous agricultural vehicles as the conventional farm machineries are crop
and topological dependent. Till date the agricultural robots have been researched
and developed principally for harvesting, chemical spraying, picking fruits and
monitoring of crops.
Robots like these are perfect substitute for manpower to a great extent
as they deploy unmanned sensing and machinery systems. The prime benefits of
development of autonomous and intelligent agricultural robots are to improve
repeatable precision, efficacy, reliability and minimization of soil compaction
and drudgery. The robots have potential for multitasking, sensory acuity,
operational consistency as well as suitability to odd operating conditions. The
study on agricultural robotic system had been done using model structure design
mingled with different precision farming machineries. Few prototypes were

73
designed by European Union named CROPS, USA-ISAAC2 & Michigan-
Hortibot, Australia-AgBot, Finland-Demeter, India-Agribot and many other
countries.
The agricultural robots are designed using different localization
techniques which are vision, GPS, laser and sensor-based navigation control
system. In this paper, comparative study including an overview of Robotics
approach for precision Agriculture in India and worldwide development is
explored.

74
REFERENCES

1. K Durga Sowjanya; R Sindhu; M Parijatham; K Srikanth; P Bhargav


“Multipurpose autonomous agricultural robot” 2017 International conference of
Electronics, Communication and Aerospace Technology (ICECA) held at
Coimbatore, India. PP: 696-699.
2. Akhila Gollakota; M. B. Srinivas “Agribot— A multipurpose agricultural robot”
2011Annual IEEE India Conference held at Hyderabad, India. PP: 1-4.
3. Saurabh Umarkar; Anil Karwankar “Automated seed sowing agribot Using
Arduino”2016 International Conference on Communication and Signal
Processing (ICCSP) held at Melmaruvathur, India. PP: 1379-1383.
4. Shivaprasad B S, Ravishankara M N, B N Shoba “Design and Implementation
of Seeding and Fertilizing Agriculture Robot” International Journal of
Application or Innovation in Engineering & Management (IJAIEM) held at
Mumbai, India, Volume 3, Issue 6, June 2014, PP. 251-255.
5. Swati D. Sambare, S. S. Belsare, “Seed Sowing Using Robotics Technology”
International Journal of scientific research and management (IJSRM)Volume 3,
Issue 5, 5 May 2015, PP. 2889-2892.
6. Ashish Lalwani, Mrunmai Bhide, S. K. Shah, “A Review: Autonomous Agribot
for Smart Farming” International Journal of Industrial Electronics and Electrical
Engineering (IJIEEE) Volume-4, Issue-2, Feb.-2016, PP. 12-15.
7. Asit Dhawale, Akash Jadhao, Sanket Hendve, Kirti Fadnvis, Sumit Hande,
Ashutosh Gadling “Review of Multipurpose Agriculture Machine” International
Journal of Research in Engineering, Science and Management Volume-2, Issue-
2, February-2019
8. Ranjitha B, Nikhitha M N, Aruna K, Afreen “Solar Powered Autonomous
Multipurpose Agricultural Robot Using Bluetooth/Android App” Third
International Conference on Electronics Communication and Aerospace
Technology.

75
APPENDIX

#include<SoftwareSerial.h>
SoftwareSerial BT (0,1);
String readvoice;
char c;
int motor1 =4;
int motor2 =5;
int motor3 =6;
int motor4 =7;
int r=8;
int ldr=A2;
int gas=A1;
int m=9;
int so=A0;
#include <dht.h>
#define dht_apin A3
// Analog Pin sensor is connected to
dht DHT;
void setup ()
{
Serial.begin(9600);
pinMode (motor1, OUTPUT); pinMode (motor3, OUTPUT);
pinMode (motor2, OUTPUT); pinMode (motor4, OUTPUT);
Serial.println("Welcome user");
Serial.println("waiting for your command");
pinMode (r, OUTPUT);
pinMode (ldr, INPUT);
pinMode (gas, INPUT);
pinMode (m, OUTPUT);
pinMode (so, INPUT);
}
void loop ()
{

while (Serial.available())
{
c = Serial.read();
//Serial.println(c);

if (c =='a')
{

Serial.println("motor is running in High condition");


analogWrite(motor1,255); analogWrite(motor2,0);
analogWrite(motor3,255); analogWrite(motor4,0);
}
if (c =='b')
{
Serial.println("motor is running in m1 high and m2
medium condition");
analogWrite(motor1,0); analogWrite(motor2,255);
analogWrite(motor3,0); analogWrite(motor4,255);
}

76
if (c =='e')
{
Serial.println("motor is running in m2 high and m1
medium condition");
analogWrite(motor1,0); analogWrite(motor2,0);
analogWrite(motor3,255); analogWrite(motor4,0);
}
if (c =='f')
{
Serial.println("motor is running in m1 high and m2 stop
condition");
analogWrite(motor1,255); analogWrite(motor2,0);
analogWrite(motor3,0); analogWrite(motor4,0);
}

}
if (c =='s')
{
Serial.println("motor is running in m1 high and m2 stop
condition");
analogWrite(motor1,0); analogWrite(motor2,0);
analogWrite(motor3,0); analogWrite(motor4,0);
}
if (c =='k')
{
digital Write (r, HIGH);
}
if (c =='P')
{
analogWrite(m,255); analogWrite(m,0);
}
if (c =='Q')
{
analogWrite(m,150);
}
if (c =='L')
{
analogWrite(m,100);
}
DHT.read11(dht_apin);
Serial. Print ("Current humidity = ");
Serial.println(DHT.humidity);
Serial.print("% “);
delay (1000);
Serial.print("temperature = ");
Serial.print(DHT.temperature);
Serial.println("C “);
delay (1000);
if (DHT.temperature>=40)
{
digital Write (r, HIGH);
}
int I=analogRead(so);
Serial.print("soil value");
Serial.println(I);
delay (1000);

77
if(I>=500)
{
digital Write (r, HIGH);
}
int x=analogRead(gas);
Serial.print("gas value");
Serial.println(x);
delay (1000);
if(x=500)
{
digital Write (r, HIGH);
}
int y=analogRead(ldr);
Serial.print("ldr value");
Serial.println(y);
delay (1000);
if(y>=500)
{
digital Write (r, HIGH);
}
}

78

You might also like