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.
-
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.
|