Analog Pressure Sensor Labview Programming

We are trying to use the Analog Pressure sensor to display the pressure of the pneumatic system of the robot during the match. We are using LabVIEW robot code, and the sensor is plugged into the Analog Ports on the roboRIO. We used the AI Open.vi and the AI Get Value.VI in LabVIEW to retrieve the data. However, it is returning values between 398-402. How do we fix this issue and get the correct value from the sensor?

Thanks!

Can you post a link to which sensor you are using? Also, are you sure the analog sensor is wired up correctly?

If you’re using the REV Robotics Analog Pressure Sensor, their datasheet has an equation to convert the voltage measured by the analog channel to the pressure measured by the sensor.

Datasheet: http://www.revrobotics.com/wp-content/uploads/2015/11/REV-11-1107-DS-00.pdf

I don’t have access to an FRC version of LabVIEW today, but I made a quick subVI that calculates the pressure from a given voltage (The VI is just the equation in the datasheet).

You should be able to use the AI Open.vi in begin to name the reference, then use the AI Get Raw Voltage.vi in teleop (or autonomous) and wire that value right to the subVI to get the pressure.

Hope this helps!

Volts to PSI (subVI).vi (10.5 KB)


Volts to PSI (subVI).vi (10.5 KB)

I used the Get Voltage.Vi and plugged the output into the Volts to PSI.vi, and printed that value, but now I am getting values between -.5 and -.3… Is there anything that I could be doing wrong? The yellow wire on the sensor is plugged into the Signal port on the roboRIO’s Analog 0 port.

What are the three colors of the wire? It could be possible that the wire is flipped the wrong way in the RoboRIO.

You’re getting negative voltages? That doesn’t seem right. There is no way you should be getting negative voltages from the RoboRIO.

Here is a link to the VI that we’re using to convert the voltage to a pressure.