12-10-2012 01:05 PM
Hello,
I am trying to control the water level in a tank using solenoid valves with LabVIEW.
I have an ultrasonic sensor that is going to measure the water level in the tank, I have the working VI (attached) for how the sensor measures the water level, I have made the vi so that it measures the distance the water level is away from the sensor (the sensor is attached to the top of the bucket). The vi which is attached also calculates the volume as more water is added into the bucket (the bucket is frustum shaped).
What works: VI interacts with ultrasonic sensor. VI measures the distance the water level is away from the sensor, VI calculates the volume in the bucket as more water is added.
What I am trying to do now: I want to have another bucket (filled with water) sitting above my bucket with the sensor on it, and with a solenoid valve attached to that bucket, and another bucket sitting below my bucket with the sensor on it (not filled with water). I want to interface these solenoid valves with LabVIEW in a way, that the user can enter in say "70%" as the desired percentage of water in the bucket with the sensor, and LabVIEW controls the the valve on the bucket to fill up the bucket with the sensor up to 70% and if there is any overshoot, there will be another valve attached to the bucket with the sensor that will let water out to go into the empty bucket).
The equipment that I have is:
Ultrasonic sensor: http://www.amazon.com/Ultrasonic-Module-HC-SR04-Distance-Arduino/dp/B004U8TOE6
Solenoid Valves: http://www.ebay.com/itm/ws/eBayISAPI.dll?ViewItem&item=290763981675&ssPageName=ADME:L:OU:US:3160
3 buckets.
12-11-2012 08:41 AM
Hello newyorklife99,
It looks like you already have an NI PCI-6251 that you're using for counter I/O, so the easiest way to approach getting the solenoid valve you've linked to work would be via a relay controlled by a digital output on the same card; also done through DAQmx. The key concern would be the logic (when to open/close the valve), as well as finding a relay that can handle a 500 mA/12V DC signal that can be controlled with a 5V TTL digital output line (24 mA maximum on that card, depending on the channel used.)
Regards,
12-11-2012 09:07 AM
Thinking off the top of my head, if it were me, I'd start with the master-slave design pattern.
In the master loop, put your vi for reading the level.
In the slave loop, put very simple logic that looks at the value coming from the notifier and takes one of three actions each time a notification is received:
Repeat until you're done.
You will probibly want to figure out a better way to stop things than what is shown in the design pattern template - using an error to stop works, but in the long run limits your options.
Oh yes, when shutting down, there is one thing that you will need to be sure that you do - to prevent wet feet. But I'll leave that for you to figure out as well.
Mike...
PS: This is homework right?
12-11-2012 09:31 AM
12-11-2012 09:44 AM
12-11-2012 09:59 AM
12-11-2012 10:42 AM
12-11-2012 11:23 AM
12-11-2012 11:48 AM
12-11-2012 12:41 PM
We got a reed relay from radio shack, 5VDC and a contact rating of 0.5 amps, 125VAC - So that should work for us, right?
But as far as the VI, I searched for about an hour, but can't find any VIs that we can modify for our application, even searching single-line digital output VIs on the forums?