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!


In reply to Re^2: Using Perl to make a hot-lead from any port by aufflick
in thread Using Perl to make a hot-lead from any port by Petras

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.