Arduino With LDR Sensor
This is my Second Simulation and Practical pairing up of LDR Sensor with the Arduino Uno Microcontroller Electronic board. While learning to pair firstly i started with the lesson on the Tinkercad for the same where i got to learn about thr online simulation of the LDR and its simulation Circuit connections.
Further then i went for the Practical Hardware Connections on the Board, where i connected the circuit as per the simulation and as a result to this my connections and the practical hardware connection were all correct and good to lit up and test the Circuit.
Supplies
1.Connecting Wires
2.Resistor
3.LED
4.Arduino Uno
5.USB Input cable
6.Breadboard
7.Arduino IDE
8.LDR(Light Dependent Resistor)
LDR(Light Dependent Resistor)
This pairing of LDR with Arduino is sourced from the tinkercad learning lesson of circuits where i ,myself learned about the Light Dependent Resistor which is photoresistive and it's resistance increases when light falls upon it from there i learn to simulate the circuit online on tinkercad and wokwi for this i have connected the circuit in the circuit board simulation space where i got to learn about the different resistors, variable resistors.
The LDR has only two terminal and is very different from the LED as the LDR falls into the category of Resistor which has two terminals connected in between the the jumper wires and paired in such a way that it is paired with the LED to show the Output as blinking.
LDR is (Light Dependent Resistor) means it's Resistance increases when the Light Falls upon it in such a way that also means it's Resistance will decrease in the Dark and thus we can make it operational when it's resistance decreases as it works on the principle of photoconductivity, resistance changes according to the intensity of light.
While learning to operate this sensor i faced a problem of sensitivity which was solved after tinkering the hardware.
in which the the sensitivity was the actual problem it was not sensing the light falling over it so to over come that problem and make the code run i changed the input sensor value of the programme and as a result it started working effortlessly.
https://components101.com/sites/default/files/component_datasheet/LDR%20Datasheet.pdf
Programme
Programme:
int sensorValue = 0;
void setup()
{
pinMode(A0, INPUT);
Serial.begin(9600);
pinMode(5, OUTPUT);
}
void loop()
{
// read the value from the sensor
sensorValue = analogRead(A0);
// print the sensor reading so you know its range
Serial.println(sensorValue);
// map the sensor reading to a range for the LED
analogWrite(5, map(sensorValue, 0, 1023, 0, 255));
delay(100); // Wait for 100 millisecond(s)
}
Upload this Programme in the Arduino Uno Microcontroller using the USB type data cable.
Hardware Connections
Hardware connections are simple as per the Simulated circuit diagram and as a result to this the connected circuit must run, Everything required to run and paired in the Board are explained.
I have attached the Video of my output result in the attached media.
If there is Something to be modified or i must add then, it will be more helpful of you.