Arduino with DHT11–Temperature and Humidity Sensor with LCD

This project will help you learn measuring Temperature and Humidity using Arduino with DHT11.

In this article, I’ll first go into a little background about humidity, then I’ll explain how the DHT11 measures humidity. After that, I’ll show you how to connect the DHT11 to an Arduino and give you some example code so you can use the DHT11 in your own projects.

Components Required  for the Arduino with LDR Project

Arduino Uno× 1Amazon
LDR× 1Amazon
LED and Resistor Kit× 1Amazon
5V Relay Module× 1Amazon
Breadboard× 1Amazon
Jumper wires× 2Amazon
USB cable type A/B× 1Amazon

Software

Arduino IDE

LDR

LDRs are light-dependent instruments, whose resistance decreases when light falls on them and increases in darkness. When a light dependent resistor is kept dark, it has very high resistance. It can be as high as 4.5 Ω. If the device can absorb light, its resistance is dramatically reduced. The current increases when a constant voltage is applied and the light intensity increased. The following figure shows the resistance vs. illumination curve for a particular LDR.

Feature

  • Wide spectral response
  • Wide ambient temperature range
  • Low cost 

LDR Specifications

Voltage100V AC or DC
Current15mA
Operating temperature range-25°C +75°C
Min. resistance @ 10lux1.8kΩ
Max. resistance @ 10lux4.5kΩ
Dark resistance after 1 sec0.03MΩ
Dark resistance after 5 sec0.25MΩ
Cost Check Price

Analog Application of LDR

  1. Modulated light source Automated gain control
  2. Colorimetric Test Equipment
  3. Densitometric measurement
  4. Dual cell electronic scales
  5. Rear view automatic mirror
  6. Automatic Gain Control – modulated light source
  7. Exposure Control Camera
  8. Dual cell Auto-Slide Focus
  9. Photocopy Machines – toner density

Digital Applications of LDR

  1. Night Light Control
  2. Street Light Control
  3. Automatic Headlight Dimmer
  4. Oil Burner Flame Out

For more information, you can check out the LDR Datasheet below:

Arduino with LDR Project Using LED Schematics

Arduino with LDR Project Using LED Schematics
Arduino with LDR Project Using LED Schematics

LDR connected to analog pin A0. In series with 10K resistor another end of the resistor will go to GND. LED connected from digital pin 2 to ground through a 220ohm resistor.

Arduino with LDR Project Using Relay Schematics

Arduino with LDR Project Using Relay Schematics
Arduino with LDR Project Using Relay Schematics

A bulb connects with a 5V relay module’s NO pin and NC pin. 

warning signWaring
This board interfaces with a high-voltage AC supply.   Improper or incorrect use may result in serious injury or death. As a result, it is intended for people who are familiar with and knowledgeable about HIGH AC voltage.

Arduino with LDR Project Code

By clicking the button in the top right corner of the code field, you can copy the code. Copy and paste it into Arduino IDE. 

int LDRInput=A0; //Set Analog Input A0 for LDR.
int LED=2;
void setup() {
Serial.begin(9600);
pinMode(LDRInput,INPUT);
pinMode(LED,OUTPUT);
}

void loop() {
int value=analogRead(LDRInput);//Reads the Value of LDR(light).
Serial.println("LDR value is :");//Prints the value of LDR to Serial Monitor.
Serial.println(value);
if(value<300)
  {
    digitalWrite(LED,HIGH);//The LED turns ON in Dark.
  }
  else
  {
    digitalWrite(LED,LOW);//The LED turns OFF in Light.
  }
}

Result

 You should see your LED turn ON in dark, and OFF in light. If you cannot see the desired output, ensure the circuit has been properly assembled, and verified and uploaded the code to your board.

Applications:
  1. Make automated Street Light system that will ON during night and OFF during day.
  2. You can make your own home automation using LDR sensor.

Leave a Reply