View Full Version : Parallel Port / Relay Control Question


Verboten
12-14-2004, 06:12 AM
I have been trying to learn about controlling my PC's parallel port and have run into a problem.

I am currently trying to control a relay on an adjustable timer and the output from pins 2 -9 trigger my solid state relays no matter what state they are supposed to be in.

When I measure the voltage between the ground pins 18 - 25 and 2 - 9 when they are supposed to be low they are at 3.68 to 3.7 volts (fluctuating) and 4.08 when high.
I can get pin 1 to .075 low, 4.09 high - which works, but I would like to use the data pins.

Could this be a problem with the type of parallel port that my PC has or how it is set up?

The relays that I have are IDEC RSSD with 3 to 32 vdc control at 1 mA. Do I need to or should I use an IC between the port and the relay? I had tried a circuit with a 74LS367 but the one at http://www.southwest.com.au/~jfuller/sio.html seems far better. Is it wrong to wire a relay of this type directly between one of the data pins and the ground pins?

I have what I would consider to be very little knowledge about electronics, programming, and computers in general.

Any help will be appreciated.
Thanks,
Jason

unterhaus
12-14-2004, 08:01 AM
Parallel port pins don't like to source current. Your best bet is to pull the low side of the relay input down to ground through the data pin. The high side of the input would then be hooked to the power supply. I think it is wise to put some kind of IC to buffer the computer port.

It's been a while since I've programmed the parallel port. You have to set it up for output. Are you using someone else's code?

sol
12-14-2004, 06:42 PM
Check out this thread
http://cnczone.com/forums/showthread.php?t=3292&page=5&pp=5

Verboten
12-14-2004, 06:51 PM
Hello and thanks for the reply

I want to use a timer in visual basic.net along with the IO.DLL from here:http://www.geekhideout.com/iodll.shtml to operate the data pins. That seems to work because I do have control over that 4 tenths of a volt (wow!).

Their parallel port monitor: http://www.geekhideout.com/parmon.shtml can also toggle the pins.

I have never wired anything in the way that you described. I saw it mentioned in a parallel port faq and thought that it would be difficult for me to do - calculations and accurate testing. It certainly did seem like a better way to do it though. If I remember right you can draw more than 2x the current.

But, even if I did this wouldn't I still not have enough difference in voltage between the two states ( High/Low) to make the relay turn off? - not sure if that is the right way to phrase it.

Thanks Again,
Jason

Al_The_Man
12-14-2004, 07:33 PM
The 2n7000 mentioned in the link has a threshold of 0.8v to 3.0v anything below .8 is off above 3.0 is on.There is essentially no loading of the port.
Al

pminmo
12-14-2004, 07:49 PM
Verboten,
This might be of help to you, go to my website:
http://webpages.charter.net/pminmo/cncelectronics.htm
Looks at the 3 or 4 axis interface board. This is the link for the document:
http://members.tripod.com/pminmo/4axisBOBdata.pdf

The aux1 driver is specifically for driving a relay. It will work with a ssr or mechanical relay. By connecting your relay between the x5-1 pin and x5-2 pin you would be able to switch your relay. All you really need is a npn transistor and a resistor.

http://www.beyondlogic.org/spp/parallel.htm Is an excellent primer on the parallel port as well as http://www.hut.fi/Misc/Electronics/circuits/lptpower.html

Phil

Verboten
12-21-2004, 07:37 AM
Thanks for the replies, they have all been helpful.

I did get the relay to work. I switched to a pc running dos and made a simple program in qbasic. The pins on that pc operated like I wanted (low below 0.8v , high above 4v). That made the 74LS367 circuit work and then the relay.

I will try a 2n7000 when I place another order.

I'm still not quite sure why my windows xp pc didn't work. I think that it might be because of the type of parallel port that it has or possibly something in the io.dll file that I was using - I have no clue how or exactly what it does. I'm kind of glad that it didn't work because it seemd to be needlessly complex - maybe I should study about Linux.

Qbasic and dos allowed me to directly address the port, the timer seems to be much better, and I really didn't need a windows form. I was really amazed how easy it was.

pminmo
12-21-2004, 05:17 PM
An application can't call a parallel port directly in XP. You need a driver.

Phil