0% found this document useful (0 votes)
15 views4 pages

3

The document describes an experiment using an Arduino board to control the state of a relay based on ambient light levels measured by an LDR light sensor. An LDR sensor's resistance decreases when light falls on it. The experiment uses an LDR in a voltage divider to take readings on an analog pin of the Arduino. If the reading is below 700, the Arduino turns on an LED and activates a relay to power lights, and if above 700 turns them off.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views4 pages

3

The document describes an experiment using an Arduino board to control the state of a relay based on ambient light levels measured by an LDR light sensor. An LDR sensor's resistance decreases when light falls on it. The experiment uses an LDR in a voltage divider to take readings on an analog pin of the Arduino. If the reading is below 700, the Arduino turns on an LED and activates a relay to power lights, and if above 700 turns them off.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

Experiment–3

Aim:ControllingrelaystatebasedonambientlightlevelsusingLDRsensor.

Procedure:Inthiscircuit,wearemakingaLightSensorusingLDRwith
Arduinotocontrolabulb/CFLasperlightconditionoftheroomoroutside area.

ComponentsRequired:
• ArduinoUNO
• LDR(LightDependentResistor)
• Resistor(100k-1;330ohm-1)
• LED–1
• Relaymodule–5v
• Bulb/CFL
• Connectingwires
• Breadboard

CircuitDiagramandConnections
LDR
LDR is Light Dependent Resistor.LDRs are made from semiconductor
materials to enable them to have their light-sensitive properties. There are
many types but one material is popular and it is cadmium sulfide (CdS). These
LDRs or PHOTO RESISTORS works on the principle of “Photo Conductivity”.
Now what this principle says is, whenever light falls on the surface of the LDR
(in this case) the conductance of the element increases or in other words, the
resistance of the LDR falls when the light falls on the surface of the LDR. This
property of the decrease in resistance for the LDR is achieved because it is a
property of semiconductor material used on the surface.

WorkingofLDRcontrolledLEDusingArduino

As per the circuit diagram, we have made a voltage divider circuit using LDR and100k
resistor. The voltage divider output is feed to the analog pin of the Arduino. The
analog Pin senses the voltage and gives some analog value to Arduino. The analog
valuechangesaccordingtotheresistanceofLDR.So,asthelightfallsontheLDR the
resistance of it gets decreased and hence the voltage value increase.

Intensityoflight↓-Resistance↑-Voltageatanalogpin↓-LightturnsON

AspertheArduinocode,iftheanalogvaluefallsbelow700weconsideritasdark and the light


turns ON. If the value comes above 700 we consider it as bright and thelight turns OFF.

ControllingRelayusingLDRwithArduino
InsteadofcontrollinganLEDaccordingtothebrightnessanddarkness,we can
control our home lights or any electrical equipment. All we have to do is
connect a relay module and set the parameter to turn ON and OFF the any AC
appliance according to the intensity of the light. If the value falls below 700,
which means it Dark, then the relay operates and the lights turns ON. If the
value is greater than 700, which means its day or bright, then the relay will not
operate and the lights remain OFF.
ArduinoCode

#definerelay10
int LED = 9;
int LDR = A0;
void setup()
{
Serial.begin(9600);
pinMode(LED, OUTPUT);
pinMode(relay,OUTPUT);
pinMode(LDR, INPUT);
}
voidloop(){
int LDRValue = analogRead(LDR);
Serial.print(“sensor = “);
Serial.print(LDRValue);
if(LDRValue<=700)
{
digitalWrite(LED, HIGH);
digitalWrite(relay,HIGH);
Serial.println(“It’sDarkOutside;Lightsstatus:ON”);
}
else
{
digitalWrite(LED, LOW);
digitalWrite(relay,LOW);
Serial.println(“It’sBrightOutside;Lightsstatus:OFF”);
}
}
Output:

Result:Theaboveexperimentisdesigned andexecutedsuccessfullyusingArduino Board.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy