From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Digital I/O

cancel
Showing results for 
Search instead for 
Did you mean: 

When reading the USB-6008 input on the DIO, it reads high When floating. How to configure to read low When it is anything but 5V

Solved!
Go to solution

I have a USB-6008, I have to read an input on the DIO.

 

I want it to report 1 When the line has a 5v present, and 0 for anything else.

 

When I have nothing on the lines.  It reads 1's

 

how do I configure this to read 0 When nothing is connected?

Also how would I configure this in c#

 

Thanks

0 Kudos
Message 1 of 8
(4,858 Views)

It should be using TTL logic levels to determine a 1 or a 0.  If it's between 0-0.8V it should read a "0" and if it's between 2.0-5V it should read a "1."  Is this not the case with your device?  Did you call any functions that reverse the logic levels?

0 Kudos
Message 2 of 8
(4,846 Views)
Solution
Accepted by ashitakaLax

Hello ashitakaLax,

 

The USB-6008 has an internal pull-up resistor to 5V (per page 22 of the User Guide and Specifications) which is pulling the line to 5V whenever nothing is connected.

 

In order to change this, you can add an external pull-down resistor to pull the output to ground when disconnected, though your device will need to source more current to drive the line high.

 

Regards,

Seth B.
Principal Test Engineer | National Instruments
Certified LabVIEW Architect
Certified TestStand Architect
0 Kudos
Message 3 of 8
(4,844 Views)

Based on your original post, you are looking for the presence of 5 volts.  Anything else would be considered "not there".  If you are truly looking for just 5 volts (4.9 volts considered "not there") then use the analog input and just measure the voltage.  If you are actually looking for "1" and "0" logic levels, then the pull-down resistor should help.  You may want to also re-evaluate how the external stimulus is being created.  For most digital signals, one the line is disconnected, they are pulled high and the external stimulus pulls them low to activate.

0 Kudos
Message 4 of 8
(4,828 Views)

Hello, I have exactly the same situation. Is there a recommended value for the pull down ? I guess it should be something like 1 KOhm to be sure to keep it below 1-1.5V when floating, and thus it will require 5mA when I use it as DO. This means that only 3.5 mA are left to drive my external device. Am I right ?

Thanks a lot

Paolo

0 Kudos
Message 5 of 8
(4,380 Views)

You only need the pull-down when the line is an input.  If you are using the line as an output, do no put in a pull-down.

 

Another alternative is to use a buffer to allow for more current to your device.


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
0 Kudos
Message 6 of 8
(4,372 Views)

HI, thanks for the quick reply ! I know that as output I don't need a pull-down. The problem is that from the power on to the moment in which my application configures the port as output there can be an unpredictable time interval. During this interval the line will be as default a high impedance input and if it floats to high values it can trigger wrong behaviors in the device that I'm controlling. That's why I need a pull down, to be sure that the line is down until I force it to be an output. I will try with values around 2K Ohm and see what happens

Regards

0 Kudos
Message 7 of 8
(4,370 Views)

You can determine the pull down resistor. At start up you have the internal pull up resistor, the input impedance of any external devices connected to the line, and the pull down resistor you need to add. Calculate the value of the pull down resistor needed to assure that the output voltage is less than the Vih specification of your external device.  Then calculate the total current sourced by the DO line when it is an output and set high.  If that current exceeds the maximum source current of the USB-6008, then you need a buffer circuit.  If it is within the specification, install the resistor.

 

A more robust method is to insert a circuit between the DAQ device DIO lines and the critical external devices which requires a series of high, low, high, low pulses before passing the data through.  With this kind of circuit, you can require not only that the device has been configured as an output, but also that the software driving the outputs is active and has sent the specified control sequence indicating that it is control.

 

Lynn

0 Kudos
Message 8 of 8
(4,358 Views)