Author Topic: Measuring water in a water tank  (Read 19530 times)

0 Members and 1 Guest are viewing this topic.

Offline ilium007

  • Regular Contributor
  • *
  • Posts: 210
  • Country: au
Re: Measuring water in a water tank
« Reply #75 on: January 08, 2013, 12:46:26 am »
This has already been discussed. The cheapest diff press sensor in Australia is $575. I agree that a 4-20ma sensor would be best but I have 5 of these tanks to monitor.

Have you checked the MPX sensors from Freescale?

Greetings,

Chris

Yeah - couldn't find one with a waterproof membrane on the sensor face. If I did go down this path I would want a 4-20ma sensor as well so that I could change the architecture of the design a little bit. With 4-20ma sensors you dont get voltage drop on long cable runs from sensor to micro controller.

Hmm, are you sure? For example, look at the MPX5700A, this is an absolute sensor in the unibody package. If you look in the datasheet for that sensor:

http://cache.freescale.com/files/sensors/doc/data_sheet/MPX5700.pdf?pspll=1

On page 4 you can see the construction of that unibody package. The pressure side is internally covered in a silicone coating. P2 is not coated, but for the absolute sensor you can glue that onto a metal sheet to seal it off, for example.

Other unibody sensors are constructed the same, IIRC. It's not that complicated to attach some simple circuitry that in turn will give you a 4-20 mA output. Or you put a small ┬ÁC locally and give it a RS485 interface. You can then cover that circuitry in silicone as well to seal it all.

Just an idea.... Since samples are available, i think it's worth a try.

Greetings,

Chris

Yes !!! I would love to give this a try. I will look at that datasheet tonight.
 

Offline mamalala

  • Supporter
  • ****
  • Posts: 777
  • Country: de
Re: Measuring water in a water tank
« Reply #76 on: January 08, 2013, 02:02:03 am »
Forgot to mention, you might also want to check out the sensors from Measurement Specialities, for example the MS5541C or similar:

http://www.meas-spec.com/product/t_product.aspx?id=5035

That particular one is from 0 to 14 bar pressure, and has a 16 bit digital output.

Greetings,

Chris
 

Offline Mosaic

  • Regular Contributor
  • *
  • Posts: 133
Re: Measuring water in a water tank
« Reply #77 on: January 08, 2013, 02:02:38 am »
Ok, @ a 1cm resolution that's about a 0.1KPa  pressure differential.
This:
http://www.newark.com/freescale-semiconductor/mpx4250ap/ic-pressure-sensor-20-to-250kpa/dp/07F9899?in_merch=Popular%20Products

Supplies 20mV per KPa or  .2mV per 0.1KPa.

It can be used but you will need a decent instrumentation opamp for perhaps a x25 gain to feed into your ADC. Thus a 10bit ADC with oversampling to give 12 bit results using a 4.096V LM4040 precision Vref can work.

@ 5mV per 1cm head (0.1KPa) after 25x amplification will resolve to an ADC result of 5*4096/4096 using 12 bit sampling = 5. Thus every 1cm head change delivers a change of 5 in your adc result.

On the matter of isolating the sensor, I suggest using a 50 mL syringe with the plastic shaft of the plunger removed leaving just the rubber diaphragm on a plastic stub. Push the plunger remnant fully in. Then seal the sensor inside the syringe rear chamber using a silicone plug (leaving a decent air chamber for the sensor), bringing the wires thru the silicone. Attach the  syringe/sensor chamber to the tank supply with appropriate tubing and silicone in place. Be sure to lubricate the syringe inner chamber with some silicone lubricant....the potable, unflavoured kind! :P

EDIT:
Actually if u use a bigger syringe it will be better as frictional forces would be negated by the square area of the plunger, also a bigger syringe will allow u to house the entire circuit with the sensor mounted on a PCB INSIDE the sealed air chamber. This means that u can make the MCu provide a 4-20mA output (buffered of course) based on its sampling of the pressure. Alternatively u can transmit the signal using RS232 with the MCu USART!

To mitigate temperature (ambient) related air expansion, perhaps dumping the whole sealed assembly into the water tank would be best. Water doesn't change temperature quickly! Or include a thermistor on the PCB for the PIC to do temp compensated pressure. Be sure to assemble in a coldish/dry atmosphere and include a bit of silica gel with the pcb to prevent condensation if  temperatures drop.

These 2 links can help u do the communications or even a network for all 5 sensors:
http://www.romanblack.com/blacknet/blacknet.htm
http://www.romanblack.com/bitbangserial.htm

« Last Edit: January 08, 2013, 02:34:06 am by Mosaic »
 

Offline bfritz

  • Regular Contributor
  • *
  • Posts: 133
  • Country: us
Re: Measuring water in a water tank
« Reply #78 on: January 08, 2013, 05:39:56 am »
Perhaps sonar? Affixed to the inside of the top of the tank? Will reflect off the water and the delay will give you the level.

Yes - this is the Maxbotix sensor that I have trialed. One of the biggest issues with this approach is that the speed of sound varies with temperature and inside a water tank it could be 35 - 40 degrees during the day (the air gap between the top of the water and the top of the inside of the tank) and down as low as 15 degrees of a night time.

Why not use a second Maxbotix sensor, measuring a known distance.  This distance can be horizontal at the top of the tank.  Then just figure the factor to scale the sensor measuring the known distance to the correct value, then apply that factor to the result from the other sensor.
 

Offline ilium007

  • Regular Contributor
  • *
  • Posts: 210
  • Country: au
Re: Measuring water in a water tank
« Reply #79 on: January 08, 2013, 07:32:33 am »
Perhaps sonar? Affixed to the inside of the top of the tank? Will reflect off the water and the delay will give you the level.

Yes - this is the Maxbotix sensor that I have trialed. One of the biggest issues with this approach is that the speed of sound varies with temperature and inside a water tank it could be 35 - 40 degrees during the day (the air gap between the top of the water and the top of the inside of the tank) and down as low as 15 degrees of a night time.

Why not use a second Maxbotix sensor, measuring a known distance.  This distance can be horizontal at the top of the tank.  Then just figure the factor to scale the sensor measuring the known distance to the correct value, then apply that factor to the result from the other sensor.

That's is a good idea - I hadn't thought of doing that. But....do you work for Maxbotix  :-DD
« Last Edit: January 08, 2013, 10:59:32 am by ilium007 »
 

Offline mjrandle

  • Contributor
  • Posts: 27
Re: Measuring water in a water tank
« Reply #80 on: January 09, 2013, 09:31:13 am »
Long time lurker, first time poster!  I have a Maxbotix MB7380 ultrasonic sensor installed in the top of my 3000 L tank - which I understand is the standard version of your sensor, i.e. without filter to ignore small objects.  The tank is above ground and about 2 m tall.  The sensor (pulse width output) is wired up to a Freetronics Etherten so I can check tank level via internet.  I'm in Brisbane and it's been pretty hot today, but I found that the tank level only varied by 1% between 5:00 am and 1:00 pm.  My tank is only 0.9 m wide so I was pleased to see Maxbotix introduce these narrow beam sensors.  I used a short length of 90 mm PVC pipe to raise sensor to maintain minimum 300 mm sensor distance.  Let me know if you have any questions.


Cheers,

Mike
« Last Edit: January 09, 2013, 09:34:48 am by mjrandle »
 

Offline Strada916

  • Frequent Contributor
  • **
  • Posts: 252
  • Country: au
Re: Measuring water in a water tank
« Reply #81 on: January 09, 2013, 11:22:47 am »
This is no good??
http://archive.siliconchip.com.au/cms/A_109529/article.html

Sounds like you are looking for something that does not exist. maybe make some compremises. You'll find pressure difference sensors the cheapest and one of the more reliable tank measuring systems. 1% is 25000L is only 2500L. A family of five can run a house on that for aleast 3 days more if your tight. Surely it does not take 3 days to get water in?

Sorry if I have offended.

Strada916
« Last Edit: January 09, 2013, 11:32:32 am by Strada916 »
The Bone, the Off-White, the Ivory or the Beige?
 

Offline ilium007

  • Regular Contributor
  • *
  • Posts: 210
  • Country: au
Re: Measuring water in a water tank
« Reply #82 on: January 09, 2013, 11:26:41 am »
Long time lurker, first time poster!  I have a Maxbotix MB7380 ultrasonic sensor installed in the top of my 3000 L tank - which I understand is the standard version of your sensor, i.e. without filter to ignore small objects.  The tank is above ground and about 2 m tall.  The sensor (pulse width output) is wired up to a Freetronics Etherten so I can check tank level via internet.  I'm in Brisbane and it's been pretty hot today, but I found that the tank level only varied by 1% between 5:00 am and 1:00 pm.  My tank is only 0.9 m wide so I was pleased to see Maxbotix introduce these narrow beam sensors.  I used a short length of 90 mm PVC pipe to raise sensor to maintain minimum 300 mm sensor distance.  Let me know if you have any questions.


Cheers,

Mike

Hi Mike - I am Brisbane as well ! I would love some more info on your setup. I am prototyping on an EtherTen as well. I am having some issues sorting out the timing on the MB7389. There are two modes of operation - free run and triggered. Freerun is more accurate but I only want it running when I drive pin 4 high. I then have (I think) 148ms to get the serial buffer and process it. I take 5 readings into an array, bubble sort them and grab the median value. I am using serial output because it is dead simple to transmit using an XBee mesh network.
« Last Edit: January 09, 2013, 11:38:43 am by ilium007 »
 

Offline ilium007

  • Regular Contributor
  • *
  • Posts: 210
  • Country: au
Re: Measuring water in a water tank
« Reply #83 on: January 09, 2013, 11:27:43 am »
 

Offline ptricks

  • Frequent Contributor
  • **
  • Posts: 664
  • Country: us
Re: Measuring water in a water tank
« Reply #84 on: January 09, 2013, 12:32:13 pm »
I needed to measure water levels in a tank but I had to do it non-contact with the water. After thinking about it a long time I came up with the idea to use  LED with a phototransistor. The led and sensor are placed into two tubes side by side pointed at the water surface. As the water lowers the reflected light decreases and is easily measured. This only works in if the water is in a dark place, otherwise you have to change the length of the tubes that hold the sensor to block all the ambient light.

An interesting side effect I found while doing this was it also makes for a great seismometer . While experimenting with the water and sensor setup I kept getting odd noise patterns , I though it was wiring at first then noticed it was the water picking up vibrations , it was sensitive enough that with a large amount of water being used it could pick up vibrations from  a train on the tracks 2 miles away.
 
 

Offline ilium007

  • Regular Contributor
  • *
  • Posts: 210
  • Country: au
Re: Measuring water in a water tank
« Reply #85 on: January 09, 2013, 12:57:41 pm »
I needed to measure water levels in a tank but I had to do it non-contact with the water. After thinking about it a long time I came up with the idea to use  LED with a phototransistor. The led and sensor are placed into two tubes side by side pointed at the water surface. As the water lowers the reflected light decreases and is easily measured. This only works in if the water is in a dark place, otherwise you have to change the length of the tubes that hold the sensor to block all the ambient light.

An interesting side effect I found while doing this was it also makes for a great seismometer . While experimenting with the water and sensor setup I kept getting odd noise patterns , I though it was wiring at first then noticed it was the water picking up vibrations , it was sensitive enough that with a large amount of water being used it could pick up vibrations from  a train on the tracks 2 miles away.

Wow - that is a really cool design ! Can you share the electronics design?
 

Offline MaxBotixInc

  • Newbie
  • Posts: 2
Re: Measuring water in a water tank
« Reply #86 on: January 09, 2013, 03:28:36 pm »
@ilium007

Hello, this is Scott from MaxBotix Inc. I'm glad to support you. All MaxBotix Inc., employees are legally required to clarify their name and affiliation with MaxBotix Inc., in forum posts. I have provided some additional information below in response to your comments. I hope this information helps clarify any misunderstandings that may have took place.   

I apologize as I did not see you have purchased the MB7389.  I had skimmed the forum post due to the length and did not see that. 

The MB7389 sensor can be mounted directly in the top of your tank and measure the distance to the water level.  Our MB7389 sensors have been implemented successfully in many tank applications. With that being said, some customers have had to work through technical challenges related to ultrasonic sensors and the mounting of the sensor and/or other factors. As a result, we know our sensors work well in tanks and bins, however, testing the sensors is always required to ensure there are no technical considerations that need to be accounted for.  We are always available and happy to support our customers through this process. 

What may have caused us to ask for diagrams of your application, is that we have not tested the MB7389 sensor in a 150mm diameter pipe for operation or accuracy.  Our engineering team did a couple of brief tests in a 5cm diameter pipe. This was done for comparison to a sensor we had programmed and calibrated for use in a 5cm diameter pipe. We are always glad to support customers the best we can and many times, the more information we can gather about an application, the better support we are able to provide and make appropriate recommendations.

If you have any specific questions, I am pleased to help any way I can.  Please email me at scott@maxbotix.com.

Best regards,

Scott Wielenberg
Technical Support & Sales
of MaxBotix Inc.
Phone: (218) 454-0766
Fax: (218) 454-0768
Email: scott@maxbotix.com
Web: www.maxbotix.com
Follow us on Facebook at: http://www.facebook.com/pages/MaxBotix-Inc/125159384204938

Technical support and sales are subject to
the terms and conditions listed on our
website at http://www.maxbotix.com/ MaxBotix,
MaxSonar,EZ0, EZ1, EZ2, EZ3, EZ4, AE0, AE1,
AE2, AE3, AE4, WR1, WRA1, and WRLA1 are
trademarks of MaxBotix Inc.
 

Offline mjrandle

  • Contributor
  • Posts: 27
Re: Measuring water in a water tank
« Reply #87 on: January 09, 2013, 11:49:01 pm »
I don't have any experience with the serial output mode, but I found the pulse width method to be very simple (I'm not a software guy).  I'm hoping to setup an Xbee mesh network in the coming months.

I've attached a photo of the sensor, all of the PVC fittings were purchased at Bunnings (tank outlet, push on cap/plug and push on cap).  Sensor is mounted using Maxbotix bulkhead nut.  If I didn't have to raise sensor slightly, I would have likely used a Clipsal 240/16/1 junction box to cover solder terminals.


Cheers,

Mike
 

Offline ilium007

  • Regular Contributor
  • *
  • Posts: 210
  • Country: au
Re: Measuring water in a water tank
« Reply #88 on: January 10, 2013, 08:23:02 am »
Yeah - mine are on Xbees as it is really easy to get the serial signal transmitted. Going by the datasheet the serial output is most accurate a well. Last night I got my MQTT server running on the RaspberryPi as well so I now have measurements streaming to MQ.
 

Offline ilium007

  • Regular Contributor
  • *
  • Posts: 210
  • Country: au
Re: Measuring water in a water tank
« Reply #89 on: January 11, 2013, 01:22:17 pm »
So I thought I would give a quick update.

I have mocked up the Arduino / RaspberryPi MQTT server.

I have a bare raspberryPi (that I didnt have a use for) running the Mosquito MQTT server for the time being - it only draws a few watts and runs a Debian based Linux distro:



I have my Arduino / MB7389 set up using the serial output as it is the most accurate (and quite easy to consume on the Arduino):



So what happens:
  • I send a message from my computer (over the data network) onto the MQTT queue that essentially says "turn on the sensor for tank1"
    The Arduino is an MQTT subscriber and is always listening for messages on a particular quque - when it receives a message a callback function is fired that interprets the command. If it is "command:range" it tells the MB7389 to take a reading.
    The Arduino sends pin4 high (it is usually tied to ground) and the MB7389 starts taking readings. The cycle time on the readings is about 148us and in this time I read the serial string it sends and extract the distance from the range reading (in mm) and store in an array. I take 9 readings and then send pin4 low again. I then discard the first 4 unfiltered results leaving me with an array 5 elements long. I bubble sort them from high to low and pull out the median value (hence the odd numbered array length).
    This reading is then packaged up into a MQTT message and sent back to the queue where it can be consumed by other program logic (this will be Python code) to, say, turn a pump on/off or send the reading to a database / internet cloud service (Pachube etc) so I can keep historical data on water usage.

Video:

« Last Edit: January 11, 2013, 01:25:13 pm by ilium007 »
 

Offline wigman27

  • Regular Contributor
  • *
  • Posts: 143
  • Country: au
    • Wiggins Wonderful Websites
Re: Measuring water in a water tank
« Reply #90 on: August 28, 2014, 04:19:04 am »
Hi all!

I know this is a very old topic I am wondering of you have some example code?

I am trying to do a very similar thing but unsure how to go about it.

I am having a lot of trouble working out how everything fits together with MQTT

We are using a raspberry pi to serve a webpage that on load it sends the arduino a message over MQTT then the arduino reads values and sends it back to the pi which displays the results on the webpage but I just can figure out the best way to do it!

Anyone that can help would be fantastic.

Thanks

Lee
Need a website designed? Check out my Australian based web development business www.wigweb.com.au for affordable fixed price packages
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf