I'm looking for a simple pcboard or kit to make one. I'm pretty much
a beginner in electronics but I have made one pcboard to open and
close switches. I use it to keep my telescope from turning to far
east/west or north/south in a remote observatory. I know how to
program in C. I want to be able to use the pcboard to open/close a 5V
relay that will then start/stop a motor that can open close the
observatory roof. I can make this work with a battery but would like
to be able to control from inside the house. So I guess I'm looking
for a simple pcboard that I can program in C to give 5V output.
Hi, Bob. Your question is kind of vague and has a number of answers,
depending on how you want to solve your problem.
1) One IC programmable in C. Get a PIC, and purchase one of the many
C compilers which are available.
2) Small stand-alone Single Board Computer. Try the Rabbit. It
comes with a Dynamic C compiler (an in-house multi-threading C
compiler), and it's reliable and inexpensive.
3. A quick 'n' dirty parallel port hack. You can do what you want by
connecting a perfboard to your parallel port, and putting the relay on
the perfboard (you'll need a separate wall wart DC power supply for
the relay -- the port I/O pins don't have that much drive capability).
If you're doing this from DOS, it's trivial -- get a junker '286, set
the port for SPP in BIOS, and use outportb() to bit-bang the I/O port
number. It's more difficult in Windows because of conflicts with the
OS. You'll need drivers for your device, which are not trivial to
write. A good place to start with this is Jan Axelson's "Parallel
Port Complete", a book which goes into great detail on all of this.
Examples are available for many languages and OS in the book.
3a) A Q&D PP hack with a kit.
You might want to look at the Velleman K8000RS Computer Control
Interface Kit available from Jameco for $139.95 USD in single
quantities as Jameco #128928. It has 16 optocoupled inputs/relay
outputs, and includes a disk with C++ source code (DOS only, I
believe). The Velleman kits are well-made, and a good choice for the
beginner, with soldering and layout instructions that are easy to
4) You want to control a large number of relays from a PC. A good
place to start with this is Measurement Computing CIO-DIO24H, a PC
board available for $109.00 USD. The ISA card gives you 24
byte-selectable inputs or outputs, and will give you outputs which can
source 15 mA and sink 64 mA. While that's not enough to pull a relay
coil by itself, and there's no diode protection for the TTL-level
outputs, you can hook up perfboards to the DB-37 connector in the
back. If you want, you can also order an interface board which hooks
up to this, and provides the relays. Programming in C in DOS is
trivial, and you can use the Measurement Computing Universal Library
routines for C libraries of functions in Visual C. If you have
questions, you can call their apps people -- they're very helpful.
I'd recommend against buying a PC card with the relays on the card --
relay contact arcing in the PC box can sometimes cause your computer
Or possibly you have something else in mind. These are just the first
ideas that come to mind -- there's plenty more.
Your call. Good luck.