0% found this document useful (0 votes)
227 views88 pages

Shireesha Smartirrigationsystemusingiot Lora

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
227 views88 pages

Shireesha Smartirrigationsystemusingiot Lora

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 88

ABSTRACT:

Automated irrigation system was developed to minimize water use for the agricultural
field. Deficiency in freshwater raised a big problem in the lastdecade.This paper presents smart
system that uses a soil moisture sensor that providesuseful information about the soil and
transmits this information to a centralized server that controls water supply. Generally, we are
using a MATLAB Programming to display threshold value and previous data in excel sheet. In
this paper, we are describing a 3 sensor i.e. temperature sensor, light sensor and soil moisture
sensor that transmit soil data to authorized person pc using LORA.
CHAPTER 1
INTRODUCTION AND LITERATURE SURVEY

Introduction

Agriculture plays a vital role in every countries economy. Generally, agriculture uses 80
% of fresh water this percentage will be dominant in water consumption because of population
growth so this becomes very important to create a system which is based on science and
technology for sustainable use of water.There are so many systems are available to achieve
water savings in various crops from basic ones to more technologically advanced ones.In one
system plant, water status was monitored and it is based on canopy temperature of the plant,
another system was developed to arrange irrigation of crop water stress index. This paper uses
a low-cost wireless device for data communication.An automated irrigation system is
developed with a low-cost moisture sensor.
Another way to determine crop irrigation is estimated plant system. Application using
mobile devices is also available; it is used for calculating leaf area using an image processing
technique. A data acquisition system was developed for monitoring crop condition such as a
soil moisture air and canopy temperature data were downloaded using a computer connected
throw a serial port for analysis and storage. To achieve the effectiveness of water management
another system is developed which is based on a WSN a weather station for internet
monitoring of drainage water. The development of a WSNs based on microcontroller and
communication technologies can improve the current methods Home applications is also based
on a wirelessembedded sensor for monitoring and controlling household devices. Also, the
sensor network can be used for security purpose.
In industrial environments for inventory management WSNs have been installed which
provides real-time data acquisition.Industrial WSNs have been implemented to monitor fault
diagnosis and monitoring of the temperature sensitive products. In environmental application,
sensors network have been used to monitor a variety of environmental parameters or
conditions in marine, soil and atmospheric conditions. Application in agriculture has been used
to provide data for appropriate management. Variouscommercial WSNs exist, ranging from
limited and low-resolution devices with sensors and embedded processors.In a wireless node,
the radio modem consumes more power.
The radio modem consumes more power recently there are too many wireless
standardshas been established such as local area network uses IEEE 802.11b (Wi-Fi) and
wireless personal area network uses IEEE 802.15.1 (WPAN), IEEE 802.15.1 (Bluetooth) and
IEEE 802.15.4 (Zig-Bee). In this paper, the development of an automated irrigation system
based on microcontroller and wireless communication is presented. The aim of this
implementation is to reduce water use using an automatic irrigation system.In this
implementation, we are using a 3 sensors i.e. soil moisture sensor temperature sensor, light
sensor these 3sensors are interfaced with PIC controller where we are transmitting the soil data
to the PC using Zig-Bee transreciever and also we are using a motor for watering the field. 3
sensors are deployed in the plant root zone.
If the soil is dry automatically motor will get on in this way soil moisture sensor provide
quick information to the controller Communication between the sensor node and data receiver
is via the Zig-Bee protocol. This data is given to the PC via Zig-Bee and we are using
MATLAB software for setting a threshold value and creating previous data in excel sheet.

Agriculture is a very important part of human life for that sufficient amount of water is
needed but sometimes due tohumanignorance, some part of the crop is not getting sufficient
amount of water due to that percentage of production of crops reduces.The automated
irrigation system provides use of water can be reduced for a given amount of biomass
production and also reduces human power by automatically switching of pumps.The irrigation
system can be adjusted to a variety of specific crop needs and require minimum maintenance.
The modular configuration of the automated
The irrigation system can allow it to be increased for large green houses. Today’s world
is digital .in this 21st-century country needs automation and Agriculture is the main and vast
field for our country’s financial system.So we are trying to implement technology which is used
for agriculture hence we are implementing automation Irrigation system so that we can reduce
manpower.Irrigationconsists of a hand pump channel water computerized watering system.
Irrigation is useful to supply water where large most of the crop is stored in a large building.
For continuously increasing demand and decrease in supply of food necessities, it’s
important to rapid improvement in production of food technology. Agriculture is only the
source to provide this. This is the important factor in human societies to growing and dynamic
demand in food production. Agriculture plays the important role in the economy and
development, like India. Due to lack of water and scarcity of land water result the decreasing
volume of water on earth, the farmer use irrigation. Irrigation may be defined as the science of
artificial application of water to the land or soil that means depending on the soil type, plant
are to be provided with water.
Area of Utility
 The primary focus of this project is to help the farmers and reduce their work.
 This module can be implemented in perennial plant irrigation land and gardening land.

Literature Survey
 In irrigation field, soil moisture sensor, temperature sensors are placed in root of plant
and microcontroller handles the sensor information and transmits data. One algorithm
was developed to measure threshold values of temperature sensor and soil moisture
sensor that was programmed into a microcontroller to control water quantity.[1]
 A model of automatic irrigation system which is based on microcontroller and solar
power was used only for source of power supply. Various sensor are placed in paddy
field. Sensors sense water level continuously and give the information to farmer through
cellular phone. Farmer controls the motor using cellular phone without going in paddy
field. If the water level reaches at danger level, automatically motor will be off without
conformation of farmer.[1]
Block diagram:

Lora
Temperature sensor Module
Ac
Ldr sensor Relay pump
motor

Humidity sensor
PIC24FJ16GA002 PIC24F
PIC24FJ16GA002 J16GA0
Soil sensor PIC24F
02
J16GA0 PIC24F
PIC24FJ1 02 J16GA0
Water level sensor
6GA002 02
PIC24FJ16GA00
2

PIC24FJ16
GA002 Fig: Irrigation Field Unit
PIC24FJ16GA002
Lora Module

NODE MCU
IOT

Fig: Irrigation Server Unit PIC24FJ16GA00


PIC24FJ16GA002 2
Block diagram description: PIC24F
J16GA0
Agriculture is a very important part of human life for that sufficient
02 amount of water is
needed but sometimes due tohumanignorance, some part of the crop is not getting sufficient
amount of water due to that percentage of production of crops reduces.The automated irrigation
system provides use of water can be reduced for a given amount of biomass production and also
reduces human power by automatically switching of pumps.The irrigation system can be
adjusted to a variety of specific crop needs and require minimum maintenance. The modular
configuration of the automated.
The irrigation system can allow it to be increased for large green houses. Today’s world
is digital .in this 21st-century country needs automation and Agriculture is the main and vast
field for our country’s financial system.So we are trying to implement technology which is used
for agriculture hence we are implementing automation Irrigation system so that we can reduce
manpower.Irrigationconsists of a hand pump channel water computerized watering system.
Irrigation is useful to supply water where large most of the crop is stored in a large building.

Mechanized Irrigation framework:


The Automated water system framework comprise of two unit WSU for example
Remote sensor unit it is connected by radio handsets that permitted the exchange of soil
dampness information, temperature information and light information for this it utilizes Lora
innovation and we are utilizing a GPRS module to transmit the information to a web server by
means of general society portable system. The data can be remotely checked online toss web get
to gadgets and utilizing Wi-Fi organize accessible in Smartphone.

Remote Sensor Unit:


A WSU is comprised of RF transreciever, Sensors,microcontroller,and control
sources.A minimal effort,powerful,remote sensor that gives an extensive stretch of operability
without upkeep. The remote sensor is made to speak with a base unit. At the point when the
sensor unit identifies the condition like smoke, fire, water and so on the sensors speak with the
base unit and gives information in regards to the condition. The sensor unit gets guidance to
change working parameters and control outer gadgets. A few WSU can be embedded into the
field to design conveyed sensor arrange for the robotized water system.WSU unit comprises of
a PIC Controller, sensors, Lora module,and Motor. We are utilizing a three sensor temperature
sensor,soil dampnesssensor and light sensor these sensors are interfaced with PIC and with the
assistance of a programming one can control Motor naturally likewise Lora is interfaced with a
controller that exchange the sensors information to the PC and FTP Server.

LORA 868 MHZ SX1276 RF TRANSCEIVER MODULES:

The 868MHz SX1276 RF transceivers feature the Lora TM long range modem that
provides ultra-long range spread spectrum communication and high interference immunity
whilst minimizing current consumption. Using Lora modulation technique it can achieve a
sensitivity of over -148dBm using a low-cost crystal and bill of materials. The high sensitivity
combined with the integrated +20 dBm power amplifier yields industry leading link budget
making it optimal for any application requiring range or robustness. Lora also provides
significant advantages in both blocking and selectivity over conventional modulation
techniques, solving the traditional design compromise between range, interference immunity,
and energy consumption. These devices also support high performance (G) FSK modes for
systems including WMBus, IEEE802.15.4g. The 868MHz SX1276 RF deliver exceptional
phase noise, selectivity, receiver linearity and IIP3 for significantly lower current consumption
than competing devices.
PIC24FJ16GA002:
This document defines the programming specification for the PIC24FJ16GA002 family of 16-bit
microcontroller devices. This programming specification is required only for those developing
programming support for the PIC24FJ16GA002 family. Customers using only one of these devices
should use development tools that already provide support for device programming.
TEMPERATURE SENSOR:
In general, a temperature sensor is a device which is designed specifically to measure the
hotness or coldness of an object.LM35 is a precision IC temperature sensor with its output
proportional to the temperature (in °C).With LM35, the temperature can be measured more
accurately than with a thermistor. It also possesses low self heating and does not cause more
than 0.1 °C temperature rise in still air. The operating temperature range is from -55°C to
150°C.The LM35’s low output impedance, linear output, and precise inherent calibration make
interfacing to readout or control circuitry especially easy. It has found its applications on power
supplies, battery management, appliances, etc.
LDR SENSOR:
A photo resistor (or light-dependent resistor, LDR, or photo-conductive cell) is a light-
controlled variable resistor. The resistance of a photo resistor decreases with increasing incident
light intensity; in other words, it exhibits photoconductivity. A photo resistor can be applied in
light-sensitive detector circuits, and light-activated and dark-activated switching circuits.
HUMIDITY SENSOR:
Humidity is the amount of water vapour present in air. Water vapour, the gaseous state of water,
is generally invisible to the human eye. Humidity indicates the likelihood for precipitation, dew,
or fog to be present. The amount of water vapour needed to achieve saturation increases as the
temperature increases. As the temperature of a parcel of air decreases it will eventually reach
the saturation point without adding or losing water mass. The amount of water vapour contained
within a parcel of air can vary significantly. For example, a parcel of air near saturation may
contain 28 grams of water per cubic meter of air at 30 °C, but only 8 grams of water per cubic
meter of air at 8 °C.
SOIL MOISTURE SENSOR:

This moisture sensor can read the amount of moisture present in the soil surrounding it.
It's a low tech sensor, but ideal for monitoring an urban garden, or your pet plant's water level.
This is a must have tool for a connected garden. This sensor uses the two probes to pass current
through the soil, and then it reads that resistance to get the moisture level. More water makes
the soil conduct electricity more easily (less resistance), while dry soil conducts electricity
Poorly (more resistance). It will be helpful to remind you to water your indoor plants or to
monitor the soil moisture in your garden.
WATER LEVEL SENSOR:
Level sensors detect the level of liquids and other fluids and fluidized solids,
including slurries, granular materials, and powders that exhibit an upper free surface.
Substances that flow become essentially horizontal in their containers (or other physical
boundaries) because of gravity whereas most bulk solids pile at an angle of repose to a peak.
The substance to be measured can be inside a container or can be in its natural form (e.g., a river
or a lake). The level measurement can be either continuous or point values. Continuous level
sensors measure level within a specified range and determine the exact amount of substance in a
certain place, while point-level sensors only indicate whether the substance is above or below
the sensing point. Generally the latter detect levels that are excessively high or low.
AC PUMP MOTOR:
A submersible pump (or sub pump, electric submersible pump) is a device which has
a hermetically sealed motor close-coupled to the pump body. The whole assembly is
submerged in the fluid to be pumped. The main advantage of this type of pump is that it
prevents pump cavitations’, a problem associated with a high elevation difference between
pump and the fluid surface. Small DC Submersible water pumps push fluid to the surface as
opposed to jet pumps having to pull fluids. Submersibles are more efficient than jet pumps. It
is usually operated between 3v to 12v.

RELAY:
Relay is an electromagnetic device which is used to isolate two circuits electrically and
connect them magnetically. They are very useful devices and allow one circuit to switch
another one while they are completely separate. They are often used to interface an electronic
circuit (working at a low voltage) to an electrical circuit which works at very high voltage. For
example, a relay can make a 5V DC battery circuit to switch a 230V AC mains circuit. Thus a
small sensor circuit can drive, say, a fan or an electric bulb.
NODE MCU (ESP8266):
ESP8266 is a complete and self-contained Wi-Fi network solutions that can carry software
applications, or through another application processor uninstall all Wi-Fi networking capabilities.
ESP8266 when the device is mounted and as the only application of the application processor, the flash
memory can be started directly from an external Move. Built-in cache memory will help improve system
performance and reduce memory requirements.
POWER SUPPLY:
In this project we required operating voltage for ARM controller board is 12V. Hence
the 12V D.C. power supply is needed for the ARM board. This regulated 12V is generated by
stepping down the voltage from 230V to 18V now the step downed a.c voltage is being rectified
by the Bridge Rectifier using 1N4007 diodes. The rectified a.c voltage is now filtered using a
‘C’ filter. Now the rectified, filtered D.C. voltage is fed to the Voltage Regulator.
12V BATTERY:
A battery is a device consisting of one or more electrochemical cells with external
connections provided to power electrical devices such as flashlights, smart phones, and electric
cars. When a battery is supplying electric power, its positive terminal is the cathode and its
negative terminal is the anode. The terminal marked negative is the source of electrons that will
flow through an external electric circuit to the positive terminal. When a battery is connected to
an external electric load, a red ox reaction converts high-energy reactants to lower-energy
products, and the free-energy difference is delivered to the external circuit as electrical
energy. Historically the term "battery" specifically referred to a device composed of multiple
cells, however the usage has evolved to include devices composed of a single cell.
CHAPTER 2

BASICS OF IoT

Definition

The Internet of Things (IoT) is the interconnection of uniquely identifiable embedded


computing devices within the existing Internet infrastructure.

The “Internet of Things” connects devices and vehicles using electronic sensors and the
Internet.

Introduction

The Internet of Things (IoT) is the network of physical objects devices, vehicles,
buildings and other items embedded with electronics, software, sensors, and network
connectivity that enables these objects to collect and exchange data. The IoT allows objects to
be sensed and controlled remotely across existing network infrastructure, creating
opportunities for more direct integration of the physical world into computer based systems,
and resulting in improved efficiency, accuracy and economic benefit, when IoT is augmented
with sensors and actuators, the technology becomes an instance of the more general class of
cyber physical systems, which also encompasses technologies such as smart grids, smart
homes, intelligent transportation and smart cities. Each thing is uniquely identifiable through
its embedded computing system but is able to interoperate within the existing Internet
infrastructure.

So, Internet of Things or IoT is an architecture that comprises specialized hardware


boards, Software systems, web APIs, protocols which together creates a seamless environment
which allows smart embedded devices to be connected to internet such that sensory data can
be accessed and control system can be triggered over internet.

Also devices could be connected to internet using various means like Wi-Fi, Ethernet
and so on. Furthermore devices may not needed to be connected to internet independently.
Rather a cluster of devices could be created (for example a sensor network) and the base station
or the clusterhead could be connected to internet. This leads to more abstract architecture for
communication protocols which ranges from high level to low level.

Most interestingly, these devices must be uniquely discovered. For unique discovery of
the devices in a Network, they need to have unique IP address. IoT devices essentially have
IPv6 addressing scheme. All these devices have either fixed or Subnet masked IP addresses of
type v6. Unique IP addresses makes IoT devices discoverable in the internet as independent
node. This is the most important concept to have in mind to understand IoT.

Following figure.2.1 explain what IoT is all about.

Figure 2.1 Internet of Things (IoT) Basic Architecture

What Devices Makes it to IoT

Since IoT are essentially embedded systems and smart objects connected to internet
with unique IP address which can be discovered and communicated over internet. We have
also seen that the IoT devices may have external peripheral like Actuators and Sensors.
Are Mobile Phones are IoT Devices

One of the most common in day to day life are mobile phones. Mobile phone is
essentially an embedded system with a processor at the core having display and keypad. They
support wide variety of sensors like ambient light Sensors, Accelerometer, Gyroscope and so
on. They are connected to internet. Mobile phones gets IP addresses, can access internet. In
other words it virtually fits every description of IoT. So can we call mobile phones IoT devices?

This doubt was clarified at a keynote event during Sept 2011's Mobile World Congress
in Barcelona by Qualcomm Chairman and CEO Dr. Paul Jacobs.

Paul Jacobs talked about how mobile technology could be used to connect non-phone,
non-tablet devices called IoT devices and objects to the Internet. In this future where
everything is Web-connected, mobile phones will serve as the hub, or the remote control,
for Internet of Things.

So IoT is internet connectivity of smart objects and embedded system other than mobile
phones which can be connected with external hardware and Mobiles, Tablets, Laptops and PCs
are remote control/access center of IoT.

IoT Devices

Figure 2.2 Common IoT Devices and Technologies


The most common and popular technologies in IoT will give an overview devices. The
IoT devices into two broad categories: The wearable ones and Microcontroller /Microprocessor
driven embedded IoT devices. Some of the embedded devices like Arduino Lillypad are
minisque and it can further utilize them to make wearable solution. But wearable includes
hardware which are pretty standard and IoT has only software scope for the developer. Some
peripheral hardware are which might require are in IoT hardware in embedded level. Apps can
be used with popular wearable platforms, Embedded IoT platform may include broader
technologies like Raspberry Pi, Arduino or Galileo, etc.

IoT Platforms
IoT development can be divided into two parallel technologies: Wearable and
Embedded. Developers can build apps for custom Wearable devices like Peeble, Samsung Gear
or can often create their own platform using Embedded solution and then can develop app for
that platform.

Wearable Platform
Tizen is fast becoming one of the most popular platform for Mobile and wearable
devices. Tizen SDK comes ported with wearable emulator which makes it easier to develop
wearable solutions for Tizen platform.

As figure 2.2 suggests, a large Android Wear devices are now being made and
marketed. Smart watches are getting popular by every day. Android Wear apps can be
developed and tested in Eclipse. This Android Developer Guide helps you in setting up
Android Wear development environment in Eclipse.

Salesforce is another platform which is coming up with awesome development


environment, APIs in wearable technologies. Their solution is extended from Peeble to Google
glass.

Embedded Platform

Arduino is probably the best starting point for embedded based IoT. Basic Arduino
boards don't come with Ethernet shield or Wi-Fi shield and for Arduino to be able to work as
IoT device, their need to select Arduino with Ethernet shield or Wi-Fi shield. Arduino Yun on
the other hand is a board that comes ported with Ethernet shield.
Raspberry Pi is probably one of the best things to happen in DIY IoT. A wide range
of Data driven applications like Home Automation Server to Home Multimedia server, File
Server can be developed with Pi. PI like Arduino has general purpose IO pins. But seamless
working with sensors is bit tedious in Pi.

Another efficient IoT board is Intel Edision which has integrated BLE, Wi-Fi among
host of other features. It supports wide range of Industry standard hardware (over 30) through
70-pin interface.

Intel Galileo is another good offering by Intel which supports the same shielding that
of Arduino Uno. So it can be said to be first Intel powered device which is Arduino compatible.
It has among other thing a USB host controller like Raspberry Pi which makes this an attractive
hardware. Galileo also has ethernet shield in built.

Cloud Platform

IoT really can bring several services (like online payment gateway), several hardware
platform (like embedded board of the vending machine) and smart objects and data like NFC,
GPS into a seamless environment.

Now it can integrate online payment into beverage vending machine, if one is using
location service for beverage machine, then utilizing the location and payment service can be
done. One can get the data of a medical diagnosis like ECG (acquired through another
embedded board pertaining to medical electronics) into cloud such that several doctors can
view it and form a comprehensive opinion about the patient's state.

Well, infact all of them are possible. A little understanding of web and software design
would take your mind towards cloud. Just like Web of Machines, in a Machine to Machine
(M2M) or Machine to Objects (M2O) or any similar communication several modules will be
common and several modules demands data to be available for sharing. Cloud APIs comes in
handy in this regard.

For instance, to make a device discoverable in web, then assign a fixed IP address,
maintain a router and follow several networking skills.

Yaler is a great example of what services and cloud can bring to table. This provides
connection as a service such that your device is easily discoverable and communicable over
the web without much hassle and take care of underneath security.
Axeda Provides infrastructure for M2M architecture.

OpenIoT is an open source IoT platform that provides out of other services a unique
Sensing as a Service.

Google has already integrated location services with its cloud. Location extracted from
your devices are silently put in your status updates in facebook and twitter and are also used
for more personalized searches.

So cloud APIs has a great potential in IoT in all levels of architecture starting from
firmware to hardware to more top level architecture.

Implementation using IoT

This project uses concept of IoT for monitoring and controlling the system using a
public server called MQTT server. It uses an android app called My MQTT. In this app, one
has to subscribe a topic and publish a message of specific function. The server will call-back
to perform the function.

MQTT

MQTT stands for Message Queue Telemetry Transport. It is a publish /subscribe,


extremely simple and lightweight messaging protocol, designed for constrained devices and
low-bandwidth, high-latency or unreliable networks. The design principles are to minimize
network bandwidth and device resource requirements whilst also attempting to ensure
reliability and some degree of assurance of delivery. These principles also turn out to make the
protocol ideal of the emerging “machine-to-machine” (M2M) or “Internet of Things” world of
connected devices, and for mobile applications where bandwidth and battery power are at a
premium.

MQTT Architecture

MQTT has a client/server model, where every sensor is a client and connects to a server,
known as a broker, over TCP.

MQTT is message oriented. Every message is a discrete chunks of data, opaque to the
broker.
Every message is published to an address, known as a topic. Clients may subscribe to
multiple topics. Every client subscribed to a topic receives every message published to the
topic.

MQTT defines methods (sometimes referred to as verbs) to indicate the desired action
to be performed on the identified resource. What this resource represents, whether pre-existing
data or data that is generated dynamically, depends on the implementation of the server. Often,
the resource corresponds to a file or the output of an executable residing on the server.

Connect: Waits for a connection to be established with the server.

Disconnect: Waits for the MQTT client to finish any work it must do, and for
the TCP/IP session to disconnect.

Subscribe: Waits for completion of the Subscribe or UnSubscribe method.

UnSubscribe: Requests the server unsubscribe the client from one or more topics.

Publish: Returns immediately to the application thread after passing the request to the MQTT
client.

MQTT Ports

The server listens on the following ports:

 1883 : MQTT, unencrypted


 8883 : MQTT, encrypted
 8884 : MQTT, encrypted, client certificate required
 8080 : MQTT over WebSockets, unencrypted
 8081 : MQTT over WebSockets, encrypted

This project uses 1883 an unencrypted MQTT port.

MQTT Example

Imagine a simple network with three clients and a central broker.

All three clients open TCP connections with the broker. Clients B and C subscribe to the topic
temperature (Figure 2.3).
Figure 2.3 Client B and C Subscribing Topic temperature.

At a later time, Client A publishes a value of 22.5 for topic temperature. The broker forwards
the message to all subscribed clients (Figure 2.4).

Figure 2.4 Client A publishing a value and broker forward this to other clients.

The publisher subscriber model allows MQTT clients to communicate one-to-one, one-to-
many and many-to-one.
CHAPTER 3

INTRODUCTION OF HARDWARES

Arduino

Arduino is an open source physical computing platform based on simple input/output


board and a development environment that implements the Processing language
(www.processing.org). Arduino can be used to develop standalone interactive objects or can
be connected to software on your computer. The boards can be assembled by hand or purchased
preassembled; the open source IDE (Integrated Development Environment) can be downloaded
for free from www.arduino.cc.

Introduction to Arduino Boards

Arduino is an architecture that combines Atmel microcontroller family with standard


hardware into a board with inbuilt bootloader for plug and play embedded
programming. Arduino Software comes with an IDE that helps writing, debugging and
burning program into Arduino. The IDE also comes with a Serial Communication window
through which can easily get the serial data from the board.

Arduino Uno

Figure 3.1 Arduino Uno


Diagram of Arduino Uno is showed in figure 3.1.

The Uno is a microcontroller board based on the ATmega328P. It has 14 digital


input/output pins (of which 6 can be used as PWM outputs), 6 analog inputs, a 16 MHz quartz
crystal, a USB connection, a power jack, an ICSP header and a reset button. Each of the 14
digital pins can be used as an input or output, using pinMode(), digitalWrite(),
and digitalRead() functions. They operate at 5 volts. Each pin can provide or receive 20 mA as
recommended operating condition and has an internal pull-up resistor (disconnected by default)
of 20-50k ohm. A maximum of 40mA is the value that must not be exceeded on any I/O pin to
avoid permanent damage to the microcontroller.

In addition, some pins have specialized functions:

 Serial: 0 (RX) and 1 (TX). Used to receive (RX) and transmit (TX) TTL serial data.
 External Interrupts: 2 and 3. These pins can be configured to trigger an interrupt on a
low value, a rising or falling edge, or a change in value.
 PWM: 3, 5, 6, 9, 10, and 11. Provide 8-bit PWM output with the analogWrite ()
function.
 SPI: 10 (SS), 11 (MOSI), 12 (MISO), 13 (SCK). These pins support SPI communication
using the SPI library.
 LED: 13. There is a built-in LED driven by digital pin 13.
 TWI: A4 or SDA pin and A5 or SCL pin. Support TWI communication using the Wire
library.

The Uno has 6 analog inputs, labeled A0 through A5, each of which provide 10 bits of
resolution (i.e. 1024 different values). By default they measure from ground to 5 volts, though
is it possible to change the upper end of their range using the AREF pin and the
analogReference () function.

There are a couple of other pins on the board,

 AREF Reference voltage for the analog inputs. Used with analogReference ().
 Reset. Bring this line LOW to reset the microcontroller. Typically used to add a reset
button to shields which block the one on the board.
Arduino Uno Technical Speciations

Microcontroller ATmega328P
Operating Voltage 5V
Input Voltage (recommended) 7-12V
Input Voltage (limit) 6-20V

Digital I/O Pins 14 (of which 6 provide PWM output)


PWM Digital I/O Pins 6

Analog Input Pins 6


DC Current per I/O Pin 20 mA

DC Current for 3.3V Pin 50 mA


Flash Memory 32 KB (ATmega328P)
of which 0.5 KB used by bootloader

SRAM 2 KB (ATmega328P)
EEPROM 1 KB (ATmega328P)
Clock Speed 16 MHz

Length 68.6 mm

Width 53.4 mm
Weight 25 g
Table 3.1 Technical Specification

3.2 ESP8266

Introduction to ESP8266

ESP8266 is a complete and self-contained Wi-Fi network solutions that can carry
software applications, or through another application processor uninstall all Wi-Fi networking
capabilities. ESP8266 when the device is mounted and as the only application of the application
processor, the flash memory can be started directly from an external Move. Built-in cache
memory will help improve system performance and reduce memory requirements. Another
situation is when wireless Internet access assume the task of Wi-Fi adapter, you can add it to
any microcontroller-based design, and the connection is simple, just by SPI / SDIO interface
or central processor AHB bridge interface. Processing and storage capacity on ESP8266
powerful piece, it can be integrated via GPIO ports sensors and other applications specific
equipment to achieve the lowest early in the development and operation of at least occupy
system resources. The ESP8266 highly integrated chip, including antenna switch balun, power
management converter, so with minimal external circuitry, and includes front-end module,
including the entire solution designed to minimize the space occupied by PCB. The system is
equipped with ESP8266 manifested leading features are: energy saving VoIP quickly switch
between the sleep / wake patterns, with low-power operation adaptive radio bias, front-end
signal processing functions, troubleshooting and radio systems coexist characteristics eliminate
cellular / Bluetooth / DDR / LVDS / LCD interference.

Figure 3.2 Explore ESP8266 Wi-Fi Module

Block Diagram of ESP8266

Figure 3.3 Block Diagram of ESP8266


Characteristics of ESP8266

 802.11 b / g / n
 Wi-Fi Direct (P2P), soft-AP
 Built-in TCP / IP protocol stack
 Built-in TR switch, balun, LNA, power amplifier and matching network
 Built-in PLL, voltage regulator and power management components
 802.11b mode + 19.5dBm output power
 Built-in temperature sensor
 Support antenna diversity
 off leakage current is less than 10uA
 Built-in low-power 32-bit CPU: can double as an application processor
 SDIO 2.0, SPI, UART
 STBC, 1x1 MIMO, 2x1 MIMO
 A-MPDU, A-MSDU aggregation and the 0.4 Within wake
 2ms, connect and transfer data packets
 standby power consumption of less than 1.0mW (DTIM3)

Schematic Diagram ESP8266-EX

Figure 3.4 Schematic Diagram ESP8266EX


ESP Modules

The ESP8266 is a low cost Wi-Fi chip with full TCP/IP stack and microcontroller
capability produced by Shanghai-based Chinese manufacturer, Espressif. These were the first
series of modules made by third-party manufacturer, AI-Thinker with the ESP8266 and
remain the most widely available.

Board ID Pins Pitch LEDs Antenna Dimensions mm


ESP-01 8 .1“ Yes Etched-on PCB 14.3 x 24.8
ESP-02 8 .1” No None 14.2 x 14.2
ESP-03 14 2mm No Ceramic 17.3 x 12.1
ESP-04 14 2mm No None 14.7 x 12.1
ESP-05 5 .1“ No None 14.2 x 14.2
ESP-06 12+GND misc No None ?
ESP-07 16 2mm Yes Ceramic 20.0 x 16.0
ESP-08 14 2mm No None 17.0 x 16.0
ESP-09 12+GND misc No None 10.0 x 10.0
ESP-10 5 2mmm? No None 14.2 x 10.0
ESP-11 8 1.27mm No Ceramic 17.3 x 12.1
ESP-12 16 2mm Yes Etched-on PCB 24.0 x 16.0
ESP-12-E 22 2mm Yes Etched-on PCB 24.0 x 16.0
ESP-13 18 1.5mm - Etched-on PCB -
ESP-14 22 2mm 1 Etched-on PCB 24.3 x 16.2
WROOM-02 18 1.5mm No Etched on PCB 20.0 x 18.0
WT8266-S1 18 1.5mm 1 Etched on PCB 15.0 x 18.6
Table 3.2 ESP Modules

ESP8266 Applications

 Smart Power Plug


 Home Automation
 Industrial wireless control
 Baby Monitor
 Network Camera
 Wireless location-aware devices and positioning system signals
Explore ESP8266 Wi-Fi Module

The ESP8266 ESP12E Wi-Fi Module is more user friendly with the Explore ESP8266
Wi-Fi Module. It fits on a breadboard with all pins taken out. The module goes into
programming mode with a single reset switch.

Features:

 Fits on a breadboard.
 Single button 'Reset' switch for programming. Uses MOSFET's to put the module in
programming mode.
 All pins of ESP12E taken out.
 Separate serial pins breakout compatible with FTDI cable layout.
 On-board LM1117-3.3V regulator.
 Works with Arduino IDE for ESP8266.
 Programs can easily dumped using USB to TTL converter.
 ESP8266 ESP12E features.

Schematic Diagram of Explore ESP8266 Wi-Fi Module

Figure 3.5 Schematic Diagram of Explore ESP8266 Wi-Fi Module.


AT Commands

ESP8266, in its default configuration, boots up into the serial modem mode. In this
mode you can communicate with it using a set of AT commands. AT commands are based on
the Hayes Command Set.

Index of all known AT commands is given in table 3.3

Basic Wi-Fi layer TCPIP Layer

AT AT+CWMODE AT+CIPSTATUS

AT+RST AT+CWJAP AT+CIPSTART

AT+GMR AT+CWLAP AT+CIPSEND

AT+GSLP AT+CWQAP AT+CIPCLOSE

ATE AT+CWSAP AT+CIFSR

AT+CWLIF AT+CIPMUX

AT+CWDHCP AT+CIPSERVER

AT+CIPSTAMAC AT+CIPMODE

AT+CIPAPMAC AT+CIPSTO

AT+CIPSTA AT+CIUPDATE

AT+CIPAP +IPD

Soil Moisture Sensor

This moisture sensor can read the amount of moisture present in the soil surrounding it.
It's a low tech sensor, but ideal for monitoring an urban garden, or your pet plant's water level.
This is a must have tool for a connected garden. This sensor uses the two probes to pass current
through the soil, and then it reads that resistance to get the moisture level. More water makes
the soil conduct electricity more easily (less resistance), while dry soil conducts electricity
poorly (more resistance). It will be helpful to remind you to water your indoor plants or to
monitor the soil moisture in your garden.

Figure 3.6 Soil Moisture Sensor YL-69 YL-38

A Chinese built YL-69 sensors (Figure 3.6) come with a ‘middle-man’ circuit which
allows to get two outputs: one is an analog readout of the resistance between the sensor’s probes
and the second is a digital output (essentially, HIGH or LOW, 5v or 0v) depending on whether
the humidity is above or below a threshold which can in turn be adjusted by a built-in POTS.
The YL-69 sensor has two pins which need to be wired to be the two pins on the YL-38 Bridge.
On the other end of the YL-38 have four pins which represent VCC, GND, D0 and A0. VCC
and GND are power pins which should set to 3.3/5V and ground respectively. A0 is an analog
output. D0 is a digital output.

Solenoid Valve
A solenoid valve is an electromechanically operated valve. The valve is controlled by
an electric current through a solenoid: in the case of a two-port valve the flow is switched on
or off; in the case of a three-port valve, the outflow is switched between the two outlet ports.
Multiple solenoid valves can be placed together on a manifold.

Solenoid valves are the most frequently used control elements in fluidics. Their tasks
are to shut off, release, dose, distribute or mix fluids. They are found in many application areas.
Solenoids offer fast and safe switching, high reliability, long service life, good medium
compatibility of the materials used, low control power and compact design.
A 2-way valve, for example, has 2 ports; if the valve is open, then the two ports are
connected and fluid may flow between the ports; if the valve is closed, then ports are isolated.
If the valve is open when the solenoid is not energized, then the valve is termed normally
open (N.O.). Similarly, if the valve is closed when the solenoid is not energized, then the valve
is termed normally closed.

Figure 3.7 Solenoid Valve and its part

The figure 3.7 depicts the basic components of a solenoid valve. The valve shown in
the picture is a normally-closed, direct-acting valve. This type of solenoid valve has the most
simple and easy to understand principle of operation. The media is controlled by the solenoid
valve enters the valve through the inlet port. The media must flow through the orifice (9) before
continuing into the outlet port (3). The orifice is closed and opened by the plunger (7).The
valve pictured above is a normally-closed solenoid valve. Normally-closed valves use a spring
(8) which presses the plunger tip against the opening of the orifice. The sealing material at the
tip of the plunger keeps the media from entering the orifice, until the plunger is lifted up by an
electromagnetic field created by the coil.

Submersible Water Pump

A submersible pump (or sub pump, electric submersible pump) (figure3.8) is a device
which has a hermetically sealed motor close-coupled to the pump body. The whole assembly
is submerged in the fluid to be pumped. The main advantage of this type of pump is that it
prevents pump cavitation’s, a problem associated with a high elevation difference between
pump and the fluid surface. Small DC Submersible water pumps push fluid to the surface as
opposed to jet pumps having to pull fluids. Submersibles are more efficient than jet pumps. It
is usually operated between 3v to 12v.

Figure 3.8 Submersible Water Pump.

Specifications:

 Voltage : 2.5-10V
 Maximum lift : 40-110cm / 15.75"-43.4"
 Flow rate : 80-120L/H
 Outside diameter : 7.5mm / 0.3"
 Inside diameter : 5mm / 0.2"
 Diameter : Approx. 24mm / 0.95"
 Length : Approx. 45mm / 1.8"
 Height : Approx. 30mm / 1.2"
 Material : Engineering plastic
 Driving mode : DC design, magnetic driving
 Continuous working life for 500 hours

Relay Switch

Relay is an electromagnetic device which is used to isolate two circuits electrically and
connect them magnetically. They are very useful devices and allow one circuit to switch
another one while they are completely separate. They are often used to interface an electronic
circuit (working at a low voltage) to an electrical circuit which works at very high voltage. For
example, a relay can make a 5V DC battery circuit to switch a 230V AC mains circuit. Thus a
small sensor circuit can drive, say, a fan or an electric bulb.
Figure 3.9 Relay Switch

A relay switch can be divided into two parts: input and output. The input section has a
coil which generates magnetic field when a small voltage from an electronic circuit is applied
to it. This voltage is called the operating voltage. Commonly used relays are available in
different configuration of operating voltages like 6V, 9V, 12V, 24V etc. The output section
consists of contactors which connect or disconnect mechanically. In a basic relay there are
three contactors: normally open (NO), normally closed (NC) and common (COM). At no input
state, the COM is connected to NC. When the operating voltage is applied the relay coil gets
energized and the COM changes contact to NO.

Transistor (BC-547)

A BC547 transistor is a negative-positive-negative (NPN) transistor that is used for


many purposes. Together with other electronic components, such as resistors, coils, and
capacitors, it can be used as the active component for switches and amplifiers. Transistors has
an emitter terminal, a base or control terminal, and a collector terminal. In a typical
configuration, the current flowing from the base to the emitter controls the collector current. A
short vertical line, which is the base, can indicate the transistor schematic for an NPN transistor,
and the emitter, which is a diagonal line connecting to the base, is an arrowhead pointing away
from the base (Figure 3.10).

Figure 3.10 BC-547 NPN Transistor


Diode (IN4007)

In electronics, a diode is a two-terminal electronic component that conducts primarily


in one direction (asymmetric conductance), it has low (ideally zero) resistance to the flow
of current in one direction, and high (ideally infinite) resistance in the other. A semiconductor
diode is a crystalline piece of semiconductor material with a p–n junction connected to two
electrical terminals (figure 3.11).

Figure 3.11 Diode IN4007

Relay Circuit

The relay circuit consists of relay switch, diode and transistor as shown in figure 3.12.
This circuit controls 18-24v DC solenoid valve or 2.5-10v submersible motor. The control
signal from controller to the base of transistor controls ON-OFF of actuators. The diode
prevents the reverse flow of current in input end of the relay switch. At output end of relay
switch a series connection of battery source and actuator. It is used because of actuators needs
supply of 3-24v DC, but controller output signal is of 3.3v DC.

Figure 3.12 Circuit Diagram to controls actuator (motor) using relay switch.
PIC24FJ16GA002:

This document defines the programming specification for the PIC24FJ16GA002 family of 16-bit
microcontroller devices. This programming specification is required only for those developing programming
support for the PIC24FJ16GA002 family. Customers using only one of these devices should use development
tools that already provide support for device programming.
There are two methods of programming the PIC24FJ16GA002 family of devices discussed in this
programming specification.
They are: • In-Circuit Serial Programming™ (ICSP™) • Enhanced In-Circuit Serial Programming
(Enhanced ICSP) The ICSP programming method is the most direct method to program the device; however, it
is also the slower of the two methods. It provides native, low-level programming capability to erase, program
and verify the chip. The Enhanced In-Circuit Serial Programming (Enhanced ICSP) protocol uses a faster
method that takes advantage of the programming executive, as illustrated. The programming executive provides
all the necessary functionality to erase, program and verify the chip through a small command set. The
command set allows the programmer to program the PIC24FJ16GA002 devices without having to deal with the
low-level programming protocols of the chip.

This specification is divided into major sections that describe the programming methods independently.
Section 4.0 “Device Programming – Enhanced ICSP” describes the Run-Time Self-Programming (RTSP)
method. Section 3.0 “Device Programming – ICSP” describes the In-Circuit Serial Programming method.
All devices in the PIC24FJ16GA002 family are dual voltage supply designs: one supply for the core
and peripherals and another for the I/O pins. A regulator is provided on-chip to alleviate the need for two
external voltage supplies. All of the PIC24FJ16GA002 devices power their core digital logic at a nominal 2.5V.
To simplify system design, all devices in the PIC24FJ16GA002 family incorporate an on-chip regulator that
allows the device to run its core logic from VDD.
The regulator provides power to the core from the other VDD pins. A low-ESR capacitor (such as
tantalum) must be connected to the VDDCORE pin. This helps to maintain the stability of the regulator. The
specifications for core voltage and capacitance are listed in Section 7.0 “AC/DC Characteristics and Timing
Requirements”.
The Flash program memory on the PIC24FJ16GA002 devices has a specific write/erase
requirement that must be adhered to for proper device operation. The rule is that any given word in
memory must not be written more than twice before erasing the page in which it is located. Thus, the
easiest way to conform to this rule is to write all the data in a programming block within one write
cycle. The programming methods specified in this specification comply with this requirement.

PIN DIAGRAM:

The pin diagrams for the PIC24FJ16GA002 family are shown in the following figures. The pins that are
required for programming are listed in Table and are shown in bold letters in the figures. Refer to the
appropriate device data sheet for complete pin descriptions.

High-Performance CPU:

• Modified Harvard Architecture


• Up to 16 MIPS Operation @ 32 MHz
• 8 MHz Internal Oscillator with 4x PLL Option and Multiple Divide Options
• 17-Bit by 17-Bit Single-Cycle Hardware Multiplier
• 32-Bit by 16-Bit Hardware Divider
• 16-Bit x 16-Bit Working Register Array
• C Compiler Optimized Instruction Set Architecture:
- 76 base instructions
- Flexible addressing modes
• Two Address Generation Units (AGUs) for Separate Read and Write Addressing of Data
Memory
Special Microcontroller Features:

• Operating Voltage Range of 2.0V to 3.6V


• 5.5V Tolerant Input (digital pins only)
• High-Current Sink/Source (18 mA/18 mA) on All I/O Pins
• Flash Program Memory:
- 10,000 erase/write
- 20-year data retention minimum
• Power Management modes:
- Sleep, Idle, Doze and Alternate Clock modes
- Operating current: 650 A/MIPS, typical at 2.0V
- Sleep current: 150 nA, typical at 2.0V
• Fail-Safe Clock Monitor (FSCM) Operation:
- Detects clock failure and switches to on-chip, low-power RC oscillator
• On-Chip, 2.5V Regulator with Tracking mode
• Power-on Reset (POR), Power-up Timer (PWRT) and Oscillator Start-up Timer (OST)
• Flexible Watchdog Timer (WDT) with On-Chip, Low-Power RC Oscillator for Reliable
Operation
• In-Circuit Serial Programming™ (ICSP™) and In-Circuit Debug (ICD) via 2 Pins
• JTAG Boundary Scan Support

Analog Features:

• 10-Bit, up to 13-Channel Analog-to-Digital Converter:


- 500 ksps conversion rate
- Conversion available during Sleep and Idle
• Dual Analog Comparators with Programmable Input/Output Configuration

Peripheral Features:
• Peripheral Pin Select (PPS):
- Allows independent I/O mapping of many peripherals
- Up to 26 available pins (44-pin devices)
- Continuous hardware integrity checking and safety interlocks prevent
unintentional configuration changes
• 8-Bit Parallel Master/Slave Port (PMP/PSP):
- Up to 16-bit multiplexed addressing, with up to 11 dedicated address pins on
44-pin devices
- Programmable polarity on control lines
• Hardware Real-Time Clock/Calendar (RTCC):
- Provides clock, calendar and alarm functions
• Programmable Cyclic Redundancy Check (CRC)
• Two 3-Wire/4-Wire SPI modules (support 4 Frame modes) with 8-Level FIFO
Buffer

• Two I2C™ modules Support Multi-Master/Slave mode and 7-Bit/10-Bit


Addressing
• Two UART modules:
- Supports RS-485, RS-232, and LIN/J2602

- On-chip hardware encoder/decoder for IrDA®


- Auto-wake-up on Start bit
- Auto-Baud Detect
- 4-level deep FIFO buffer
• Five 16-Bit Timers/Counters with Programmable Prescaler
• Five 16-Bit Capture Inputs
• Five 16-Bit Compare/PWM Outputs
• Configurable Open-Drain Outputs on Digital I/O Pins
• Up to 3 External Interrupt Sources
Core Features:

16-BIT ARCHITECTURE:

Central to all PIC24F devices is the 16-bit modified Harvard architecture, first introduced with
Microchip’s dsPIC® Digital Signal Controllers (DSCs). The PIC24F CPU core offers a wide range
of enhancements, such as:

• 16-bit data and 24-bit address paths with the ability to move information between data
and memory spaces
• Linear addressing of up to 12 Mbytes (program space) and 64 Kbytes (data)
• A 16-element working register array with built-in software stack support
• A 17 x 17 hardware multiplier with support for integer math
• Hardware support for 32 by 16-bit division
• An instruction set that supports multiple addressing modes and is optimized for high-level
languages such as ‘C’
• Operational performance up to 16 MIPS

POWER-SAVING TECHNOLOGY:

All of the devices in the PIC24FJ16GA002 family incorporate a range of features


that can significantly reduce power consumption during operation. Key items
include:

• On-the-Fly Clock Switching: The device clock can be changed under software
control to the Timer1 source or the internal, low-power RC oscillator during
operation, allowing the user to incorporate power-saving ideas into their software
designs.
• Doze Mode Operation: When timing-sensitive applications, such as serial
communications, require the uninterrupted operation of peripherals, the CPU
clock speed can be selectively reduced, allowing incremental power savings
without missing a beat.
• Instruction-Based Power-Saving Modes: The microcontroller can suspend all
operations, or selectively shut down its core while leaving its peripherals
active, with a single instruction in software.

OSCILLATOR OPTIONS AND FEATURES:

All of the devices in the PIC24FJ16GA002 family offer five different oscillator
options, allowing users a range of choices in developing application hardware.
These include:

• Two Crystal modes using crystals or ceramic resonators.


• Two External Clock modes offering the option of a divide-by-2 clock output.
• A Fast Internal Oscillator (FRC) with a nominal 8 MHz output, which can
also be divided under
software control to provide clock speeds as low as 31 kHz.
• A Phase Lock Loop (PLL) frequency multiplier, available to the External
Oscillator modes and the FRC oscillator, which allows clock speeds of up to 32
MHz.
• A separate internal RC oscillator (LPRC) with a fixed 31 kHz output, which
provides a low-power option for timing-insensitive applications.

The internal oscillator block also provides a stable reference source for the Fail-Safe
Clock Monitor. This option constantly monitors the main clock source against a
reference signal provided by the internal oscillator and enables the controller to
switch to the internal oscillator, allowing for continued low-speed operation or a
safe application shutdown.

EASY MIGRATION:

Regardless of the memory size, all devices share the same rich set of peripherals, allowing for a
smooth migration path as applications grow and evolve.

The consistent pinout scheme used throughout the entire family also aids in migrating to the next
larger device. This is true when moving between devices with the same pin count, or even jumping
from 28-pin to 44-pin devices.

The PIC24F family is pin-compatible with devices in the dsPIC33 family, and shares some
compatibility with the pinout schema for PIC18 and dsPIC30. This extends the ability of applications
to grow from the relatively simple, to the powerful and complex, yet still selecting a Microchip
device.
Other Special Features:

• Communications:

The PIC24FJ16GA002 family incorporates a range of serial communication peripherals to

handle a range of application requirements. There are two independent I2C modules that support
both Master and Slave modes of operation. Devices also have, through the Peripheral Pin Select
(PPS) feature, two independent UARTs with built-in IrDA encoder/decoders and two SPI
modules.

• Peripheral Pin Select (PPS):


The Peripheral Pin Select feature allows most digital peripherals to be mapped over a fixed set
of digital I/O pins. Users may independently map the input and/or output of any one of the many
digital peripherals to any one of the I/O pins.

• Parallel Master/Enhanced Parallel Slave Port:


One of the general purpose I/O ports can be reconfigured for enhanced parallel data
communications. In this mode, the port can be configured for both master and slave operations,
and supports 8-bit and 16-bit data transfers with up to 16 external address lines in Master modes.

• Real-Time Clock/Calendar (RTCC):


This module implements a full-featured clock and calendar with alarm functions in hardware,
freeing up timer resources and program memory space for use of the core application.

• 10-Bit A/D Converter:


This module incorporates programmable acquisition time, allowing for a channel to be selected
and a conversion to be initiated without waiting for a sampling period, as well as faster sampling
speeds.
Details on Individual Family Members:
Devices in the PIC24FJ16GA002 family are available in 28-pin and 44-pin
packages. The general block diagram for all.

The devices are differentiated from each other in two ways:

1. Flash program memory (64 Kbytes for PIC24FJ64GA devices, 48 Kbytes for
PIC24FJ48GA devices, 32 Kbytes for PIC24FJ32GA devices and 16 Kbytes
for PIC24FJ16GA devices).
2. Internal SRAM memory (4k for PIC24FJ16GA devices, 8k for all other
devices in the family).
3. Available I/O pins and ports (21 pins on 2 ports for 28-pin devices and 35 pins
on 3 ports for 44-pin devices).

All other features for devices in this family are identical.

A list of the pin features that are available on the PIC24FJ16GA002 family devices,
sorted by function. Note that this table shows the pin location of individual
peripheral features and not how they are multiplexed on the same pin. This
information is provided in the pin out diagrams in the beginning of the data sheet.
Multiplexed features are sorted by the priority given to a feature, with the highest
priority peripheral being listed first.
TABLE: DEVICE FEATURES FOR THE PIC24FJ16GA002 FAMILY

16GA00

32GA00

48GA00

64GA00

16GA00

32GA00

48GA00

64GA00
Featur
es

4
Operating Frequency DC – 32 MHz
Program Memory (bytes) 16K 32K 48K 64K 16K 32K 48K 64K
Program Memory (instructions) 5,504 11,00 16,51 22,01 5,504 11,00 16,51 22,01
8 2 6 8 2 6
Data Memory (bytes) 4096 819 4096 819
2 2
Interrupt Sources 43
(soft vectors/NMI traps) (39/
4)
I/O Ports Ports A, Ports A, B, C
B
Total I/O Pins 21 35
Timers:
Total Number (16-bit) 5(1)
32-Bit (from paired 16-bit 2
timers)
Input Capture Channels 5(1)
Output Compare/PWM 5(1)
Channels
Input Change Notification 21 30
Interrupt
Serial
Communications: 2(1)
UART 2(1)
2
SPI (3-wire/4-wire)
I2C™
Parallel Communications Yes
(PMP/PSP)
JTAG Boundary Scan Yes
10-Bit Analog-to-Digital 10 13
Module (input channels)
Analog Comparators 2
Remappable Pins 16 26
Resets (and delays)
POR, BOR, RESET Instruction, MCLR, WDT, Illegal
Opcode, REPEATInstruction, Hardware Traps,
Configuration Word Mismatch (PWRT, OST, PLL
Lock)
Instruction Set 76 Base Instructions, Multiple Addressing Mode
Variations
Packages 28-Pin 44-Pin QFN/TQFP
SPDIP/SSOP/SOIC/QFN
TABLE: PIC24FJ16GA002 FAMILY PINOUT DESCRIPTIONS

Pin
Number Inp
Functi I/O Descript
28-Pin 28- 44-Pin ut
on ion
SPDIP/ Pin QFN/T Buff
SSOP/S QF QFP er
OIC N
AN0 2 27 19 I ANA A/D Analog Inputs.
AN1 3 28 20 I ANA
AN2 4 1 21 I ANA
AN3 5 2 22 I ANA
AN4 6 3 23 I ANA
AN5 7 4 24 I ANA
AN6 — — 25 I ANA
AN7 — — 26 I ANA
AN8 — — 27 I ANA
AN9 26 23 15 I ANA
AN10 25 22 14 I ANA
AN11 24 21 11 I ANA
AN12 23 20 10 I ANA
ASCL1 15 12 42 I/ I2C Alternate I2C1 Synchronous Serial Clock
O Input/Output.(1)
2
ASDA1 14 11 41 I/ I C Alternate I2C2 Synchronous Serial Clock
O Input/Output. (1)
AVDD — — 17 P — Positive Supply for Analog Modules.
AVSS — — 16 P — Ground Reference for Analog Modules.
C1IN- 6 3 23 I ANA Comparator 1 Negative Input.
C1IN+ 7 4 24 I ANA Comparator 1 Positive Input.
C2IN- 4 1 21 I ANA Comparator 2 Negative Input.
C2IN+ 5 2 22 I ANA Comparator 2 Positive Input.
CLKI 9 6 30 I ANA Main Clock Input Connection.
CLKO 10 7 31 O — System Clock Output.

Basic Connection Requirements:

Getting started with the PIC24FJ16GA002 family of 16-bit microcontrollers requires attention to
a minimal set of device pin connections before proceeding with development.
The following pins must always be connected:

• All VDD and VSS pins


• MCLR pin
• ENVREG/DISV
• MCLR pin
• ENVREG/DISVREG

Power Supply Pins:

DECOUPLING CAPACITORS:

The use of decoupling capacitors on every pair of power supply pins, such as VDD, VSS, AVDD
and AVSS is required.
Consider the following criteria when using decoupling capacitors:
• Value and type of capacitor: A 0.1 F (100 nF), 10-20V capacitor is recommended. The
capacitor should be a low-ESR device with a resonance frequency in the range of 200 MHz and
higher. Ceramic capacitors are recommended.
• Placement on the printed circuit board: The decoupling capacitors should be placed as close
to the pins as possible. It is recommended to place the capacitors on the same side of the board
as the device. If space is constricted, the capacitor can be placed on another layer on the PCB
using a via; however, ensure that the trace length from the pin to the capacitor is no greater than
0.25 inch (6 mm).
• Handling high-frequency noise: If the board is experiencing high-frequency noise (upward of
tens of MHz), add a second ceramic type capaci- tor in parallel to the above described
decoupling capacitor. The value of the second capacitor can be in the range of 0.01 F to 0.001
F. Place this second capacitor next to each primary decoupling capacitor. In high-speed circuit
designs, consider implementing a decade pair of capacitances as close to the power and ground
pins as possible (e.g., 0.1 F in parallel with 0.001 F).
• Maximizing performance: On the board layout from the power supply circuit, run the power
and return traces to the decoupling capacitors first, and then to the device pins. This ensures that
the decoupling capacitors are first in the power chain. Equally important is to keep the trace
length between the capacitor and the power pins to a minimum, thereby reducing PCB trace
inductance.

TANK CAPACITORS:

On boards with power traces running longer than six inches in length, it is suggested to use a tank
capacitor for integrated circuits including microcontrollers to supply a local power source. The value
of the tank capacitor should be determined based on the trace resistance that connects the power
supply source to the device, and the maximum current drawn by the device in the application. In other
words, select the tank capacitor so that it meets the acceptable voltage sag at the device. Typical
values range from 4.7 F to 47 F.
The MCLR pin provides two specific device functions: device Reset, and device
programming and debug- ging. If programming and debugging are not required in
the end application, a direct connection to VDD may be all that is required. The
addition of other com- ponents, to help increase the application’s resistance to
spurious Resets from voltage sags, may be beneficial. A typical configuration . Other
circuit designs may be implemented, depending on the application’s requirements.

During programming and debugging, the resistance and capacitance that can be
added to the pin must be considered. Device programmers and debuggers drive the
MCLR pin. Consequently, specific voltage levels (VIH and VIL) and fast signal
transitions must not be adversely affected. Therefore, specific values of R1 and C1
will need to be adjusted based on the application and PCB requirements. For
example, it is recommended that the capacitor, C1, be isolated from the MCLR pin
during programming and debug- ging operations by using a jumper. The jumper is
replaced for normal run-time operations.
Any components associated with the MCLR pin should be placed within 0.25 inch
(6 mm) of the pin.

Voltage Regulator Pins:

The on-chip voltage regulator enable/disable pin (ENVREG or DISVREG, depending on the
device family) must always be connected directly to either a supply voltage or to ground. The
particular connection is determined by whether or not the regulator is to be used:

• For ENVREG, tie to VDD to enable the regulator, or to ground to disable the regulator
• For DISVREG, tie to ground to enable the regulator or to VDD to disable the regulator
Refer to “On-Chip Voltage Regulator” for details on connecting and using the on-chip
regulator.

When the regulator is enabled, a low-ESR (< 5Ω) capacitor is required on the VCAP/VDDCORE
pin to stabilize the voltage regulator output voltage. The VCAP/VDDCORE pin must not be
connected to VDD and must use a capacitor of 10 µF connected to ground. The type can be ceramic
or tantalum. Suitable examples of capacitors. Capacitors with equivalent specification can be used.

The placement of this capacitor should be close to VCAP/VDDCORE. It is


recommended that the trace length not exceed 0.25 inch (6 mm). Refer to
“Electrical Characteristics” for additional information.

When the regulator is disabled, the VCAP/VDDCORE pin must be tied to a voltage
supply at the VDDCORE level. Refer to “Electrical Characteristics” for
information on VDD and VDDCORE.

FREQUENCY vs. ESR PERFORMANCE FOR SUGGESTED VCAP:


CONSIDERATIONS FOR CERAMIC CAPACITORS:

In recent years, large value, low-voltage, surface-mount ceramic capacitors have become very cost
effective in sizes up to a few tens of microfarad. The low-ESR, small physical size and other properties
make ceramic capacitors very attractive in many types of applications.

Ceramic capacitors are suitable for use with the inter- nal voltage regulator of this microcontroller.
However, some care is needed in selecting the capacitor to ensure that it maintains sufficient
capacitance over the intended operating range of the application.

Typical low-cost, 10 F ceramic capacitors are available in X5R, X7R and Y5V dielectric ratings
(other types are also available, but are less common). The initial toler- ance specifications for these
types of capacitors are often specified as ±10% to ±20% (X5R and X7R), or -20%/+80% (Y5V).
However, the effective capacitance that these capacitors provide in an application circuit will also vary
based on additional factors, such as the applied DC bias voltage and the temperature. The total in-
circuit tolerance is, therefore, much wider than the initial tolerance specification.

The X5R and X7R capacitors typically exhibit satisfac- tory temperature stability (ex: ±15% over a
wide temperature range, but consult the manufacturer’s data sheets for exact specifications). However,
Y5V capacitors typically have extreme temperature tolerance specifications of +22%/-82%. Due to
the extreme tem- premature tolerance, a 10 F nominal rated Y5V type capacitor may not deliver
enough total capacitance to meet minimum internal voltage regulator stability and transient response
requirements. Therefore, Y5V capacitors are not recommended for use with the internal regulator if
the application must operate over a wide temperature range.

In addition to temperature tolerance, the effective capacitance of large value ceramic capacitors can
vary substantially, based on the amount of DC voltage applied to the capacitor. This effect can be
very significant, but is often overlooked or is not always documented.

Typical DC bias voltage vs. capacitance graph for X7R type capacitors.
DC BIAS VOLTAGE vs. CAPACITANCE CHARACTERISTICS:

When selecting a ceramic capacitor to be used with the internal voltage regulator, it is
suggested to select a high-voltage rating, so that the operating voltage is a small
percentage of the maximum rated capacitor volt- age. For example, choose a ceramic
capacitor rated at 16V for the 2.5V or 1.8V core voltage Suggested capacitors.

ICSP Pins:

The PGECx and PGEDx pins are used for In-Circuit Serial Programming (ICSP)
and debugging purposes. It is recommended to keep the trace length between the
ICSP connector and the ICSP pins on the device as short as possible. If the ICSP
connector is expected to experience an ESD event, a series resistor is recom-
mended, with the value in the range of a few tens of ohms, not to exceed 100Ω.

Pull-up resistors, series diodes and capacitors on the PGECx and PGEDx pins are not
recommended as they will interfere with the programmer/debugger communi-
cations to the device. If such discrete components are an application requirement,
they should be removed from the circuit during programming and debugging.
Alternatively, refer to the AC/DC characteristics and timing requirements
information in the respective device Flash programming specification for information
on capacitive loading limits and pin input voltage high (VIH) and input low (VIL)
requirements.

For device emulation, ensure that the “Communication Channel Select” (i.e.,
PGECx/PGEDx pins), programmed into the device, matches the physical
connections for the ICSP to the Microchip debugger/emulator tool.
For more information on available Microchip development tools connection
requirements.

CPU:

The PIC24F CPU has a 16-bit (data) modified Harvard architecture with an enhanced instruction
set and a 24-bit instruction word with a variable length opcode field. The Program Counter (PC)
is 23 bits wide and addresses up to 4M instructions of user program memory space. A single-cycle
instruction prefetch mechanism is used to help maintain throughput and pro- vides predictable
execution. All instructions execute in a single cycle, with the exception of instructions that change
the program flow, the double-word move (MOV.D) instruction and the table instructions. Over-
head-free program loop constructs are supported using the REPEAT instructions, which are
interruptible at any point.

PIC24F devices have sixteen, 16-bit working registers in the programmer’s model. Each of the
working registers can act as a data, address or address offset register. The 16th working register
(W15) operates as a Software Stack Pointer for interrupts and calls.

The upper 32 Kbytes of the data space memory map can optionally be mapped into program space
at any 16K word boundary defined by the 8-bit Program Space Visibility Page Address (PSVPAG)
register. The program to data space mapping feature lets any instruction access program space as if
it were data space.

The Instruction Set Architecture (ISA) has been significantly enhanced beyond that of the PIC18,
but maintains an acceptable level of backward compatibil- ity. All PIC18 instructions and
addressing modes are supported, either directly, or through simple macros. Many of the ISA
enhancements have been driven by compiler efficiency needs.

The core supports Inherent (no operand), Relative, Literal, Memory Direct and three groups of
addressing modes. All modes support Register Direct and various Register Indirect modes. Each
group offers up to seven addressing modes. Instructions are associated with predefined addressing
modes depending upon their functional requirements.
MEMORY ORGANIZATION:
As Harvard architecture devices, PIC24F micro- controllers feature separate program and data
memory spaces and buses. This architecture also allows the direct access of program memory
from the data space during code execution.
Program Address Space:
The program address memory space of the PIC24FJ16GA002 family devices is 4M instructions.
The space is addressable by a 24-bit value derived from either the 23-bit Program Counter (PC)
during pro- gram execution, or from table operation or data space remapping. User access to the
program memory space is restricted to the lower half of the address range (000000h to 7FFFFFh).
The exception is the use of TBLRD/TBLWT operations which use TBLPAG<7> to permit
access to the Configuration bits and Device ID sections of the configuration memory space.
Memory maps for the PIC24FJ16GA002 family of devices.
Temperature sensor LM35:

In general, a temperature sensor is a device which is designed specifically to measure the


hotness or coldness of an object.LM35 is a precision IC temperature sensor with its output
proportional to the temperature (in °C).With LM35, the temperature can be measured more
accurately than with a thermistor. It also possesses low self heating and does not cause more than
0.1 °C temperature rise in still air. The operating temperature range is from -55°C to 150°C.The
LM35’s low output impedance, linear output, and precise inherent calibration make interfacing to
readout or control circuitry especially easy. It has find its applications on power supplies, battery
management, appliances, etc.

The LM35 is an integrated circuit sensor that can be used to measure temperature with an electrical
output proportional to the temperature (in °C).It can measure temperature more accurately than a using
a thermistor. The sensor circuitry is sealed and not subject to oxidation. The LM35 generates a higher
output voltage than thermocouples and may not require that the output voltage be amplified. The
LM35 has an output voltage that is proportional to the Celsius temperature. The scale factor is
.01V/°C.

The LM35 does not require any external calibration or trimming and maintains an accuracy of +/-
0.4°C at room temperature and +/-0.8°C over a range of 0°C to +100°C.Another important
characteristic of the LM35 is that it draws only 60 micro amps from its supply and possesses a low
self-heating capability. The LM35 comes in many different packages such as TO-92 plastic transistor-
like package, T0-46 metal can transistor-like package, 8-lead surface mount SO-8 small outline
package.
WORKING PRINCIPLE OF LM35:

There are two transistors in the center of the drawing. One has ten times the emitter area of the other.
This means it has one tenth of the current density, since the same current is going through both
transistors. This causes a voltage across the resistor R1 that is proportional to the absolute temperature,
and is almost linear across the range. The "almost" part is taken care of by a special circuit that
straightens out the slightly curved graph of voltage versus temperature.

The amplifier at the top ensures that the voltage at the base of the left transistor (Q1) is proportional to
absolute temperature (PTAT) by comparing the output of the two transistors.

The amplifier at the right converts absolute temperature (measured in Kelvin) into either Fahrenheit or
Celsius, depending on the part (LM34 or LM35).The little circle with the "i" in it is a constant current
source circuit.

The two resistors are calibrated in the factory to produce a highly accurate temperature sensor.

The integrated circuit has many transistors in it -- two in the middle, some in each amplifier, some in
the constant current source, and some in the curvature compensation circuit. All of that is fit into the
tiny package with three leads.
Humidity sensors

Introduction:
DHT 11 sensors send the temperature data to the ESP8266. For every single test location, 2
sensors are placed to validate received sensor data as well as to provide device redundancy at the
sensor level. ESP8266 is loaded with the firmware program written in C that does all the interfacing
with sensors, processing the sensor data and interfacing with cloud platform and finally uploading
the data to the cloud platform ideally once every one minute. To write the code and upload it to the
ESP8266, Arduino IDE is used. Two sets of data from two sensor units are compared for an unusual
mismatch and if any such mismatch is found that set of data is discarded and next set of data are
fetched. This processing is done by the microcontroller along with supporting components on the
ESP8266 board. If data received from two sensors located at a single spot are found somewhat
matching, then that set of data is pushed to the Ubidots cloud. Ubidots cloud platform needs to be
configured to accept this data from the sensors and show the data over dashboards. This platform
also has feature to configure alert for different events. For this case, multilevel alert SMSs are
configured for specific phone numbers. Similarly email notifications are configured to report alert at
multiple levels of temperature.

Temperature is the most often-measured environmental quantity. This might be expected since most
physical, electronic, chemical, mechanical, and biological systems are affected by temperature. Certain
chemical reactions, biological processes, and even electronic circuits perform best within limited
temperature ranges. Temperature is one of the most commonly measured variables and it is therefore
not surprising that there are many ways of sensing it.
Temperature sensing can be done either through direct contact with the heating source, or remotely,
without direct contact with the source using radiated energy instead. There are a wide variety of
temperature sensors on the market today, including Thermocouples, Resistance Temperature Detectors
(RTDs), Thermistors, Infrared, and Semiconductor Sensors.

5 Types of Temperature Sensors

 Thermocouple: It is a type of temperature sensor, which is made by joining two dissimilar metals
at one end. The joined end is referred to as the HOT JUNCTION. The other end of these dissimilar
metals is referred to as the COLD END or COLD JUNCTION. The cold junction is actually
formed at the last point of thermocouple material. If there is a difference in temperature between
the hot junction and cold junction, a small voltage is created. This voltage is referred to as an EMF
(electro-motive force) and can be measured and in turn used to indicate temperatu Thermocouple
 The RTD is a temperature sensing device whose resistance changes with temperature. Typically
built from platinum, though devices made from nickel or copper are not uncommon, RTDs can take
many different shapes like wire wound, thin film. To measure the resistance across an RTD, apply
a constant current, measure the resulting voltage, and determine the RTD resistance. RTDs exhibit
fairly linear resistance to temperature curves over their operating regions, and any nonlinearity are
highly predictable and repeatable. The PT100 RTD evaluation board uses surface mount RTD to
measure temperature. An external 2, 3 or 4-wire PT100 can also be associated with measure
temperature in remote areas. The RTDs are biased using a constant current source. So as to reduce
self-heat due to power dissipation, the current magnitude is moderately low. The circuit shown in
figure is the constant current source uses a reference voltage, one amplifier, and a PNP transistor.

 Thermistors: Similar to the RTD, the thermistor is a temperature sensing device whose resistance
changes with temperature. Thermistors, however, are made from semiconductor materials.
Resistance is determined in the same manner as the RTD, but thermistors exhibit a highly nonlinear
resistance vs. temperature curve. Thus, in the thermistors operating range we can see a large
resistance change for a very small temperature change. This makes for a highly sensitive device,
ideal for set-point applications.
 Semiconductor sensors: They are classified into different types like Voltage output, Current
output, Digital output, Resistance output silicon and Diode temperature sensors. Modern
semiconductor temperature sensors offer high accuracy and high linearity over an operating range
of about 55°C to +150°C. Internal amplifiers can scale the output to convenient values, such as
10mV/°C. They are also useful in cold-junction compensation circuits for wide temperature range
thermocouples. A brief detail about this type of temperature sensor is given below.
Sensor ICs

There are a wide variety of temperature sensors ICs that are available to simplify the broadest possible
range of temperature monitoring challenges. These silicon temperature sensors differ significantly
from the above mentioned types in a couple of important ways. The first is operating temperature
range. A temperature sensor IC can operate over the nominal IC temperature range of -55°C to
+150°C. The second major difference is functionality.A silicon temperature sensor is an integrated
circuit, and can therefore include extensive signal processing circuitry within the same package as the
sensor. There is no need to add compensation circuits for temperature sensor Ics. Some of these are
analogue circuits with either voltage or current output. Others combine analogue-sensing circuits with
voltage comparators to provide alert functions. Some other sensor ICs combine analogue-sensing
circuitry with digital input/output and control registers, making them an ideal solution for
microprocessor-based systems.

Digital output sensor usually contains a temperature sensor, analog-to-digital converter (ADC), a two-
wire digital interface and registers for controlling the IC’s operation. Temperature is continuously
measured and can be read at any time. If desired, the host processor can instruct the sensor to monitor
temperature and take an output pin high (or low) if temperature exceeds a programmed limit. Lower
threshold temperature can also be programmed and the host can be notified when temperature has
dropped below this threshold. Thus, digital output sensor can be used for reliable temperature
monitoring in microprocessor-based systems.
LDR SENSOR:

A photoresistor (or light-dependent resistor, LDR, or photo-conductive cell) is a light-controlled


variable resistor. The resistance of a photoresistor decreases with increasing incident light intensity; in
other words, it exhibits photoconductivity. A photoresistor can be applied in light-sensitive detector
circuits, and light-activated and dark-activated switching circuits.

A photoresistor is made of a high resistance semiconductor. In the dark, a photoresistor can have a
resistance as high as several megohms (MΩ), while in the light, a photoresistor can have a resistance
as low as a few hundred ohms. If incident light on a photoresistor exceeds a
certain frequency, photons absorbed by the semiconductor give bound electrons enough energy to
jump into the conduction band. The resulting free electrons (and their whole partners) conduct
electricity, thereby lowering resistance. The resistance range and sensitivity of a photoresistor can
substantially differ among dissimilar devices. Moreover, unique photoresistors may react substantially
differently to photons within certain wavelength bands.
A photoelectric device can be either intrinsic or extrinsic. An intrinsic semiconductor has its
own charge carriers and is not an efficient semiconductor, for example, silicon. In intrinsic devices the
only available electrons are in the valence band, and hence the photon must have enough energy to
excite the electron across the entire band gap. Extrinsic devices have impurities, also called do pants,
added whose ground state energy is closer to the conduction band; since the electrons do not have as
far to jump, lower energy photons (that is, longer wavelengths and lower frequencies) are sufficient to
trigger the device. If a sample of silicon has some of its atoms replaced by phosphorus atoms
(impurities), there will be extra electrons available for conduction. This is an example of an extrinsic
semiconductor.

Photoresistors are less light-sensitive devices than photodiodes or phototransistors: the two latter
components are true semiconductor devices, while a photoresistor is a passive component and does not
have a PN-junction. The photo resistivity of any photoresistor may vary widely depending on ambient
temperature, making them unsuitable for applications requiring precise measurement of or sensitivity
to light photons.

Photoresistors also exhibit a certain degree of latency between exposure to light and the subsequent
decrease in resistance, usually around 10 milliseconds. The lag time when going from lit to dark
environments is even greater than, often as long as one second. This property makes them unsuitable
for sensing rapidly flashing lights, but is sometimes used to smooth the response of audio signal
compression.

APPLICATIONS:

Photoresistors come in many types. Inexpensive cadmium sulfide cells can be found in many
consumer items such as camera light meters, clock radios, alarm devices (as the detector for a light
beam), nightlights, outdoor clocks, solar street lamps and solar road studs, etc.

Photoresistors can be placed in streetlights to control when the light is on. Ambient light falling on the
photoresistor causes the streetlight to turn off. Thus energy is saved by ensuring the light is only on
during hours of darkness.

They are also used in some dynamic compressors together with a small incandescent or neon lamp,
or light-emitting diode to control gain reduction. A common usage of this application can be found in
many guitar amplifiers that incorporate an onboard tremolo effect, as the oscillating light patterns
control the level of signal running through the amp circuit.
The use of CdS and CdSe photoresistors is severely restricted in Europe due to the RoHS ban
on cadmium.

Lead sulfide (PBS) and indium antimonide (InSb) LDRs (light-dependent resistors) are used for the
mid-infrared spectral region. Ge:Cuphotoconductors are among the best far-infrared detectors
available, and are used for infrared astronomy and infrared spectroscopy.

INTRODUCTION TO LORA TECHNOLOGY.

The IoT industry is bringing lots of technology and solutions to the market with chip
manufacturers investing heavily in the market growing the industry exponentially. It isn’t however
without its challenges. One of the key challenges in building out the internet of things is ensuring
that those “things” or end nodes are in fact able to communicate with the internet.
The sheer number of current internet devices is massive and is expected to hit 25 billion by 2020.
Any network that supports such an infrastructure needs to have the ability to handle the traffic.
These issues don’t include the fact that nodes need to run on some sort of battery power, have
weak radios and also are limited in memory and processing power.

IoT devices today use a number of different technologies to support their communications, but
none of them are really ideal for the purpose and application of today. Wi-Fi is everywhere at the
moment but it uses a lot of energy and transmits lots of data, whilst this is great it isn’t su ch a
perfect solution for IoT devices that don’t have as much energy at their disposal or wish to send
small amounts of data. There are also limitations in the modulation techniques used and as such
access points can only handle a handful of devices at once.

Bluetooth devices allow local communication but have very limited range in version 4.0. They
also require too much power. Even newer Bluetooth Low Energy devices still consume much
more power than is necessary. Up to recently the best available technology on the market was
considered to be ZigBee low power modules that transmit over greater distances and at low
transfer rates, usually a few kilometers in clear path.

What is LoRa?

LoRa technology was developed by a company called Semtech and it is a new wireless protocol
designed specifically for long-range, low-power communications. LoRa stands for Long Range
Radio and is mainly targeted for M2M and IoT networks. This technology will enable public or
multi-tenant networks to connect a number of applications running on the same network.

LoRa Alliance was formed to standardize LPWAN (Low Power Wide Area Networks) for IoT and
is a non-profit association which features membership from a number of key market shareholders
such as CISCO, activity, Microchip, IBM, STMicro, SEMTECH, Orange mobile and many more.
This alliance is key to providing interoperability among multiple nationwide networks.

Each LoRa gateway has the ability to handle up to millions of nodes. The signals can span a
significant distance, which means that there are fewer infrastructures required, making
constructing a network much cheaper and faster to implement.
LoRa also features an adaptive data rate algorithm to help maximize the nodes battery life and
network capacity. The LoRa protocol includes a number of different layers including encryption at
the network, application and device level for secure communications.

Features

The following table showcases some of the key features of the LoRa protocol such as range,
modulation and capacity.

Specification LoRa Feature


Range 2-5Km Urban (1.24-3.1 mi),
15Km suburban (9.3 mi)
Frequency ISM 868/915 MHz
Standard IEEE 802.15.4g
Modulation Spread spectrum modulation type based
on FM pulses which vary.
Capacity One LoRa gateway takes thousands of
nodes
Battery Long battery life
LoRa Physical layer Frequency, power, modulation and
signalling between nodes and gateways
LoRa Modules

Semtech Corporation is the leader in LoRa wireless technology and as such has introduced a
number of LoRa RF modules for the market. In particular, the SX127x family of RF transceivers
for the IoT/M2M markets.

These RF modules operated between 860-1000 MHz and 137-960MHz. Semtech also offer
evaluation and testing devices at 860MHz band.

Ad fruit has recently introduced a number of breakout boards and development boards based
around the Semtech RFM69 and RFM95 modules for a range of frequencies such as 433, 868 and
960 MHz’s

These are +20dBm LoRa packet radios that have a special radio modulation that is not compatible
with the RFM69s but can go much farther. They can easily go 2 Km (1.24 mi) line of sight using
simple wire antennas, or up to 20Km (12.4 mi) with directional antennas and settings t weaking’s.

 Packet radio with ready-to-go Arduino libraries


 Uses the license-free ISM band: "European ISM" @ 868MHz or "American ISM" @
915MHz
 Use a simple wire antenna or spot for uFL or SMA radio connector
 SX1276 LoRa® based module with SPI interface
 +5 to +20 dBm up to 100 mW Power Output Capability (power output selectable in
software)
 ~100mA peak during +20dBm transmit, ~30mA during active radio listening.
 Range of approx. 2Km (1.24 mi), depending on obstructions, frequency, antenna and power
output

Each radio comes with some header, a 3.3V voltage regulator and level shifter that can handle 3 -
5V DC power and logic so you can use it with 3V or 5V devices. Some soldering is required to
attach the header. You will need to cut and solder on a small piece of wire (any solid or stranded
core is fine) in order to create your antenna. Optionally you can pick up a uFL or SMA edge -
mount connector and attach an external duck.

Microchip, also being a key partner in the LoRa Alliance has also introduced a number of LoRa
modules for the IoT market. The module is a small form factor with up to 14 GPIO pins for
connecting sensors and actuators whilst taking up very little space.

"The RN2483 module is a revolutionary end-node IoT solution for the new LoRa technology
network, enabling extremely long-range, bidirectional communication with significant battery
life," said Steve Caldwell, vice president of Microchip's Wireless Products Division. "As a
founding member of the LoRa Alliance, we are working to ensure our modules are compatible
with all partner gateways and back-end network service providers."

The RN2483 comes with the Lora WAN™ protocol stack, so it can easily connect with the
established and rapidly expanding LoRa Alliance infrastructure including both privately managed
local area networks (LANs) and telecom-operated public networks to create Low Power Wide
Area Networks (LPWANs) with nationwide coverage.
This stack integration also enables the module to be used with any microcontroller that has a
UART interface, including hundreds of Microchip's PIC® MCUs. Additionally, the RN2483
features Microchip's simple ASCII command interface for easy configuration and control.

With its scalability, robust communication, mobility and the ability to operate in harsh outdoor
environments, the RN2483 is well suited for a broad range of low-data-rate wireless monitoring
and control designs.

LORA 868MHZ SX1276:

LoRa Radio Module is a type of long range low data rate data radio modem based on Sx1276 from
Semtech. It is a low-cost sub-1 GHz transceiver module designed for operations in the unlicensed ISM
(Industrial Scientific Medical) and LPRD bands. Frequency spectrum modulation/demodulation,
multi-channel operation, high bandwidth efficiency and anti-blocking performance make LoRa
modules easy to realize the robust and reliable wireless link.

The module can work in two different modes: Standard mode and Star network mode. In the standard
mode, it acts as transparent data radio modem which it communicates with the host at the preset data
format without encoding / decoding needed. In start network mode, one module will be the configured
to the central node and other modules are set to node modules. The communication between the
central module and node module are bidirectional but the node modules cannot talk with each other.
Please note that the module doesn't contain lorawan protocol. Therefore the star network feature of
this module is used with itself protocol so it is not compatible with lorawan. Recommend USB to TTL
Converter to set the module parameter, and Gravity IO Expansion Shield can directly work with the
Lora modules.

This xCHIP features an SC18IS602B SPI/I2C converter IC for handling radio operations, the on-board
TM
RFM95W Lora module provides ultra-long range spread spectrum communication and high
interference immunity whilst minimizing current consumption.

Product Highlights

 868 MHz Range (Software Selectable Center Frequency


 Lora TM Modem
 168 dB maximum link budget.
 +20 dBm - 100 mW constant RF output vs. V supply.
 +14 dBm high efficiency PA.
 Programmable bit rate up to 300 kbps.
 High sensitivity: down to -148 dBm.
FEATURES:

1. LoRa Frequency Spectrum

2. 868/915Mhz ISM frequency band

3. 137 dBm receive sensitivity

4. 20 dBm Max. output power

5. Serial port wake-up

6. Wireless wake-up

7. Star networking ability

8. Supply voltage 3.4~5.5V

 168 dB maximum link budget.


o +20 dBm - 100 mW constant RF output vs. V supply.
 +14 dBm high efficiency PA.
 Programmable bit rate up to 300 kbps.
 High sensitivity: down to -148 dBm.
 Bullet-proof front end: IIP3 = -12.5 dBm.
 Excellent blocking immunity.
 Low RX current of 10.3 mA, 200 nA register retention.
o Fully integrated synthesizer with a resolution of 61 Hz.
 FSK, GFSK, MSK, GMSK, LoRaTM and OOK modulation.
o Built-in bit synchronizer for clock recovery.
o Preamble detection.
 127 dB Dynamic Range RSSI.
 Automatic RF Sense and CAD with ultra-fast AFC.
 Packet engine up to 256 bytes with CRC.
 I2C-bus slave interface operating up to 400 kHz
 SPI master operating up to 1.8 Mb/s
 200-byte data buffer
 Low power mode
 Internal oscillator option.

Power Supply:

The vitality supply is intended to exchange over extreme voltage air con mains solidarity to a
sensible low voltage supply for computerized circuits and awesome contraptions. A power convey
can by way of isolated into an enhancement of impedes, each individual in all which performs out
a chose capacity. A D.C. Control supply which keeps up the yield voltage reliable independent of
A.C mains instabilities or load assortments is known as "Oversaw D.C Power Supply"

For instance 5V controlled vitality conveys system as demonstrated as pursues:

Figure: Practical Block Diagram of Control supply

Transformer:
A transformer is an electrical gadget this is connected to interchange over electrical power starting
with one electric circuit then onto the accompanying without substitute in repeat.
Transformers trade over air con power starting with one voltage then onto the consequent with
little absence of vitality. Transformers works of art earnestly with air con and that is one reason
why mains vitality is air con. Advance up transformers increase in yield voltage, upgrade down
transformers decrease in yield voltage.
Most vitality substances utilize a certificate down transformer to reduce the dangerously radical
mains voltage to an additional quiet low voltage. The measurements circle is alluded to as the vital
and the yield twist is alluded to as the assistant. There isn't any electric relationship among the two
twists; rather they will be related through way of a turning engaging field made inside the touchy
iron center of the transformer.
The two strains in the midst of the circuit picture impart profoundly. Transformers waste beside no
vitality so the power out is (about) indistinguishable to the vitality in. Note that as voltage is
wandered down contemporary is wandered up. The level of the measure of turns on each circle,
known as the turn's percent, includes a choice the level of the voltages. A dimension down
transformer has endless on its vital (input) circle that is related with the unbalanced voltage mains
convey, and few turns on its non-necessary (yield) twist to exhibit a low yield voltage.

Figure: An Electrical Transformer

Turns proportion = Vp/Versus = Np/NS


Power Out= Power In
Versus X IS=VP X IP
Vp = essential (input) voltage
Np = number of turns on essential curl
Ip = essential (input) current.

RECTIFIER:

A circuit, which is used to convert a.c to dc, is known as RECTIFIER. The


process of conversion a.c to d.c is called “rectification”.
TYPES OF RECTIFIERS:
• Half wave Rectifier.
• Full wave rectifier.
1. Center tap full wave rectifier.
2. Bridge type full bridge rectifier.

Comparison of rectifier circuits:

Type of Rectifier

Half wave Full wave Bridge


Number of diodes
1 2 3
PIV of diodes
Vm 2Vm Vm

D.C output voltage Vm/ 2Vm/ 2Vm/

Vdc, at no-load 0.318Vm 0.636Vm 0.636Vm

Ripple factor 1.21 0.482 0.482


Ripple
Frequency F 2f 2f
Rectification
Efficiency 0.406 0.812 0.812
Transformer
Utilization 0.287 0.693 0.812
Factor(TUF)
RMS voltage Vrms Vm/2 Vm/√2 Vm/√2

Table Comparison of rectifier circuits.


Full-wave Rectifier and Bridge Rectifier:

Full-wave Rectifier:

From the above comparisons we came to know that full wave bridge
rectifier as more advantages than the other two rectifiers. So, in our project we are
using full wave bridge rectifier circuit.

Bridge Rectifier: A bridge rectifier makes use of four diodes in a bridge


arrangement to achieve full-wave rectification. This is a widely used configuration,
both with individual diodes wired as shown and with single component bridges where
the diode bridge is wired internally. The bridge rectifier circuit diagram is shown in
below fig :

A bridge rectifier makes use of four diodes in a bridge arrangement to


achieve full-wave rectification. This is a widely used configuration, both with
individual diodes wired with single component bridges where the diode bridge is
wired internally.

Figure Bridge Rectifier circuit diagram.


Operation:
During positive half cycle of secondary, the diodes D2 and D3 are in
forward biased while D1 and D4 are in reverse biased. The current flow direction is
with dotted arrows. The operation of forward biased Bridge Rectifier is shown in
below fig
Figure Operation of forward biased Bridge Rectifier.
During negative half cycle of secondary voltage, the diodes D1 and
D4 are in forward biased while D2 and D3 are in reverse biased. The current
flow direction is with dotted arrows. The Operation of reverse biased Bridge
Rectifier is shown in below fig :

Figure Operation of reverse biased Bridge Rectifier.


Filter:

A Filter is a device, which removes the a.c component of


rectifier output but allows the d.c component to reach the load.

Capacitor Filter:

We have seen that the ripple content in the rectified output of half
wave rectifier is 1.21% or that of full-wave or bridge rectifier or bridge
rectifier is 48% such high percentages of ripples is not acceptable for most
of the applications. Ripples can be removed by one of the following
methods of filtering:

A capacitor, in parallel to the load, provides an easier by pass for the
ripples voltage though it due to low impedance. At ripple frequency and
leave the d.c.to appears the load.


An inductor, in series with the load, prevents the passage of the ripple current
(due to high impedance at ripple frequency) while allowing the d.c
(due to low resistance to d.c).


Various combinations of capacitor and inductor, such as L-section filter
section filter, multiple section filter etc. which make use of both the
properties mentioned. Two cases of capacitor filter, one applied on
half wave rectifier and another with full wave rectifier.

Filtering is performed by a large value electrolytic capacitor


connected across the DC supply to act as a reservoir, supplying current to the
output when the varying DC voltage from the rectifier is falling. The
capacitor charges quickly near the peak of the varying DC, and then
discharges as it supplies current to the output. Filtering significantly
increases the average DC voltage to almost the peak value (1.4 × RMS
value).

To calculate the value of capacitor(C),

C = ¼*√3*f*r*RL

Where,

f = supply

frequency, r =

ripple factor,

RL = load resistance,

Note: In our circuit we are using 1000microfarads.


Regulator:

Voltage regulator ICs is available with fixed (typically 5, 12 and


15V) or variable output voltages. The maximum current they can pass also
rates them. Negative voltage regulators are available, mainly for use in dual
supplies.
Most regulators include some automatic protection from excessive
current ('overload protection') and overheating ('thermal protection'). Many
of the fixed voltage regulator ICs has 3 leads and look like power
transistors, such as the 7805 +5V 1 A regulator shown on the right. The A 3
terminal voltage regulator is shown in below fig :

The LM7805 is simple to use. You simply connect the positive lead
of your unregulated DC power supply (anything from 9VDC to 24VDC) to
the Input pin, connect the negative lead to the Common pin and then when
you turn on the power, you get a 5 volt supply from the output pin.

Figure A Three Terminal Voltage Regulator.


78XX:

The Bay Linear LM78XX is integrated linear positive regulator with


three terminals. The LM78XX offer several fixed output voltages making
them useful in wide range of applications. When used as a zener
diode/resistor combination replacement, the LM78XX usually results in an
effective output impedance improvement of two orders of magnitude, lower
quiescent current.

Features:

• Output Current of 1.5A.


• Output Voltage Tolerance of 5%.
• Internal thermal overload protection.
• Internal Short-Circuit Limited.
• No External Component.
• Output Voltage 5.0V, 6V, 8V, 9V, 10V, 12V, 15V, 18V, 24V.
• Offer in plastic TO-252, TO-220 & TO-263.
• Direct Replacement for LM78XX.

Battery:

LIQUID CRYSTAL DISPLAY:


Fluid gem shows (LCDs) have substances, which join the homes of every refreshment and
gems. Instead of having a liquefying part, they have a temperature assortment inside which
the atoms are nearly as versatile as they is presumably in a fluid, anyway are assembled
together in an arranged frame like a precious stone.
A LCD comprises of glass boards, with the fluid precious stone texture sand witched in
among them. The inward ground of the glass plates are fixed with straightforward terminals
which characterize the man or lady, images or styles to be shown polymeric layers are seen
in a large number of the anodes and the fluid gem, which sorts the particles to hold a
characterized introduction disposition.
One each polarizer's are stuck outside the two glass boards. These spellbinds should pivot
the light beams passing completed them to an exact mentality, in a chose way.
At the point when the LCD is in the off nation, moderate beams are pivoted by means of
method for the two polarizer and the fluid precious stone, to such an extent that the slight
beams fly out of the LCD with no introduction, and in this manner the LCD seems self-
evident.
At the point when adequate voltage is connected to the terminals, particles may be adjusted
in a chose course. The light beams going through the LCD could be hovered through the
polarizer's, which may realize actuating/featuring the ideal characters.
The LCD's are light-load with only a couple of millimeters thickness. Since the LCD's eat
less quality, they'll be very much coordinated with low power computerized circuits, and
can be controlled for protracted lengths.
The LCD's don't produce light thus gentle is needed to look at the presentation. By the
utilization of backdrop illumination, perusing is possible in obscurity. The LCD's have
delayed ways of life and a broad working temperature run.
Changing the showcase length or the format length is especially simple which makes the
LCD's more customer’s kind.

The LCDs connected totally in watches, including machines and evaluating gadgets are the
basic seven-area appears, having a controlled measure of numeric actualities. The greatest
current advances in age have come to fruition inside the LCDs being outstandingly utilized
in media communications and enjoyment hardware. The LCDs have even begun supplanting
the cathode beam tubes (CRTs) utilized for the presentation of content and pictures, and
moreover in little TV applications.
This portion depicts the task methods of LCD's at that point portrays how to program and
interface a LCD to 8051 the utilization of Assembly and C.

LCD task:
In present day years the LCD is discovering monster utilize evolving LEDs (seven-stage
LEDs or phenomenal multi fragment LEDs).This is because of the resulting intentions:
1. The declining costs of LCDs.
2. The ability to uncover numbers, characters and pix. This is in settlement to LEDs,
which compartment be confined to numbers and a few characters.
3. Incorporation of a spotless controller into the LCD, there by utilizing calming the CPU of
the endeavor of cleans the LCD. In the appraisal, the LED should be revived through the
CPU to safeguard demonstrating the actualities.
4. Simplicity of programming for characters and pictures.
LCD pin description
The LCD discussed in this section has 14 pins. The function of each pin is given in table.
TABLE 1: Pin description for LCD:
P i n s y m b o l I / O Description
1 V s s - - G r o u n d
2 V c c - - +5V power supply
3 V E E - - Power supply to control contrast
4 R S I RS=0 to select command register
RS=1 to select
data register
5 R / W I R/W=0 for write
R/W=1 for read
6 E I / O E n a b l e
7 D B 0 I / O The 8-bit data bus
8 D B 1 I / O The 8-bit data bus
9 D B 2 I / O The 8-bit data bus
1 0 D B 3 I / O The 8-bit data bus
1 1 D B 4 I / O The 8-bit data bus
1 2 D B 5 I / O The 8-bit data bus
1 3 D B 6 I / O The 8-bit data bus
1 4 D B 7 I / O The 8-bit data bus

TABLE 2: LCD Command Codes


C o d e C o m m a n d t o L C D I n s t r u c t i o n
( h e x ) R e g i s t e r

1 C l e a r d i s p l a y s c r e e n
2 R e t u r n h o m e
4 D e c r e m e n t c u r s o r
6 I n c r e m e n t c u r s o r
5 S h i f t d i s p l a y r i g h t
7 S h i f t d i s p l a y l e f t
8 D i s p l a y o f f , c u r s o r o f f
A D i s p l a y o f f , c u r s o r o n
C D i s p l a y o n , c u r s o r o f f
E D i s p l a y o n , c u r s o r o n
F D i s p l a y o n , c u r s o r b l i n k i n g
1 0 S h i f t c u r s o r p o s i t i o n t o l e f t
1 4 S h i f t c u r s o r p o s i t i o n t o r i g h t
1 8 S h i f t t h e e n t i r e d i s p l a y t o t h e l e f t
1 C Shift the ent ire dis pla y t o the ri gh t
s t
8 0 Force cursor to beginning of 1 line
n d
C 0 Force cursor to beginning of 2 line
3 8 2 l i n e s a n d 5 x 7 m a t r i x

Makes utilization of: The LCDs utilized absolutely in watches, number crunchers and
estimating gadgets are the simple seven-fragment recommends, having a controlled amount
of numeric ability. The state-of-the-art propels in period have finished in better neatness,
additional data showing ability and a far more extensive temperature run. These have
brought about the LCDs being generally utilized in broadcast communications and
satisfaction hardware. The LCDs have even begun changing the cathode beam tubes (CRTs)
utilized for the show of printed substance and depictions, and also in little TV programs.

LCD INTERFACING
Sending commands and data to LCDs with a time delay:
Figure: Interfacing of LCD to a micro controller

 To send any facility from table 2 to the LCD, make pin RS=0.

 For data, make RS=1.Then sends a high –to-low pulse to the E pin to enable the internal
latch of the LCD.
CHAPTER 4
EXPERIMENTAL SETUP AND RESULTS

Initial Setups in Arduino IDE Software


Step 1: Install the Arduino 1.6.7 IDE.

Step 2: Go to File>>Preferences>>Additional Boards Manager URLs:

http://arduino.esp8266.com/stable/package_esp8266com_index.json

>>Ok

Step 3: Go to Tools>>Boards>>Boards Manager>>

Download the “esp8266 by ESP8266 Community version 2.2.0”

Step 4: Go to Tools>>Boards>>Generic ESP8266 Module

Step 5: Go to Tools>>Upload Speed>>115200

Port>>choose preferred COM ports.

How to Flash ESP8266-12

Step 1: First upload BareMinimum code to Arduino Uno board.

Step 2: Connect the pins of Arduino Uno to ESP8266-12 pins as mention below

Arduino Pins  ESP8266 pins

 5v  5v
 3.3v  3.3v, CH_PD
 Gnd  Gnd (both)
 Tx  Tx
 Rx  Rx

Note: Program code is directly uploaded into ESP8266 module. In this case, Arduino board is
used as a Flash Burner, i.e. code is directly uploaded to ESP8266 module.
Step 3: Reset the ESP8266 by connecting RESET pin to GND3.3vGND and disconnect.
But Explore ESP8266 Wi-Fi module has inbuilt Reset button. Press the reset button to reset the
module.

Step 4: While uploading the program code connect the GPIO 0 to GND.

Step 5: Once upload is successful, disconnect the GPIO 0 from GND.

Experimental Setup

List of Components
Components Quantity
Explore ESP8266 Wi-Fi Module 1
Relay Switch 3
Transistor (BC-547) 3
Diode (IN4007) 3
LED (Power Indication) 1
Power Supply - 5v 1 (from Arduino)
3.3v 1 (from Arduino)
9v 1 (from 9v battery)
18v 2 (from 9+9v battery)
Gnd From Arduino
Table 4.1 List of Components

Circuit Connection Procedure


Step 1: Make the connection in bread-board as shown in figure 4.1 and verify results.

Figure 4.1 Circuit Diagram


Step 2: Once results are confirmed, make a PCB layout using software ExpressPCB as shown
below in figure 4.2.

Figure 4.2 PCB Layout

Step 3: Print the PCB layout on a copper plate.

Step 4: Itching: Immerse the printed PCB copper plate in a copper sulphate solution until all
copper oxidizes except PCB traces. Then, wash with petrol to remove printed carbon.

Step 5: Place the components and carefully solder them. Front and rear views are shown in
figure 4.3a, 4.3b.

Figure 4.3a Front View of PCB board


Figure 4.3b Rear View of PCB board

Step 5: Make the complete connections, i.e. connect the water level indicator, soil moisture
sensors, submersible motor pump and solenoid valves.

Step 6: Connect the power supplies to output ends of relay switches as mentioned in the circuit
diagram. 9v to motor pump, 18v to both valves. Connect the power supplies to PCB board 5v,
3.3v and ground from Arduino board.

Physical Connections

Physical connections include the placing the sensors and actuators in small model of
agriculture field and includes proper connections. Detail is given below

 The field includes two Regions: 1, 2 and a water reservoir.


 Submerse the submersible motor pump in the reservoir.
 Place the valve 1 in Region 1.
 Place the valve 2 in Region 2.
 Make proper pipeline connections from motor pump to the valves.
 Extend the pipeline connection to respective fields to supply water.
 Make some arrangements to supply the water like making the holes to pipes.
 Place the water level indicator in the water reservoir.
 Place the soil moisture sensor 1 in Region 1 near the roots of the plants.
 Place the soil moisture sensor 2 in Region 2 near the roots of the plants.
Give all required supply voltages.

Physical connection and implementation is shown in figure 4.4.

Figure 4.4 Experimental Setup

Note: The Wi-Fi module ESP8266 is must be connected to internet services via an internet
router (having specific USERNAME and PASSWORD which is specified in program
code).

Results

How module works?

 Wi-Fi module has to connect the internet by an internet service provider like mobile
hotspot, Wi-Fi router.
 Firstly module checks status of water level indicator, if water is present then it proceeds
otherwise it terminates.



 If water is present, then it checks status of soil moisture sensor 1,
 If Region 1 is wet, motor will be off.
 If Region 1 is dry, valve 1 will open and motor will be on for 10 seconds.
 If Region 1 is humid, valve 1 will open and motor will be on for 5 seconds.
 During this, valve 2 will remain closed.

 Once again module checks status of water level indicator, if water is present then it
proceeds otherwise it terminates.
 If water is present, then it checks status of soil moisture sensor 2,
 If Region 2 is wet, motor will be off.
 If Region 2 is dry, valve 2 will open and motor will be on for 10 seconds.
 If Region 2 is humid, valve 2 will open and motor will be on for 5 seconds.
 During this, valve 1 will remain closed.
 System is usually OFF state.
 It is possible to get STATUS of the field.
 It is possible to make System ON whenever. Once System is ON, it will check the status
and supply the water one time only. Then again System is OFF.
 It is possible to make System OFF. But usually System is always will OFF condition.

Controlling the Module using MyMQTT Android App

MyMQTT is a simple Message Queue Telemetry Transport (MQTT) client for


Android. The service is being provided by Mosquitto of eclipse a service provider.

Features: Connect to MQTT v3.1 Broker (optional with username and password)
Subscribe to various topics.
Publish messages to a topic
Save messages
Filter received Messages

Step 1: Initial setups in app is to make. Go to Settings>>Broker URL>>”test.mosquitto.org”


(Figure 4.4a). Then client will connect to Broker URL (Figure 4.4b).

Step 2: Subscribe to a topic called bbbn. Go to Subscribe>>”bbbn”>>Add (Figure 4.4c). Once


subscription is successful, then messages will be received in Dashboard.
Step 3: Publish a message. Go to Publish>>Topic>>”bbbn”>>”—message--“>>Publish
(Figure 4.4d). Then message will be published in Dashboard and broker server.
“—messages—“may be STATUS, SYSTEM_ON, SYSTEM_OFF>

Depending upon messages published, different functions will be executed and client will
publish in Dashboard what it do? what it will be does? what it done?

The following figures shows screenshots of Dashboards depending upon Publish.

Figure 4.4a Initial Setup Figure 4.4b Connection to Broker URL


Figure 4.4c Subscribing a Topic Figure 4.4d Messages in Dashboard

Figure 4.4e Publsih of message(STATUS) Figure 4.4f Messages on Dashboard due to STATUS

Figure 4.4g Publish of Message(SYSTEM_ON) Figure 4.4h Message on Dashboard(SYSTEM_ON)


Figure 4.4i Message on Dashboard(SYSTEM_ON) Figure 4.4j Message on Dashboard(SYSTEM_ON)

Figure 4.4k Message on Dashboard(SYSTEM_ON) Figure 4.4l Message on Dashboard(SYSTEM_ON)


Thus result of the system can be verified.
CHAPTER 5: PROJECT EXPENDITURE

1. Arduino UNO Board - Rs.425/-


2. Wi-Fi Module - Rs.625/-
3. Soil Moisture Sensors (3) - Rs.360/-
4. Solenoid Valves (2) - Rs.600/-
5. Submersible water Pump - Rs.160/-
6. Water Supply Pipes - Rs.15/-
7. Relay Switch (3) - Rs.30/-
8. Transistor BC 547(3) - Rs.9/-
9. Diode IN 4007 (3) - Rs.6/-
10. LED - Rs.5/-
11. Battery 9V (2) - Rs.40/-
12. PCB Board - Rs.40/-
13. Connecting Wires - Rs.90/-
14. 2.54mm female header pins - Rs.40/-
15. Field Model - Rs.250/-

TOTAL COST - Rs.2695/-


CHAPTER 6: CONCLUSION

End The mechanized water system framework is imperative for advancing water assets
for a horticultural generation.This framework helps to screen naturally so we can lessen labor
and furthermore it demonstrates that utilization of water can be decreased for a given measure
of crisp biomass creation and furthermore this water system framework is used for substantial
greenhouse generation.
References

[1] W.A.Jury and H.J.Vaux,"The rising Global water emergency: Managing Scarcity and strife
between water clients." Adv.Army,vol.95,pp.1-76.
[2] Forrest S.Melton, Lee F.Johnson,Edwin.J.sheffner,and Ramakrishna, "Satellite Irrigation
Management Support with the Terrestrial Observation and Prediction System: A Framework for
incorporation of Satellite and Ein Agricultural Water Resource Management ."IEEE diary Vol
5,No 6,December 2012.
[3] A.Kumar,K.Kamal,M.O.Arshad, T.Vadamala, S.Mathavan,"Smart Irrigation Using Low-
Cost Moisture Sensors and Lora-based Communication".IEEE 2014 Global compassionate
Technology meeting. [4] Joaquin GutierrezJaguey, JaunFrancisco, Villa-Medina, Aracely Lopez
– Guzman and Miguel Angel Porta-Gandara, "Cell phone Irrigation Sensor" IEEE sensors
diary.vol.15.No.9.Sep 2015.
[5] B-G,Lee and W.Y.Chung."Driver sharpness observing utilizing a combination of facial
highlights and bio-signals."IEEE Sensors J.,12,no7,pp.Jul.2012
[6] Joaquin Gutierrez Jaguey, Juan Francisco Villa-Medina,Aljendra,Nieto,"Automated
Irrigation framework utilizing remote sensor organize and a GPRS Module".IEEE exchange on
Instrumentation and Measurement, vol.63,No.1,January 2014.
[7] S.Kolli and M.Zawodniok," Energy-effective multi-key security conspire for remote sensor
arrange,"in Proc.IEEE 34th conf.LNC.,oct.2005,pp.1-6.
[8] Wireless Medium Access Control and Physical layer detail:High rate remote individual
territory organize IEEE Standard 802.15.3,2003.
[9] C.Gomez and J.Paradells,"Wireless home robotization networks:A study of engineering and
advancements," IEEE Commun.Mag,vol.48,no.6,pp.92-101,jun.2010.

You might also like