photo-interrupter state indicator

Discussion in 'General Electronics Chat' started by Marky2891, Jul 17, 2012.

  1. Marky2891

    Thread Starter New Member

    Jul 17, 2012
    7
    0
    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: Jul 17, 2012
  2. Marky2891

    Thread Starter New Member

    Jul 17, 2012
    7
    0
    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.
     
  3. bertus

    Administrator

    Apr 5, 2008
    15,648
    2,348
    Hello,

    Do you have a datasheet of the opto interupter?

    Bertus
     
  4. Marky2891

    Thread Starter New Member

    Jul 17, 2012
    7
    0
  5. bertus

    Administrator

    Apr 5, 2008
    15,648
    2,348
    Hello,

    From the datasheet I extracted this drawing:

    [​IMG]

    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.

    [​IMG]

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

    Bertus
     
  6. Marky2891

    Thread Starter New Member

    Jul 17, 2012
    7
    0
    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.
     
  7. Marky2891

    Thread Starter New Member

    Jul 17, 2012
    7
    0
    Am I anywhere near close with this?
     
  8. bertus

    Administrator

    Apr 5, 2008
    15,648
    2,348
    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
     
  9. Marky2891

    Thread Starter New Member

    Jul 17, 2012
    7
    0
    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.
     
  10. Marky2891

    Thread Starter New Member

    Jul 17, 2012
    7
    0
    As said above, I have never done any work with Logic Gates before.

    But is this right?
     
  11. MrChips

    Moderator

    Oct 2, 2009
    12,449
    3,365
    For maximum brightness you can do it this way:

    [​IMG]
     
Loading...