using serial or parallel port for TTL input

HI,

I would like to be able to use my PC to detect when a transistor is high. I have found several circuit designs on how to control a transistor from a serial or parallel port, but none for detecting the state of transistor.

I want to build a laser beam break detector like this :

formatting link

When the beam is broken, a transistor will be triggered and I would like the computer to sense when the line is high.

Can this be done with a serial or parallel port?

thanks chad

Reply to
chad
Loading thread data ...

If you have a logic level signal, simplest thing is to use one of the status bits that the printer sends to the computer. There are ways on many parallel ports to reverse the data lines too, but you shouldn't need to resort to that when you already have dedicated inputs.

You could alternatively use a control input on the serial port, but may need a larger voltage swing for that (or may not - despite outputting larger voltages, PC serial ports can often read TTL level signals fine in low noise circumstances)

Reply to
cs_posting

Shouldn't you give it a blood test, or urinalysis?

;-)

Reply to
Rich, Under the Affluence

Chad, since you're obviously a bit uneducated about controlling a parallel port, I suggest you look at Jan Axelson's web site at

formatting link
Jan has several books on using the parallel and serial ports on a PC to control external circuitry, as well as using these ports to monitor external events. Check out the parallel port links and you'll learn a lot about what you're trying to do. A copy of her book Parallel Port Complete will teach you more than you ever wanted to know about the parallel port.

Cheers!!!!

--
Dave M
MasonDG44 at comcast dot net  (Just substitute the appropriate characters in 
the address)

Never take a laxative and a sleeping pill at the same time!!
Reply to
DaveM

thanks for the link. I think I will order the book.

thanks chad

Reply to
chad

Yes, this can be done very easy with the parallel port. You can use any one of the five status inputs on the connector. For example S3 (S7-S0 byte, S0-S2 not accesable) is on pin 15. The pin is normally high. I suggest you use an opti-isolation IC to interface the port, that way you will protect the computer if something goes wrong in your circuit. Use an opto with an NPN transistor output, such as the 4N28. Connect the transistor's collector to pin 15, and the emitter to any one of the ground pins (18-25). The led inside the opto can be connected to your monitored circuit. Now have your software poll the port and do it's routine on the bit change.

Reply to
scada

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.