[quote author=Papa G link=topic=170175.msg1265761#msg1265761 date=1370360782]
I see, but the analog in pin (with analogRead) should be able to read values between 0 and 5 volts as far as I know, so why would I need to reduce this voltage ?
I tried doing this without the extra resistor, but then my readings were just 0 all the time.
At first I thought that I was making a short circuit, but I don't see how I can make a short circuit when there's already a resistor (the LDR) between ground and 5v.
The Light Dependent Resistor only has two leads. Which lead did you expect to change, the one attached to +5V or the one attached to ground?
By "change" you mean read the voltage value at that specific point, or? I want to read the voltage on the LDR lead that goes to ground.
When I put a 220 ohm resistor I get quite low voltage between the resistor and LDR, but when I place a 10kohm resistor I get "much" higher voltage (less voltage drop) - how does this work out?
This is a potential divider, see:-
And if I don't have a pull down resistor the voltage won't "flow" that way.
Voltage NEVER flows, it is current that flows. A current flowing through a resistance causes a voltage to be developed across that resistance. The relationship between current flow, voltage and resistance is called ohms law.
When I measured the voltage on the gnd side of the LDR (without a pull down) I got absolutely 0 voltage.
Yes you will, why do you think this is odd? People keep telling you an LDR does NOT generate any voltage it is just a Light Dependent Resistor.
I think maybe I need some kind of logical explanation if that's possible
Well every reply in this thread is a logical explanation, you have to do your bit by saying what bit of the logic you don't understand.
I know that it's a voltage divider, but I think I'm generally a bit confused why I need to measure the output voltage between R1 and R2. Why not after R2, or even without R2 and then measure voltage after R1?
I'm sorry, wrong use of words. I meant current of course.
So a normal reistor generates voltage, but an LDR does not? Aha. It seems odd to me because they are both resistors - I mean, they "make" resistance in the circuit - but there most be something I'm not getting right obviously. Please bare with me, it's a great help all the things people have written already. I really prefer discussing the matter with someone instead of finding out everything on my own (I spend quite a lot of time doing that, heh).
I'm really trying to express myself specifically as to where my lack of knowledge is. Is there anything in particular you would like me to elaborate on?