I thought that the voltage doesn't change whether if it's before or after the resistor. Is it a hardware problem that only I'm facing? Does it have to do with resistor value?
Hi,
In the second diagram, you have the analog input connected to GND, it will not change potential as it is the GND that the UNO uses as GND reference.
The first diagram, the voltage changes because the CURRENT through the LDR and resistor changes as the light level changes on the LDR.
Because the resistor is fixed in value, it will drop a voltage proporional to the total current flowing through the LDR and resistor.
I get it now. It was reading the GND the entire time, that's why it was showing 0.
After quickly reading an article, it really clarified everything for me.
Thanks Tom
Rebuilt this circuit
Set battery-voltage to 100V and both resistors to 100 Ohm
Then change the value of one resistor and watch the two voltage measurings