Professional Documents
Culture Documents
TRAINING REPORT
ON
Bachelor of Technology
In
Branch ECE
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.
2.
Kamlesh Gehlot
3.
Kamlesh Kumar
4.
Sunil Choudhary
5.
Mahendra Patel
6.
7.
Jitendra Suthar
8.
Om Dev Singh
9.
Shravenram Prajapat
Counter Signed by
year
(Electronics and Communication Engineering), under the guidance of Mr. Gaurav Kumar.
(Signature of Guide)
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
12
13
17
18
19
21
22
22
22
3.5.APPLICATIONS...............................................................................
22
3.6. FEATURES......................................................................................
22
25
4.2. SPECIFICATION..............................................................................
25
27
4.4. BREADBOARD................................................................................
28
29
29
30
31
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.
10 | 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.
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.
2. Click the just download and also start to download, as shown in Figure
below
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:
Now open the ARDUINO software file and hardware system is connected to
it and last write program on it as shown in figure:
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.
Microcontroller ATmega328
Operating Voltage 5V
Boot loader
SRAM 2 KB
EEPROM 1 KB
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.
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
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.
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
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.5.
APPLICATIONS:
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
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.
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
Pin used:
D4-D7
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
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
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.
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.
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");
}}
dht.begin(); lcd.print("DHT11
test!");
}
PROJECT PICTURES:
REFERENCES
www.adafruit.com/products/50
www.arduino.cc
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