Home Electrical Control.pdf

(16 KB) Pobierz
Home Electrical Device Control HOWTO
Rui Li
ruili@worldnet.att.net
Joy Yokley −
Coverted document from Linuxdoc to DocBook v4.1 (SGML).
2001−06−13
Revision History
Revision 0.006
Revision 0.005
Revision 0.004
2001−06−27
2001−06−13
2001−06−12
Revised by: JEY
Revised by: RL
Revised by: JEY
This HOWTO will tell you how to use Linux to control your home electrical devices. You will only need to
make a very simple circuit to control almost any kind of electrical device using Linux!
Home Electrical Device Control HOWTO
Table of Contents
1. Introduction.....................................................................................................................................................1
2. System Requirement.......................................................................................................................................2
3. Electronic Circuit............................................................................................................................................3
4. Examples of Relays.........................................................................................................................................4
5. Special Thanks................................................................................................................................................7
6. Copyright and License
....................................................................................................................................8
i
1. Introduction
Many people asked me, "Is it possible to control some electrical stuff [e.g. lights, radio, tv, etc.] by using a
home computer?" The answer is YES. The process is very easy, and anyone can do it.
After I read the Coffee Machine Mini−HOWTO, I got an idea of how to control my home electrical
appliances. I made some modifications on the circuit discussed in that Coffee Machine Mini−HOWTO, and
wrote a simple program. The circuit can control many small electrical devices.^_^ You can use
crontab
to set
your lights to come on automatically or to turn on your airconditioner. I use it to control my VCR and VCD (
I do still need some modification on VCR/VCD). By writing a simple program, you can control everything
over the web. You can use telnet with SSH and your telephone dial in to control all the appliances you have
on the circuit.
This circuit is VERY SIMPLE. Even if you don't know anything about circuits, you can set up this circuit.
1. Introduction
1
2. System Requirement
Get any computer that is running Linux and has a working parallel port. :) I'm using a 386DX with 4MB
RAM 40MB HD. You will need gcc to compile the program. If you want to use telnet or SSH, you will also
need telnetd or sshd. You can write your own program by using ioperm and outb. If you would like to use my
program, you will need g++.
Click the following link to download my program. You will need g++ to compile it.
home.att.net/~ruili/goldencat/paralle.tar.gz.
2. System Requirement
2
3. Electronic Circuit
The data line of the parallel port can provide between 0 and 5 volts. Therefore, we can use this line to control
a relay and let that relay control an electrical device.
Use pins 2 through 9 to get +5V
Use pins 18 through 25 as the Ground
____________________________________________________________
/
\
\
\
25 24 23 22 21 20 19 18 17 16 15 14
/
\______________________________________________________/
13
12
11
10
9
8
7
6
5
4
3
2
1
/
\
/
| Vcc for Relay
|
|
/ −−−−−−−+−−−−−−−−| |−−−−−−−−−|
P data
4.7K
B / c
| 1N4002 |_|
|−−−−−−−
−−−−−−−−−−−/\/\/\/\−−−−−−−−−+−−−−−| NPN
___
| relay
|home device
|
\
e
__\_/__
|−|
|−−−−−−−
LED
X
\
|−−−−−−−−| |−−−−−−−−−|
P Ground
|
|
|
−−−−−−−−−−−−−−−−−−−−−−−−−−−−+−−−−−−−+−−−−−−−−+
Relay Ground
|
−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−+
Below is the key to the diagram above:
P data
P Ground
Vcc
Relay Ground
4.7k
NPN
1N4002
LED
relay
parallel port data line(pin 2 to pin 9, use any)
parallel port ground (pin 18 to pin 25, use any)
depends on the type of your relay. I'm using 12VDC
the ground for 12VDC
4.7K resistor
C2235 NPN transistor
1N4002 diode
light emitting diode
a coil relay
+5 volts from parallel port will turn on the relay. Once the relay is on, the device connected to that relay will
be on. When the parallel port's data line goes back to 0, it will turn off the relay, and device is off.
3. Electronic Circuit
3
Zgłoś jeśli naruszono regulamin