learn and build innovative projects

Light Intensity Measurement using Arduino and LDR

No comments :

Light Intensity Measurement using Arduino and LDR

Arduino and Light Dependent Resistor (LDR). The LDR sensor is employed to measure light intensity.
This tutorial illustrates the procedure of connecting/interface a Light Dependent Resistor (LDR) Sensor to an Arduino. It guides you through the process of establishing an interface between an Arduino and an LDR sensor, resulting in the blinking of a Built-In LED based on the detected light intensity.

Components Required:

  • Arduino Uno with USB 2.0 Cable
  • LDR (Light dependent resistor)
  • Jumper Wires

Arduino Uno with USB 2.0 Cable:

Arduino is an open-source electronics platform that combines user-friendly hardware and software, catering to individuals involved in creating interactive projects.
light intensity measurement using arduino and ldr light dependent resistor. LDR sensor is used to detect the light intensity. We will interface an Arduino with LDR sensor and blink a Built-In Led based on light intensity.

LDR Sensor: 

The term "LDR" stands for Light Dependent Resistor, which is a sensor capable of detecting light intensity. It incorporates a variable resistance that changes in response to the varying light intensity fall upon it. As the light intensity fluctuates, the resistance undergoes corresponding variations.
LDR sensor stands for Light Dependent Resistor. It can detect the light intensity. It has a (variable) resistance that changes with the light intensity that falls upon it. when light intensity varies the rate of resistance will be varied.

Specifications:
  • Power Supply :3.3V to 5V DC
  • Operating Current : 15mA
  • Output: Analog and Digital

Jumper Wires:

A jumper wire is an electrical wire equipped with connectors or pins at each end. It is commonly employed to interconnect components without the need for soldering, providing a convenient method for establishing electrical connections between different parts of a circuit.
A jumper wire is an electrical wire with a connector or pin at each end, which is normally used to interconnect the components each other without soldering.

Connection Diagram:

Connect your components according to the provided diagram and link the USB cable from Arduino to your computer.

Connect your components using jumper wires with arduino with LDR

Arduino Code:

int sensorPin = A0; // select the input pin for the LDR
int ledPin = 13; // select the pin for the LED
int sensorValue = 0; // variable to store the value coming from the sensor

void setup()
{
// declare the ledPin as an OUTPUT:
pinMode(ledPin, OUTPUT);
}

void loop() {
// read the value from the sensor:
sensorValue = analogRead(sensorPin);
Serial.print(sensorValue); //Prints the Value from Sensor
if (sensorValue<400)
{
// turn the ledPin on
digitalWrite(ledPin, HIGH);
Serial.print("Turn on LED & LED Status : ");
Serial.println(sensorValue);
}
else{
// turn the ledPin off:
digitalWrite(ledPin, LOW);
Serial.print("Turn off LED & LED Status : ");
Serial.println(sensorValue);
}
delay(1000); // stop the program for <1000> milliseconds:
}

Upload:

Connect Arduino board to computer using USB cable and wait for few seconds then it will show you "Com port".

Check your Com Port and Board Selection before upload Arduino code.
Check your Com Port and Board Selection before upload Arduino code.

Check output in Arduino serial monitor.




No comments :

Post a Comment

Internet of Things

What is Internet of Things?

What is IoT? The Internet of Things (IoT) is the network of physical objects/things are embedded with software, sensors, and hardw...