LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Liquid level sensor integration

I am working on a project in which I need to control the flow of pumps into and out of a tank. I have a series of relays set up and can turn the pumps on and off with Labview. Now, however, I am trying to automate the process so that the pumps are triggered by two liquid level sensors, one mounted at the top of the tank and the other mounted at the bottom. I need to be able to program Labview to switch one pump on until the tank is full, turn it off, then switch another on until the tank is near empty, then turn it off. I have an NI-9205 analog input module. Is there a way to integrate these liquid level sensors into my system using this module, maybe using an external power supply and reading a voltage? If so, what type of logic should my Labview VI encompass to read the level sensors?

Any help would be greatly appreciated. Thanks in advance.
Message 1 of 9
(3,828 Views)
You didn't specify what sensors you were planning to use, but as long as they output a voltage you can measure with your module, then you can determine ON/OFF state.  Just make sure your Voltage levels are in range for the card.

I think you pretty much outlined your logic.  If A is full and B is empty, and assuming you're just mindlessly filling and emptying the tank, then when A is ON, turn off your fill relay and turn on your empty relay.  Wait until A is OFF and B is OFF.  Then turn off your empty relay and turn on your fill relay.  When B is ON and A is ON, repeat.


0 Kudos
Message 2 of 9
(3,826 Views)
Nick525,

What MattewK said is correct but I would like to add that in order for you to control the pumps, you would need some sort of relays, and to control the relays you need a Digital I/O module such as the NI 9401. You cannot control the relays (pumps) with jus the analog input module.
Eli S.
National Instruments
Applications Engineer
0 Kudos
Message 3 of 9
(3,796 Views)
Thanks for all of the input. I have an NI 9481 relay device and an external power supply that I have set up to turn the pumps on and off. Tonight I am going to attempt to wire the level sensors into the 9205 and build a vi to control the 9481 based on an analog input from the level sensors on the 9205. I'll let you know if I run into any other complications.
0 Kudos
Message 4 of 9
(3,792 Views)
During my attempt at wiring in my level sensors, I ran into a problem. I am trying to hard-wire an ac power adapter along with a level sensor (essentially a switch) into the 9205. The power adapter specifies an output of 4.5 volts at 700mA, and the level sensor is wired in line with the positive lead of the adapter. My ultimate goal is to write a digital output when the 9205 senses a voltage, and write another digital out when the 9205 does not.

I tried wiring for differential measurements at first, getting a relatively stable reading of about 5.6 when the level sensor was closed, and a fluctuation between -10.7 and +10.7 when the level sensor was open. I also tried wiring for rse measurements, and this also resulted in a relatively stable reading when the level sensor was in one position, but fluctuating readings when the level sensor was in the opposite position. This is obviously a problem if I am using logic that writes a digital out when the voltage reading is > X and writes a different digital out when the value is < X

Is there any way in which I can configure the 9205, the level sensor, and the power adapter to get the voltage measurements I need? What could be the cause(s) for the fluctuating measurements, and what can I do to fix them?


0 Kudos
Message 5 of 9
(3,768 Views)
After a bit of research, I think I answered my own question: I needed to modify the signal to an RMS value, then use that value to either open or close my relays. This, however, brings me another problem.

I already have an analog input set up to read a thermocouple, in addition to the analog input voltage reading. When I start my vi and try to get a voltage reading in addition to the reading off of the thermocouple, it seems that the vi reads voltage for a fraction of a second, then stops and begins reading temperature. Is there any way to get a constant analog input voltage reading at the same time as the analog input thermocouple reading? If so, how?
0 Kudos
Message 6 of 9
(3,752 Views)
Your going to need to put a pull-down resistor on your AI.  What is happening is the signal starts floating once the level sensor shuts off the voltage.  Putting something like a 1.2k resistor betwwen the AI and AIGND should stop the drifting when the switch is off.
0 Kudos
Message 7 of 9
(3,742 Views)

Hi Nick!

 

I hope you're still active in this forum. I am currently doing an experiment similar to the one you mention in this thread. And I am having some problems with the software side of it. I was wondering how you programmed the valve/pump control in Labview, cause I cant seem to make it work. Is it possible to see some overview of your code?

Thanks a bunch for the help in advance!

0 Kudos
Message 8 of 9
(1,896 Views)

Or is there maybe any samples from NI themselves that could be useful? I'm new on this site so don't know how if there's any example repository around.

0 Kudos
Message 9 of 9
(1,895 Views)