You are on page 1of 85

OPTIMIZATION AND CONTROL OF HYDROPONICS

AGRICULTURE USING IOT


Submitted by

SANJU.K (Reg. No. 22309020)


SARANRAJ.R (Reg. No. 22309021)
SETHURAMAN.A (Reg. No. 22309022)
SILAMBARASAN R (Reg. No. 22309023)
SEKAR P (Reg. No. 22394148)

in partial fulfillment for the award of the degree of


DIPLOMA IN ELECTRICAL AND ELECTRONICS
ENGINEERING

SRI RANGANATHAR INSTITUTE OF POLYTECHNIC COLLEGE

ATHIPALAYAM, COIMBATORE – 641110.

Directorate of Technical Education, Chennai – 600025


Government of Tamilnadu
APRIL-2024
ii

SRI RANGANATHAR INSTITUTE OF POLYTECHNIC COLLEGE


(Approved By Govt. of Tamilnadu and AICTE)
Athipalayam,Coimbatore-641110. Ph(0422)-2904008,2904009
E-mail:sripoly@yahoo.co.in

Department of Electrical and Electronics Engineering


Certificate
This is to certify that this project report titled

“OPTIMIZATION AND CONTROL OF HYDROPONICS AGRICULTURE USING IOT”

Is a bonafide project work done by


SANJU.K (Reg. No. 22309020)
SARANRAJ.R (Reg. No. 22309021)

SETHURAMAN.A (Reg. No. 22309022)


SILAMBARASAN R (Reg. No. 22309023)

SEKAR P (Reg. No. 22394148)

Submitted in the partial fulfillment of the requirements for the award of


DIPLOMA IN ELECTRICAL AND ELECTRONICS ENGINEERING
Of
Directorate of Technical Education, Government of Tamil Nadu.

During the year 2023-2024

Project guide Head of the Department

Certified that the candidate was examined by using the Project Viva-Voce examination
Held on _____________

Internal Examiner External Examiner


iii
iv

ABSTRACT

This project presents Intelligent Plant Care Hydroponic that exercises


environment driven control methods through an Internet-of-Things (IoT)
management tool called IoTtalk. IoTtalk provides a scalable and configurable
software for users to easily and quickly add/remove/exchange the sensors and
actuators, and program their interactions. From the experimental measurement
results, the developed environment driven control methods include LED lighting;
water spray and water pump which can effectively lower the CO2 concentration,
the temperature andincrease water level, respectively. Specifically, the time of
CO2 concentration reduction is 38.54% faster than that with the plant system
without our mechanism.
v

ACKNOWLEDGEMENT

At this pleasing moment of having successfully completed our project, We wish to

convey our sincere thanks and gratitude to the management of our college and our beloved

Chairman Mr. V.NARAYANASAMY, who has provided all the facilities to us.

We would like to express our sincere thanks to our beloved Vice Chairman

Mr.N.HARIKRISHNAN & Our Director Mrs.B.ARTHI HARIKRISHNAN, for giving us the

opportunity and support.

We would like to express our sincere thanks to our Principal

Mr.K.KARTHIKEYAN,M.E., for forwarding us to do our project and offering adequate

duration in completing our project.

We are also grateful to the Head of Department Mr. P. THIRUMOORTHY M.E., for

his constructive suggestions & encouragement during our project which leads to the successful

completion of our project.

With deep sense of gratitude, we extend our earnest & sincere thanks to our guide

Mr. P. THIRUMOORTHY M.E., Department of Electrical and Electronics Engineering for

his kind guidance & encouragement during this project.

We also express our indebt thanks to our Teaching and Non-Teaching Staff

members of ELECTRICAL AND ELECTRONICS ENGINEERING DEPARTMENT, Sri

Ranganathar Institute of Polytechnic College, Athipalayam for their sincere support in

completion of this project.


vi

TABLE OF CONTENTS

CHAPTER TITTLE PAGE


NO NO
ABSTRACT iv

LIST OF FIGURES viii

LIST OF ABBREVATIONS x

1 INTRODUCTION 1

2 PROPOSED SYSTEM 3

3 BLOCK DIAGRAM 5

4 COMPONENTS DESCRIPTION 7

4.1 POWER SUPPLY 8

4.2 TYPES OF BRIDGE RECTIFIERS 10

4.3 IC VOLTAGE REGULATORS 13

4.4 TRANSFORMER 15

4.5 PIC 16F877A MICROCONTROLLER 16

4.6 LCD 21

4.7 LED 22

4.8 DHT11 TEMPERATURE AND HUMIDITY 22


SENSOR
4.10 RELAY 25
vii

4.11 PH VALUE MEASUREMENT 27

4.12 WI-FI 28

4.13 DC MOTOR 29

5 CIRCUIT DIAGRAM 33

6 PROGRAM 36

7 SOFTWARE 45

7.1 PCB DESIGN 46

7.2 PCB Board Design 49

7.3 PROTEUS DESIGN SUITE 50

7.4 PIC C COMPILE 52

7.5 C COMPILER 52

7.6 MP LAB 52

8 CONCLUSION 55

9 BIBLIOGRAPHY 57

10 PHOTO GRAPHY 59

11 PROJECT ESTIMATION 61
viii

LIST OF FIGURES

FIGURE TITLE PAGE NO


NO
3.1 Block Diagram 6

4.1.1 Power Supply Diagram 8

4.1.2 Bridge Rectifier Diagram 9

4.2.1 Single Phase & Three Phase Rectifier Diagram 10

4.2.2 Uncontrolled Bridge Rectifier Diagram 10

4.2.3 Controlled Bridge Rectifier Diagram 11

4.2.4 Bridge Rectifier Diagram 12

4.3.2 (A) Fixed Positive Voltage Regulators Diagram 14

4.4.1 Transformer Diagram 15

4.5.1 PIC 16f877a Microcontroller Diagram 16

4.6 LCD Diagram 21

4.7 LED Diagram 22

4.8 DHT11 Sensor 22

4.10 (A) Relay 26

4.10 (B) SPST, SPDT, DPST, DPDT 26

4.11 PH Value Measurement 27


ix

4.12 WI-FI 28

4.13 DC Motor 29

4.13.1 (A) Motor Drive IC 30

5.1 Circuit Diagram 34

7.1.1 PCB Board Diagram 48

7.6.1 MPLAB Diagram 53

10.1 Photography 60
x

LIST OF ABBREVIATIONS
DC - DIRECT CURRENT
AC - ALTERNATING CURRENT
SCR - SILICON CONTROLLER RECTIFIER
METAL–OXIDE–SEMICONDUCTOR FIELD-EFFECT
MOSFET -
TRANSISTOR
IGBT - INSULATED GATE BIPOLAR TRANSISTOR
V - VOLTAGE
PIV - PEAK INVERSE VOLTAGE
D - DIODE
IC - INTEGRATED CIRCUIT
VI - INPUT VOLTAGE
VO - OUTPUT VOLTAGE
GND - GROUND
IN - INPUT
OU - OUTPUT
PIC - PERIPHERAL INTERFACE CONTROLLER
CPU - CENTRAL PROCESSING UNIT
RISC - REDUCED INSTRUCTION SET COMPUTER
MHZ - MEGA HERTZ
RAM - RANDOM ACCESS MEMORY
MA - MICRO AMPS
PWM - PULSE WITH MODULATION
CCP - CAPTURE, COMPARE, PULSE WITH MODULATION
SSP - SYNCHRONOUS SERIAL PORT
BOR - BROWN-OUT RESET
POR - POWER-ON RESET
PWRT - POWER-UP TIMER
xi

OST - OSCILLATOR START-UP TIMER


WDT - WATCHDOG TIMER
RC - RESISTOR CAPACITOR
IC - INTEGRATED CIRCUIT
TMR - TIMER
A/D - ANALOG TO DIGITAL
DVD - DIGITAL VIDEO DISC
CRT - CATHODE RAY TUBE
LED - LIGHT EMITTING DIODE
PCB - PRINTED CIRCUIT BOARD
CHAPTER – 1
INTRODUCTION
1
1.1 INTRODUCTION
With the advances in technology and the improvement of people's living standards,
hydroponic plants become an integral part of daily life. Hydroponic plants not only decorate the
environment but also can delight us. However, traditional plant cultivation has been mainly performed
in the soil. It is known that a series of drawbacks can be found in such a way. For example, regular
watering and fertilizing have to require more time and labor. With the development of various
techniques, soilless cultivation has become a more mature and popular breeding choice such as
hydroponic. Hydroponics is an eco-friendly system to cultivate crops without soil by utilizing
aquaculture and hydroponics. At present, hydroponics is mainly used in agricultural production.
Modern people have been always engaged in work and they have no more extra time to look after
hydroponic plants. Plants need watering and fertilization frequently.
The whole process is compound and onerous. Based on the above shortcomings, the
automatic control system is proposed. Unfortunately, the current automatic control system is not
stable, some unexpected errors occur especially when it is difficult to realize the remote monitoring
and control. Consequently, it is very necessary to design a smart monitor and control system,
especially for people who travel frequently. With the rapid development of sensors, the Internet,
communication, and computer technology, the smart lifestyle will become a popular trend in our
future lives. To solve the current shortcoming, this study designs a smart monitor and controlling
system, which can make it easy to implement the connection of the monitoring field and to remote
monitoring centers. This system can monitor the environment of hydroponic devices through some
sensors in a real-time and stable way, and then accurately, and automatically transmit the data of
temperature, humidity, light intensity, water level, and pH in real-time.

2
CHAPTER – 2
PROPOSED SYSTEM

3
2.1 PROPOSED SYSTEM
In our project, we have proposed an idea that would control the
parameters automatically. Also, the cultivators can know the conditions of the
plant growth and control the parameters remotely using IoT technology. The
hydroponics cultivator can only monitor the necessary conditions required for
plant growth such as humidity, temperature, water level, and light intensity. The
cultivator can know the increase or decrease in necessary parameters and
control it. This system has a disadvantage because the user controls these
parameters if he is at a distance, since the system needs constant monitoring and
control the existing system doesn’t satisfy the control of this agriculture
completely.

4
CHAPTER – 3
BLOCK DIAGRAM

5
3.1 BLOCK DIAGRAM

Figure No.3.1 Block Diagram

6
CHAPTER – 4
COMPONENTS DESCRIPTION

7
4.1 POWER SUPPLY
A power supply is an electronic device that supplies electric energy to
an electrical load. The primary function of a power supply is to convert one
form of electrical energy to another and, as a result, power supplies are
sometimes referred to as electric power converters. Some power supplies are
discrete, stand-alone devices, whereas others are built into larger devices along
with their loads. Examples of the latter include power supplies found in desktop
computers and consumer electronics devices.
Every power supply must obtain the energy it supplies to its load, as well
as any energy it consumes while performing that task, from an energy source.
Depending on its design, a power supply may obtain energy from various types
of energy sources, including electrical energy transmission systems, energy
storage devices such as batteries and fuel cells, electromechanical systems such
as generators and alternators, solar power converters, or other power supply.

Figure No 4.1.1Power Supply Diagram


All power supplies have a power input, which receives energy from the
energy source, and a power output that delivers energy to the load. In most
power supplies the power input and output consist of electrical connectors or
hardwired circuit connections, though some power supplies employ wireless
energy transfer in lieu of galvanic connections for the power input or output.
Some power supplies have other types of inputs and outputs as well, for
functions such as external monitoring and control.

8
Bridge Rectifier Circuit with Working Operation and Their Types A
bridge rectifier circuit is a common part of the electronic power supplies. Many
electronic circuits require rectified DC power supply for powering the various
electronic basic components from available AC mains supply. We can find this
rectifier in a wide variety of electronic AC power devices like home appliances,
motor controllers, modulation process, welding applications, etc.

Figure No 4.1.2 Bridge Rectifier Diagram


What is a Bridge Rectifier?
A Bridge rectifier is an Alternating Current (AC) to Direct Current (DC)
converter that rectifies mains AC input to DC output. Bridge Rectifiers are
widely used in power supplies that provide necessary DC voltage for the
electronic components or devices. They can be constructed with four or more
diodes or any other controlled solid state switches. Depending on the load
current requirements, a proper bridge rectifier is selected. Components’ ratings
and specifications, breakdown voltage, temperature ranges, transient current
rating, forward current rating, mounting requirements and other considerations
are taken into account while selecting a rectifier power supply for an
appropriate electronic circuit’s application.

9
4.2 TYPES OF BRIDGE RECTIFIERS
Bride rectifiers are classified into several types based on these factors:
type of supply, controlling capability, bride circuit’s configurations, etc. Bridge
rectifiers are mainly classified into single and three phase rectifiers. Both these
types are further classified into uncontrolled, half controlled and full controlled
rectifiers. Some of these types of rectifiers are described below.
1. Single Phase and Three Phase Rectifiers

Figure No 4.2.1 Single Phase & Three Phase Rectifier Diagram


The nature of supply, i.e., a single phase or three-phase supply decides these
rectifiers. The Single phase bridge rectifier consists of four diodes for
converting AC into DC, whereas a three phase rectifier uses six diodes, as
shown in the figure. These can be again uncontrolled or controlled rectifiers
depending on the circuit components such as diodes, thyristors, and so on.
2. Uncontrolled Bridge Rectifiers

Figure No 4.2.2 Uncontrolled Bridge Rectifier Diagram

10
This bridge rectifier uses diodes for rectifying the input as shown in the
figure. Since the diode is a unidirectional device that allows the current flow in
one direction only. With this configuration of diodes in the rectifier, it doesn’t
allow the power to vary depending on the load requirement. So this type of
rectifier is used in constant or fixed power supplies.
3. Controlled Bridge Rectifier

Figure No 4.2.3 Controlled Bridge Rectifier Diagram


In this type of rectifier, AC/DC converter or rectifier – instead of
uncontrolled diodes, controlled solid state devices like SCR’s, MOSFET’s,
IGBT’s, etc. are used to vary the output power at different voltages. By
triggering these devices at various instants, the output power at the load is
appropriately changed.

Bridge Rectifier Circuit Diagram


The main advantage of bridge rectifier is that it produces almost double
the output voltage as with the case of a full wave rectifier using center-tapped
transformer. But this circuit doesn’t need center tapped transformer so it
resembles low-cost rectifier. The bridge rectifier circuit diagram consists of
various stages of devices like transformer, Diode Bridge, filtering and
regulators. Generally all these blocks combination is called as regulated DC
power supply that powers various electronic appliances.

11
The first stage of the circuit is a transformer which is a step-down type that
changes the amplitude of the input voltage. Most of the electronic projects uses
230/12V transformer to step-down the AC mains 230V to 12V AC supply.

Figure No 4.2.4 Bridge Rectifier Diagram


Next stage is a diode-bridge rectifier which uses four or more diodes
depending on the type of bridge rectifier. Choosing a particular diode or any
other switching device for a corresponding rectifier needs some considerations
of the device like Peak Inverse Voltage (PIV), forward current If, voltage
ratings, etc. It is responsible for producing unidirectional or DC current at the
load by conducting a set of diodes for every half cycle of the input signal. Since
the output after the diode bridge rectifiers is of pulsating nature, and for
producing it as a pure DC, filtering is necessary. Filtering is normally performed
with one or more capacitors attached across the load, as you can observe in the
below figure wherein smoothing of wave is performed. This capacitor rating
also depends on the output voltage.
The last stage of this regulated DC supply is a voltage regulator that
maintains the output voltage to a constant level. Suppose the microcontroller
works at 5V DC, but the output after the bridge rectifier is around 16V, so to
reduce this voltage, and to maintain a constant level – no matter voltage changes
in input side – a voltage regulator is necessary.

12
Bridge Rectifier Operation
As we discussed above, a single-phase bridge rectifier consists of four
diodes and this configuration is connected across the load. For understanding
the bridge rectifier’s working principle, we have to consider the below circuit
for demonstration purpose. During the Positive half cycle of the input AC
waveform diodes D1 and D2 are forward biased and D3 and D4 are reverse
biased. When the voltage, more than the threshold level of the diodesD1 and
D2, starts conducting – the load current starts flowing through it, as shown as
red lines path in the diagram below.

4.3 IC VOLTAGE REGULATORS


Voltage regulators comprise a class of widely used ICs. Regulator IC
units contain the circuit for reference source, comparator amplifier, control
device, and overload protection all in a single IC.
Although the internal construction of the IC is somewhat different from
that described for discrete regulator circuits, the external operation is much the
same. IC units provide regulator of either a fixed positive voltage, a fixed
negative, or an adjustable set voltage.
A power supply can be built using a transformer connected to the AC
supply line to step the AC voltage to desired amplitude, then rectifying that AC
voltage, filtering with a capacitor and RC filter, if desired, and finally regulator
the DC voltage using an IC regulator.
The regulators can be selected for operation with load current from
hundreds of mill amperes to tens of amperes, corresponding to power ratings
from mill watts to tens of watts.

13
4.3.1 TREE-TERMINAL VOLTAGE REGULATORS
Fig shows the basic connection of a three-terminal voltage regulator IC to
load. The fixed voltage regulator has on unregulated DC input voltage, VI,
applied to one input terminal, a regulator output DC voltage, VO, from a second
terminal, with the third terminal connected to ground.
For a selected regulator, IC device specifications list a voltage range over
which the input voltage can vary to maintain a regulator output voltage over a
range of load current. The specification also lists the amount of output voltage
change resulting from a change in load current (load regulator) or in input
voltage (line regulator).

4.3.2 FIXED POSITIVE VOLTAGE REGULATORS


FROM TRANSFORMER SEC

Figure No 4.3.2 (A) Fixed Positive Voltage Regulators Diagram


The series 78 regulators provide fixed regulated voltage from 5 to 24V.
Figure shows how one such IC, a 7812, is connected to provide voltage
regulator without from this units of +12V DC. An unregulated input voltage VI
is filtered by capacitor CI and connected to the IC’s IN terminal. The IC’s OUT
terminal provide a regulated +12V which is filtered by capacitor C2 (mostly for
any high-frequency noise). The third IC terminal is connected to ground
(GND). Which the input voltage may vary over some permissible voltage range,
and the output load may vary over some acceptable range, the output voltage
remains constant within specified voltage variation limits.
14
4.4 TRANSFORMER
A transformer is a static electrical device that transfers electrical energy
between two or more circuits. A varying current in one coil of the transformer
produces a varying magnetic flux, which, in turn, induces a varying
electromotive force across a second coil wound around the same core. Electrical
energy can be transferred between the two coils, without a metallic connection
between the two circuits. Faraday's law of induction discovered in 1831
described the induced voltage effect in any coil due to changing magnetic flux
encircled by the coil.

Figure No 4.4.1 Transformer Diagram


Transformers are used for increasing or decreasing the alternating
voltages in electric power applications, and for coupling the stages of signal
processing circuits. Since the invention of the first constant-potential
transformer in 1885, transformers have become essential for the transmission,
distribution, and utilization of alternating current electric power. A wide range
of transformer designs is encountered in electronic and electric power
applications. Transformers range in size from RF transformers less than a cubic
centimeter in volume, to units weighing hundreds of tons used to interconnect
the power grid.

15
4.5 PIC 16F877A MICROCONTROLLER

Figure No 4.5.1 PIC 16f877a Microcontroller Diagram


HIGH PERFORMANCE RISC CPU
 Only 35 single word instructions to learn
 All single cycle instructions except for program branches, which are two-
cycle
 Operating speed: DC-20 MHZ clock input DC-200 ns instruction cycle
 2K x 14 words of program memory, 128 x 8 bytes of Data Memory
(RAM)
 Pin out compatible to PIC16C72/72A and PIC16F872
 Interrupt capability
 Eight-level deep hardware stack
 Direct, Indirect and Relative Addressing modes

16
PERIPHERAL FEATURES
 High sink/source current: 25mA
 Timer0: 8-bit timer/counter with 8-bit pre scalar
 Timer1: 16-bit timer/counter with pre scalar, can be incremented during
SLEEP via external crystal/clock
 Timer2: 8-bit timer/counter with 8-bit period register, pre scalar and post
scalar
 Capture, compare, PWM (CCP) module
 Capture is 16-bit, max. Resolution is 12.5 ns
 Compare is 16-bit, max. Resolution is 200 ns
 PWM max. Resolution is 10-bit
 8-bit, 5-channel analog-to-digital converter
 Synchronous Serial Port (SSP) with SPI tm (slave)
 Brown-out detection circuitry for Brown-out Reset (BOR)

SPECIAL MICROCONTROLLER FEATURE


 1,000 erase/write cycle FLASH program memory typical
 Power-on Reset (POR), Power-up Timer (PWRT) and oscillator Start-up
Timer (OST)
 Watchdog Timer (WDT) with its own on-chip RC oscillator for reliable
operation
 Programmable code protection
 Power saving SLEEP mode
 Selectable oscillator options
 In-circuit Serial Programming tm (ICSPtm) via 2 pins
 Processor read access to program memory

17
SPECIAL FUNCTION REGISTERS
The Special Function Registers are registers used by the CPU and
peripheral modules for controlling the desired operation of the device. These
registers are implemented as static RAM. The Special Function Registers can be
classified into two sets core (CPU) and peripheral. Those registers associated
with the core functions are described in detail in this section. Those related to
the operation of the peripheral features are described in detail in the peripheral
feature section.

TIMER0 MODULE
 The Timer0 module timer/counter has the following features:
 8-bit timer/counter
 Readable and writable
 8-bit software programmable pre scale
 Internal or external clock select
 Interrupt on overflow from FFH to 00H
 Edge select for external clock

TIMER1 MODULE
 The timer1 module timer/counter has the following features:
 16-bit timer/counter (Two 8-bit registers; TMR1H and TMR1L)
 Readable and writable (both registers)
 Internal or external clock select
 Interrupt on overflow from FFFFH to 0000H
 RESET from CCP module trigger
 Timer1 can be enabled/disabled by setting/clearing control bit TMR1ON
(T1CON<0>)

18
TIMER1 MODULE
 The timer2 module timer has the following features:
 8-bit timer (TMR@ register)
 8-bit period register (both register)
 Readable and writable (both registers)
 Software programmable pre scalar (1:1, 1:4, 1:16)
 Software programmable pre scalar (1:1, to 1:16)
 Interrupt on TMR2 match of PR2
 SSP module optional use of TMR2 output to generate clock shift timer2
can by shut-off by clearing control bit TMR2ON (T2CON<2>) to
minimize power consumption.

ANALOG-TODIGITAL CONVERTER (A/D) MODULE


The analog-to-digital (A/D) converter module has five inputs for the
PIC16f72. The A/D allows conversion of an analog input signal to a
corresponding 8-bit digital number. The output of the sample and hold is the
input into the converter, which generates the result via successive
approximation. The analog reference voltage is software selectable to either the
device’s positive supply voltage level on the RA3/AN3/VREF pin. The A/D
converter has a unique feature of being able to operate while the device is in
SLEEP mode. To operate in SLEEP, the A/D module has three registers:
 A/D Result Register ADRES
 A/D Control Register 0 ADCON0
 A/D Control Register 1 ADCON1
A device RESET forces all registers to their RESET state. This forces the
A/D module to turn off and any conversion is aborted. The ADCON0 register,
shown in register 10- Control the operation of the A/D module. The ADCON1
register, shown in register 10- Configures the function of the port pins.

19
SPECIAL FEATURES OF THE CPU
These devices have a host of features intended to maximize system
reliability, minimize cost through elimination of external components, and
provide power saving operation modes and offer code protection:
 Oscillator selection
 RESET
 Power-on reset (POR)
 Power-up timer (PWRT)
 Oscillator start-up timer (OST)
 Brown-out reset (BOR)
 Interrupts
 Watchdog timer (WDT)
 Sleep
 Code protection
 ID Locations
 In-Circuit serial Programming
These devices have a watchdog timer. Which can be enabled or disable
using a configuration bit. It runs off its own RC oscillator for added reliability.
There are two timers that offer necessary delays on power-up. One is the
oscillator start-up Timer (OST), intended to keep the chip in RESET until the
crystal oscillator is stable. The other is the power-up Timer (PWRT), which
provides a fixed delay of 72ms (nominal) on power-up only. It is designed to
keep the part in RESET while the power supply stabilizes, and is enabled or
disabled using a configuration bit. With these two timers on-chip, most
applications need no external RESET circuitry. SLEEP mode is designed to
offer a very low current power-down mode. The user can wake-up from SLEEP
through external RESET, watchdog Timer wake-up, or through an interrupt.
Several oscillator options are also made available to allow the part to fit the
application.
20
4.6 LCD
A liquid-crystal display (LCD) is a flat panel display, electronic visual
display, or video display that uses the light modulating properties of liquid
crystals. Liquid crystals do not emit light directly.
LCDs are available to display arbitrary images (as in a general-purpose
computer display) or fixed images which can be displayed or hidden, such as
preset words, digits, and 7-segment displays as in a digital clock. They use the
same basic technology, except that arbitrary images are made up of a large
number of small pixels, while other displays have larger elements.

Figure No 4.6 LCD Diagram


LCDs are used in a wide range of applications including computer
monitors, televisions, instrument panels, aircraft cockpit displays, and signage.
They are common in consumer devices such as DVD players, gaming devices,
clocks, watches, calculators, and telephones, and have replaced cathode ray tube
(CRT) displays in most applications. The LCD screen is more energy efficient
and can be disposed of more safely than a CRT. Its low electrical power
consumption enables it to be used in battery-powered electronic equipment.

21
4.7 LED
A light-emitting diode (LED) is a two-lead semiconductor light source. It
is a pn-junction diode, which emits light when activated.]When a suitable
voltage is applied to the leads, electrons are able to recombine with electron
holes within the device, releasing energy in the form of photons. This effect is
called electroluminescence, and the color of the light (corresponding to the
energy of the photon) is determined by the energy band gap of the
semiconductor.

Figure No 4.7 LED Diagram

4.8 DHT11 TEMPERATURE AND HUMIDITY SENSOR


This DHT11 Temperature and Humidity Sensor features a calibrated
digital output temperature and humidity sensor module. Its technology ensures
high reliability and excellent long-term stability. A high-performance 8-bit
microcontroller is connected. This sensor includes a resistive element and wet
NTC temperature measuring devices. It has excellent quality, fast response,
anti-interference ability and high cost performance advantages.

Figure No.4.8 DHT11 SENSORS

22
Each DHT11 sensors features extremely accurate calibration of humidity
calibration chamber. The calibration coefficients stored in the OTP program
memory. Internal sensors detect signals in the process in accordance with their
calibration coefficients. The single-wire serial interface system is integrated to
become quick and easy to use. The small size, low power, and signal
transmission distance up to 20 meters makes it useful in a variety of
applications and even the most demanding applications. The product is 4-pin
single row pin package. Convenient connections and special packages can be
provided according to users need.
Specification
 Supply Voltage: +5 V
 Temperature range :0-50 °C error of ± 2 °C
 Humidity :20-90% RH ± 5% RH error
 Interface: Digital

4.9 LIGHT SENSOR


Photodetectors, also called photosensors, are sensors of light or other
electromagnetic radiation. A photo detector has a p–n junction that converts
light photons into current. The absorbed photons make electron–hole pairs in
the depletion region. Photodiodes and photo transistors are a few examples of
photo detectors. Solar cells convert some of the light energy absorbed into
electrical energy.
TYPES
Photoemission or photoelectric effect: Photons cause electrons to transition
from the conduction band of a material to free electrons in a vacuum or gas.
 Thermal: Photons cause electrons to transition to mid-gap states then
decay back to lower bands, inducing phonon generation and thus heat.
 Polarization: Photons induce changes in polarization states of suitable
materials, which may lead to change in index of refraction or other
polarization effects.
23
 Photochemical: Photons induce a chemical change in a material.
 Weak interaction effects: photons induce secondary effects such as in
photon drag detectors or gas pressure changes in Golay cells.
 Photodetectors may be used in different configurations. Single sensors
may detect overall light levels. A 1-D array of photodetectors, as in a
spectrophotometer or a Line scanner, may be used to measure the
distribution of light along a line. A 2-D array of photodetectors may be
used as an image sensor to form images from the pattern of light before it.
 A photodetector or array is typically covered by an illumination window,
sometimes having an anti-reflective coating.
PROPERTIES
There are a number of performance metrics, also called figures of merit, by
which photodetectors are characterized and compared
 Spectral response: The response of a photodetector as a function of photon
frequency.
 Quantum efficiency: The number of carriers (electrons or holes) generated per
photon.
 Responsivity: The output current divided by total light power falling upon the
photodetector.
 Noise-equivalent power: The amount of light power needed to generate a signal
comparable in size to the noise of the device.
 Detectivity: The square root of the detector area divided by the noise equivalent
power.
 Gain: The output current of a photodetector divided by the current directly
produced by the photons incident on the detectors, i.e., the builtin current gain.
 Dark current: The current flowing through a photodetector even in the absence
of light.
 Response time: The time needed for a photodetector to go from 10% to 90% of
final output.

24
 Noise spectrum: The intrinsic noise voltage or current as a function of
frequency. This can be represented in the form of a noise spectral density.
 Nonlinearity: The RF-output is limited by the nonlinearity of the
Photodetector

4.10 RELAY
A relay is an electrically operated switch. Many relays use
an electromagnet to mechanically operate a switch, but other operating
principles are also used, such as solid-state relays. Relays are used where it is
necessary to control a circuit by a separate low-power signal, or where several
circuits must be controlled by one signal. The first relays were used in long
distance telegraph circuits as amplifiers: they repeated the signal coming in
from one circuit and re-transmitted it on another circuit. Relays were used
extensively in telephone exchanges and early computers to perform logical
operations. A small cradle relay often used in electronics. The "cradle" term
refers to the shape of the relay's armature. When an electric current is passed
through the coil it generates a magnetic field that activates the armature and the
consequent movement of the movable contact either makes or breaks
(depending upon construction) a connection with a fixed contact. If the set of
contacts was closed when the relay was de-energized, then the movement opens
the contacts and breaks the connection, and vice versa if the contacts were open.
When the current to the coil is switched off, the armature is returned by a force,
approximately half as strong as the magnetic force, to its relaxed position.
Usually this force is provided by a spring, but gravity is also used commonly in
industrial motor starters. Most relays are manufactured to operate quickly. In a
low-voltage application this reduces noise; in a high voltage or current
application it reduces arcing.
Relays with calibrated operating characteristics and sometimes multiple
operating Automotive-style miniature relay, dust cover is taken off. If the coil is
25
designed to be energized with alternating current (AC), some method is used to
split the flux into two out-of-phase components which add together, increasing
the minimum pull on the armature during the AC cycle. Typically, this is done
with a small copper "shading ring" crimped around a portion of the core that
creates the delayed, out-of-phase component, which holds the contacts during
the zero crossings of the control voltage.

Figure No 4.10 (A) Relay


Circuit symbols of relays (C denotes the common terminal in SPDT and
DPDT types.). Since relays are switches, the terminology applied to switches is
also applied to relays; a relay switches one or more poles, each of
whose contacts can be thrown by energizing the coil. Normally open (NO)
contacts connect the circuit when the relay is activated; the circuit is
disconnected when the relay is inactive. Normally closed (NC) contacts
disconnect the circuit when the relay is activated; the circuit is connected when
the relay is inactive. All of the contact forms involve combinations of NO and
NC connections.

Figure No 4.10 (B) SPST, SPDT, DPST, DPDT

26
SPDT (Single-Pole Double-Throw) relays have a single set of Form
C, break before make or transfer contacts. That is, a common terminal connects
to either of two others, never connecting to both at the same time. Including two
for the coil, such a relay has a total of five terminals.
DPST – Double-Pole Single-Throw relays are equivalent to a pair of
SPST switches or relays actuated by a single coil. Including two for the coil,
such a relay has a total of six terminals. The poles may be Form A or Form
B (or one of each; the designations NO and NC should be used to resolve the
ambiguity).
DPDT – Double-Pole Double-Throw relays have two sets of Form
C contacts. These are equivalent to two SPDT switches or relays actuated by a
single coil.

4.11 PH VALUE MEASUREMENT


This circuit is designed to measure the PH level in the water. The PH
electrode is used to measure the PH level. Depending on the PH level in the
water it generates the corresponding voltage signal.

Figure No 4.11 PH Value Measurement


This voltage signal is in the range of mV so it is amplified by the
operational amplifier. The amplifier is constructed by the OP07 operational
amplifier. Then the amplified signal is given to inverting input terminal of the
operational amplifier. The amplifier is constructed by LF356 operational
amplifier. Then the +12v to -12v reference signal is generated by the pair diodes
D1 and D2 which is given to non inverting input terminal.

27
Then the output signal is given to filter section in which the noise signal
in the output is filtered. The filter section is constructed by the LM324
operational amplifier and the capacitor C1 and C2. Then the noise free signal is
given to comparator in which the PH level is compared with reference level then
the final voltage given to gain amplifier in which the variable resistor is
connected in the feedback path. Then final gain voltage is given to related
circuit in order to find the PH level in the water.

4.12 WI-FI
Wi-Fi is wireless communication devices based on IEEE 802.11
standards, most commonly used Wi-Fi module are ESP8266, which is a low-
cost Wi-Fi microchip with full TCP/IP stack and microcontroller capability.
This module can be integrated with any mobility devices. Wi-Fi can be used to
connect to the internet and send data to cloud reliably.

Figure No 4.12 Wi-Fi


The ESP8266 is a really useful, cheap WiFi module for controlling
devices over the Internet. It can work with a micro-controller like the Arduino
or it can be programmed to work on its own. The Internet of Things (IoT) has
just been made a whole lot cheaper and easier! The ESP8266 comes with
factory installed firmware allowing you to control it with standard “AT
commands”. You can also easily create and upload your own code and this

28
makes it hugely powerful and flexible. The ESP8266 was launched in 2014 and
is rapidly growing in popularity. There is only one ESP8266 processor but it is
found on many different breakout boards. These all differ in terms of which pins
are exposed and the size of the flash memory etc. These breakout boards have
evolved rapidly over the years and there is a lot of information to be found on
the web. This is both a blessing and a curse as some of the advice is outdated or
just plain wrong. As a result it took me 3 days before I could get it to do
anything! Some people are lucky but for me it was a battle to get anything
working.

4.13 DC MOTOR
A DC motor is any of a class of rotary electrical machines that converts
direct current electrical energy into mechanical energy. The most common types
rely on the forces produced by magnetic fields. Nearly all types of DC motors
have some internal mechanism, either electromechanical or electronic; to
periodically change the direction of current flow in part of the motor.

Figure No 4.13 DC Motor


DC motors were the first type widely used, since they could be powered
from existing direct-current lighting power distribution systems. A DC motor's

29
speed can be controlled over a wide range, using either a variable supply
voltage or by changing the strength of current in its field windings. Small DC
motors are used in tools, toys, and appliances. The universal motor can operate
on direct current but is a lightweight brushed motor used for portable power
tools and appliances. Larger DC motors are used in propulsion of electric
vehicles, elevator and hoists, or in drives for steel rolling mills. The advent of
power electronics has made replacement of DC motors with AC motors possible
in many applications.

4.13.1 MOTOR DRIVER


A motor driver is an integrated circuit chip which is usually used to
control motors in autonomous robots. Motor driver act as an interface between
Arduino and the motor. The most commonly used motor driver IC’s are from
the L293 series such as L293D L293NE, etc. These ICs are designed to control
2 DC motors simultaneously. L293 consist of two H-bridge. H-bridge is the
simplest circuit for controlling a low current rated motor. We will be referring
the motor driver IC as L293D only. L293D has 16 pins.

Figure No 4.13.1 (A) Motor Driver IC

30
1) L293D IC
2) 4 1 microfarad capacitor
3) 6 Header Male pins
Add Tip Ask Question Comment Download
5) Wires or female sockets
6) 2 Motors
7) Arduino (Any) to test the Driver
8) Computer with arduino IDE
9) Misc itmes like soldering iron, soldering Wire etc.
The L293D is a 16 pin IC, with eight pins, on each side, dedicated to the
controlling a motor. There are 2 INPUT pins, 2 OUTPUT pins and 1 ENABLE
pin for each motor L293D consist of two H-bridge. H-bridge is the simplest
circuit for controlling a low current rated motor.
Pin No. - Pin Characteristics
1 - Enable 1-2, when this is HIGH the left part of the IC will work and when it
is low the left part won’t work.
2 INPUT 1 HIGH 1
3 - OUTPUT 1, this pin should be connected to one of the terminals of motor
4, 5 - GND, ground pins
6 - OUTPUT 2, this pin should be connected to one of the terminals of motor
7 - INPUT 2, when this pin is HIGH the current will flow though output 2
8 - VCC2, this is the voltage which will be supplied to the motor.
16 - VCC1, this is the power source to the IC. So, this pin should be supplied
with V
15 - INPUT 4, when this pin is HIGH the current will flow though output 4
14 - OUTPUT 4, this pin should be connected to one of the terminals of motor
13, 12 - GND, ground pins
11 - OUTPUT 3, this pin should be connected to one of the terminal of motor
10 - INPUT 3, when this pin is HIGH the current will flow though output 3

31
9 - Enable 3-4, when this is HIGH the right part of the IC will work and when it
is l the right part won’t work.
The motor driver IC deals with heavy currents. Due to so much current
flows 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.
The DC motor is an inductive load. So, it develops a back EMF when
supplied by a voltage. There can be fluctuations of voltage while using the
motor say when sudden we take a reverse while the motor was moving in some
direction. At this point the fluctuation in voltage is quite high and this can
damage the IC. Thus, we use four capacitors that help to dampen the extreme
variation in current. Now depending upon the values of the Input and Enable the
motors will rotate in either clockwise or anticlockwise direction with full speed
(when Enable is HIGH) or with less speed (when Enable is provided with
PWM).Let us assume for Left Motor when Enable is HIGH and Input 1 and
Input 2 are HIGH and LOW respectively then the motor will move in clockwise
direction.

32
CHAPTER – 5
CIRCUIT DIAGRAM

33
5.1 CIRCUIT DIAGRAM
There are three main parts in a vertical hydroponics farm: sensor
interface, microcontroller and hardware. In the sensor interface section, there
are four sensors: pH sensor, water level sensor, air temperature and humidity
sensor and light sensor. This sensor interface section is connected to ESP32
microcontroller through GPIO port. A four-channeled relay is also connected
with the ESP32 microcontroller. Hardware section consists of a fan, a nutrient
pump, a lighting system and a water pump. The hardware components are
connected to the four-channeled relay as an output. There is a display connected
to the ESP32 microcontroller. By using a router gateway, data can be stored in a
cloud server. By using a mobile application, the data can be shown on the
display and the owner can control the hardware components with his/her mobile
phone.

Figure No 5.1 Circuit Diagram

34
Firstly, on the circuit an LCD is connected to ESP32 microcontroller.
SCL and SDA of the LCD 12v system are connected to ESP32 through data
pins D22 and D21 respectively. Two resistors R8 (4.7 K) and R9 (4.7 K) are
used here for pull up. Secondly, an LDR is connected to data pin D19 of ESP32
board and a resistor R7 (10 K) is used for pull down. Thirdly, there is a buzzer
in the circuit for alarm system. The negative pole of the buzzer is connected to
the ground of ESP32 through VIN pin and positive pole is connected to D4 pin
of ESP32. The D4 pin has been pulled down by a resistor R6 (1 K). For the
buzzer, a T1 2N2222 amplifier is used to amplify the sound. Fourthly, a DHT11
censor is used in the system which is connected to ESP32 through D15 pin.
Fifthly, there is a water level censor here which is connected to D34 pin of
ESP32 board.
The negative pole of the water level censor is connected to the ground of
ESP32 through a GND pin and positive pole is connected to 3.3 V pin of
ESP32. Sixthly, there are 4 buttons (S1, S2, S3 and S4) used in the system for
the controlling of different devices i.e., S1 for fan, S2 for nutrient pump, S3 for
lighting system, and S4 for water pump. These 4 buttons are connected to
ESP32 through 4 pins: S1 through D35, S2 through D32, S3 through D33 and
S4 through D25. To pull down these pins, 4 resistors are used: R1 (10 K) for
D35, R2 (10 K) for D32, R3 (10 K) for D33 and R4 (10 K) for D36. Seventhly,
a 4 channeled (ln1, ln2, ln3 and ln4) relay is used in the system which is
connected to ESP32 through 4 pins: ln1 through D27, ln2 through D14, ln3
through D12 and ln4 through D13. Two pumps, one fan and a lighting system
are connected to the relay each of which has a potential of 12 V.

35
CHAPTER – 6
PROGRAM

36
6.1 PROGRAM
#include <ESP8266WiFi.h>

#include <DallasTemperature.h>

#include <OneWire.h>

#include "DHT.h"

#include "Adafruit_MQTT.h"

#include "Adafruit_MQTT_Client.h"

#include <ArduinoJson.h>

const char *ssid = "Galaxy-M20"; // Enter your WiFi Name

const char *pass = "ac312124"; // Enter your WiFi Password

WiFiClient client;

#define MQTT_SERV "io.adafruit.com"

#define MQTT_PORT 1883

#define MQTT_NAME "aschoudhary" // Your Adafruit IO Username

#define MQTT_PASS "1ac95cb8580b4271bbb6d9f75d0668f1" // Adafruit IO


AIO key

const char server[] = "api.openweathermap.org";

String nameOfCity = "Jaipur,IN";

String apiKey = "e8b22b36da932dce8f31ec9be9cb68a3";

String text;

const char* icon="";

int jsonend = 0;

37
boolean startJson = false;

int status = WL_IDLE_STATUS;

#define JSON_BUFF_DIMENSION 2500

unsigned long lastConnectionTime = 10 * 60 * 1000; // last time you


connected to the server, in milliseconds

const unsigned long postInterval = 10 * 60 * 1000; // posting interval of 10


minutes (10L * 1000L; 10 seconds delay for testing)

const int ldrPin = D1;

const int ledPin = D0;

const int moisturePin = A0; // moisteure sensor pin

const int motorPin = D8;

float moisturePercentage; //moisture reading

int temperature, humidity, soiltemp;

#define ONE_WIRE_BUS 4 //D2 pin of nodemcu

#define DHTTYPE DHT11 // DHT 11

#define dht_dpin D4

DHT dht(dht_dpin, DHTTYPE);

OneWire oneWire(ONE_WIRE_BUS);

DallasTemperature sensors(&oneWire);

const unsigned long Interval = 50000;

unsigned long previousTime = 0;

//Set up the feed you're publishing to

38
Adafruit_MQTT_Client mqtt(&client, MQTT_SERV, MQTT_PORT,
MQTT_NAME, MQTT_PASS);

Adafruit_MQTT_Publish Moisture =
Adafruit_MQTT_Publish(&mqtt,MQTT_NAME "/f/Moisture"); // Moisture is
the feed name where you will publish your data

Adafruit_MQTT_Publish Temperature =
Adafruit_MQTT_Publish(&mqtt,MQTT_NAME "/f/Temperature");

Adafruit_MQTT_Publish Humidity =
Adafruit_MQTT_Publish(&mqtt,MQTT_NAME "/f/Humidity");

Adafruit_MQTT_Publish SoilTemp =
Adafruit_MQTT_Publish(&mqtt,MQTT_NAME "/f/SoilTemp");

Adafruit_MQTT_Publish WeatherData =
Adafruit_MQTT_Publish(&mqtt,MQTT_NAME "/f/WeatherData");

//Set up the feed you're subscribing to

Adafruit_MQTT_Subscribe LED = Adafruit_MQTT_Subscribe(&mqtt,


MQTT_NAME "/f/LED");

Adafruit_MQTT_Subscribe Pump = Adafruit_MQTT_Subscribe(&mqtt,


MQTT_NAME "/f/Pump");

void setup()

Serial.begin(9600);

delay(10);

dht.begin();

sensors.begin();

mqtt.subscribe(&LED);

mqtt.subscribe(&Pump);

39
pinMode(motorPin, OUTPUT);

pinMode(ledPin, OUTPUT);

pinMode(ldrPin, INPUT);

digitalWrite(motorPin, LOW); // keep motor off initally

digitalWrite(ledPin, HIGH);

text.reserve(JSON_BUFF_DIMENSION);

Serial.println("Connecting to ");

Serial.println(ssid);

WiFi.begin(ssid, pass);

while (WiFi.status() != WL_CONNECTED)

delay(500);

Serial.print("."); // print ... till not connected

Serial.println("");

Serial.println("WiFi connected");

void loop()

unsigned long currentTime = millis();

MQTT_connect();

40
if (millis() - lastConnectionTime > postInterval) {

// note the time that the connection was made:

lastConnectionTime = millis();

makehttpRequest();

//}

int ldrStatus = analogRead(ldrPin);

if (ldrStatus <= 200) {

digitalWrite(ledPin, HIGH);

Serial.print("Its DARK, Turn on the LED : ");

Serial.println(ldrStatus);

else {

digitalWrite(ledPin, LOW);

Serial.print("Its BRIGHT, Turn off the LED : ");

Serial.println(ldrStatus);

moisturePercentage = ( 100.00 - ( (analogRead(moisturePin) / 1023.00) *


100.00 ) );

Serial.print("Soil Moisture is = ");

Serial.print(moisturePercentage);

Serial.println("%");

41
if (moisturePercentage < 35) {

digitalWrite(motorPin, HIGH); // tun on motor

if (moisturePercentage > 38) {

digitalWrite(motorPin, LOW); // turn off mottor

temperature = dht.readTemperature();

humidity = dht.readHumidity();

//Serial.print("Temperature: ");

//Serial.print(temperature);

//Serial.println();

//Serial.print("Humidity: ");

//Serial.print(humidity);

//Serial.println();

sensors.requestTemperatures();

soiltemp = sensors.getTempCByIndex(0);

// Serial.println("Soil Temperature: ");

// Serial.println(soiltemp);

if (currentTime - previousTime >= Interval) {

if (! Moisture.publish(moisturePercentage)) //This condition is used to


publish the Variable (moisturePercentage) on adafruit IO. Change thevariable
according to yours.

42
const size_t bufferSize = 2*JSON_ARRAY_SIZE(1) +
JSON_ARRAY_SIZE(2) + 4*JSON_OBJECT_SIZE(1) +
3*JSON_OBJECT_SIZE(2) + 3*JSON_OBJECT_SIZE(4) +
JSON_OBJECT_SIZE(5) + 2*JSON_OBJECT_SIZE(7) +
2*JSON_OBJECT_SIZE(8) + 720;

DynamicJsonBuffer jsonBuffer(bufferSize);

// DynamicJsonDocument(bufferSize);

// FIND FIELDS IN JSON TREE

JsonObject& root = jsonBuffer.parseObject(jsonString);

if (!root.success()) {

Serial.println("parseObject() failed");

return;

JsonArray& list = root["list"];

JsonObject& nowT = list[0];

JsonObject& later = list[1];

JsonObject& tommorow = list[2];

// String conditions = list.weather.main;

// including temperature and humidity for those who may wish to hack it in

String city = root["city"]["name"];

String weatherNow = nowT["weather"][0]["description"];

String weatherLater = later["weather"][0]["description"];

String list12 = later["weather"][0]["list"];

43
Serial.println(list12);

Serial.println(weatherLater);

if(weatherLater == "few clouds"){

icon = "Few Clouds";

Serial.print(icon);

else if(weatherLater == "rain"){

icon = "Rain";

Serial.print(icon);

else if(weatherLater == "broken clouds"){

icon = "Broken Clouds";

Serial.print(icon);

else {

icon = "Sunny";

44
CHAPTER – 7
SOFTWARE

45
7.1 PCB DESIGN
A printed circuit board (PCB) mechanically supports and electrically
connects electronic components or electrical components using conductive
tracks, pads and other features etched from one or more sheet layers of copper
laminated onto and/or between sheet layers of a non-conductive substrate.
Components are generally soldered onto the PCB to both electrically connect
and mechanically fasten them to it. Printed circuit boards are used in all but the
simplest electronic products. They are also used in some electrical products,
such as passive switch boxes. Alternatives to PCBs include wire wrap and
point-to-point construction, both once popular but now rarely used. PCBs
require additional design effort to layout the circuit, but manufacturing and
assembly can be automated. Specialized CAD software is available to do much
of the work of layout. Mass-producing circuits with PCBs is cheaper and faster
than with other wiring methods, as components are mounted and wired in one
operation. Large numbers of PCBs can be fabricated at the same time, and the
layout only has to be done once. PCBs can also be made manually in small
quantities, with reduced benefits. PCBs can be single-sided (one copper layer),
double-sided (two copper layers on both sides of one substrate layer), or multi-
layer (outer and inner layers of copper, alternating with layers of substrate).
Multi-layer PCBs allow for much higher component density, because circuit
traces on the inner layers would otherwise take up surface space between
components. The rise in popularity of multilayer PCBs with more than two, and
especially with more than four, copper planes was concurrent with the adoption
of surface mount technology. However, multilayer PCBs make repair, analysis,
and field modification of circuits much more difficult and usually impractical.
A basic PCB consists of a flat sheet of insulating material and a layer of
copper foil, laminated to the substrate. Chemical etching divides the copper into
separate conducting lines called tracks or circuit traces, pads for connections,
visa to pass connections between layers of copper, and features such as solid
46
conductive areas for EM shielding or other purposes. The tracks function as
wires fixed in place, and are insulated from each other by air and the board
substrate material. The surface of a PCB may have a coating that protects the
copper from corrosion and reduces the chances of solder shorts between traces
or undesired electrical contact with stray bare wires. For its function in helping
to prevent solder shorts, the coating is called solder resist. A printed circuit
board can have multiple copper layers. A two-layer board has copper on both
sides; boards sandwich additional copper layers between layers of insulating
material. Conductors on different layers are connected with visas, which are
copper-plated holes that function as electrical tunnels through the insulating
substrate. Through-hole component leads sometimes also effectively function as
After two-layer PCBs, the next step up is usually four-layer. Often two layers
are dedicated as power supply and ground planes, and the other two are used for
signal wiring between components.
"Through hole" components are mounted by their wire leads passing
through the board and soldered to traces on the other side. "Surface mount"
components are attached by their leads to copper on the same side of the board.
A board may use both methods for mounting components. PCBs with only
through-hole mounted components are now uncommon. Surface mounting is
used for transistors, diodes, IC chips, resistors and capacitors. Through-hole
mounting may be used for some large components such as electrolytic
capacitors and connectors. The pattern to be etched into each copper layer of a
PCB is called the "artwork". The etching is usually done using is coated onto
the PCB, then exposed to light projected in the pattern of the artwork. The resist
material protects the copper from dissolution into the etching solution. The
etched board is then cleaned.
A PCB design can be mass-reproduced in a way similar to the way
photographs can be mass-duplicated from film negatives using a photographic
printer. In multi-layer boards, the layers of material are laminated together in an

47
alternating sandwich: copper, substrate, copper, substrate, copper, etc.; each
plane of copper is etched, and any internal are plated-through, before the layers
are laminated together. Only the outer layers need be coated; the inner copper
layers are protected by the adjacent substrate layers. FR-4 glass epoxy is the
most common insulating substrate. Another substrate material is cotton paper
impregnated with phenolic resin, often tan or brown.
When a PCB has no components installed, it is less ambiguously called a
printed wiring board (PWB) or etched wiring board. However, the term "printed
Wiring board" has fallen into disuse. A PCB populated with electronic
components is called a printed circuit assembly (PCA), printed circuit board
assembly or PCB assembly (PCBA). In informal usage, the term "printed circuit
board" most commonly means "printed circuit assembly" (with components).

Figure No 7.1.1 PCB Board Diagram


The IPC preferred term for assembled boards is circuit card assembly
(CCA), and for assembled backplanes it is backplane assemblies. "Card" is
another widely used informal term for a "printed circuit assembly". A PCB may
be "silkscreen" printed with a legend identifying the components, test points, or
identifying text. Originally, an actual silkscreen Printing process was used for
this purpose, but today other, finer quality printing methods are usually used
instead. Normally the screen printing is not significant to the function of the
PCBA. A minimal PCB for a single component, used for prototyping, is called a
breakout board. The purpose of a breakout board is to "break out" the leads of a
component on separate terminals so that manual connections to them can be
made easily. Breakout boards are especially used for surface-mount components
or any components with fine lead pitch.

48
7.2 PCB Board Design
Initially PCBs were designed manually by creating a photo mask on a
clear Mylar sheet, usually at two or four times the true size. Starting from the
schematic diagram the component pin pads were laid out on the Mylar and then
traces were routed to connect the pads. Rub-on dry transfers of common
component footprints increased efficiency. Traces were made with self-adhesive
Tape. Pre-printed non-reproducing grids on the assisted in layout. The finished
was onto a photoresist coating on the blank copper-clad boards. Modern PCBs
are designed with dedicated layout software, generally in the following steps:
1. Schematic capture through an electronic design automation (EDA) tool.
2. Card dimensions and template are decided based on required circuitry and
case of the PCB.
3. The positions of the components and heat sinks are determined.
4. Layer stack of the PCB is decided, with one to tens of layers depending on
complexity. Ground and power planes are decided. A power plane is the
5. Counterpart to a ground plane and behaves as an AC signal ground while
providing DC power to the circuits mounted on the PCB. Signal
interconnections are traced on signal planes. Signal planes can be on the outer
as well as inner layers. For optimal EMI performance high frequency signals are
routed in internal layers between power or ground planes.
6. Line impedance is determined using dielectric layer thickness, routing copper
thickness and trace-width. Trace separation is also taken into account in case of
differential signals. Micro strip, strapline or dual strip line can be used to route
signals.
7. Components are placed. Thermal considerations and geometry are taken into
account. Visa and lands are marked.
8. Signal traces are routed. Electronic design automation tools usually create
clearances and connections in power and ground planes automatically.
9. Gerber files are generated for manufacturing.
49
7.3 PROTEUS DESIGN SUITE
The Proteus Design Suite is a proprietary software tool suite used
primarily for electronic design automation. The software is used mainly by
electronic design engineers and technicians to create schematics and electronic
prints for manufacturing printed circuit boards. It was developed in Yorkshire,
England by Labcenter Electronics Ltd and is available in English, French,
Spanish and Chinese languages.

Product Modules
The Proteus Design Suite is a Windows application for schematic
capture, simulation, and PCB (Printed Circuit Board) layout design. It can be
purchased in many configurations, depending on the size of designs being
produced and the requirements for microcontroller simulation. All PCB Design
products include an auto router and basic mixed mode SPICE simulation
capabilities.

Schematic Capture
Schematic capture in the Proteus Design Suite is used for both the
simulation of designs and as the design phase of a PCB layout project. It is
therefore a core component and is included with all product configurations.

Microcontroller Simulation
The micro-controller simulation in Proteus works by applying either a hex
file or a debug file to the microcontroller part on the schematic. It is then co-
simulated along with any analog and digital electronics connected to it. This
enables its use in a broad spectrum of project prototyping in areas such as motor
control, temperature control and user interface design. It also finds use in the

50
general hobbyist community and, since no hardware is required, is convenient
to use as a training or teaching tool. Support is available for co-simulation of:
 Microchip Technologies PIC10, PIC12, PIC16, PIC18, PIC24, dsPIC33
Microcontrollers.
 Atmel AVR (and Arduino), 8051 and ARM Cortex-M3 Microcontrollers
 NXP 8051, ARM7, ARM Cortex-M0 and ARM Cortex-M3
Microcontrollers.
 Texas Instruments MSP430, PICCOLO DSP and ARM Cortex-M3
Microcontrollers.
 Parallax Basic Stamp, Freescale HC11, 8086 Microcontrollers.

PCB Design
The PCB Layout module is automatically given connectivity information
in the form of a net list from the schematic capture module. It applies this
information, together with the user specified design rules and various design
automation tools, to assist with error free board design. PCB's of up to 16
copper layers can be produced with design size limited by product
configuration.

3D Verification
The 3D Viewer module allows the board under development to be viewed
in 3D together with a semi-transparent height plane that represents the boards
enclosure. STEP output can then be used to transfer to mechanical CAD
software such as Solid works or Autodesk for accurate mounting and
positioning of the board.

51
7.4 PIC C COMPILE
MPLAB is official software developed by Microchip
for PIC Microcontroller. ... In MPLAB you can work on assembly language as
well but using the C18 compiler you can write your code in C Language.
MPLAB is the most flexible compiler for PIC Microcontroller as you can do
anything in it with you PIC Microcontroller.

7.5 C COMPILER
A compiler is a special program that processes statements written in a
particular programming language and turns them into machine language or
"code" that a computer's processor uses. Typically, a programmer writes
language statements in a language such as Pascal or C one line at a time using
an editor.
Software is used for PIC microcontroller PIC Pgm is a PC-Software to
program PIC microcontrollers using external programmer hardware connected
to the PC. It allows to: Program a HEX file into a PIC microcontroller.

PIC Microcontroller Programming


The PIC is a family of the microcontroller, which is manufactured by the
different companies such as NXP, microchip, etc. The PIC stands for
“peripheral interface controller”, which contains memories, timers/counters,
serial communication, interrupts and ADC converters built into a single
integrated chip.

7.6 MPLAB
MPLAB is a proprietary freeware integrated development
environment for the development of embedded applications on PIC and ds
PIC microcontrollers, and is developed by Microchip Technology. MPLAB X is

52
the latest edition of MPLAB, and is developed on the Net Beans platform.
MPLAB and MPLAB X support project management, code editing, debugging
and programming of Microchip 8-bit PIC and AVR (including ATMEGA)
microcontrollers, 16-bit PIC24 and ds PIC microcontrollers, as well as 32-bit
SAM (ARM) and PIC32 (MIPS) microcontrollers.
MPLAB is designed to work with MPLAB-certified devices such as
the MPLAB ICD 3 and MPLAB REAL ICE, for programming and debugging
PIC microcontrollers using a personal computer. PICK it programmers are also
supported by MPLAB.
MPLAB X supports automatic code generation with the MPLAB Code
Configurator and the MPLAB Harmony Configuration plugins.

Figure No .6.6.1 MPLAB Diagram

MPLAB 8.X
MPLAB 8.X is the last version of the legacy MPLAB IDE technology,
custom built by Microchip Technology in Microsoft Visual C++. MPLAB
supports project management, editing, debugging and programming of
Microchip 8-bit, 16-bit and 32-bit PIC microcontrollers. MPLAB only works
on Microsoft Windows. MPLAB is still available from Microchip's archives,
but is not recommended for new projects.
MPLAB supports the following compilers:

53
 MPLAB MPASM Assembler
 MPLAB ASM30 Assembler
 MPLAB C Compiler for PIC18
 MPLAB C Compiler for PIC24 and dsPIC DSCs
 MPLAB C Compiler for PIC32
 HI-TECH C

MPLAB X
MPLAB X is the latest version of the MPLAB IDE built by Microchip
Technology, and is based on the open-source NetBeans platform. MPLAB X
supports editing, debugging and programming of Microchip 8-bit, 16-bit and
32-bit PIC microcontrollers.
MPLAB X is the first version of the IDE to include cross-platform
support for Mac OS X and Linux operating systems, in addition to Microsoft
Windows.
MPLAB X supports the following compilers:
 MPLAB XC8 — C compiler for 8-bit PIC and AVR devices
 MPLAB XC16 — C compiler for 16-bit PIC devices
 MPLAB XC32 — C/C++ compiler for 32-bit MIPS-based PIC32 and
ARM-based SAM devices
 HI-TECH C — C compiler for 8-bit PIC devices (discontinued)
 SDCC — open-source C compiler

54
CHAPTER – 8
CONCLUSION

55
8.1 CONCLUSION
IoT will help to enhance smart farming. Using IoT the system can predict
the soil moisture level and humidity so that the irrigation system can be
monitored and controlled. IoT works in different domains of farming to improve
time efficiency, water management, crop monitoring, soil management and
control of insecticides and pesticides. This system also minimizes human
efforts, simplifies techniques of farming and helps to gain smart farming.
Besides the advantages provided by this system, smart farming can also help to
grow the market for farmer with single touch and minimum effort.

56
CHAPTER – 9
BIBLIOGRAPHY

57
9.1 BIBLIOGRAPHY
[1] S. Prabhakar, S. Pankanti, and A. K. Jain, “Biometric recognition: Security
and privacy concerns,” IEEE Security Privacy Mag., vol. 1, no. 2,pp. 33–42,
2003.
[2] D. Maltoni, D. Maio, A. K. Jain, and S. Prabhakar, Handbook of Fingerprint
[3] Recognition. New York: Springer-Verlag, 2003.
[4] A. K. Jain, R. Bolle, and S. Pankanti, Eds., Biometrics: Personal
Identificationin Networked Society. Norwell, MA: Kluwer, 1999.
[5] Moses Okechukwu Onyesolu, Ignatius Majesty Ezeani, “ATM Security
Using Fingerprint Biometric Identifer: An Investigative Study”, (IJACSA)
International Journal of Advanced Computer Science and Applications, Vol. 3,
No.4, 2012, pp. 68-72

58
CHAPTER – 10
PHOTO GRAPHY

59
10.1 PHOTO GRAPHY

Figure No. 10.1 Photography

60
CHAPTER – 11
PROJECT ESTIMATION
61
11.1 PROJECT ESTIMATION
S.NO. DESCRIPTION SPECIFICATION UNIT COST IN RS.
Resistor 1Kohm, connecting wires
(single lead), capacitors
1 Raw material As required Rs. 300
100microfarad, 22 microfarad, LED
(red)
Microcontroller 01 Rs.210
LCD 01 Rs.250
LDR light sensor 01 Rs.300
Standard Items
2 Temperature & humidity sensor 01 Rs.350
Relays 01 Rs.200
Water level sensor 01 Rs.1,200
WiFi module 01 Rs.350
3 Machining Cost PCB board 01 Rs.550
TOTAL COST Rs.3,710

62
ii
iii

Directorate of Technical Education, Chennai - 600025


Government of Tami Nadu

BONAFIDE CERTIFICATE

Certified that this Report titled “OPTIMIZATION AND CONTROL OF


HYDROPONICS AGRICULTURE USING IOT” is the bonafide work of
K.SANJU (Reg. No. 22309020), R.SARANRAJ (Reg. No. 22309021),
A.SETHURAMAN (Reg. No. 22309022), R.SILAMBARASAN (Reg. No.
22309023), P.SEKAR (Reg. No. 22394148) who carried out the work under my
supervision. Certified further that to the best of my knowledge the work reported here
in does not form part of any other thesis or dissertation on the basis of which a degree
or award was conferred on an earlier occasion on this or any other candidate.

Signature of the Guide with date Signature of the HOD with date
Mr.P.THIRUMOORTHY M.E., Mr.P.THIRUMOORTHY M.E.,
ii
iii

Directorate of Technical Education, Chennai - 600025


Government of Tami Nadu

BONAFIDE CERTIFICATE

Certified that this Report titled “OPTIMIZATION AND CONTROL OF


HYDROPONICS AGRICULTURE USING IOT” is the bonafide work of
A.SETHURAMAN (Reg. No. 22309022) who carried out the work under my
supervision. Certified further that to the best of my knowledge the work reported here
in does not form part of any other thesis or dissertation on the basis of which a degree
or award was conferred on an earlier occasion on this or any other candidate.

Signature of the Guide with date Signature of the HOD with date
Mr.P.THIRUMOORTHY M.E., Mr.P.THIRUMOORTHY M.E.,
ii
iii

Directorate of Technical Education, Chennai - 600025


Government of Tami Nadu

BONAFIDE CERTIFICATE

Certified that this Report titled “OPTIMIZATION AND CONTROL OF


HYDROPONICS AGRICULTURE USING IOT” is the bonafide work of
R.SARANRAJ (Reg. No. 22309021) who carried out the work under my supervision.
Certified further that to the best of my knowledge the work reported here in does not
form part of any other thesis or dissertation on the basis of which a degree or award
was conferred on an earlier occasion on this or any other candidate.

Signature of the Guide with date Signature of the HOD with date
Mr.P.THIRUMOORTHY M.E., Mr.P.THIRUMOORTHY M.E.,
ii
iii

Directorate of Technical Education, Chennai - 600025


Government of Tami Nadu

BONAFIDE CERTIFICATE

Certified that this Report titled “OPTIMIZATION AND CONTROL OF


HYDROPONICS AGRICULTURE USING IOT” is the bonafide work of
K.SANJU (Reg. No. 22309020) who carried out the work under my supervision.
Certified further that to the best of my knowledge the work reported here in does not
form part of any other thesis or dissertation on the basis of which a degree or award
was conferred on an earlier occasion on this or any other candidate.

Signature of the Guide with date Signature of the HOD with date
Mr.P.THIRUMOORTHY M.E., Mr.P.THIRUMOORTHY M.E.,
ii
iii

Directorate of Technical Education, Chennai - 600025


Government of Tami Nadu

BONAFIDE CERTIFICATE

Certified that this Report titled “OPTIMIZATION AND CONTROL OF


HYDROPONICS AGRICULTURE USING IOT” is the bonafide work of
R.SILAMBARASAN (Reg. No. 22309023) who carried out the work under my
supervision. Certified further that to the best of my knowledge the work reported here
in does not form part of any other thesis or dissertation on the basis of which a degree
or award was conferred on an earlier occasion on this or any other candidate.

Signature of the Guide with date Signature of the HOD with date
Mr.P.THIRUMOORTHY M.E., Mr.P.THIRUMOORTHY M.E.,
ii
iii

Directorate of Technical Education, Chennai - 600025


Government of Tami Nadu

BONAFIDE CERTIFICATE

Certified that this Report titled “OPTIMIZATION AND CONTROL OF


HYDROPONICS AGRICULTURE USING IOT” is the bonafide work of
P.SEKAR (Reg. No. 22394148) who carried out the work under my supervision.
Certified further that to the best of my knowledge the work reported here in does not
form part of any other thesis or dissertation on the basis of which a degree or award
was conferred on an earlier occasion on this or any other candidate.

Signature of the Guide with date Signature of the HOD with date
Mr.P.THIRUMOORTHY M.E., Mr.P.THIRUMOORTHY M.E.,

You might also like