Photo lnterrupter to a PC parallel port

Discussion in 'The Projects Forum' started by no1knows, Sep 22, 2010.

  1. no1knows

    Thread Starter New Member

    Sep 21, 2010
    3
    0
    Hello everyone. I'm new to this site and circuit design. :D I am looking for a little help with my project. To start out I'm just trying to attach a Photo lnterrupter to a parallel port and read the value via basic. The PC/basic stuff is not a problem.. but I seem to have a flaw in my design. I made the drawing below from memory so I might have the parallel pins wrong.. In the image below you will see i'm connected to pin 10 (one of the data input pins) and pin 25 (gnd). By default Pin 10 will hang high at 5 volts @ 2.0 mA max. My power source is 5V from the PC power supply (not the port itself) The output at R2 (lower right) from the photo interrupter(CNZ1112) will be at 5 volts when nothing is blocking the LED. 0V when blocked.

    I have two problems:

    1) the value of R2 seems to effect the response time of the photo interrupter, but it also lowers its output voltage. What would you think is the best value for this that would still keep the PC port happy? :confused:

    2) I also need to pull pin 10 low so that the parallel port pin will only be high when the LED is not blocked.. After much trail and error I was unable to find a resistor that would not pull low all the time or never at all... Am I going about this wrong? :eek:


    Datasheet for CNZ1112: http://www.semicon.panasonic.co.jp/ds4/SHG00031BED_discon.pdf


    Thanks :D
     
  2. windoze killa

    AAC Fanatic!

    Feb 23, 2006
    605
    24
    You have the parallel port pin conected to ground. You will never get any input. Move the input (pin 10) to the top of the resistor.
     
  3. eblc1388

    Senior Member

    Nov 28, 2008
    1,542
    102
    You don't need to use any resistor at all.

    The pin#10 of the printer port is an input pin and has internal pullup resistor.

    You just use the following connection:

    [​IMG]
     
  4. no1knows

    Thread Starter New Member

    Sep 21, 2010
    3
    0
    Opps.. Pin 10 connects above R2 ,not below it. I have it wired above it on my test board. I just connected it wrong in the picture.


    Re: eblc1388
    Thanks a bunch :D.... How could I be so blind :eek:.... I knew the trans needed power.. so why not use the power of the port itself... I have not tried this yet, but I will tonight.


    Thanks.
     
  5. no1knows

    Thread Starter New Member

    Sep 21, 2010
    3
    0
    Thanks for the help. Everything is working fine now.
     
Loading...