You are on page 1of 45

A

TRAINING REPORT
ON

HUMIDITY & TEMPERATURE SENSOR


USING ARDUINO
Submitted to the
Department of Electronics and Communication Engineering
In partial fulfilment of the requirements
For the degree of

Bachelor of Technology
In
Branch ECE

Guided ByMR.GAURAV KUMAR


SCIENTIST/ENGINEER SE
RRSC-WEST/NRSC/ISRO (JODHPUR)
DEPARTMENT OF ELECTRONIC & COMMUNICATION ENGINEERING

JIET GROUP OF INSTITUTIONS


(RAJASTHAN TECHNICAL UNIVERSITY)
2015-2016
1|Pag
e

CANDIDATES DECLARATION

We hereby declare that the work, which is being presented thesis work, entitled
HUMIDITY AND TEMPERATURE SENSOR USING ARDUINO in partial fulfilment
for the award of Degree of Bachelor of Technology in Deptt. Of Electronics and
Communication Engineering and submitted to the Department of Electronics and
Communication Engineering, JIET GROUP OF INSTITUTE Rajasthan Technical
University is a record of my own work carried under the Guidance of Mr. Gaurav Kumar
Scientist/Engineer work in Regional Remote Sensing Centre(RRSC),Jodhpur.

Candidates Names
1.

Lalit Kumar Khushlani

2.

Kamlesh Gehlot

3.

Kamlesh Kumar

4.

Sunil Choudhary

5.

Mahendra Patel

6.

Krunal Singh Solanki

7.

Jitendra Suthar

8.

Om Dev Singh

9.

Shravenram Prajapat

JIET GROUP OF INSTITUTE

Counter Signed by

Department of Electronics Engineering


JIET GROUP OF INSTITUTIONS
CERTIFICATE
This is to certify that thesis report entitled HUMIDITY AND TEMPERATURE SENSOR
rd

USING ARDUINO being submitted by GROUP OF STUDENTS (9) of 3

year

(Electronics and Communication Engineering), under the guidance of Mr. Gaurav Kumar.

(Signature of Guide)

Mr. Gaurav Kumar


Scientist/Engineer SE
Regional Remote Sensing Centre (West)
NRSC/ISRO, JODHPUR
CAZRI Campus
Department of Space (DOS)

DATE:
STAMP:

ACKNOWLEDGEMENT
The satisfaction that accompanies the successful completion of any task would be incomplete
without the mention of people who made it possible, whose constant guidance and
encouragement crown all efforts with success. Thus, the successful completion of this project
is attributed to the great and indispensable help I have received from different people.
It is not the brain that matter the most, but that which guide them: The character, the heart,
generous qualities and progressive force
I would like to take opportunity to extend my heartfelt gratitude to Dr. A T Jeyaseelan,
General Manager, RRSC-West, Jodhpur ISRO, for support in carrying out the training.
I wish to express my sincere regards and gratitude to my guide Shri. Gaurav Kumar,
Scientist/Engineer SE in ISRO Jodhpur for his continuous guidance and encouragement,
which has led to successful completion of this training.
I owe special debt of gratitude to respected Prof.Aswathy Puthukulam for her constant
support and guidance throughout the course of my work. Her sincerity, thoroughness and
perseverance have been a constant source of inspiration for me. It is only her cognizant
efforts that mine endeavour have seen light of the day.
Candidates Names
1. Lalit Kumar Khushlani
2. Kamlesh Gehlot
3. Kamlesh Kumar
4. Sunil Choudhary
5. Mahendra Patel
6. Krunal Singh Solanki
7. Jitendra Suthar
8. Om Dev Singh
9. Shravenram Prajapat

ABSTRACT
Humidity is one of the important parameters in the atmospheric gases. The natural air can
contain humidity and varies from season to season. Humidity indicates the likelihood of
precipitation, dew, or fog. There are three main measurements of humidity: absolute, relative
and specific. Absolute humidity is the water content of air. Relative humidity, expressed as a
percent, measures the current absolute humidity relative to the maximum for that
temperature. Specific humidity is a ratio of the water vapour content of the mixture to the
total air content on a mass basis.
The temperature is a numerical measure of hot and cold in a body that is in its own state of
internal thermal equilibrium. Its measurement is by detection of heat radiation or
environment temperature changes. Temperature is important in all fields of natural science,
including physics, geology, chemistry, atmospheric sciences and biology.
In this project hardware is designed to measure the temperature and humidity that based on
ARDUINO UNO microcontroller which controls all its functions. A humidity and
temperature sensor DHT11 is used for sensing the humidity and temperature of the
environment and the system displays the humidity and temperature on an LCD in the range of
15%RH to 95%RH and 0C to +75C respectively. We combined together an Arduino with a
DHT11 sensor, 1602 LCD keypad shield display and a Ethernet cable or printer cable and
using DHT library function to run the program.

TABLE OF CONTENTS
PAGE NO.
CANDIDATES DECLARATION.......................................................................

CERTIFICATE..................................................................................................

ACKNOWLEDGEMENT...................................................................................

ABSTRACT......................................................................................................

ISRO AT A GLANCE........................................................................................

Chapter 1. INTRODUCTION............................................................................
1.1. ARDUINO......................................................................................

12

1.2. ARDUINO SOFTWARE INSTALLATION PROCESSS....................

12

1.3. STEPS TO DOWNLOADING ARDUINO SOFTWARE.....................

13

Chapter 2. INTRODUCTION TO ARDUINO UNO BOARD..............................


2.1. ARDUINO......................................................................................

17

2.2. ARDUINO UNO SPECIFICATION...................................................

18

2.3. PIN CONFIGURATION......................................................................

19

Chapter 3.TEMPERATURE AND HUMIDITY SENSOR...................................


3.1. DHT11 TEMPERATURE AND HUMIDITY SENSOR.......................

21

3.2. TECHNICAL SPECIFICATION.........................................................

22

3.3. ELECTRICAL CHARACTERISTICS..................................................

22

3.4. PIN DESCRIPTION..........................................................................

22

3.5.APPLICATIONS...............................................................................

22

3.6. FEATURES......................................................................................

22

Chapter 4. LCD KEYPAD SHIELD DISPLAY.....................................................


4.1. ARDUINO SHIELD KEYPAD...........................................................

25

4.2. SPECIFICATION..............................................................................

25

4.3. PINOUT DIAGRAM.........................................................................

27

4.4. BREADBOARD................................................................................

28

Chapter 5.PROCESS OF CODING IN ARDUINO...............................................


5.1. WIRING UP OF DHT11.....................................................................

29

5.2. DHT LIBRARY AND TEST SKETCH................................................

29

5.3. LCD TEST SKETCH.........................................................................

30

5.4. COMBINING DHT11 AND LCD SKETCH........................................

31

5.5. APPLICATION AREAS OF TEMPERATURE AND HUMIDITY SENSOR............................33

PROJECT PICTURE..........................................................................................

REFERENCES......................................................................................................

35

36

LIST OF FIGURES
PAGE NO.
FIG.1. THE ORGANIZATION CHART OF ISRO.................................................
FIG.2. ARDUINO UNO R3 BOARD......................................................................
FIG.3.DOWNLOADING ARDUINO SOFTWARE.............................................
FIG.4.DOWNLOAD THE FILE............................................................................
FIG.5.INSTALLING ARDUINO 1.6.5 SOFTWARE............................................
FIG.6.DEVICE MANAGER FILE........................................................................
FIG.7.WRITTEN CODE IN ARDUINO 1.6.5......................................................
FIG.8.PINOUT DIAGRAM OF ARDUINO UNO................................................
FIG.9.DIMENSIONS OF DHT11..........................................................................
FIG.10.DHT11 TEMPERATURE & HUMIDITY SENSOR..............................
FIG.11.CONNECTION OF ARDUINO WITH DHT11......................................
FIG.12.LCD KEYPAD SHIELD PINOUT........................................................
FIG.13.1602 LCD KEYPAD SHIELD................................................................
FIG.14.BREADBOARD......................................................................................

ISRO AT A GLANCE
This Introduction gives an overview of the Profile, Alliance, and Fields of specification, Objectives
and Functions of Indian Space Research Organization and the range of services it performs
Organization Introduction

Space activities in the country started during early 1960s with the
scientific investigation of upper atmosphere and ionosphere over the
magnetic equator that passes over Thumba near Thiruvananthapuram
using small sounding rockets Realising the immense potential of space
technology for national development, Dr. Vikram Sarabhai, the visionary
leader envisioned that this powerful technology could play a
meaningful role in national development and solving the problems of
common man Thus, Indian Space programme born in the church
beginning, space activities in the country, concentrated on achieving self
reliance and developing capability to build and launch communication
satellites
for
television
broadcast,
telecommunications
and
meteorological applications; remote sensing satellites for management of
natural resources.
The objective of ISRO is to develop space technology and its application
to various national tasks. Accordingly, Indian Space Research
Organisation (ISRO) has successfully operationalised two major satellite
systems namely Indian National Satellites (INSAT) for communication
services and Indian Remote Sensing (IRS) satellites for management of
natural resources; also, Polar Satellite Launch Vehicle (PSLV) for launching
IRS type of satellites and Geostationary Satellite Launch Vehicle (GSLV)
for launching INSAT type of satellites.
The Space Commission formulates the policies and oversees the implementation of the
Indian space programme to promote the development and application of space science and
technology for the socio-economic benefit of the country. DOS implements these
programmes through, mainly Indian Space Research Organisation (ISRO), Physical Research
Laboratory (PRL), National Atmospheric Research Laboratory (NARL), North Eastern-Space
Applications Centre (NE-SAC) and Semi-Conductor Laboratory (SCL). The Antrix
Corporation, established in 1992 as a government owned company, markets the space
products and services.

Fig.1.The Organization chart of ISRO

Five Regional Remote Sensing Service Centres (RRSCs) established under


National Natural Resources Management System (NNRMS) by DOS at
Bangalore, Jodhpur, Kharagpur (recently relocated to Kolkata), Dehradun
and Nagpur have been integrated with NRSC and renamed as Regional
Remote Sensing Centres (RRSCs) South, West, East, North and Central
respectively on December2,2009.
RRSCs support various remote sensing tasks specific to their regions as well as at the
national level. RRSCs are carrying out application projects encompassing all the fields of
natural resources like agriculture and soils, water resources, forestry, oceanography, geology,
environment and urban planning.
Apart from executing application projects, RRSCs are involved in
software development, customization and packaging specific to user
requirements and conducting regular training programmes for users in
Remote Sensing Application, digital techniques, GIS and theme based
10 | P a
ge

applications. RRSC also provides expert advice / consultancy towards


promotion of technology in the country. These centres are located at:

10 | P a
ge

Jodhpur (Western Region)


Nagpur (Central Region)
Kharagpur (Eastern Region)
Bangalore (Southern Region)
RRSC: Jodhpur
Jodhpur centre was established in January 1988 under the aegis of NNRMS
at CAZRI campus covering North-western part of the country (Rajasthan,
Delhi, Gujarat, and Haryana, Punjab). The centre is equipped with
adequate facilities of hardware, software and expertise, and has assisted
various central and state Government agencies, research, aadei
istitutios ad NGOOs i sure, aageet oitorig ad plaig for
natural resources using satellite data, digital techniques and geographical
information system.
Objectives and Functions
Provide facilities for digital image analysis and GIS.
Guide/Assists the users in applications of digital techniques and GIS.
Develop and demonstrate techniques / software in the new areas of
applications.
Provide support service to conduct national projects and promote
remote sensing.
Train scientists from user agencies in RS data applications, digital
techniques and GIS. Train students and staff of academic
Institutions.
Fields of specification
Regional Planning, Regional Development & Geography.
Water Resources and Irrigation Management.
Land use and Urban Planning, system planning, installation &
maintenance.
Environment, Ecology and forest.
Agronomy, Agricultural Engineering, Socio-economic data analysis and Watershed
Development Planning.
11 | P a
ge

CHAPTER 1
INTRODUCTION
We have design a hardware system to measure temperature and humidity in a room or outside
the room that is environment .so we use a DHT11 temperature and humidity sensor to
measure has a temperature range of 0oC to 70oC, and humidity range of 20%RH to
90%RH.this sensor has a both type of property. To display the values of temperature and
humidity we use 1602 lcd keypad shield display and used a main component which
ARDUINO UNO on which we put lcd keypad display connected to DHT11 sensor which
connected to breadboard. Further system is connected to computer through Ethernet cable.
Here DHT11 measures the humidity and temperature and sends an analog voltage to the
microcontroller ARDUINO UNO.

1.1. ARDUINO:
Arduino is an open-source design for a microcontroller interface board, it is actually rather
more than that, as it encompasses the software development tools that you need to program
an Arduino board, as well as the board itself. There is a large community of construction,
programming, electronics, and even art enthusiasts willing to share their expertise and
experience on the Internet. Arduino is a small microcontroller board with a USB plug to
connect to your computer and a number of connection sockets that can be wired up to
external electronics, such as motors, relays, light sensors, laser diodes, loudspeakers,
microphones, etc. They can either be powered through the USB connection from the
computer or from a 9V battery. They can be controlled from the computer or programmed by
the computer and then disconnected and allowed to work independently.

FIG.2. Arduino Uno R3 Board

1.2. ARDUINO SOFTWARE INSTALLATION PROCESS:


To download the ARDUINO software, first go to the Arduino site (www.arduino.cc) and
download the software for windows, PC, ubuntu or LINUX. You can then either buy an
official Arduino by clicking the Buy Arduino software. After downloading this software, install
it on pc or laptop for further programming. These are intended for different types of
applications. They can all be programmed from the same Arduino development software,
and in general, programs that work on one board will work on all. Most of the projects we
can use Arduino uno r3 because it is easily handle for new user. When you are making a
project with an Arduino, you will need to download programs onto the board using a USB
lead between your computer and the Arduino. This is one of the most convenient things
about using an Arduino. Many microcontroller boards use separate programming hardware
to get programs into the microcontroller. With Arduino, its all contained on the board itself.
This also has the advantage that you can use the USB connection to pass data back and
forth between an Arduino board and your computer. For instance, you could connect a
temperature sensor to the Arduino and have it repeatedly tell your computer the
temperature. On the older arduino uno r3 boards, you will find a jumper switch immediately
below the USB socket. With the jumper fitted over the top two pins, the board will receive its
power from the USB connection.
When over the middle and bottom pins, the board will be powered from an external power
supply plugged into the socket below. On the newer Uno boards, there is no such jumper
and the supply switches automatically from USB to the 9V socket. The power supply can be
any voltage between 7 and 12 volts. So a small 9V battery will work just fine for portable
applications. Typically, while you are making your project, you will probably power it from
USB for convenience. When you are ready to cut the umbilical cord (disconnect the USB
lead), you will want to power the board independently. This may be with an external power
adaptor or simply with a 9V battery connected to a plug to fit the power socket.
There are two rows of connectors on the edges of the board. The row at the top of the
diagram is mostly digital (on/off) pins, although any marked with PWM can be used as
analog outputs. The bottom row of connectors has useful power connections on the left and
analog inputs on the right. These connectors are arranged like this so that so-called
shield boards can be plugged on to the main board in a piggyback fashion. It is possible
to buy ready-made shields for many different purposes you can also use prototyping shields
to create your own shield designs.

We will use these Protoshields in some of our projects. Shields usually

have through

connectors on their pins, which mean that you can stack them on top of each other. So a
design might have three layers: an Arduino board on the bottom, a GPS shield on it, and
then an LCD display shield on top of that.

1.3.

STEPS TO DOWNLOAD ARDUINO SOFTWARE:


1. To download this software goes to
https://www.arduino.cc/en/main/software and
doload for our PCOs as sho i figure elo:

FIG.3. Downloading arduino software

2. Click the just download and also start to download, as shown in Figure
below

FIG.4. DOWNLOADING THE FILES

3. After downloading install it .

FIG.5. INSTALLING ARDUINO 1.6.5 SOFTWARE


Installing
Drivers:

The et task is to istall the driers for our Arduio oardd s USB iterfae.
1. Connect your Arduino to your PC with the USB cable. After a few moments an error message
will be displayed, which will say something like Device driver software not successfully
istalled. Just lose that dialog or alloo.
2. Open the my computer property& Open the Device Manager and scroll
down until you see the Arduino port, as shown in Figure:

FIG.6.DEVICE MANAGER FILES

Now open the ARDUINO software file and hardware system is connected to
it and last write program on it as shown in figure:

FIG.7. WRITTEN CODE IN ARDUINO 1.6.5

CHAPTER 2
INTRODUCTION TO ARDUINO UNO BOARD
2.1 ARDUINO:
An Arduino is a tiny computer that you can program to process inputs and outputs going to
and from the chip. The Arduino are what is known as a Physical or Embedded Computing
platform, which means that it is an interactive system that through the use of hardware and
software can interact with its environment.
For example, a simple use of the Arduino would be to turn a light on for a set period of time,
lets say 30 seconds; after a button has been pressed (we will build this very same project
later in the book). In this example, the Arduino would have a lamp connected to it as well as
a button. The Arduino would sit patiently waiting for the button to be pressed. When you
press button it would then turn the lamp on and start counting. Once it had counted 30
seconds it would then turn the lamp off and then carry on sitting there waiting for another
button press. You could use this set-up to control a lamp in an under-stairs cupboard for
example.
When the cupboard door was opened and automatically turns the light on, turning it off after
a set period of time.
The Arduino can be used to develop stand-alone interactive objects or it can be connected to
a computer to retrieve or send data to the Arduino and then act on that data (e.g. Send sensor
data out to the internet).
The Arduino can be connected to Leds. Dot Matrix displays, LED displays, buttons,
switches, motors, temperature sensors, pressure sensors, distance sensors, webcams, printers,
GPS receivers, Ethernet modules.
The Arduino board is made of an Atmel AVR Microprocessor, a crystal or oscillator
(basically a crude clock that sends time pulses to the microcontroller to enable it to operate at
the correct speed) and a 5-volt linear regulator. Depending on what type of Arduino you
have, you may also have a USB connector to enable it to be connected to a PC or Mac to
upload or retrieve data. The board exposes the microcontrollers I/O (Input/output) pins to
enable you to connect those pins to other circuits or to sensors, etc.
To program the Arduino (make it do what you want it to) you also use the Arduino IDE
(Integrated Development Environment), which is a piece of free software, that enables you to
program in the language that the Arduino understands. In the case of the Arduino the
language is C. The IDE enables you to write a computer program, which is a set of step-by
step instructions that you then upload to the Arduino. Then your Arduino will carry out those
instructions and interact with the world outside. In the Arduino world, programs are known as
sketches.
The Arduino hardware and software are both Open Source, which means the code, the
schematics, design, etc. are all open for anyone to take freely and do what they like with it.

This means there is nothing stopping anyone from taking the schematics and PCB designs of
the Arduino and making their own and selling them. This is perfectly legal, and indeed the
whole purpose of Open Source, and indeed the Freeduino that comes with the Earthshine
Design Arduino Starter Kit is a perfect example of where someone has taken the Arduino
PCB design, made their own and are selling it under the

Freeduino name. You could even make your own 10 Arduino, with just a few cheap
components, on a breadboard.
The only stipulation that the Arduino development team put on outside developers is that the
Arduino name can only be used exclusively by them on their own products and hence the
clone boards have names such as Freeduino, Boarduino, Roboduino, etc. As the designs are
open source, any clone board, such as the Freeduino, is 100% compatible with the Arduino
and therefore any software, hardware, shields, etc. will all be 100% compatible with a
genuine Arduino. The Arduino can also be extended with the use of shields which circuit
boards are containing other devices (e.g. GPS receivers, LCD Displays, Ethernet connections,
etc.) that you can simply slot into the top of your Arduino to get extra functionality. You
dont have to use a shield if you dont want to as you can make the exact same circuitry using
a breadboard, some Vero board or even by making your own PCBs.
There are many different variants of the Arduino available. The most common one is the
Diecimila or the Duemilanove. You can also get Mini, Nano and Bluetooth Arduinos.
New to the product line is the new Arduino Mega with increased memory and number of I/O
pins. Probably the most versatile Arduino, and hence the reason it is the most popular, is the
Duemilanove. This is because it uses a standard 28 pin chip, attached to an IC Socket. The
beauty of this systems is that if you make something neat with the Arduino and then want to
turn it into something permanent (e.g. Or under stairs cupboard light), then instead of using
the relatively expensive Arduino board, you can simply use the Arduino to develop your
device, then pop the chip out of the board and place it into your own circuit board in your
custom device. You would then have made a custom embedded device, which is really cool.
The Arduino is an amazing device and will enable you to make anything from interactive
works of art to robots. With a little enthusiasm to learn how to program the Arduino and
make it interact with other components a well as a bit of imagination, you can build anything
you want.

2.2. ARDUINO UNO SPECIFICATION:

Microcontroller ATmega328

Operating Voltage 5V

Input Voltage (recommended) 7-12V

Input Voltage (limits) 6-20V

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

Analog Input Pins 6

DC Current per I/O Pin 40 mA

DC Current for 3.3V Pin 50 mA

Flash Memory 32 KB of which 0.5 KB used by

Boot loader

SRAM 2 KB

EEPROM 1 KB

Clock Speed 16 MHz

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

VIN. The input voltage to the Arduino board when it's using an external power source
(as opposed to 5 volts from the USB connection or other regulated power source).
You can supply voltage through this pin, or, if supplying voltage via the power jack,
access it through this pin.
GND (3): Short for Ground. There are several GND pins on the Arduino, any of
which can be used to ground your circuit.

20 | P a
ge

5V (4) & 3.3V (5): As you might guess, the 5V pin supplies 5 volts of power, and the
3.3V pin supplies 3.3 volts of power. Most of the simple components used with the
Arduino run happily off of 5 or 3.3 volts.
Analog (6): The area of pins under the Analog Inlabel (A0 through A5 on the UNO)
are Analog In pins. These pins can read the signal from an analog sensor (like a
temperature sensor) and convert it into a digital value that we can read.
Digital (7): Across from the analog pins are the digital pins (0 through 13 on the
UNO). These pins can be used for both digital input (like telling if a button is pushed)
and digital output (like powering an LED).
PWM (8): You may have noticed the tilde (~) next to some of the digital pins (3, 5, 6,
9, 10, and 11 on the UNO). These pins act as normal digital pins, but can also be used
for something called Pulse-Width Modulation (PWM). We have these pins as being
able to simulate analog output (like fading an LED in and out).
AREF (9): Stands for Analog Reference. Most of the time you can leave this pin
alone. It is sometimes used to set an external reference voltage (between 0 and 5
Volts) as the upper limit for the analog input pins as shown in fig.

FIG.8.PINOUT DIAGRAM OF ARDUINO UNO

Reset Button
Just like the original Nintendo, the Arduino has a reset button (10). Pushing it will
temporarily connect the reset pin to ground and restart any code that is loaded on the
Arduino. This can be very useful if your code doesnt repeat, but you want to test it multiple
times. Unlike the original Nintendo however, blowing on the Arduino doesnt usually fix any
problems.
21 | P a
ge

Power LED Indicator


Just beneath and to the right of the word UNO on your circuit board, theres a tiny LED
next to the word ON(11). This LED should light up whenever you plug your Arduino into a
power source. If this light doesnt turn on, theres a good chance something is wrong. Time to
re-check your circuit!

TX RX LEDs
TX is short for transmit, RX is short for receive. These markings appear quite a bit in
electronics to indicate the pins responsible for serial communication. In our case, there are
two places on the Arduino UNO where TX and RX appear once by digital pins 0 and 1, and
a second time next to the TX and RX indicator LEDs (12). These LEDs will give us some
nice visual indications whenever our Arduino is receiving or transmitting data (like when
were loading a new program onto the board).
Main IC
The black thing with all the metal legs is an IC, or Integrated Circuit (13). Think of it as the
brains of our Arduino. The main IC on the Arduino is slightly different from board type to
board type, but is usually from the ATmega line of ICs from the ATMEL company. This can
be important, as you may need to know the IC type (along with your board type) before
loading up a new program from the Arduino software. This information can usually be found
in writing on the top side of the IC. If you want to know more about the difference between
various ICs, reading the datasheets is often a good idea.

CHAPTER 3
TEMPERATURE AND HUMIDITY SENSOR
3.1. TEMPERATURE AND HUNIDITY SENSOR (DHT11):
The DHT11 is a basic, ultra low cost digital temperature and humidity sensor. It uses a
capacitive humidity sensor and a thermostat to measure the surrounding air, and spits out a
digital signal on the data pin. Its fairly simple to use but requires careful timing to grab data.
To only real downside of this sensor are you can only get new data from it once every 2
seconds. In the market you will find many models, some of this has 3 or 4 pins, so be careful
and read the technical specification.

FIG.10. DHT11 TEMPERATURE AND HUMIDITY SENSOR

For this project we will require the following materials1. DHT11 temperature and humidity sensor
2. Wires.
3. Arduino UNO R3
4.10K resistor for the DHT11 pull-up
5.16x2 LCD display HD44780

3.1.1DIMENSIONS (In mm):

FIG.9. DIMENSIONS OF DHT11 (In mm)

3.2. TECHNICAL SPECIFICATIONS:

Relative humidity
Resolution: 16Bit
Repeatability: 1% RH
Accuracy: At 25% 5% RH
Interchange ability: fully interchangeable
Response time: 1 / e (63%) of 25% 6s
1m / s air 6s
Hysteresis: < 0.3% RH
Long-term stability: < 0.5% RH / yr in
Temperature
Resolution: 16Bit
Repeatability: 0.2%
Range: At 25% 2%
Response time: 1 / e (63%) 10S

3.3. ELECTRICAL CHARACTERISTICS:


Power supply: DC 3.5~5.5V
Supply Current: measurement 0.3mA standby 60A
Sampling period: more than 2 seconds

3.4. PIN DESCRIPTION:


1, the VDD power supply 3.5~5.5V DC
2 DATA serial data, a single bus
3, NC, empty pin
4, GND ground, the negative power

3.5.

APPLICATIONS:

HVAC, dehumidifier, testing and inspection equipment, consumer goods,


automotive, automatic control, data loggers, weather stations, home
appliances,
humidity
regulator,
medical
and
other
humidity
measurement and control.

3.6.

FEATURES:

Low cost, long-term stability, relative humidity and temperature measurement, excellent
quality, fast response, strong anti-interference ability, long distance signal transmission,
digital signal output, and precise calibration.

DHT22 Sensor :

Fig : DHT22
DHT22 output calibrated digital signal. It utilizes exclusive digital-signal-collectingtechnique and humidity sensing technology, assuring its reliability and stability.Its sensing
elements is connected with 8-bit single-chip computer.
Every sensor of this model is temperature compensated and calibrated in accurate calibration
chamber and the calibration-coefficient is saved in type of programme in OTP memory, when
the sensor is detecting, it will cite coefficient from memory.
Small size & low consumption & long transmission distance (20m) enable DHT22 to be
suited in all kinds of harsh application occasions.
Single-row packaged with four pins, making the connection very convenient.

Technical Specification:
Model

DHT22

Power supply
Output signal
Sensing element

3.3-6V DC
digital signal via single-bus
Polymer capacitor

Operating range
Accuracy
Resolution or sensitivity

humidity 0-100%RH;
temperature 40~80Celsius
humidity +-2%RH(Max +-5%RH);
temperature <+0.5Celsius0.1%RH;
humidity
temperature 0.1Celsius

Repeatability
Humidity
Long-term Stability
Sensing period

humidity +-1%RH

temperature +-0.2Celsius

Interchangeability
Dimensions

fully interchangeable
small size 14*18*5.5mm; big size 22*28*5mm

+-0.5%RH/year
Average: 2s

Fig.11. CONNECTION OF ARDUINO WITH DHT11


In the next figure we can see the pin is connected to pin digital to in Arduino board, the
middle one to 5 volt and the last one is connected to ground.

Fig. : Connection of DHT11

Basic arduino code:


Setup ( ): A function present in every Arduino sketch. Run once before the loop ( )
function. Often used to set pin mode to input or output. The setup ( ) function looks like:
Void setup ( ) {
//code goes here
}
loop ( ): A function present in every single Arduino sketch. This code happens over and
over again. The loop ( ) is where (almost) everything happens. The one exception to this is
setup ( ) and variable declaration. ModKit uses another type of loop called forever ( )
which executes over Serial. The loop ( ) function looks like:

Void loop ( ) {
//code goes here
}
Input: A pin mode that intakes information.
Output: A pin mode that sends information.
HIGH: Electrical signal present (5V for Uno). Also ON or True in Boolean logic.
LOW: No electrical signal present (0V). Also OFF or False in Boolean logic.
Digital Read: Get a HIGH or LOW reading from a pin already declared as an input.
Digital Write: Assign a HIGH or LOW value to a pin already declared as an output.
Analog Read: Get a value between or including 0 (LOW) and 1023 (HIGH). This allows
you to get readings from analog sensors or interfaces that have more than two states.
Analog Write: Assign a value between or including 0 (LOW) and 255 (HIGH). This allows
you to set output to a PWM value instead of just HIGH or LOW.
PWM: Stands for Pulse-Width Modulation, a method of emulating an analog signal
through a digital pin. A value between or including 0 and 255. Used with analog Write.
Price:
Rs 1800-2000

Applications:
In mapping
Home application
In electrical and electronics projects
In quad copters
Home heating
Smart 3D printing
RFID projects
Ventilation
Air conditioning systems
Google and satellite application

CHAPTER 4
LCD KEYPAD SHIELD DISPLAY
4.1. ARDUINO LCD SHIELD KEYPADS:
This is a very popular LCD Keypad shield for Arduino and other variants. It includes a 2x16
LCD display and 6 momentary push buttons. Pins 4, 5, 6, 7, 8, 9 and 10 are used to interface
with the LCD. Just one Analog Pin 0 is used to read the five pushbuttons. The LCD shield
supports contrast adjustment and back-lit on/off functions. It also exposes five analog pins
with DF Robot colour code for easy analog sensor plugging and display. The on board LED
indicates power on.
This design is great since easily lets you keep connecting sensors to the rest of the pins, and
use it for monitoring or menu selection with the push buttons even for gaming. Often project
applications require testing or debugging. Displaying information right away help on most
occasions when a computer is not at reach. If you are planning to build something not
attached to a computer and you need to check what is going on when you place it on position,
this addition will prove very valuable to make sure the program is running well.
The used LCD pins are not exposed on top side of the board leaving only the unused ones.
This way, conflict with LCD pins on top of the board will not happen anymore. This design
includes an APC / Bluetooth v3 socket to enable you data transmission with your robot.This
is a 16x2 LCD and Keypad shield for Arduino Uno, Diecimila, Duemilanove and Freeduino
boards.

Blue Backlight with white words


uses 4 Bit Arduino LCD Library
Left, Right, Up, Down and Select buttons
Screen contrast adjustment
Arduino Reset button

The board uses different pins to the Arduino example sketches, so to make the display work,
use the following sequence of pins when starting the library:
Liquid Crystal LCD (8, 9, 4, 5, 6, 7);
The buttons are connected to only one analog input pin through resistors to give a different
voltage for each button, thus saving on input/output pins. Reading the buttons is easy and
example code is shown below:

4.2. SPECIFICATION:

Operating Voltage:5V

5 Push buttons to supply a custom menu control panel

RST button for resetting arduino program

Integrate a potentiometer for adjusting the backlight

Pin used:
D4-D7

-> LCD Data transmission

D8
-> Register Select
D9
-> Enable pin
D10
-> Backlight control

APC&BT pin header for connecting wireless devices, directly compatible with:
o
APC220 Radio Communication Module
o
DF Robot Bluetooth V3

Expanded available I/O pins


Expanded Analog Pin out with standard DF Robot configuration for fast sensor
extension

Dimension: 80 x 58 mm
o
o
o

Pin Connections
Pin
Analog 0
Digital 4
Digital 5
Digital 6
Digital 7
Digital 8
Digital 9

Function
Buttons (select, up, right, down and left)
DB4
DB5
DB6
DB7
RS (Data or Signal Display Selection)
Enable

Note: Do not use pin Digital 10 when this board is plugged in.
The board is a little bigger than an Arduino UNO (measuring 8cm x 6cm). This can be seen in the
images.
// include the library code:
#include <LiquidCrystal.h>
// initialize the library with the numbers of the interface pins LiquidCrystal lcd(8, 9, 4, 5, 6,
7);
void setup() {
// set up the LCD's number of columns and rows: lcd.begin(16, 2);
// Print a message to the LCD.
lcd.setCursor(0, 0); lcd.print("LCD Key
Shield"); lcd.setCursor(0, 1);
lcd.print("Press Key :");
}
void loop() { int x;
x = analogRead (0);
lcd.setCursor(10, 1); if (x
< 60) {
lcd.print ("Right ");
}
else if (x < 200) { lcd.print
("Up
");
}
else if (x < 400){ lcd.print
("Down );
}

30 | P a
ge

else if (x < 600){ lcd.print


("Left );
}
else if (x < 800){ lcd.print
("Select");
}

4.3. PINOUT DIAGRAM:

FIG12. LCD keypad shield pin out

Fig.:13.16x2 LCD KEYPAD SHIELD

31 | P a
ge

4.4. BREADBOARD:
A breadboard is used to build and test circuits quickly before finalizing any circuit
Design. The breadboard has many holes into which circuit components like ICs and
Resistors can be inserted. A typical breadboard is shown below:

The bread board has strips of metal which run underneath the board and connect the holes
On the top of the board. The metal strips are laid out as shown below. Note that the top
And bottom rows of holes are connected horizontally while the remaining holes are
Connected vertically.

FIG.14. BREADBOARD
To use the bread board, the legs of components are placed in the holes. Each set of holes
connected by a metal strip underneath forms a node. A node is a point in a circuit where
Two components are connected. Connections between different components are formed
By putting their legs in a common node.
The long top and bottom row of holes are usually used for power supply connections. The
Rest of the circuit is built by placing components and connecting them together with
Jumper wires. ICs are placed in the middle of the board so that half of the legs are on one
Side of the middle line and half on the other.

CHAPTER 5
PROCESS OF CODING IN ARDUINO
We wanted them to check the temperature and humidity of the room
both by checking an LCD display in the room and also via a web page. We
put together an Arduino with a DHT11 sensor, 16x2 LCD display and
ENC28J60 Ethernet module. We did the project in stages first getting the
DHT11 portion working using the DHT11 library and examples from
Adafruit, then adding an LCD display and finally adding Ethernet using
the Ether Card library and modifying their example code. This makes
troubleshooting a lot easier and I could build/learn the code as I went
along. We have taken code from the various examples provided with
the necessary libraries. The DHT11 sensor isn't very accurate - about plus
and ius 2 degrees Celsius ad 5% aura for huidit. WeOll
proal e changing to a DHT22 which is plus and minus .5 degrees
Celsius and between 2% and 5% for humidity. The good news is it's an
easy change in the code.

5.1.

WIRING UP OF DHT11:

The DHT11 and DHT12 have 4 pins. Looking at it with the side with square
cut outs in it the pins are from left to right:
+5v
Signal

Not used

GND

It also requires a 10k pull-up resistor between +5V and Signal For this
project the Signal lead goes to Digital Pin 2 on the Arduino The images
show the DHT11 soldered into a prototype shield with the signal lead
going to the Arduino digital Pin2.

5.2.

DHT11 LIBRARY AND TEST SKETCH:

Adafruit have a DHT11 library and example code that makes it easy to
test the DHT11 and get values to display on the serial window of the
Arduino IDE
Download the library from Adafruit, the link takes you to the
"GitHub" page. Look for the zip file download button.
Unzip the files into your libraries folder. The best place to unzip to is
under your "My Documents\Arduino\Libraries" folder - later if you
upgrade the Arduino IDE the library will still be there.

If you browse to your libraries folder you should see a new


folder named DHT- sensor-library-master Rename it to DHT
Connect up your Arduino and start the IDE
-> Examples -> DHT and open DHTtester.
You will need to comment the line starting with #define DHTTYPE DHT22 by putting
a // in front of it and then uncomment the line starting with //#define DHTTYPE
DHT11by removing the two leading //'s.

Upload the sketch then open the serial window. You should see the temperature and
humidity level scrolling. If you breathe onto the sensor you should see the
temperature and humidity rise. It will take a few seconds as the sensor is slow.
In the example sketch the temperature and humidity variables are defines as "float", i.e. they
have decimal places. This can be changed to an "int" to remove the decimal places as they
aren't needed in this project. Find the lines: float h = dht.readHumidity (); float t =
dht.readTemperature (); and change them to: int h = dht.readHumidity (); int t =
dht.readTemperature ();
Upload the sketch and check the results in the serial window. You should see the temperature
as whole rather than decimal numbers. If you have a working sensor the next step is to
connect an LCD display and see the temp and humidity on it. Before you go onto the next
step you should save the sketch to a folder. This way if you need to troubleshoot later you can
load the minimal code needed to test the sensor. My test sketch:
// Example testing sketch for various DHT humidity/temperature sensors
// written by ladyada, public domain
#include "DHT.h"
#define DHTPIN 2 // what pin we're connected to
// uncomment whatever type you're using!
#define DHTTYPE DHT11 // DHT 11
//#define DHTTYPE DHT22 // DHT 22 (AM2302)
//#define DHTTYPE DHT21 // DHT 21 (AM2301)
// connect pin 1 (on the left) of the sensor to +5V
// connect pin 2 of the sensor to whatever your DHTPIN is
// connect pin 4 (on the right) of the sensor to GROUND
// connect a 10K resistor from pin 2 (data) to pin 1 (power) of the sensor
DHT dht (DHTPIN, DHTTYPE);
Void setup () { Serial.begin
(9600);
Serial.println ("DHTxx test!"); dht.begin ();
}
Void loop () { // Reading temperature or humidity takes about
250 milliseconds!
// Sensor readings may also be up to 2 seconds 'old' (its a very slow
sensor)
int h = dht.readHumidity();
int t = dht.readTemperature ();
// check if returns are valid, if they are NaN (not a number) then
something went wrong!
if (isnan(t) || isnan(h)) { Serial.println("Failed to read from
DHT");

}
else { Serial.print("Humidity: "); Serial.print
(h);
Serial.print (" %\t"); Serial.print("Temperature:
");
Serial.print (t); Serial.println ("
*C");
}}

5.3. LCD TEST SKETCH:


The library for the HD44780 compatible LCD displays is included with the
latest versions of the Arduino IDE.
"Hello World" test sketch under File -> Examples -> Liquid
Crystal
Liquid Crystal LCD (12, 11, 5, 4, 3, 2); and change it to: Liquid Crystal LCD
(3, 4, 5, 6, 7, 8); we need to change the pin assignments as the Ethernet
controller we will add later uses pins 11 and 12.
Upload the sketch
Adjust the trimpot until you see the display clearly
you should see hello, world! On the top line and numbers
counting on the second line
Save the sketch to a folder.
The Arduino website has a good tutorial on LCD displays It also
covers the LCD. Begin, the lcd.print, and the LCD. Set Cursor

5.4. COMBINING DHT11 AND LCD SKETCH:


If the DHT11 test sketch and the LCD test sketch both work we can combine them. Load the
sketch below. Upload it to the Arduino - you should now see the temperature and humidity
displayed on the LCD screen. Again, breathe on the sensor and you should see the temp and
humidity change. If this is working save the sketch and we can move onto setting up the
Ethernet
#include "DHT.h"
#define DHTPIN 2
#define DHTTYPE DHT11
DHT dht(DHTPIN, DHTTYPE);
#include <LiquidCrystal.h> LiquidCrystal
lcd(8, 9, 4, 5, 6, 7); void setup()
{
Serial.begin(9600);
lcd.begin(16,2);

dht.begin(); lcd.print("DHT11
test!");
}

void loop() { delay(2000);


float h = dht.readHumidity();
// Read temperature as Celsius (the default) float t =
dht.readTemperature();
// Read temperature as Fahrenheit (isFahrenheit = true) float f =
dht.readTemperature(true);
// Check if any reads failed and exit early (to try again). if (isnan(h) ||
isnan(t) || isnan(f)) {
lcd.print("Failed to read from DHT sensor!"); return;
}
// Compute heat index in Fahrenheit (the default) float hif =
dht.computeHeatIndex(f, h);
// Compute heat index in Celsius (isFahreheit = false) float hic =
dht.computeHeatIndex(t, h, false);
// set the cursor to (0,0): lcd.setCursor(0,
0);
// print from 0 to 9:
lcd.print("Temp: ");
lcd.print(t); lcd.print("C");
// set the cursor to (16,1):
lcd.setCursor(0,1);
lcd.print("Humidity: ");
lcd.print(h); lcd.print("%");
delay(2000);
}

APPLICATION AREAS OF TEMPERATURE AND HUMIDITY SENSOR:


1. HVAC
2. Dehumidifier
3. Testing and inspection equipment
4. Consumer goods
5. Automotive
6. Automatic control
7. Data loggers
8. Weather stations
9. Home appliances
10.
Humidity regulator
11.
Medical and other humidity measurement and control.

PROJECT PICTURES:

REFERENCES

www.adafruit.com/products/50

www.arduino.cc

Data sheet of DHT11 Temperature & Humidity Sensor

www.arduino.cc/en/Main/arduinoBoardUno

www.instructables.com/id/Arduino

www.humiditycontrol.com/catalog

Duino4projects.com

www.forefront.io/a/beginners-guide-to-arduino

www.droboticsonline.com

8.http://linksprite.com/wiki/index.php5?title=File:1602_LCD_shield-A01.jpg#metadata

http://www.freetronics.com.au/products/lcd-keypad-shield#.VcE_Hq5SQfh

https://en.wikipedia.org/wiki/Zinccarbon_battery

You might also like