LabVIEW Interface for Arduino Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

problems with limit switch with digital read VI

I am using the Arduino to interface with Labview. I am
trying to use a limit switch supplied with the 5V from the Arduino board to
give a 5V or 0V to the Arduino digital input pin. In the Labview program I have
used the digital set pin VI and the digital read VI. The digital read pin
output feeds into a not equal to zero block witch converts the signal into Boolean
logic for use in the program. This is kind of working but the problem is
sometimes when the switch is not made its flicking the motor on and off. The
signal is not reliable and I was wondering if there is a better way of using
the output from the digital read pin other than putting to through the not
equal to zero block. All I need is a Boolean true when there is 5V on the pin
and false when it is not or vice versa.

0 Kudos
Message 1 of 2
(4,014 Views)

Using the "not equal to zero" function is the correct method.  It sounds to me like you need to use a pull-down resistor.  Put a 10kOhm resistor between your digital pin and ground.  This will make sure vthat the digital pin will read as 0 (false) when your switch is not activated.  Alternatively, you can use a single pole, double throw switch (SPDT) which will connect the signal to 5V when activated or to ground when not activated.

Message 2 of 2
(3,236 Views)