LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

HOW TO CONTROL TWO LIMIT SWITCH WITH ONE WATER PUMP AND ONE SOLENOID VALVE?

Highlighted

I am attempting to write a program in LabView interface with Arduino (using LINX) which will turn a pump on or off based on the water level in a container.  I am using a floatation device along with limit switches (something like an electronic version of a toilet float switch) which I would like to use to signal the pump to turn on or off.  When the bottom limit switch is triggered, I want the pump to turn on and remain on until the top limit switch is triggered.  When the top switch is triggered, I want the pump to turn off until the bottom switch is triggered. Same goes with solenoid valve, when limit switch bottom switch triggered the solenoid valve will be on/off and remain on until the top limit switch is triggered. If anyone can help me to settle this problem.  I am still learning LabView, so simplicity in answering would be appreciated.  Thank you.12v-solenoid-valve-34-sparkfun-rob-10456.jpg1 - solenoid valveliquid-water-level-sensor-right-angle-float-switch-mini-float-switch-ball (1).jpg2 - limit switch/float switchH026200-W001536844_g1.jpg1 - dc water pump

0 Kudos
Message 1 of 2
(599 Views)

I think a good way to approach this problem is with a State Machine.

 

You have several cases, and have already described how they should be linked together.

 

The link above should provide some tips to creating a State Machine in LabVIEW. It's important to use a typedef for your States! Create this beforehand - that way you won't get block diagram constants that are not linked.

 

Inside the cases, you'll need the hardware specific code to activate and deactivate pumps and valves - do you already have this working? If so, great. If not, consider using simple VIs to test that code separately and use SubVIs to modularize the functionality.

0 Kudos
Message 2 of 2
(541 Views)