Page 1 of 1

Novice needs help with Relative Humidity Sensors

Posted: Fri May 04, 2018 4:09 am
by ghostrider513
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

Re: Novice needs help with Relative Humidity Sensors

Posted: Fri May 04, 2018 5:58 am
by Silverlock
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!

Re: Novice needs help with Relative Humidity Sensors

Posted: Fri May 04, 2018 6:48 am
by DougieLawson
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.

Re: Novice needs help with Relative Humidity Sensors

Posted: Sun May 06, 2018 3:45 am
by nios2
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

Re: Novice needs help with Relative Humidity Sensors

Posted: Sun May 06, 2018 6:19 am
by joan
The DHT22 may not be the best choice if you are after accuracy. Do you have a feel for the precision you will need?

Re: Novice needs help with Relative Humidity Sensors

Posted: Sun May 06, 2018 9:55 am
by bensimmo
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.

Re: Novice needs help with Relative Humidity Sensors

Posted: Sun Jun 24, 2018 5:08 pm
by ghostrider513
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.

Re: Novice needs help with Relative Humidity Sensors

Posted: Mon Jun 25, 2018 6:59 pm
by rickyh89
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.