Digital Humidity Sensor With Lcd Display Using Microcontroller

14
1/20/2016 Digital humidity sensor with lcd display using microcontroller http://microcontrollerslab.com/digitalhumiditysensorusingpicmicrocontroller/ 1/14 Page Contents [hide] 1 Digital humidity sensor with LCD display using PIC microcontroller 2 Applications of humidity sensors 3 Humidity sensor selection 4 How to use HS1101 humidity sensor 5 components list 6 Circuit diagram of humidity sensor 7 Coding: DIGITAL HUMIDITY SENSOR WITH LCD DISPLAY USING PIC MICROCONTROLLER Digital humidity sensor with LCD display is used to measure relative percentage of water vapors in air. HS1101 capacitive ADVERTISEMENT PLEASE SUPPORT OUR WORK Our goal is to discover new solutions and provide working examples with Digital humidity sensor using PIC microcontroller BILAL Malik July 28, 2014 PIC microcontrollers 29 Comments Compact sensor Rugged magnetic speed and position sensors with IP 67/68 certification HOME PROJECTS TUTORIALS PROJECT IDEAS GENERAL ARTICLES PROJECT SERVICES

description

electrical project

Transcript of Digital Humidity Sensor With Lcd Display Using Microcontroller

Page 1: Digital Humidity Sensor With Lcd Display Using Microcontroller

1/20/2016 Digital humidity sensor with lcd display using microcontroller

http://microcontrollerslab.com/digital­humidity­sensor­using­pic­microcontroller/ 1/14

Page Contents [hide]

1 Digital humidity sensor with LCD display using PIC microcontroller

2 Applications of humidity sensors

3 Humidity sensor selection

4 How to use HS1101 humidity sensor

5 components list

6 Circuit diagram of humidity sensor

7 Coding:

DIGITAL HUMIDITY SENSOR WITH LCD DISPLAYUSING PIC MICROCONTROLLER

Digital humidity sensor with LCD display is used to measure

relative percentage   of water vapors in air. HS1101 capacitive

ADVERTISEMENT

PLEASE SUPPORTOUR WORK

Our goal is to discover

new solutions and provide

working examples with

Digital humidity sensorusing PIC microcontroller BILAL Malik July 28, 2014 PIC microcontrollers

29 Comments

Compact sensorRugged magnetic speed and position sensorswith IP 67/68 certification

HOME PROJECTS TUTORIALS PROJECT IDEAS

GENERAL ARTICLES PROJECT SERVICES

Page 2: Digital Humidity Sensor With Lcd Display Using Microcontroller

1/20/2016 Digital humidity sensor with lcd display using microcontroller

http://microcontrollerslab.com/digital­humidity­sensor­using­pic­microcontroller/ 2/14

humidity sensor is interfaced with PIC16F877A microcontroller

to measure humidity and LCD is used to display percentage

humidity in air.For humans there is certain limit for water vapors

presence in air. Above that limit relative humidity may cause

problems to human health.

APPLICATIONS OF HUMIDITY SENSORS

Humidity sensors have many application in industry and

domestic areas. Humidity means presence of water vapors in

air. Percentage of water vapors in air should be with in safety

limit. Otherwise It have harmful physical and chemical effects

on human beings and also in industrial products. Humidity

sensors have major applications in agriculture ,chemical, oil, gas

and medical industry. For example in agriculture industry

humidity sensor is used to measure moisture in fields. There are

also many other application of humidity sensor.You can search

them in Google.

HUMIDITY SENSOR SELECTION

When you search on Google, you will come across many

humidity sensors. All these humidity sensors have their

advantage and disadvantage. But I used capacitive HS1101

humidity sensor in this project. What is meant by capacitive

humidity sensor? All capactive senors give output in capacitive

form.They change their capacitance with respect to change in

sensing parameter like in HS1101 sensor sensing parameter is

amount of water vapors in air. The reason why I used this

humidity sensor?  Because

It can be used for highly sensitive applications.

less cost

easy to interface with microcontroller with small extra

circuitry

No calibration is required

It can be easily used for home appliances and industrial

control system.

HOW TO USE HS1101 HUMIDITY SENSOR

HS1101 is a  capacitive humidity sensor, so it can be used with

555 timer circuit to generate square wave of different

frequency. I assume you know about 555 timer IC and its use.

video, pictures, code and

schematics. Please

support our efforts.

SUBSCRIBE TOBLOG VIA EMAILEnter your email addressto subscribe to this blogand receive notificationsof new posts by email.

Join 261 other subscribers

Email Address

Subscribe

FIND US ONFACEBOOK

RELATED POSTS

Digital DC watt

meter using pic

Be the first of your friends to like this

Microcontrollers Lab6,145 likes

Like Page

Page 3: Digital Humidity Sensor With Lcd Display Using Microcontroller

1/20/2016 Digital humidity sensor with lcd display using microcontroller

http://microcontrollerslab.com/digital­humidity­sensor­using­pic­microcontroller/ 3/14

humidity sensor circuit with external circuitry

As shown in above figure, variable capacitor is used in place of

humidity sensor for simulation purpose. Becuase HS1101

simulation model is not available in Proteus. Above circuit is

used as a signal conditioning circuit to convert one form of

parameter to its other proportional parameter so that it can be

easily interfaced with any digital system or microcontroller. It is

not possible for any microcontroller to read change in

capacitance directly. That why above circuit is used to convert

changing capacitance of HS1101 into sqaure wave whose

frequency changed according to change in capacitance .

I have already post a tutorial on how to measure of square

wave using PIC 16F877A microcontroller. I recommend you to

go through article before going further in this project.

Square wave frequency measurement using PIC16F877A

microcontroller 

Now you know we can easily measure square wave frequency

with microcontroller. But now the question is how we will

convert  frequency back into relative humidity?   There is a

proper relationship between humidity and frequency. Go

through data sheet of HS1101 humidity sensor to know   more

about HS1101 sensor.

COMPONENTS LIST

microcontroller …

Bluetooth

module

interfacing with

pic

microcontrollers …

Line follower

robot using

microcontroller …

Green house

intelligent

control

system …

Digital

Ohmmeter

circuit using pic

microcontroller …

Automatic

electronic bell

for school

using pic

microcontroller …

Automatic

control of

street lights …

zero crossing

detector circuit

using pic

microcontroller …

Category,Reference,Value,Order Code Resistors,"R1",1732k, Resistors,"R2",549k, 

Page 4: Digital Humidity Sensor With Lcd Display Using Microcontroller

1/20/2016 Digital humidity sensor with lcd display using microcontroller

http://microcontrollerslab.com/digital­humidity­sensor­using­pic­microcontroller/ 4/14

CIRCUIT DIAGRAM OF HUMIDITY SENSOR

Complete circuit diagram of Digital humidity sensor with LCD

display:

circuit diagram of digital humidity sensor

 

Simulation results using pulse generator in proteus:

 

 

Resistors,"R3",1k, Resistors,"R4",49.9k, Resistors,"R44",10k, Integrated Circuits,"U1",NE555, Integrated Circuits,"U2",PIC16F877A, Miscellaneous,"LCD1",LM016L, Miscellaneous,"SENSOR",humidity sensor HS1101, crystal 20mhz

Page 5: Digital Humidity Sensor With Lcd Display Using Microcontroller

1/20/2016 Digital humidity sensor with lcd display using microcontroller

http://microcontrollerslab.com/digital­humidity­sensor­using­pic­microcontroller/ 5/14

As shown in above diagram humidity is shown in percentage.

27% humidity mean air contains 27% water vapors. so you can

take control actions according to your requirement. By little bit

modification in this project you can also control anything

according to change in relative humidity. let me know what is

your requirement I will be happy to provide you solution.

CODING:

Code is written in mikro c for pic:

//***************[email protected]***********

// LCD module connections

sbit LCD_D7 at RB2_bit;

sbit LCD_D6 at RB3_bit;

sbit LCD_D5 at RB4_bit;

sbit LCD_D4 at RB5_bit;

sbit LCD_EN at RB6_bit;

sbit LCD_RS at RB7_bit;

sbit LCD_D7_Direction at TRISB2_bit;

sbit LCD_D6_Direction at TRISB3_bit;

sbit LCD_D5_Direction at TRISB4_bit;

sbit LCD_D4_Direction at TRISB5_bit;

sbit LCD_EN_Direction at TRISB6_bit;

sbit LCD_RS_Direction at TRISB7_bit;

// End LCD module connections

//******************************frequency meter variables*******

int value,freq,humidity;

char humid[7];

//**************************************************************

void data_converstion(void)

{

IntToStr(humidity, humid);

}

void display1(void)

{

lcd_out(1,1,”Humidity = “);

lcd_out(1,13, Ltrim(humid));

Lcd_Chr_Cp(‘%’);

Lcd_Chr_Cp(‘ ‘);

}

Page 6: Digital Humidity Sensor With Lcd Display Using Microcontroller

1/20/2016 Digital humidity sensor with lcd display using microcontroller

http://microcontrollerslab.com/digital­humidity­sensor­using­pic­microcontroller/ 6/14

void interrupt(void) // high portD

{

if(T1CON.TMR1ON==0)

{

T1CON.TMR1ON=1; // turn on the timer1

INTCON.INTF = 0; // clear the interrupt flag

}

else if(T1CON.TMR1ON==1)

{

T1CON.TMR1ON=0; // turn off the timer1

value=(TMR1H<<8)|(TMR1L);

INTCON.INTE = 0; //Enable RB0/INT external Interrupt

freq=(5018035/value);

humidity = 565 – freq/13;

// freq = freq /13.18;

//freq = 100 – freq;

TMR1H=0;

TMR1L=0;

INTCON.INTE = 1; //Enable RB0/INT external Interrupt

INTCON.INTF = 0; // clear the interrupt flag

//freq=0;

}

}

void main()

{

long count;

count=0;

TMR1H=0;

TMR1L=0; // intialization of timer one prescalar and internal

clock

INTCON.GIE = 1; //Enable Global Interrupt

INTCON.INTE = 1; //Enable RB0/INT external Interrupt

OPTION_REG.INTEDG = 0; //Interrupt on rising edge

ADC_Init();

Lcd_Init(); // Initialize LCD

freq=0;

Lcd_Cmd(_LCD_CLEAR); // Clear display

lcd_cmd(_LCD_CURSOR_OFF);

lcd_out(1,4,”GREEN HOUSE”);

lcd_out(2,6,”SYSTEM”);

delay_ms(1000);

Lcd_Cmd(_LCD_CLEAR); // Clear display

Page 7: Digital Humidity Sensor With Lcd Display Using Microcontroller

1/20/2016 Digital humidity sensor with lcd display using microcontroller

http://microcontrollerslab.com/digital­humidity­sensor­using­pic­microcontroller/ 7/14

while(1)

{

data_converstion();

display1();

}

}

 

If you have any problem after reading this article, comment on

this post with your problem and if you need complete circuit

diagram, simulation and hexa file of this project, comment on

this post with your email address.

If you feel this article helps you in getting some knowledge

kindly don’t forget to share it with your friends on social media.

enjoy coding

Related Posts

Temperature SensorSearch Largest China Supplier Base. VerifiedGlobal Exporters-Join Free

Auto intensitycontrol of streetlights using picmicrocontroller

Line follower robotusingmicrocontroller

Digital Ohmmetercircuit using picmicrocontroller

Page 8: Digital Humidity Sensor With Lcd Display Using Microcontroller

1/20/2016 Digital humidity sensor with lcd display using microcontroller

http://microcontrollerslab.com/digital­humidity­sensor­using­pic­microcontroller/ 8/14

About The AuthorBilal Malikwe providing project services to students and

industry from last 2 years and working as a

freelancer. I also write technical articles related

to electrical ,electronics, embedded and power

electronics Engineering. Contact me if you need my project

services. My email address: [email protected]

29 Comments

Reply

david shalom SEPTEMBER 13, 2014

i want to know how u calculate the percentage

from the frequency

thanx

Reply

BILAL Malik SEPTEMBER 18, 2014

I have used the formula which is given in

HS1101 humidity sensor data sheet. Formula is

used to convert humidity % into frequency and

vice versa

Reply

ally NOVEMBER 19, 2014

Hi!

Bilal I need your help can you help me to make

codes for count down timer, temperature and

humidity in one micro-controller I tried to do that

but there is interference one not working when all

reads at the same time please you can email me

the hex file for that.

Thanks and kind regards

Ally

Page 9: Digital Humidity Sensor With Lcd Display Using Microcontroller

1/20/2016 Digital humidity sensor with lcd display using microcontroller

http://microcontrollerslab.com/digital­humidity­sensor­using­pic­microcontroller/ 9/14

Reply

reeza NOVEMBER 20, 2014

hey can u give me the full schematic and source

code for this project?

Reply

Ally NOVEMBER 22, 2014

Hi!

I downloaded the code from Bilal

Project for humidity sensor but is not

working is not giving me 27%

Please can any one give me the

formula for calculating frequency in this

circuit.

and Bilal can you tell me how you get

27%?

Thanks

Ally

Reply

Ally NOVEMBER 22, 2014

Hi Reeza!

Sorry I generate codes from different

projects and I build it in one micro

controller so please if you know to

separate codes help me.

I need to make Incubator to control

temperature,humidity and turning of

the eggs automatic so if you any one

can help me here the codes I will be

thankfully to him.

Regards

Ally

Reply

Abdullah Zohaib Kiani NOVEMBER 29, 2014

Assalamoalikum

brother what is the capacitence of hs1101 sensor

at 0% humidity and at 100% humidity??

and what is the maximum frequency generated by

555 at 100% humidity??

Page 10: Digital Humidity Sensor With Lcd Display Using Microcontroller

1/20/2016 Digital humidity sensor with lcd display using microcontroller

http://microcontrollerslab.com/digital­humidity­sensor­using­pic­microcontroller/ 10/14

Reply

Raj Kumar DECEMBER 19, 2014

Dear Mr. Bilal

I would like to have the code (hex file) for humidity

controller and temperature controller.

Thanks.

Raj

Reply

ali JANUARY 5, 2015

hi

please tell me the program used for

coding

tnx

and give me the hex ofprogram

very very tnx for solving my problem

Reply

ali JANUARY 10, 2015

hi

if any one have the hex of program please send to

my mail

[email protected]

tnx all

Reply

Nur Ikhlas FEBRUARY 14, 2015

Hello there Bilal. Can you email me complete

circuit diagram, simulation and hex file of this

project? please let me know that you email-ed

me. Please. this is my email [email protected]

Reply

smwal FEBRUARY 15, 2015

hi can i use Lm331 for convert frequency to volt in

this project

Reply

smwal FEBRUARY 17, 2015

Can you write equation for humidity and

frequency because idont understand these please

Page 11: Digital Humidity Sensor With Lcd Display Using Microcontroller

1/20/2016 Digital humidity sensor with lcd display using microcontroller

http://microcontrollerslab.com/digital­humidity­sensor­using­pic­microcontroller/ 11/14

Reply

akif MARCH 4, 2015

hi

if any one have the hex of program please send to

my mail

[email protected]

Reply

moheed MARCH 5, 2015

i need complete code

Reply

ion APRIL 21, 2015

Please be so kind and email me

the whole project and code

I have proteus and i would like to try it

Thank you

Reply

foxc APRIL 21, 2015

hi Bilal. im working on something like this, where i

need to get the frequency from the timer. can you

email the whole project because i would like to try

this out. thanks brother

[email protected]

Reply

BILAL Malik APRIL 21, 2015

hi code and circuit diagram is

already available in post

Reply

lam MAY 13, 2015

i need complete code of humidity use key pad

control only four key start,use,enter,program .help

me

Reply

JOBIN GEORGE MAY 21, 2015

Please email me the whole project and code

Thank you

Page 12: Digital Humidity Sensor With Lcd Display Using Microcontroller

1/20/2016 Digital humidity sensor with lcd display using microcontroller

http://microcontrollerslab.com/digital­humidity­sensor­using­pic­microcontroller/ 12/14

Reply

JOBIN GEORGE MAY 21, 2015

Please email me the whole project and code

Thank you

[email protected]

Reply

omer JUNE 16, 2015

i need hex.file for humidity sensor

Reply

Sarmad JULY 28, 2015

Can you please send me the hex file of this

program

thanks!

Reply

Kalaiyarasan AUGUST 20, 2015

I am going to make water generator from air

machine so i need humidity value in air .

http://www.instructables.com/id/The-Arduino-

Weather-Station-Thermostat/ you can see this

link. i think this project value is very high cost, but i

need same like as above with cheapest cost can

your provide good project with program

[email protected]

Reply

Bilal Malik AUGUST 21, 2015

you can purchase it from our shop

Reply

Romesh JANUARY 16, 2016

Do we need to ground the D0 to D3 pins in the

LCD module?if we won’t do that will it work?

Reply

BILAL Malik JANUARY 17, 2016

No need

Page 13: Digital Humidity Sensor With Lcd Display Using Microcontroller

1/20/2016 Digital humidity sensor with lcd display using microcontroller

http://microcontrollerslab.com/digital­humidity­sensor­using­pic­microcontroller/ 13/14

Comment Text*

Name*

Email*

Website

Post Comment

Notify me of follow-up comments by email.

Notify me of new posts by email.

Leave a Reply

Reply

Romesh JANUARY 17, 2016

I tried this out.But it is not

displaying anything.Is

display connections are

correct?

Reply

BILAL Malik

JANUARY 17, 2016

yes it is correct.

Connect D+ with

5 volt and D- with

ground

Page 14: Digital Humidity Sensor With Lcd Display Using Microcontroller

1/20/2016 Digital humidity sensor with lcd display using microcontroller

http://microcontrollerslab.com/digital­humidity­sensor­using­pic­microcontroller/ 14/14

RECENT POSTS

Electronic lock using pic microcontroller

HUMANOID robotic ARM using pic

microcontroller

Insulation materials used in transformers

GSM based home devices control system

MULTIPLE INPUT CHARGE CONTROLLER FOR

RENEWABLE ENERGY

POPULAR POSTS

Electronic lock using pic

microcontroller

SUBSCRIBE ME ON YOUTUBE

PAGES

Contact us

privacy policy

Project services

Sitemap

December 23, 2015 No Comments

Microcontrollers Lab Copyright © 2016. Sitemap