-5
\$\begingroup\$

I need to control some relays via parallel port data pins.I am looking for the simpliest circuit for that and a sample program in C for Linux or for windows xp or above.Are there any?

\$\endgroup\$
  • 4
    \$\begingroup\$ This is a very poor question for this site, and here is why... Programming for computers is off-topic here (only firmware is on-topic), so this leaves the hardware part of your question about controlling some relays via a parallel port. What relays are you using? What voltage are you switching? What voltage does your relay need to get controlled by? All of those questions are just a start to what you would need to answer before we could be any help. \$\endgroup\$ – Kellenjb Jan 20 '12 at 1:25
  • \$\begingroup\$ See here for lots of parallel (and other) port info: lvr.com \$\endgroup\$ – Steve Fallows Jan 20 '12 at 3:04
  • 1
    \$\begingroup\$ @Kellenjb - both transistors circuits to drive relays from parallel port type signals - and in today's world the necessary hoops to jump through to directly assert parallel port output bits while running under a multitasking operating system - are very much on topic here. It's really sad to see such a key question (which probably mirrors early projects bridging the software-hardware divide done by many here) be downvoted. \$\endgroup\$ – Chris Stratton Jul 29 '12 at 16:18
6
\$\begingroup\$

You may find this article illuminating: http://www.codeproject.com/KB/cs/csppleds.aspx . It deals with controlling LEDs with parallel port.

Here's an example of a relay driver circuit. The choice of an NPN transistor depends on coil current that your relay requires. Post the model of the relay you're planning to use, and I'll help you pick a transistor.

enter image description here

So, if you replace LEDs in the CodeProject article with relay driver circuits (or hook them up in parallel), you'll be able to control relays via parallel port. You can also find ready-made hardware if you look-up parallel port relay board .

\$\endgroup\$

protected by Kortuk Sep 10 '13 at 6:30

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged or ask your own question.