Temperature and Humidity Sensor

by rjkorn in Circuits > Sensors

2450 Views, 37 Favorites, 0 Comments

Temperature and Humidity Sensor

14, 19:36.jpg

At work we use a lot of environmental monitors. I wanted something similar for home. I saw these DHT-11 Sensors on ebay pretty cheap. there are wider range and higher resolution version available but I wanted a few of them cheap.

I decided to do a simple serial interface so it would work easily with Linux, Pic's, Windows etc..

Prototype

14, 19:36.jpg

I had a bunch of PIC16F73's left over from a project so I used them.

I opened the serial to USB adapter's case and ran a wire from the USB power pin to pin 9 on the serial port. This is actually the ring indicator input but this way I didn't need an external power connector.

The hex file attached uses a simple menu interface good for testing and a raw data feed command for using in scripts.

Final Design

14, 19:36.jpg
14, 19:36.jpg
14, 19:36.jpg

I saw these nice time bulkhead boxes on Electronics Goldmine. I used them in my Instructables on Balun's too.

I used a mill to cut the holes for the serial port and sensor but a Dremel or drill and file will do just as well.

Schematic and Code

DHT-11.bmp

I used a 10Mhz ceramic resonator instead of the 10MHz crystal and two 12pf caps. I just happened to have a bunch of those around and its quicker to wire on a protoboard

Downloads

Communicating With It

Screen Shot 2014-06-02 at 5.24.19 PM.png

Its pretty simple to talk to. I use 2400 Baud to help with slow devices or long cable runs.

The screen shot above was from Zterm on a mac.

The commands are simple and can be upper or lower case:

V - Version (4 line info header)

A - Ascii Reading Output (2 lines in plain English)

T - Temperature Reading (always 3 digits)

H - Humidity Reading (always 3 digits)

B - Both Reading separated by a comma

all readings are zero padded for fixed length. This makes it easy to read with some languages. All lines are terminated by a CR and LF. If the sensor fails the English commands will say "Sensor not Responding" and the data reads (T-H-B) will return 3 dashes in place of the reading.