Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

parallel port light detector

Status
Not open for further replies.

3dOptics

Member
I would like to build a circuit that interfaces with my computers parallel port to detect if a led is on or off. Could I just replace the switch in the image with a photo diode? Thanks.
 

Attachments

  • circuit.gif
    circuit.gif
    1.5 KB · Views: 359
You don't need the 330Ω resistor in either circuit. Short it out.
Depending on the sensitivity required, you could attach a photo-transistor directly in place of the switch. Adding a 2nd transistor to boost the sensitivity is also possible as is adding a comparator circuit.
To use a photodiode you'd need to add a comparator IC for it to be able to drive the parallel port.
 
My circuit is based on the one from the website below. I basically just simplified the 5 input to a 1 input circuit. It refers to the 330 resistor as a "safety resistor". Are you sure I should leave it out?
Parallel port output

I plan to mount the photo transistor right next to this led. Would I need to add a transistor to the circuit or is the light from the led bright enough for the photo transistor to detect?
https://www.electro-tech-online.com/custompdfs/2010/01/ds300039.pdf

Which photo transistor would you recommend. Least expensive preferred.
phototransistor
 

Attachments

  • circuit.gif
    circuit.gif
    2.3 KB · Views: 349
It refers to the 330 resistor as a "safety resistor". Are you sure I should leave it out?
The only problem with leaving it in is it adds a voltage drop. It is only really necessary on a pin which can be configured as either an output OR and input. You wouldn't need it on pins 10-13 & 15. That said, the safety resistor may save your ass (and pins 10-13 & 15) if you connected it to 12V or something.

I plan to mount the photo transistor right next to this led. Would I need to add a transistor to the circuit or is the light from the led bright enough for the photo transistor to detect?
It should be bright enough at close range. How far away is it going to be? Be sure to use a transistor with the same peak wavelength sensitivity as the LEDs peak wavelength output. What colour is the LED you have? The datasheet you posted covers 3 different colours and thus 3 different peak wavelengths.
 
I don't see many photo transistors @ Mouser which match that LED. What exactly are you trying to do?
There are photo interrupters which come as a package with matched emitters and detectors. These are used to detect objects passing through the slot.
Then there are opto-isolators for electrically isolating a signal, usually for safety reasons. They contain a optically linked LED and photo-detector in a single package.
 
Last edited:
For the MV5094A, the datasheet has the Peak Wavelength (nm) 660/635.

Mouser has a photo transistor that has a 660 nm Peak Wavelength:
EL-PLT131/6 Everlight Photodetector Transistors


How critical is it that the peak wavelength of the transistor match the wavelength of the led? If the wavelength of the led is different than the transistor, will the transistor detect the light? In my case ambient light is not a problem.
 
For photo diodes Wikipedia shows:

Material Wavelength range (nm)
Silicon 190–1100
Germanium 400–1700
Indium gallium arsenide 800–2600
Lead(II) sulfide <1000-3500

According to the datasheet this photo transistor is silicon. I do not how much difference there is between photo diodes and photo transistor with regard to wavelength range.
EL-PT204-6C Everlight Photodetector Transistors
 
Mouser has a photo transistor that has a 660 nm Peak Wavelength:
EL-PLT131/6 Everlight Photodetector Transistors
Yes, I did see that one. It doesn't look like it would be a standard photo-transistor, but rather a fiber optic transmitter going by similar part #s on **broken link removed**. Everlight's website doesn't list a datasheet for the PLT131, so I would avoid it.


How critical is it that the peak wavelength of the transistor match the wavelength of the led?
The sensitivity is a curve which looks like a steep mountain. So it's "off-colour" sensitivity could be anywhere from 50% to 5% of the peak sensitivity or less.


If the wavelength of the led is different than the transistor, will the transistor detect the light?
Yes. See above. What are you try to accomplish anyway? Will a optocoupler or photo-interrupter not work? Why the need for two discreet devices?
 
I have a motor that moves clockwise and counterclockwise. I would like to know when the motor is on or off. The direction of movement is not important. Visual indication and also feedback to the parallel port. See image.
 

Attachments

  • Untitled.jpg
    Untitled.jpg
    8.9 KB · Views: 228
Last edited:
Ah. I see now why you chose a bi-colour LED.
An AC opto coupler would be the solution for you. The AC opto couplers have two back to back LEDs just like your bi-colour LED does. The 859-LTV-814 from mouser should work in this application. You could connect it like this:
 

Attachments

  • motorled.jpg
    motorled.jpg
    24.9 KB · Views: 206
Ah. I see now why you chose a bi-colour LED.
An AC opto coupler would be the solution for you. The AC opto couplers have two back to back LEDs just like your bi-colour LED does. The 859-LTV-814 from mouser should work in this application. You could connect it like this:

My power source is DC. Would an AC opto coupler work with a DC power source?
 
My power source is DC. Would an AC opto coupler work with a DC power source?
Yes, it'll work perfectly. It will also work no matter which polarity is applied to the LED input. I chose it for this feature because of your reversing DC motor.
 
Last edited:
Pin 12 on my parallel port is high. If I connect pin 12 to ground then it goes low. Do I need the +5v and 3k resistor?
 

Attachments

  • motorled.jpg
    motorled.jpg
    14.7 KB · Views: 185
  • ParallelPortMonitor.jpg
    ParallelPortMonitor.jpg
    12.3 KB · Views: 148
Sounds like you can get away without it. If the voltage between pins 12 & 25 is more than 2.4 V, then you can eliminate the +5v and 3k pullup resistor. You still need the 3.3K on the motor side to limit LED current.
 
Last edited:
Pin 12 goes low when the motor is on but it will randomly flucate between high and low. This problem seems to occur when the voltage on pins 1 and 2 is below 1.18v. Would I be correct in assuming that I need to use a resistor that has less resistance than the current 3.3K 1/2w in use.

motor off, pin 3 and pin 4 = 4.5v
motor on, pin 3 and pin 4 = 0.5v...0.08v

motor off, pin 1 and pin 2 = 0v
motor on, pin 1 and pin 2 = 1.06v...1.19v
 
This problem seems to occur when the voltage on pins 1 and 2 is below 1.18v.
What is the voltage across the motor at this point?

How is the motor controlled? ie: Is it controlled via a PWM motor speed controller or is it being fed straight DC?
You could reduce the resistor value to increase the LED current in the opto if the motor is running on straight DC. I wouldn't go beyond 30ma LED current as the max for the LTV-814 is 50ma.
 
What is the voltage across the motor at this point?

How is the motor controlled? ie: Is it controlled via a PWM motor speed controller or is it being fed straight DC?
You could reduce the resistor value to increase the LED current in the opto if the motor is running on straight DC. I wouldn't go beyond 30ma LED current as the max for the LTV-814 is 50ma.

The motor is being fed straight DC.

Motor voltage: 30v(starting)...43v(before motor stops). Problem occurs when the voltage is less than 37v.
 
Last edited:
Then, yes, reducing the resistor value will work. You'll have to up the wattage rating of the resistor or just add another one in parallel.
 
Last edited:
Bipolar Led:
*Peak Forward Current: 90mA
*Continuous Forward Current: 30mA
*Forward Voltage max: 2.8v
*Typical: 2.0v

LTV-814:
*Peak Forward Current: 50mA
*Continuous Forward Current: 30mA
*Forward Voltage max: 1.4v
*Typical: 1.2v


R = V/I
R = 43/0.03
R = 1,433 ohm

P = (V^2)/R
P = (43*43)/1,433ohm
P = 1.29 watts


I tried a 2watt 1.5Kohm and the problem still occurs.
 
Last edited:
Status
Not open for further replies.

Latest threads

Back
Top