ghostrider513
Posts: 35
Joined: Tue Mar 28, 2017 6:03 am

Novice needs help with Relative Humidity Sensors

Fri May 04, 2018 4:09 am

I'm 59 and this is all new to me. I have got a RPi 3B+ and ordered a DHT22 and while this is real neat, I feel a little overwhelmed. I'm not a quitter so here I am. I have a few questions.

First let me say this is being used for my research project I'm funding myself so I have to have accuracy.

Okay, can the DHT provide relative humidity? There's a difference between humidity and relative humidity. RH is a mathematical equation consisting of dew point, temperature and, humidity.

I'm studying ESD - Electro Static Discharge. You know, that nasty zap you get when you touch something after you drag feet across a carpet or the air outside is cold and dry?

So "Humidity" data is not what I want.
1. Can anyone tell me if the DHT 22 can do this?
2. Can the data be changed to Fahrenheit from Celsius?
3. I need data transmitted every five seconds or less to a remote website for monitoring. Can someone tell me how to do that too. All help would be great. If I can build the first one, I'll be able to make multiple ones later.

I have set up a MySQL database on my website already. I just gotta get everything talking to each other.
Thank you in advance for helping an old guy learn new tricks.
Mike

Silverlock
Posts: 87
Joined: Wed Apr 10, 2013 3:51 am

Re: Novice needs help with Relative Humidity Sensors

Fri May 04, 2018 5:58 am

1. The DHT22 outputs RH, so no problems there.

2. The sensor isn't programmable. You'll have to convert the temperature value to Fahrenheit yourself.

3. If you google: DHT22 website, you will find no end of options. Good luck!
RPi3+external HDD/Raspbian Stretch

User avatar
DougieLawson
Posts: 35381
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: Novice needs help with Relative Humidity Sensors

Fri May 04, 2018 6:48 am

ghostrider513 wrote:
Fri May 04, 2018 4:09 am

2. Can the data be changed to Fahrenheit from Celsius?
Why? Most sensors give readings using ISO units. Fahrenheit was a crap scientist who couldn't even measure the freezing point of water. At least Celsius got his freezing point at zero.

C to F is easy:
F = ((C/5)*9) + 32;

which simplifies to:
F = (C * 1.8) + 32;

F to C is equally easy:
C = ((F - 32)/9)*5);

which simlifies to
C = (F - 32)/1.8;

Get into the 21st century, start using ISO temperatures and forget °F ever existed.
Note: Having anything remotely humorous in your signature is completely banned on this forum.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

nios2
Posts: 38
Joined: Mon Mar 12, 2018 3:22 am

Re: Novice needs help with Relative Humidity Sensors

Sun May 06, 2018 3:45 am

Looks like your Qns 1 and 2 have been answered.

To send to a website you need to setup your pi as a client and have it send a string of information that the server can interpret.

I found this tutorial helpful (in python but the same can be found in C/C++)

https://www.tutorialspoint.com/python3/ ... orking.htm

User avatar
joan
Posts: 14021
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK

Re: Novice needs help with Relative Humidity Sensors

Sun May 06, 2018 6:19 am

The DHT22 may not be the best choice if you are after accuracy. Do you have a feel for the precision you will need?

User avatar
bensimmo
Posts: 4073
Joined: Sun Dec 28, 2014 3:02 pm
Location: East Yorkshire

Re: Novice needs help with Relative Humidity Sensors

Sun May 06, 2018 9:55 am

DHT22 has two sensors in it, the capacitive humidity sensor.
This is 0 to 100 % relative humidity, 5% accuracy.

A thermistor for temperature -45C to 125C 0.5Caccuracy.

Polling max every 2 seconds.
And a little chip to give you the readings easily.

That's what I have written in my book.
A search for the spec sheet would give you the correct data and more.

So
1 as mention is fine for you, accuracy is up to you.
2 use degC, do everything in degC. Only at the end for a display do the maths to convert it to F, conversion is given above.

3 Try Adafruit and other websites.
Reading the data will be the easy part in my opinion.
I always find communication the harder part
You may find MQTT is a worthwhile method to so this.

ghostrider513
Posts: 35
Joined: Tue Mar 28, 2017 6:03 am

Re: Novice needs help with Relative Humidity Sensors

Sun Jun 24, 2018 5:08 pm

bensimmo wrote:
Sun May 06, 2018 9:55 am
DHT22 has two sensors in it, the capacitive humidity sensor.
This is 0 to 100 % relative humidity, 5% accuracy.

A thermistor for temperature -45C to 125C 0.5Caccuracy.

Polling max every 2 seconds.
And a little chip to give you the readings easily.

That's what I have written in my book.
A search for the spec sheet would give you the correct data and more.

So
1 as mention is fine for you, accuracy is up to you.
2 use degC, do everything in degC. Only at the end for a display do the maths to convert it to F, conversion is given above.

3 Try Adafruit and other websites.
Reading the data will be the easy part in my opinion.
I always find communication the harder part
You may find MQTT is a worthwhile method to so this.
I bought the SHT31D and it's working great. It has the I2C and works better than the DHT's. Now to figure out how to loop the program, record the data and save it to a csv file. Or get it to send the data to MySQL DB. Know how to do that? That's the reason I bought this thing in the first place. recording data for later comparison. Thanks for the feed back. I've been trying to find the answer on my own, no luck. That's why it took so long to reply.

rickyh89
Posts: 55
Joined: Mon Jun 18, 2018 11:01 pm

Re: Novice needs help with Relative Humidity Sensors

Mon Jun 25, 2018 6:59 pm

You should find oUT how to display the readings you need a single time. Then you will easily be able to loop them to refresh whenever you need... saving to a DB is super easy also. There is a million really in depth write ups for DB operationships.

I do not have the sensor myself and haven't used one before but once you figure out how to display the reading you want just 1 single time then you have the back bone of your script figured out. The rest will be easy as so much material online.

Return to “Automation, sensing and robotics”