switching a relay via USB

Anyone got any ideas for sending a pulse to a 24V relay via an opto isolator plugged into a USB port, this is to open a security gate some 150 metres away.

A short Linux script would be nice too!

AJH

Reply to
andrew
Loading thread data ...

andrew coughed up some electrons that declared:

It's going to be a bit more complicated than that. Unless you really meant "anyone know of a USB to General-digital-IO device"? In which case I think I did, but I'll have go searching again... One readily available way is to wibble one of the handshake lines on an RS232 port (that could be a USB adaptor if needs be, as long as it's a decent chip that lets you wibble the handshake lines). RS232 will generally drive the LED in an opto isolator.

USB isn't good for 150m unless you cascade loads of hubs.

Cheers

Tim

Reply to
Tim S

It should be easy with one of these

formatting link

Reply to
dennis

Sounds like a 5V/12V relay plugged into a parallel port line (or even a serial port handshake line) which then switches a 24V supply to drive the main relay would be simpler - that way you don't need to drive USB directly.

Reply to
PCPaul

In article , dennis@home scribeth thus

How exactly are you to control this gate?, on a timed basis or is there a command off the PC to open it and are you going to be there at the PC to make that?..?..

Reply to
tony sayer

No but I was wondering about using a higher DC voltage and current limiting it so I could just use telephone wire and keep the opto isolator near the PC.

AJH

Reply to
andrew

I was hoping to use a low power PC which has no serial output but I could use a usb to serial converter.

AJH

Reply to
andrew

formatting link

Reply to
Steve Firth

The idea is that the pc will check criteria and then send a pulse if it's met

AJH

Reply to
andrew

Ok...

Dunno if the netiom will do that for you?. It works over 10/100 ethernet if distance is a problem?..

Reply to
tony sayer

andrew coughed up some electrons that declared:

It's probably the simplest and cheapest way.

Your low power PC doesn't have any GPIO (digital IO) lines does it (some embedded style low power MOBOs do)?

Cheers

Tim

Reply to
Tim S

You could use X10.

Reply to
dennis

The obvious way would be using something like the DTR line on a USB to RS232 adaptor. 99p on ebay usually.

Alternatively a remote single board PC with IO capability communicating with the main host over a homeplug network connection.

Reply to
John Rumm

Arduino is "open source hardware" and becoming a popular and very cheap microcontroller board (USB interface, linux development tools etc) - I can attest to the very low entry threshold to "getting something working" with Arduino.

formatting link

Reply to
RubberBiker

The digital outputs can sink enough to power a single relay without any further buffering - I've used one to drive a 12vDC relay directly.

The supplied drivers are windows-only, however, there is a third-party linux application available, with links from Velleman's site, supporting scripted behaviour.

It's a bit like using a sledge-hammer to crack a nut, but the card could always be used for "other" things as it's capabilities are recognised.

Reply to
Mike Dodd

I've not bought from these people, but I found this site some time back:

formatting link
formatting link
advertise Linux support and while their website seems to have changed since I last looked, they did mention previously command-line utilities.

Gordon

Reply to
Gordon Henderson

from these people:

Reply to
Jon Fairbairn

Agreed. That's how I do it. Background: USB -> Serial -> self-built board with a PIC 16c74 on it. The serial works at 9600 Baid and sends a text string from an AutoIt script. As an added bonus, in this case, the 16c74 contains 8 * 8bit A-D's so you can take measurements, too!

Reply to
pete

Even then you can't get to 150m and stay within the spec.

MBQ

Reply to
Man at B&Q

You could use a spare keyboard led as the computer half of your opto- isolator.

formatting link

Reply to
Owain

HomeOwnersHub website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.