Go Down

Topic: LDR circuit (Read 1 time)previous topic - next topic

Vincent19

Sep 14, 2012, 08:04 am
https://gist.github.com/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 ?

AWOL

#1
Sep 14, 2012, 08:33 am
Quote
If the sensovalue is <150,

That's not what the code says.

Why don't you post your code and the serial output?
"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

Vincent19

#2
Sep 14, 2012, 04:06 pm
Erm, sorry .. My code is <400..Typo..

So how to explain the thing ?

AWOL

#3
Sep 14, 2012, 04:12 pm
Explain what thing?
What do you mean by 'play with it'?
"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

Vincent19

#4
Sep 14, 2012, 04:32 pm
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

Lakes

#5
Sep 14, 2012, 04:44 pm
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.

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.

Go Up

Please enter a valid email to subscribe