Why does order of connections in this Phototransistor-Resistor circuit matter

I have this circuit. I remember when I was putting it together I had the wiring of the A0 pin to the phototransistor different. The current setup is this:

orderofwires.jpg

In this image the order is:

R-A0-Emitter

but originally I remember I had it:

A0-R-Emitter

Does it matter?

The question in the title and the post differ, so why do you think it matters?

And about the connection, where does that "emitter" connect? In other words, place the whole circuit diagram :wink:

You can swap resistor and photodiode.

If the diode is connected to ground, light makes the pin low.
If the diode is conected to +5volt, light makes the pin high.

So if you swap parts, you also have to swap the HIGH and LOW pin readings in the code.
Leo..

Here is the diagram:

nightlightwiringorder-2.jpg

I mean I can see that in the second one, the A0 pin goes to ground “before” reaching the emitter.

Marciokoko:
Here is the diagram:

nightlightwiringorder-2.jpg

I mean I can see that in the second one, the A0 pin goes to ground “before” reaching the emitter.

Those two diagrams show identical circuits.

Yeah, identical connections.

Resistor holds A0 low, until light hits Photo trans, Then theoretically connects +5V directly to A0 (as in going high).

Pretty dirt simple.

123Splat

Thanks, that's an brilliantly simple explanation. I'm not an electronics guy, it's just a hobby. That is a great way to explain it.

Thanks