# LDR circuit

**URL:** <https://forum.arduino.cc/t/ldr-circuit/120199>\
**Category:** General Guidance\
**Created:** [September 14, 2012, 6:04am UTC](https://forum.arduino.cc/t/ldr-circuit/120199 "2012-09-14T06:04:36Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Vincent19](https://avatars.discourse-cdn.com/v4/letter/v/f05b48/32.png) [@Vincent19](https://forum.arduino.cc/u/Vincent19)\
**Post date:** [September 14, 2012, 6:04am UTC](https://forum.arduino.cc/t/ldr-circuit/120199/1 "2012-09-14T06:04:36Z")

</div>

> <https://gist.github.com/anonymous/3720060>

Hey, according to this coding, this is a night lamp circuit. So I am curious about one thing. LDR is an analog sensor. So, the light intensity of the LED at pin 13 will change according to the light intensity received by the LDR. But then according to this coding, it is either a sharp 5V HIGH for the LED at pin 13 or a LOW for the LED. If the sensovalue is \<150, which means dark ,so the LED will light up with 5V. But when I play with it, the light intensity of the LED is various with the LDR. So this make me do not understand fully about the coding @@ Can anyone clarify for me ?

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/system/32/1140315_2.png) [@system](https://forum.arduino.cc/u/system)\
**Post date:** [September 14, 2012, 6:33am UTC](https://forum.arduino.cc/t/ldr-circuit/120199/2 "2012-09-14T06:33:25Z")

</div>

> If the sensovalue is \<150,

That's not what the code says.

Why don't you post _your_ code and the serial output?

---

<div class="post-metadata">

**Author:** ![Vincent19](https://avatars.discourse-cdn.com/v4/letter/v/f05b48/32.png) [@Vincent19](https://forum.arduino.cc/u/Vincent19)\
**Post date:** [September 14, 2012, 2:06pm UTC](https://forum.arduino.cc/t/ldr-circuit/120199/3 "2012-09-14T14:06:50Z")

</div>

Erm, sorry .. My code is \<400..Typo..

So how to explain the thing ?

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/system/32/1140315_2.png) [@system](https://forum.arduino.cc/u/system)\
**Post date:** [September 14, 2012, 2:12pm UTC](https://forum.arduino.cc/t/ldr-circuit/120199/4 "2012-09-14T14:12:32Z")

</div>

Explain what thing?  
What do you mean by 'play with it'?

---

<div class="post-metadata">

**Author:** ![Vincent19](https://avatars.discourse-cdn.com/v4/letter/v/f05b48/32.png) [@Vincent19](https://forum.arduino.cc/u/Vincent19)\
**Post date:** [September 14, 2012, 2:32pm UTC](https://forum.arduino.cc/t/ldr-circuit/120199/5 "2012-09-14T14:32:43Z")

</div>

Means I various with the light intensity. Hahahaha..

Explain why the light intensity of the LED will affected by the intensity of light o LDR. I suppose it to be either HIGH or LOW...no intermediate. But when I vary the light intensity, the LED light up abit and when totally \<400, the LED is fully light up

---

<div class="post-metadata">

**Author:** ![Lakes](https://avatars.discourse-cdn.com/v4/letter/l/db5fbb/32.png) [@Lakes](https://forum.arduino.cc/u/Lakes)\
**Post date:** [September 14, 2012, 2:44pm UTC](https://forum.arduino.cc/t/ldr-circuit/120199/6 "2012-09-14T14:44:14Z")

</div>

LDR = Light Sensitive Resistor, at a certain light resistance level the sketch turns the LED on.

You could change the LDR for a potentiometer and load the example sketch AnalogReadSerial to see what happens.

The Analog Input is another example sketch which shows how to use analogin to change the blink rate of the LED.

In the Arduino IDE goto File - Examples - Basics - AnalogReadSerial for the first example  
and File - Examples - Analog - AnalogInput for the second example.

In your case it sounds like the LED is being switched on and off very quickly, which should not happen, replace the LDR with a POT and see how that affects the LED.

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/system/32/1140315_2.png) [@system](https://forum.arduino.cc/u/system)\
**Post date:** [May 5, 2021, 4:44pm UTC](https://forum.arduino.cc/t/ldr-circuit/120199/7 "2021-05-05T16:44:13Z")

</div>

Closed on May 5, 2021, 4:44pm UTC


