368 lines
8.0 KiB
HTML
368 lines
8.0 KiB
HTML
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
|
<HTML
|
|
><HEAD
|
|
><TITLE
|
|
>Examples of Relays</TITLE
|
|
><META
|
|
NAME="GENERATOR"
|
|
CONTENT="Modular DocBook HTML Stylesheet Version 1.7"><LINK
|
|
REL="HOME"
|
|
TITLE="Home Electrical Device Control HOWTO"
|
|
HREF="index.html"><LINK
|
|
REL="PREVIOUS"
|
|
TITLE="Electronic Circuit"
|
|
HREF="circuit.html"><LINK
|
|
REL="NEXT"
|
|
TITLE="Special Thanks"
|
|
HREF="thanks.html"></HEAD
|
|
><BODY
|
|
CLASS="SECT1"
|
|
BGCOLOR="#FFFFFF"
|
|
TEXT="#000000"
|
|
LINK="#0000FF"
|
|
VLINK="#840084"
|
|
ALINK="#0000FF"
|
|
><DIV
|
|
CLASS="NAVHEADER"
|
|
><TABLE
|
|
SUMMARY="Header navigation table"
|
|
WIDTH="100%"
|
|
BORDER="0"
|
|
CELLPADDING="0"
|
|
CELLSPACING="0"
|
|
><TR
|
|
><TH
|
|
COLSPAN="3"
|
|
ALIGN="center"
|
|
>Home Electrical Device Control HOWTO</TH
|
|
></TR
|
|
><TR
|
|
><TD
|
|
WIDTH="10%"
|
|
ALIGN="left"
|
|
VALIGN="bottom"
|
|
><A
|
|
HREF="circuit.html"
|
|
ACCESSKEY="P"
|
|
>Prev</A
|
|
></TD
|
|
><TD
|
|
WIDTH="80%"
|
|
ALIGN="center"
|
|
VALIGN="bottom"
|
|
></TD
|
|
><TD
|
|
WIDTH="10%"
|
|
ALIGN="right"
|
|
VALIGN="bottom"
|
|
><A
|
|
HREF="thanks.html"
|
|
ACCESSKEY="N"
|
|
>Next</A
|
|
></TD
|
|
></TR
|
|
></TABLE
|
|
><HR
|
|
ALIGN="LEFT"
|
|
WIDTH="100%"></DIV
|
|
><DIV
|
|
CLASS="SECT1"
|
|
><H1
|
|
CLASS="SECT1"
|
|
><A
|
|
NAME="RELAY"
|
|
></A
|
|
>4. Examples of Relays</H1
|
|
><P
|
|
>The diagrams below are used to explain how relays work.</P
|
|
><P
|
|
>The relay itself is just a switch as seen in the diagram below:</P
|
|
><TABLE
|
|
BORDER="0"
|
|
BGCOLOR="#E0E0E0"
|
|
WIDTH="100%"
|
|
><TR
|
|
><TD
|
|
><FONT
|
|
COLOR="#000000"
|
|
><PRE
|
|
CLASS="PROGRAMLISTING"
|
|
>relay power off relay power on
|
|
|
|
|3 |3
|
|
| |
|
|
| |
|
|
o o
|
|
\ |
|
|
o \ o
|
|
| |
|
|
| |
|
|
| |
|
|
|4 |4 </PRE
|
|
></FONT
|
|
></TD
|
|
></TR
|
|
></TABLE
|
|
><P
|
|
>The diagram below demonstrates the setup of a 4 pin relay.</P
|
|
><TABLE
|
|
BORDER="0"
|
|
BGCOLOR="#E0E0E0"
|
|
WIDTH="100%"
|
|
><TR
|
|
><TD
|
|
><FONT
|
|
COLOR="#000000"
|
|
><PRE
|
|
CLASS="PROGRAMLISTING"
|
|
> ____________________________
|
|
| |
|
|
1 | | 3
|
|
-----|---------s o----------|-------
|
|
| coil s \switch |
|
|
2 | s \ | 4
|
|
-----|---------s o- \-------|-------
|
|
| |
|
|
| |
|
|
| |
|
|
|__________________________| </PRE
|
|
></FONT
|
|
></TD
|
|
></TR
|
|
></TABLE
|
|
><P
|
|
> In the diagram above, pin 3 and pin 4 are disconnected by default.
|
|
When you send +12V between pin 1 and pin 2,
|
|
it will turn on a switch, and pin 3 and 4 are now connected.
|
|
</P
|
|
><P
|
|
>The following is a 5 pin relay:</P
|
|
><TABLE
|
|
BORDER="0"
|
|
BGCOLOR="#E0E0E0"
|
|
WIDTH="100%"
|
|
><TR
|
|
><TD
|
|
><FONT
|
|
COLOR="#000000"
|
|
><PRE
|
|
CLASS="PROGRAMLISTING"
|
|
> _______________________________
|
|
| |
|
|
1 | | 5
|
|
---------|---+ o------------|----------------
|
|
| |-----------/---- s |
|
|
| / s |
|
|
3 | / s |
|
|
---------|-----------o/ coil s | 4
|
|
| o---s-------|----------------
|
|
| | |
|
|
| | |
|
|
2 | | |
|
|
----------|---------------------+ |
|
|
|_____________________________|</PRE
|
|
></FONT
|
|
></TD
|
|
></TR
|
|
></TABLE
|
|
><P
|
|
> In the above diagram pin 3 is connected to pin 5, by default.
|
|
By sending +12V between pin 1 and pin 2, you will
|
|
will turn on a switch. Pin 1 and pin 2 will disconnect,
|
|
and pin 5 and pin 4 will connect.
|
|
</P
|
|
><TABLE
|
|
BORDER="0"
|
|
BGCOLOR="#E0E0E0"
|
|
WIDTH="100%"
|
|
><TR
|
|
><TD
|
|
><FONT
|
|
COLOR="#000000"
|
|
><PRE
|
|
CLASS="PROGRAMLISTING"
|
|
> relay power off relay power on
|
|
|
|
|5 |5
|
|
| |
|
|
| |
|
|
o o
|
|
\ |
|
|
o \ o o
|
|
| o | |
|
|
| | | |
|
|
| | | |
|
|
4| |3 4| |3</PRE
|
|
></FONT
|
|
></TD
|
|
></TR
|
|
></TABLE
|
|
><P
|
|
>Some relays may have more that 5 pins. More pins just means there are more switches.</P
|
|
><P
|
|
>I wrote a simple program that can control 8 relays. The program is available at the following location and
|
|
will need g++ in order to be able to use this program.
|
|
<A
|
|
HREF="http://edc.sourceforge.net/paralle.tar.gz"
|
|
TARGET="_top"
|
|
>http://edc.sourceforge.net/paralle.tar.gz</A
|
|
></P
|
|
><P
|
|
>A complete circuit can control up to eight relays, that means that a complete circuit can control
|
|
eight different devices. You will need a DB25 connector. Using a parallel
|
|
switch cable, connect this relay board to your computer. I put the relay board in a box
|
|
and use a parallel switch cable to connect it to my Linux box:</P
|
|
><TABLE
|
|
BORDER="0"
|
|
BGCOLOR="#E0E0E0"
|
|
WIDTH="100%"
|
|
><TR
|
|
><TD
|
|
><FONT
|
|
COLOR="#000000"
|
|
><PRE
|
|
CLASS="PROGRAMLISTING"
|
|
>Panel: LED, Switch Back: DB25 connector</PRE
|
|
></FONT
|
|
></TD
|
|
></TR
|
|
></TABLE
|
|
><P
|
|
>Below is an example of how a relay board would connect with your electrical device:</P
|
|
><TABLE
|
|
BORDER="0"
|
|
BGCOLOR="#E0E0E0"
|
|
WIDTH="100%"
|
|
><TR
|
|
><TD
|
|
><FONT
|
|
COLOR="#000000"
|
|
><PRE
|
|
CLASS="PROGRAMLISTING"
|
|
> CONNECTED RELAY BOARD
|
|
|
|
|
|
+-----+ power outlet
|
|
1 _______3 | __|________ || ||
|
|
--| |---------+ | | | || ||
|
|
2 |relay|4 | (o) (o) | _||___||__
|
|
--|_____|----+ |------|---| | |
|
|
| | | |
|
|
| +------------+ | | plug
|
|
ground | | hot | |
|
|
| | | |
|
|
__|_|__ | |
|
|
| | | | |________|
|
|
| | | | plug
|
|
| | | |
|
|
|_|_|_| (i know it doesn't look like a plug, but it's a plug :-) )
|
|
|| ||
|
|
|| || </PRE
|
|
></FONT
|
|
></TD
|
|
></TR
|
|
></TABLE
|
|
><P
|
|
> To connect the system, just connect your home electrical device to the power outlet. That is it!
|
|
You don't need to make any change on the electrical device. And you can
|
|
connect any kind of device to that power outlet. Plug this power outlet into any wall outlet.
|
|
</P
|
|
><P
|
|
>To see photos of what the finished product looks like, go to the following sites:</P
|
|
><P
|
|
></P
|
|
><UL
|
|
><LI
|
|
><P
|
|
><A
|
|
HREF="http://edc.sourceforge.net/p1.jpg"
|
|
TARGET="_top"
|
|
>http://edc.sourceforge.net/p1.jpg</A
|
|
></P
|
|
></LI
|
|
><LI
|
|
><P
|
|
><A
|
|
HREF="http://edc.sourceforge.net/p2.jpg"
|
|
TARGET="_top"
|
|
>http://edc.sourceforge.net/p2.jpg</A
|
|
></P
|
|
></LI
|
|
><LI
|
|
><P
|
|
><A
|
|
HREF="http://edc.sourceforge.net/p3.jpg"
|
|
TARGET="_top"
|
|
>http://edc.sourceforge.net/p3.jpg</A
|
|
></P
|
|
></LI
|
|
></UL
|
|
><P
|
|
>The following URL shows a complete electronic circuit (control 8 devices):
|
|
<A
|
|
HREF="http://edc.sourceforge.net/01.png"
|
|
TARGET="_top"
|
|
>http://edc.sourceforge.net/01.png</A
|
|
></P
|
|
></DIV
|
|
><DIV
|
|
CLASS="NAVFOOTER"
|
|
><HR
|
|
ALIGN="LEFT"
|
|
WIDTH="100%"><TABLE
|
|
SUMMARY="Footer navigation table"
|
|
WIDTH="100%"
|
|
BORDER="0"
|
|
CELLPADDING="0"
|
|
CELLSPACING="0"
|
|
><TR
|
|
><TD
|
|
WIDTH="33%"
|
|
ALIGN="left"
|
|
VALIGN="top"
|
|
><A
|
|
HREF="circuit.html"
|
|
ACCESSKEY="P"
|
|
>Prev</A
|
|
></TD
|
|
><TD
|
|
WIDTH="34%"
|
|
ALIGN="center"
|
|
VALIGN="top"
|
|
><A
|
|
HREF="index.html"
|
|
ACCESSKEY="H"
|
|
>Home</A
|
|
></TD
|
|
><TD
|
|
WIDTH="33%"
|
|
ALIGN="right"
|
|
VALIGN="top"
|
|
><A
|
|
HREF="thanks.html"
|
|
ACCESSKEY="N"
|
|
>Next</A
|
|
></TD
|
|
></TR
|
|
><TR
|
|
><TD
|
|
WIDTH="33%"
|
|
ALIGN="left"
|
|
VALIGN="top"
|
|
>Electronic Circuit</TD
|
|
><TD
|
|
WIDTH="34%"
|
|
ALIGN="center"
|
|
VALIGN="top"
|
|
> </TD
|
|
><TD
|
|
WIDTH="33%"
|
|
ALIGN="right"
|
|
VALIGN="top"
|
|
>Special Thanks</TD
|
|
></TR
|
|
></TABLE
|
|
></DIV
|
|
></BODY
|
|
></HTML
|
|
> |