04-05-2011 10:23 AM
I am trying to control a relay (3VDC, 73mA) with DAQ USB 6009. It seems the +5V port is the only one that can deliver that much current (200mA) to switch on/off the relay. Is there a LabView VI available for that port? I have found a good VI (attached) on the Internet but there D I/O for the +5V port is sadly missing.
I am willing to write a program to control the +5V port if there is no existing VI out there.
Any guidance is appreciated.
Solved! Go to Solution.
04-06-2011 06:45 AM
The 5V port does not switch. Connect the 5V through a voltage drop resistor to one side of the coil. Use one of the digital ports to "ground" the other side of the relay coil. Setting the digital port low will activate the relay. Use Ohm's law to calculate the voltage drop resistor to get 3V across the coil when activated. Don't forget to add a diode across the coil (cathode to +3, anode to "ground") to bleed off the back EMF when the relay opens.
04-06-2011 08:44 AM
Thanks, I don't have resistor or diode. I'll just use a standard Digital port as the ground. When both have the same voltage, will there a a current (the +5V port gives more current)?
04-06-2011 08:48 AM
The resistor you may be able to get away without using. UNLESS YOUR RELAY HAS A BUILT IN BACK EMF DIODE, YOU NEED TO HAVE ONE IN THE CIRCUIT. The back EMF of the relay coil releasing can destroy the USB-6009.
04-06-2011 08:55 AM
I assume EMF is the electromagnetic field. My relay is going to be about 1 meter (or more) away from the DAQ, plus it is really small. Its size is about half that of an eraser. Will the EMF still matter?
04-06-2011 09:09 AM
The emf is the voltage created by the colapsing magnetic field across the coil. This voltage will be transmitted along the wires going from the coil to the 6009. Distance does not matter. You should also mount the diode on the relay (or very close to it) to minimize the the voltage spike noise that would travel down the wire. Google emf relay coil for all kinds of information on what emf can do.
04-06-2011 10:03 AM
Do not use the DIO line as a ground for your circuit. The USB-6009 is only spec'ed to sink 8.5mA of current, and you need to sink 73mA. You will need external circuitry to drive the relay.
04-06-2011 11:18 AM
Yep. I was so focused on diodes and such that I didn't even think about the current draw limitations. That's why I use PIC micros more often then not.
04-06-2011 11:27 AM
Thanks for your helps. Apparently, I have some limitations on the hardware side. Can I just use the +5V port and the ground? This will eliminate the switching (on/off) capability, but is it safe?
Can I use a "while loop" in labview for power control in this case? So once the loop exits, the program stops running, is the +5V power cut off by then?
04-06-2011 11:49 AM
Again, the 5V does not switch (unless you unplug the USB cable from the DAQ). Here is a simple circuit that should work. Just the coil control is connected. Your pin numbers are probably different so just use the diagram as reference.