I ended up purchasing a DHT22/AM2302 sensor, so I quickly put together a rudimentary Arduino sketch to read the temperature and relative humidity and calculate the dew point.
Components
- Arduino Duemilanove
- Jumper wires (x3)
- Breadboard
- DHT sensor
The DHT sensor has four pins and its connections are as follows (from left to right):
+5 V --> 5 V on Arduino
Data --> Digital input pin 5
Not used
Ground --> Gnd on Arduino
I used
DHTlib to read sensor values. This library makes reading these values trivial. I modified DHTlib, removing the methods for reading from DHT11 and DHT21 sensors. When you only have ~30k bytes of memory, every bit counts!
My sketch was modified from the DHTlib example and can be seen below:
Show Code
// Author: Zac DeMeo
// Uses modified DHT22 library from https://github.com/RobTillaart/Arduino/tree/master/libraries/DHTlib
#include <dht.h>
dht DHT;
short const DELAY_TEMP = 2000;
unsigned long THEN = millis();
#define DHT22_PIN 5
void setup() {
Serial.begin(115200);
Serial.println("Status,\tHumidity (%),\tTemperature (F), \tDew point (F)");
}
void loop() {
unsigned long NOW = millis();
if ((NOW - THEN) >= DELAY_TEMP) {
readTemp();
THEN = millis();
}
}
void readTemp() {
int chk = DHT.read22(DHT22_PIN);
switch (chk) {
case DHTLIB_OK:
Serial.print("OK,\t");
break;
case DHTLIB_ERROR_CHECKSUM:
Serial.print("Checksum error,\t");
break;
case DHTLIB_ERROR_TIMEOUT:
Serial.print("Time out error,\t");
break;
default:
Serial.print("Unknown error,\t");
break;
}
// Print temperature, relative humidity, and approximate dew point
Serial.print(DHT.humidity, 1);
Serial.print(",\t");
Serial.print(CtoF(DHT.temperature), 1);
Serial.print(",\t");
Serial.print(CtoF(dewpoint(DHT.temperature, DHT.humidity)) , 1);
Serial.println();
}
// Converts temperature from Celsius to Fahrenheit scale
double CtoF(double temp) {
return (temp * 1.8) + 32;
}
// Converts temperature from Celsius to Kelvin
double CtoK(double temp) {
return temp + 273.15;
}
// Calculates the dew point in Celsius, from http://andrew.rsmas.miami.edu/bmcnoldy/Humidity.html
double dewpoint(double T, double RH) {
return 243.04 * (log(RH/100)+((17.625 * T)/(243.04 + T)))/(17.625-log(RH/100)-((17.625 * T)/(243.04 + T)));
}

Every two seconds, the sensor status, current temperature in Fahrenheit, % relative humidity, and approximate dew point will be printed to the Arduino serial monitor.