LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Opening & closing a solenoid valve using ni usb-6009

Solved!
Go to solution

Hi,

 

I am very new to labview so any help would be apprciated.

 

I am using the ni usb-6009 as a power source for my solenoid valve. The valve is 12vdc but because the max output voltage for the ni usb-6009 is 5v i have designed and build an op-amp circuit which will amplify the voltage. I want to create a vi that will give a +5v digital output when a push button is pressed and 0v when the push button is off. What would be the most efficient way of doing this? Thank you.

0 Kudos
Message 1 of 6
(4,226 Views)
Solution
Accepted by topic author Scall93

Hi Adam,

 

using one of the DIO pins should be most efficient…

(It's good to know you already use an OpAmp to drive your valve! A simple transistor (either bipolar or MOSFET) should be sufficient too.)

 

LabVIEW comes with a lot of example VIs. They also explain how to output a single boolean value!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 2 of 6
(4,216 Views)

How much current does the solenoid draw? You say that you are powering the solenoid from the USB-6009 so just converting the voltage from 5V to 12V will not work - there is a current limit of 8.5mA on the 6009 which will not be enough to power the solenoid. You will need to use an external supply that can provide sufficient current to drive the coils of the solenoid and then use a transistor circuit to switch on the supply from the digital output of the 6009 (which can't draw more than 8.5mA).

 

Once you've got your circuit right, you can use MAX Test Panels, the Data Acquisition Express VIs or the DAQmx palette in LabVIEW to control the digital output. There are lots of examples in LabVIEW on how to do this 🙂


LabVIEW Champion, CLA, CLED, CTD
(blog)
Message 3 of 6
(4,208 Views)
I realize you've already marked a solution. But as another poster pointed out, depending on how you arrange your opto circuit you may not have enough current. Really what you need here is just a relay. You can use an optically isolated relay to protect your USB hardware. But it isn't required.
---------------------
Patrick Allen: FunctionalityUnlimited.ca
Message 4 of 6
(4,189 Views)

Hi guys,

 

Sorry for being so slow in writing back. The output current required is 300 mA. This is also the same for the 12VDC peristaltic pump that I am using. Would a current source be the best approach for getting this? Thank you.

 

Adam

0 Kudos
Message 5 of 6
(4,112 Views)
Solution
Accepted by topic author Scall93

You just need a supply that can handle the current.  If you are using the simple transistor or MOSFET circuit GerdW mentioned, then your external supply should just need to handle the current and you will be fine.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 6 of 6
(4,108 Views)