in reply to Re: Using Perl to make a hot-lead from any port
in thread Using Perl to make a hot-lead from any port

As mentioned by a few people in Does Perl ring a bell?, one of the oldest and easiest (and hackiest) way to get digital control out of PC style hardware is the parallel port. If you don't have one, a USB one should work since the windows or linux dirvers will take care of making it seem like a normal printer port.

http://ourworld.compuserve.com/homepages/Bill_Bowden/page6.htm shows a simple circuit that uses only a single 5v relay and one resistor or very simple circuits using transistors to run a 12v relay. As others have said though, you should probably add in an opt-isolator. You could use the output of a low voltage one to drive a transistor output stage much like the non-isolated 12v on on the page linked.

One of the big beneifts of the parallel port over USB is that it supplies 5v, which means you have a lot more relays/opto-thingamies that you can use.

Ah this makes me remember why electronics was so much fun when I was a kid :)

PS: Great stuff with the volunteer work, just don't electrocute yourself in the process!

  • Comment on Re^2: Using Perl to make a hot-lead from any port

Replies are listed 'Best First'.
Re^3: Using Perl to make a hot-lead from any port
by samizdat (Vicar) on Oct 05, 2005 at 12:37 UTC
    One of the things to be careful of when using TTL-level signals is that 'low' is not 'off'. Low is typically 'anything less than 1.3 volts', which will often leave you with a measurable current draw even if your relay does not trip. The serial port goes from +12 to -12, and so an LED behaves as a diode, passing zero current when your bit is 'off'.

    The parallel port is indeed a great place to tie digital signals; but it is HIGHLY recommended that you use an optoisolator there as well. Most ports are implemented on the motherboard these days, and motherboards still cost a bit more than a bucket of sand. :D