Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
As zentara just said and I posted in Re: Does Perl ring a bell?, a simple optoisolator will help you out with a minimal # of components. A 4N27 is a good choice, and it's dirt cheap, less than $0.50USD in single quantities. Current capacity of the phototransistor is only 50 ma, so you need to keep your driver relay small. A larger one, with a FET output phototransistor, is an NTE 3085. This one can handle 100ma. In either case, you can pulse a higher-current relay safely, but be aware that the length of the pulse needed is longer that the actual "clap" you will end up with, due to the mechanical nature of the system.

Another possibility to explore is Opto-22 Solid-State Relays and similar generic products. These are commonly available on the surplus market, and can be wired up (in carefully sealed boxes!!!) to control such things as coffeepots and other AC appliances. I buy them surplus for $5 - $10USD and they're just as easy to use as the little DIP versions. Take care, though. Playing with AC can be deadly if you do not protect your wiring. I usually mount the SSR inside a steel 4"x4" deep handi-box along with a regular outlet and 3-wire plug on SJ cord.

Be aware that once you start making your computer go "thump!" in the night (or "ding!", or "buzz", or ???), it's hard to stop. Embedded systems are some of the most fun computing systems around; they're highly addictive.

In reply to Re: Using Perl to make a hot-lead from any port by samizdat
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":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (5)
As of 2024-04-25 06:13 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found