Arduino Weather Station

21 Mar

After not doing any Arduino fiddling for quite a while I have finally started a small project again. I have made a small weather station for measuring temperature and humidity levels in my home.


The setup is based on an Arduino Uno with the standard Ethernet Shield (because it has an SD card reader) and a DHT-22 sensor that is connected as follows (following the docs):

  • Leg 1 (from the left) –> +5V
  • Leg 2 –> pin 2 (data input)
  • Leg 3 –> not connected
  • Leg 4 –> GND
  • 10k OHM resistor between +5V and data pin 2.

The code is pretty standard, a mixture of the SD library and DHT library code examples …  not really interesting. However, I have added a bit of code to calculate the dew point based on formulas I found on the web, which may be worth sharing here:

// Compute dew point (formula taken from here:
// You need to include the math.h library

float temperature = 20.0; // Set to current temperature in *C (>= 0).
float humidity = 50.0; // Set to current % of relative humidity.

float a = 7.5; // For temperatures >= 0 *C.
float b = 237.3; // For temperatures >= 0 *C.

float sdd = 6.1078 * pow(10, (a * temperature) / (b + temperature));
float dd = humidity / 100 * sdd;
float v = log10(dd / 6.1078);

float dewpoint = b * v / (a – v);

So far the setup seems to work well, but the sensor readings regarding the temperature look a bit high (maybe influenced by the Arduino which gets warm over time … its probably better to place the sensor  away from the board, and not right on top of it).

Edit: In case you are interested, you can find the code of the project here: (without the dewpoint computation).


One Response to “Arduino Weather Station”

  1. Kaide March 16, 2016 at 8:10 am #

    Can i get full code?

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: