If I want to use a parallel port to control this 8 channel relay instead of Arduino, do I need to make any modifications?
3 Answers
I'm reasonably sure that you don't want to control the relays from a parallel port, but from a PC. The parallel port is a solution, not the question.
Parallel ports are so much 1980s, none of my PCs in the last 10 years had them anymore. That means you may also have problems finding the right drivers for your PC software for them. I would suggest another route. Why wouldn't you use the standard I/O interface on PCs: USB?
This module gives you 8 general purpose I/Os which you can control from your PC. The yellow jumper selects the output voltage level: 5V or 3.3 V. A low output level will switch on the relay. Each output can sink 20 mA, but the total of 160 mA is not a problem for the USB bus voltage output, since the current comes from the relay module's power supply, not the USB bus.
On the FTDI website you can download drivers for several different operating systems, and find application examples.
-
\$\begingroup\$ I would rather use raspabary pi, because it comes with 8+ GPIO's implicitly. Bus pirate also a nice tool. Some USB2GPIO cards comes with A/D ports. but a nanoboard cost around 50$, so it's all about $$$$ in commonsense. \$\endgroup\$ Commented Oct 8, 2012 at 9:46
-
2\$\begingroup\$ @sandun - The RPi costs 4 times the breakout board I mention in my answer, and seems overkill to me if you just want to switch relays on and off. RPI also means that you have to write software for it; the FT245 breakout board only needs software on the PC. I'm also not sure about the output current drive capabilities (the RPi is very badly documented). And then there the 5 V from the relay module, versus the RPi's 3.3 V. The RPi's I/Os are not 5 V tolerant... \$\endgroup\$– stevenvhCommented Oct 8, 2012 at 10:12
-
1\$\begingroup\$ @sandun - ...A satellite single board computer may be more suitable if the control is more complex, like PWM controlled motors, or if you need monitoring or so. Even then, I think a cheap Arduino is cheaper than the RPi. The RPi may be a great board, especially for the price, but I wouldn't pay for a 700 MHz ARM, 256 MB memory, video and audio to switch a relay. \$\endgroup\$– stevenvhCommented Oct 8, 2012 at 10:19
-
\$\begingroup\$ @stevenh $35 is not 4 times $15, even if you add a few dollars for an SD card root filesystem. And you are comparing something from a known source to something from an unknown one. But they are of course different sorts of solution. \$\endgroup\$ Commented Oct 8, 2012 at 15:35
-
1\$\begingroup\$ @Chris - I searched the 'Net for a price, and the first one I found was 62 dollar. May be wrong, but even at 35 dollar I think my point is still valid: the RPi is overkill if all you need is switching a relay on and off. I think the RPi has a much better value/cost ratio than an Arduino, but why would I spend the extra 20 dollar on features like video I don't need? \$\endgroup\$– stevenvhCommented Oct 8, 2012 at 15:43
Parallel port from a PC??
A PC Parallel port should be able to drive the inputs to this relay module. A typical output of one of the DB0 to DB7 lines from the PC Parallel port would be able to turn on the relay coil when the port bit is at a low level and the proper Opto-Coupler / Relay coil voltages are supplied to the relay module. You do need to make sure to also connect the GND pin of the relay module to the parallel port connector GND pins (numbers 18-25 of the DSub-25 parallel port connector).
-
\$\begingroup\$ you need to do many things.For a example configure it in SPP mode , in linux you could do this with ioprem() [directio] or using PPDEV. \$\endgroup\$ Commented Oct 8, 2012 at 7:09
You'll need a buffer. I highly doubt your port can source 20mA per pin.
-
\$\begingroup\$ Maybe not source, but sinking that much is not out of the question. And sinking is what is required, since it's the cathode of the opto coupler LED which is connected to the input. \$\endgroup\$ Commented Oct 8, 2012 at 15:40
-