photo-interrupter state indicator

Thread Starter

Marky2891

Joined Jul 17, 2012
7
Hi all.
I would like to make a little circuit for use with a photo-interrupter, so that I can see the state of the output via bi-colour led or two leds, and also have a 0-5v output for use with a microcontroller.
So the circuit will have 3 wires, Ground, +5v, 0-5v output, photo-interrupter, one or two leds, plus what ever extra parts are needed.

The photo-interrupter has four pins.
1: A
2: C
----
3: B.
4: C.

Does anyone have a circuit layout that would be suitable for this?

Regards, Mark.
 
Last edited:

Thread Starter

Marky2891

Joined Jul 17, 2012
7
Can anyone help me with this one.

Maybe saying "circuit layout" was the wrong term to use, I should of said circuit schematic.

Regards, Mark.
 

bertus

Joined Apr 5, 2008
22,278
Hello,

From the datasheet I extracted this drawing:



As you can see the opto interupter consists of a led and a photo transistor.
You need to have a current through the led.
The datasheet states that tis current may be 50 mA max.
I used a supply voltage of 5 Volts in the calculations.
With the 180 Ohms resistor you will have a current of about 21 mA.



On the transistor there is also a resistor needed.
I used a 1K resistor giving a current of about 5 mA max.

Bertus
 

Attachments

Thread Starter

Marky2891

Joined Jul 17, 2012
7
Thanks for your reply.

I don't think I explained my self very well on my 1st post.

I understand the basics of how photo-interrupter works and how to connect it up to a microcontroller.

My question was ment to be more aimed at, what is the best way to have a single bi-led or two single leds connected to the output of the photo-interrupter, so that I can see what state the photo-interrupter is at, on or off.

I know it would be much more simple just to have one led on the output.

Regards, Mark.
 

bertus

Joined Apr 5, 2008
22,278
Hello,

When the transistor Q1 has base current, the red led will light bright.
When the transistor Q1 has no base current both leds will lit dimly, as the voltage between the leds is floating.
The green led will be a bit brighter, because it also gets the current through the 1K resistor.

Better use a logic gate to drive the leds, as it will actively pull up and down the signal.

Bertus
 

Thread Starter

Marky2891

Joined Jul 17, 2012
7
Thanks for your reply.

I have never done any work with logic gate's before.

Would you be able to show me an example circuit of how to use a logic gate to do what I need?

Regards, Mark.
 
Top