photo interrupter

I am making a DIY photo encoder using two photo interrupters would I be better connecting the power to them in series or in a star configuration.
I have already connected them up in series on a bread board I think that blue one of them up, as I tested each one first by them self and they all worked then one died.

I am using these ones Slotted Optical Switch OPB821Z from

the connections are from this site photointerrupter basics - heliosoph

If you think of the 5V and GND as "rails" then you'll see they go in parallel, across the rails.

What makes you think you blew one up?

Do you have the resistors?- the 180 is to limit current through the LED. The other is a pullup and you could simplify circuit by using the internal pullups, assuming the "OUT" goes into an Arduino IO pin.

edit.... tbh I'm not sure what you mean by connecting them in series or star.

more edit.... did you notice that the wiring in the schematic of one of those posts does not reflect the pins' physical position? In reality the led cathode and transistor emitter are diagonally opposite; the schematic might lead you think they're directly opposite.

Attached is my take on how to hook these guys up. The opto I used in my Eagle schematic better reflects the layout of the pins.



Thanks for that I connected everything up properly using the instructions for the photo interrupter I have.
when I connected one up it was working then when I connected two together one was working the other one was not.
I tested all photo interrupters before I used them they where all working.
when one died I connected them up as your Eagle schematic shows I still had one dead so swapped it out for a spear one and both where working.
what I meant by star is all the 5vdc wires coming from the same point I have them on a 5 volt supply with a common not from the arduino.

I am using a pull up as I don't know if the arduino is going to be able to run everything I wont to connect up

That 2K2 pull up looks a bit low. I would use 20 to 80K in that place. It will give a much better signal.

Star wiring is only important for things taking a lot of current or from protecting delicate things from high current grounds.

thanks will try that its all working just have to get all the values correct now

just a simple question on photo interrupter at the moment if I do an analogue read I am getting 400 odd to 1024 would it be a good idea to have it near zero to 1024

It dies not matter. It mainly depends on what material you have blocking the beam. Some are transparent to IR to some extent.

Making the pull up resistor bigger will make the unblocked reading smaller.

Thank you