basic connection for PC to electrical devices

N

Thread Starter

NoviceEngineer

I like to operate a simple device like 5v relay on/off from laptop. Hoping to keep some pins in usb port (or the vga port) in series with the switch. Can it be done? Also where can I find info on basic and simple controls by laptop?
 
J

James Ingraham

There's really no way to do this on modern systems. In the old days, you could use the parallel port, but those ports are long gone. You'll need an I/O module of some sort. These could plug in to the USB port or Ethernet port, or be wireless over Wi-Fi or Bluetooth.

For USB, Advantech, SeaLevel, National Instruments, Elexol, and others sell small, low-cost blocks. Google "USB DAQ."

Ethernet has even more options. All of the previous, plus Acromag and dozens more. Many of these are modular "slice" I/O, where you only buy what you need, although for a small setup they might actually cost more. Wago, Beckhoff, B&R Automation, Schneider / Modicon, Turck, etc. all have offerings in this area.

I didn't check too closely for 5V; some of these might not have that, as 24VDC is sort of standard for industrial automation. For sure, Wago, Beckhoff, Advantech, SeaLevel, Acromag, and NI have 5V. The others may, I just didn't double check.

The two I find most interesting are the Beckhoff and NI. Beckhoff has USB or Ethernet, you can have as many modules as you want, it's fairly cost effective, and their stuff is pretty good. However, the NI will be cheaper, assuming you don't want a ton of I/O, and probably better documentation and support. (Not that Beckhoff support is bad.)

Here's NI:
http://sine.ni.com/nips/cds/view/p/lang/en/nid/201630
24 I/O points for $99 USD on USB.


Here's Beckhoff:
http://www.beckhoff.com/
Annoyingly, the Beckhoff site doesn't give you hot links. Click on I/O -> Bus Terminal -> Bus Coupler -> USB -> BK9500 for info on the controller portion. Under "Bus Terminal" is also "Digital Input" and "Digital Output", with only two options each for 5VDC. Unfortunately, you'll need a both a 5V power supply and a 24VDC power supply, which will increase cost. On top of that, I believe that the Beckhoff will be WAY more expensive than the NI, but I don't actually know Beckhoff's pricing.


On the wireless front, things are a little more complicated. SeaLevel has a Wi-Fi solution, but it's in the $500 to $600 USD range. There's a solution from ProSoft to put Allen-Bradley Point I/O on Wi-Fi, but it's expensive, and the software to run it is either difficult or expensive. Also, there's no 24VDC inputs, and the outputs would have to be relay rather than TTL. There's also a REALLY expensive solution from Opto-22. There may be other solutions, but I didn't have a lot of luck with a quick Google search.

Bluetooth also didn't turn out too well, despite companies like Phoenix Contact and Wago pushing it. Yes, they both have Bluetooth solutions, but neither one can just be controlled of your PC like you want. One possibility could be controlBlue's OBI411. This isn't a full product; it's designed to be integrated into things. Still, they sell a development kit that would probably do what you want. I have no idea on price.


Finally, I simply MUST mention Arduino. This is really what you should be looking at. There are solutions for USB, Ethernet, and Bluetooth. Bear in mind that the Ardiuno kits aren't just dumb I/O; they're actually micro-controllers. This could be bad or good depending on what you want. The Arduino stuff is dirt cheap ($30 for a USB version with 14 digital and 6 analog.) However, like the connectBlue it's not really a product. Again, that may be good or bad for you. There's a LOT going on with Arduino. I suggest starting with http://arduino.cc

I know that it's stupid that I spent 500 words talking about all kinds of angles on this, only to end with my best suggestion. Sorry; I'm just long-winded.

-James Ingraham
Sage Automation, Inc.
 
C

curt wuollet

Pretty boring here while I've been away :^)
Google parallel port HOWTO.

Regards
cww, the Linux automation guy
 
J

James Ingraham

Good to see you, Curt. But do you really have a laptop with a parallel port? Even with my hoarding skills I don't have any left around, hence my long-winded answer above. (Okay, okay, I ALWAYS give long-winded answers, even when a yes or no would do.)

-James Ingraham
Sage Automation, Inc.
 
S
I don't know, James. In some sort of evil scheme to kill me with irony, all my newest ones seem to have a parallel port AND NO SERIAL PORT. Yes, lets omit the port automation engineers need and keep the thing no one needs. D'oh!
 
J

James Ingraham

Yeah, the lack of serial ports is a killer. I'm finally starting to see USB ports on devices, but that doesn't help with the massive installed base of RS-232 devices.

-James Ingraham
Sage Automation, Inc.
 
C

curt wuollet

Why yes, yes I do. And I find old laptops to be great for dedicating to control tasks. Cheap, even expendable if you want to leave them on site for monitoring or data collection. And even the oldest will run CLI programs on Linux. I have one set up with my 4 channel temperature chart recorder, although that doesn't require a parallel port. But the Howto also provides links to resources and it does demonstrate how simple it can be. The Linux Lab project has lots of ways to control hardware as well, but the complexity increases rapidly as the industry strives to make PCs and laptops as useless for control purposes as possible. Yes, you can stick all sorts of kludges on a USB port or try to fanout IO from a PCMCIA card, but I think the word kludge actually bestows undeserved dignity on most of those solutions. They are extremely fragile and failure prone for industrial use.

I recently had to wrestle with this issue of controlling a few ports with one of today's more useless laptops and decided that using a Freeduino "pod" to do the IO and talking to the laptop on RS232 or USB was about the easiest solution. I used 232 because you can at least fasten the connectors and use a cable long enough to avoid unplugging stuff if you bump the laptop. USB also works for only a couple dollars more, but the lack of any type of plug fasteners makes it a distant second for the real world. The program for the 'duino can be short, simple and well understood and the Linux end can be much simpler than dealing with a device driver, etc. For Python, the routines are "built-ins" and I didn't have to spend much time with comms. I guess this is the new "low end" setup as specialty cards tend to be _much_ more expensive and the 'duinos are OTS from many places. There is nothing magical about them, but for less than $20, it would be kinda silly to roll your own. And with say, 6 analog ins and at least 8 discrete IO, it's really higher bang per buck than fighting the parallel port hardware. Some sunny day, I'll do a board with the "standard" 'duino stuff and the level shifting and scaling to work with 24VDC discrete IO and 0-10 V and 4-20 Ma. analog. It would be fairly trivial to do and would eliminate the last bit of kludging.

Regards
cww
 
Top