Introduction: Gardening Temperature and Humidity Logger

About: My team has developed a new product. PLEASE CHECK IT OUT ON INDIEGOGO AND SHOW YOUR SUPPORT. CAMPAIGN LINK: https://igg.me/p/2165733/x/17027489. I'm a tech and food enthusiast and also a Soccer Player. I love…

Working with electronics has become much easier after the arduino line of boards, the large community develops a large number of libraries that make interfacing with any sensor with the arduino easy. And now years later, after the launch of the first arduino board there are thousands of arduino projects on it.

Here is a project for those who like gardening and growing plants in a greenhouse, growing plants requires specific temperature and humidity to be maintained in this instructable I'm going to show you how to make a device that measures the humidity data and temperature data and logs it and displays it on a LCD screen. You could run more than one sensor at once.

So in this instructable I'm going to show you How to make a temperature and humidity logger with the arduino and DTH11.

Step 1: Tools and Components

For this project you will need,

Step 2: Getting Started With DTH11

The DTH11 is a temperature and humidity sensor on one board, it easy to use with the arduino and has a community built library we could use. Before starting of with the project let's first try out a sample sketch with the DTH11 to see if everything is working fine and this step will act as a beginners guide to the DTH11.

The circuit to connect the arudino to the DTH11 is as follows,

Arduino -- Dth11

  • 5V -- VCC of the sensor
  • Gnd -- Gnd of the sensor
  • D3 -- Signal or data pin of the sensor

Step 3: Test Sketch

After you have connected the DTH11 to the arduino nano, it is now time to connect the arduino nano to the PC and upload program, for this you will need the arduino IDE, which can be found in the arduino official website.

After you have downloaded and installed the IDE select the arduino nano board from the tools menu of the IDE and also the right COM Port or serial port.

Then copy the code from below and paste it in the arduino IDE and hit upload, after the code has uploaded you will see a done uploading text on the bottom of the IDE.

#define DHT11_PIN 3 //DTH11 PIn

void setup() {
Serial.begin(9600);
Serial.println("welcome to TechPonder Humidity and temperature Detector"); 
}
void loop() { // READ DATA
int chk = DHT.read11(DHT11_PIN);
Serial.println(" Humidity " );
Serial.println(DHT.humidity, 1);
Serial.println(" Temparature ");
Serial.println(DHT.temperature, 1);
delay(2000);
}

Next to see the data open up the serial port on the right com port and select a baud rate of 9600 and you see the temperature and humidity displayed live time.

Step 4: Connecting the LCD

After you have the output on the serial console it is now time to eliminate the PC and display it on your LCD so you can install this project in your garden. For the LCD I'm using an I2C driver this just uses 2 lines rather than a large collection of digital lines connected to the arduino IDE. So you would have more room for more senors to be connected to the arduino nano.

Just follow the circuit as shown in the picture above, if everything went fine you can proceed to the next step where we will upload the final code tho the board.

Step 5: Code

The code is quite simple and is quite similar to that as shown in the step 3 of this project, in addition we are now adding some more libraries to get the I2C LCD working. You can download the libraries form here. Make sure you have entered the right I2C address in the code, the default address of the I2C is 0x3f.

Copy and paste the below code into the arduino and select the arduino nano and the right port and then hit upload.

#include "Wire.h" // For I2C

#include "LCD.h" // For LCD

#include "LiquidCrystal_I2C.h" 
dht DHT;
#define DHT11_PIN 3
//Set the pins on the I2C chip used for LCD connections
//ADDR,EN,R/W,RS,D4,D5,D6,D7
LiquidCrystal_I2C lcd(0x3f,2,1,0,4,5,6,7); // 0x27 is the default I2C bus address of the backpack-see article
void setup()
{
   // Set off LCD module
   lcd.begin (16,2); // 16 x 2 LCD module
   lcd.setBacklightPin(3,POSITIVE); // BL, BL_POL
   lcd.setBacklight(HIGH);
}
void loop()
{
  int chk = DHT.read11(DHT11_PIN);
  lcd.clear();
  lcd.print("Temperature");
  lcd.print(DHT.temperature, 1); // Custom text
  lcd.setCursor (0,1);
  lcd.print("Humidity-"); 
  lcd.print(DHT.humidity, 1); // Custom text
  delay(1000);
}

Step 6: Going Further

Now that you have everything working on a breadboard you can shift from a breadboard to the PCB. You can add additional sensors to monitor temperature and humidity of different parts of the garden.

I will show you how to add a soil moisture sensor to determine the soil moisture in a future instuctable.

Makerspace Contest 2017

Participated in the
Makerspace Contest 2017