Back story : I’m working on a robot with a light sensor, so I got off the breadboard and soldered together a light sensor that runs to ground, 5V, and the A0 pin.
What I did was returning only 1023 no matter the light source. (Or 0, I switched things around a little in “testing”).
I went back to the bread board, created the circuit again, and realized that I had soldered the A0 line between the resistor and ground, not between the photocell and the resistor. See the attached circuits (one is called “good”, one is called “bad”).
Now, I know that one works and one doesn’t so problem solved, but I don’t get why the one that doesn’t work, doesn’t work.
Shouldn’t A0 just pull a reading off the “circuit” I created? If light is low and R2 resistance is very high, I should get a low reading, and if the light is bright and R2 resistance is low, I should get a higher reading.
I don’t really see why the “bad” circuit is always reading 5V (or 0V. I swapped the ground and 5V around and forgot which way gave what), but the good circuit reads correctly.
Thanks. I know this is circuits 101 stuff. FTR, I got the same behavior in autodesk circuits. And, when I cut the joint and resoldered correctly everything worked, so I don’t think my soldering was a source of the problem.