DIYbanter

DIYbanter (https://www.diybanter.com/)
-   UK diy (https://www.diybanter.com/uk-diy/)
-   -   switching a relay via USB (https://www.diybanter.com/uk-diy/281266-switching-relay-via-usb.html)

andrew June 28th 09 10:28 PM

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

Tim S June 28th 09 11:05 PM

switching a relay via USB
 
andrew coughed up some electrons that declared:

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


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

dennis@home June 28th 09 11:07 PM

switching a relay via USB
 


"andrew" wrote in message
...
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!


It should be easy with one of these
http://www.maplin.co.uk/Module.aspx?ModuleNo=42857


PCPaul June 28th 09 11:10 PM

switching a relay via USB
 
On Sun, 28 Jun 2009 22:28:40 +0100, andrew wrote:

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


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.



tony sayer June 28th 09 11:12 PM

switching a relay via USB
 
In article , dennis@home
scribeth thus


"andrew" wrote in message
...
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!


It should be easy with one of these
http://www.maplin.co.uk/Module.aspx?ModuleNo=42857


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?..?..
--
Tony Sayer


andrew June 28th 09 11:13 PM

switching a relay via USB
 
Tim S wrote:

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


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

andrew June 28th 09 11:15 PM

switching a relay via USB
 
PCPaul wrote:

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.


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

AJH

Steve Firth June 28th 09 11:24 PM

switching a relay via USB
 
andrew wrote:

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!


http://www.robot-electronics.co.uk/a...y_Modules.html

andrew June 28th 09 11:24 PM

switching a relay via USB
 
tony sayer wrote:

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?..?..


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

AJH

tony sayer June 28th 09 11:29 PM

switching a relay via USB
 
In article , andrew
scribeth thus
tony sayer wrote:

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?..?..


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

AJH


Ok...

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



Tim S June 28th 09 11:33 PM

switching a relay via USB
 
andrew coughed up some electrons that declared:

PCPaul wrote:

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.


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

AJH


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

dennis@home June 28th 09 11:43 PM

switching a relay via USB
 


"andrew" wrote in message
...
PCPaul wrote:

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.


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


You could use X10.




John Rumm June 29th 09 12:21 AM

switching a relay via USB
 
andrew wrote:
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.


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.


--
Cheers,

John.

/================================================== ===============\
| Internode Ltd - http://www.internode.co.uk |
|-----------------------------------------------------------------|
| John Rumm - john(at)internode(dot)co(dot)uk |
\================================================= ================/

RubberBiker June 29th 09 05:43 AM

switching a relay via USB
 
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.

http://arduino.cc/

Mike Dodd[_3_] June 29th 09 06:47 AM

switching a relay via USB
 
dennis@home wrote:



It should be easy with one of these
http://www.maplin.co.uk/Module.aspx?ModuleNo=42857



It's a nice kit, available ready-built (I've bought one, in the past).
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.

Gordon Henderson June 29th 09 08:29 AM

switching a relay via USB
 
In article ,
andrew wrote:
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!


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

http://www.cleware.de/indexE.html

e.g.

http://www.cleware.de/produkte/p-usboptoreed_e.html

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

Gordon

Jon Fairbairn June 29th 09 11:28 AM

switching a relay via USB
 
Gordon Henderson writes:

In article ,
andrew wrote:
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!


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

http://www.cleware.de/indexE.html


They've always seemed quite expensive to me. I'm tempted to try one
from these people: http://www.easydaq.biz/PagesUSB/USB4PRSRMxFRAME.htm


--
Jón Fairbairn
http://www.chaos.org.uk/~jf/Stuff-I-dont-want.html (updated 2009-01-31)

pete June 29th 09 01:14 PM

switching a relay via USB
 
On Mon, 29 Jun 2009 00:21:20 +0100, John Rumm wrote:
andrew wrote:
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.


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.

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!

Man at B&Q June 29th 09 02:05 PM

switching a relay via USB
 
On Jun 28, 11:05*pm, Tim S wrote:
andrew coughed up some electrons that declared:



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


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

MBQ

Andy Dingley June 29th 09 03:34 PM

switching a relay via USB
 
On 28 June, 22:28, andrew wrote:
Anyone got any ideas for sending a pulse to a 24V relay via an opto isolator
plugged into a USB port,


Dead simple:
Velleman kits from Maplins

Best(ish):
USB Bit Whacker

Most capable:
Arduino board

PCPaul June 29th 09 06:41 PM

switching a relay via USB
 
On Mon, 29 Jun 2009 06:05:27 -0700, Man at B&Q wrote:

On Jun 28, 11:05Â*pm, Tim S wrote:
andrew coughed up some electrons that declared:



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


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


We do it at work over that sort of distance with a USB-to-Cat5 converter.
Seems to work OK, but only at USB1.1 speeds. However, that's plenty fast
enough for a relay ;-)

For this job though, having the switching closer to the PC and using
Plain Old Volts to carry the signal to the gates seems like a better
bet... something like the USB-RLY08 for £40+Vat from http://www.robot-
electronics.co.uk/acatalog/Relay_Modules.html would do it nicely.

I'm assuming you could pick up the 24V from the gate end, so this would
only need to be a switch.


dennis@home July 4th 09 09:46 PM

switching a relay via USB
 


"Man at B&Q" wrote in message
...
On Jun 28, 11:05 pm, Tim S wrote:
andrew coughed up some electrons that declared:



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


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



Why are you assuming the USB will be extended to 150m rather than the wires
to the relay?
It is easy to make a relay operate over 150m of cable.


Man at B&Q July 6th 09 12:35 PM

switching a relay via USB
 
On Jul 4, 9:46*pm, "dennis@home"
wrote:
"Man at B&Q" wrote in ...

On Jun 28, 11:05 pm, Tim S wrote:
andrew coughed up some electrons that declared:


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


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


Why are you assuming the USB will be extended to 150m rather


Why are you assuming that I made such an assumption?

Why can't you comprehend "USB isn't good for 150m unless you cascade
loads of hubs"?

I didn't make any assumptions about anything.

MBQ


All times are GMT +1. The time now is 10:52 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004 - 2014 DIYbanter