water tank level measurement... what sensor to use? - Page 1
Forum section: electronics / projects

author: VEGETA
author_rank: Super Contributor
timestamp: May 11, 2013, 07:09:17 pm
content: There's a new project I will work on, it's water level sensing from the residential water tank.I want to output a percentage of available water, then do other stuff according to it. I will take care of everything else, the only thing I don't know about is what sensor to use?the volume of the tank is 2m^3 (length=2m,width=1m,height=1m). so when I put a distance sensor to measure the height and say it's 40cm of water, this means 40% full and 60% empty, right? that's what I plan to do.I want a cheap sensor (solution), about 30$ or so if possible (it's a simple residential device... if it's 50$, ok. but not more ^_^).The device I'm gonna make will have more functions to do, but they depend on what current water level is.Thanks for help.

author: somlioy
author_rank: Regular Contributor
timestamp: May 11, 2013, 07:59:11 pm
content: What about a ultrasonic sensor or a load cell?

author: IanB
author_rank: Super Contributor
timestamp: May 11, 2013, 08:00:09 pm
content: Here's a thread to get you started:https://www.eevblog.com/forum/projects/measuring-water-in-a-water-tank/

author: croberts
author_rank: Regular Contributor
timestamp: May 11, 2013, 08:52:32 pm
content: I detect the water level in a smaller tank by attaching a length of aluminum flat to the shaft of a single turn potentiometer and attaching two floats (fashioned from vitamin bottles) to the end of the aluminum flat. I used a high quality sealed potentiometer and it is still working well after more than five years. The potentiometer is connected to circuitry that generates a changing voltage level at the input of an ADC pin on a PIC microcontroller.

author: VEGETA
author_rank: Super Contributor
timestamp: May 11, 2013, 09:22:16 pm
content: about ultrasonic, I found them a bit pricy. there's some people who advised me to use a magnetic float sensor (low price) but I found some on digikey that have a higher price than they said.I saw one in the lab and it outputs 4-20mA current which is an industry standard. Now, when I want to measure the level in PIC microcontroller, I should convert this current to a voltage for the sake of ADC.What came on my mind is to use a current transformer because it's easy to use, it gives an output voltage that have a direct relation with the current.... (this can be further studied later as it's not very much precise).SO, what's left to me is decide what float sensor to use.the reason I want to avoid other types of sensors is the price. I want to make the device using cheap materials.My project is like the following:- a sensor to sense water level, with current transformer (or any other mean).- PIC16F877A microcontroller.- MOC3062M with BT139 TRIAC to control a single phase induction motor (for residential use).- LCD to output some readings.- few buttons to change some threshold values.Threshold values: it's when the motor should start, say when water level is 50%, the motor should automatically start. when it's 95% it should stop... these are the thresholds ^_^. some buttons (or similar things) are used to adjust these as necessary.Now, with that said, I think it's all clear what I wanna do. So, do you recommend a float magnetic sensor? If you recommend other types of float/level sensors it's OK to me, but the price should be cheap enough just like these magnetic ones.Sorry for the long post... ^_____________^

author: Chet T16
author_rank: Frequent Contributor
timestamp: May 11, 2013, 09:33:28 pm
content: I put an ultrasonic sensor in our oil tank recently, you can read about it on my blog here:http://www.chet.ie/?p=204

author: XynxNet
author_rank: Regular Contributor
timestamp: May 11, 2013, 09:35:02 pm
content: You could use a pressure sensor.

author: Zad
author_rank: Super Contributor
timestamp: May 11, 2013, 09:45:07 pm
content: Is it a plastic tank? If so then you can use 2 wires taped to the outside of the tank. The capacitance changes as the tank fills. You use it as the capacitance in an RC oscillator circuit, and use the micro to measure the frequency.

author: IanB
author_rank: Super Contributor
timestamp: May 11, 2013, 09:45:52 pm
content: Quote from: VEGETA on May 11, 2013, 09:22:16 pmTransformers work with AC, but a 4-20 mA instrumentation signal is DC.The way you convert a 4-20 mA signal into a measurable voltage is to pass it through a resistor. For example, a 250 ohm resistor will give you a signal of 1-5 V.

author: pickle9000
author_rank: Super Contributor
timestamp: May 11, 2013, 09:51:18 pm
content: A pot and float setup is very reliable. String pots are very accurate and easy to rig as well.

author: VEGETA
author_rank: Super Contributor
timestamp: May 11, 2013, 10:02:47 pm
content: So, how much does these ultrasonic ones cost?___my tank is not plastic.____about pressure sensors, do you mean hall effect ones? how exactly can it measure distance so accurately?

author: BillyD
author_rank: Regular Contributor
timestamp: May 11, 2013, 10:19:06 pm
content: Quote from: Chet T16 on May 11, 2013, 09:33:28 pmVery nice work. And in fact theft from oil tanks is becoming quite an issue these days so this could help secure the tank. Might build a similar system on ours.

author: kripton2035
author_rank: Super Contributor
timestamp: May 11, 2013, 10:23:26 pm
content: Quote from: VEGETA on May 11, 2013, 10:02:47 pm$2 delivered ... easy to try no ?http://www.ebay.com/itm/ws/eBayISAPI.dll?ViewItem&item=290773412333

author: ChrisGreece52
author_rank: Frequent Contributor
timestamp: May 12, 2013, 12:14:44 am
content: A simple solution would be some transistors ... this worked for me and it is pretty simple and straight forward

author: ChrisGreece52
author_rank: Frequent Contributor
timestamp: May 12, 2013, 12:16:46 am
content: Quote from: kripton2035 on May 11, 2013, 10:23:26 pmRight they are so cheap and usefull and pretty much easy to use after you have a look at the code !!!

author: ChrisGreece52
author_rank: Frequent Contributor
timestamp: May 12, 2013, 12:17:54 am
content: Quote from: XynxNet on May 11, 2013, 09:35:02 pmI may be wrong but ...... would it be accurate?

author: c4757p
author_rank: Super Contributor
timestamp: May 12, 2013, 12:18:05 am
content: 1) Why 6VAC?2) The capacitive method above sounds better because the levels aren't discrete. They can be adjusted without moving sensors.3) Who taught this bastard his alphabet? "F-A-B-C D-E-Q, X-V-U-P L-M-N-O-Z!!!" Must have been some kindergarten!

author: ChrisGreece52
author_rank: Frequent Contributor
timestamp: May 12, 2013, 12:21:45 am
content: Quote from: c4757p on May 12, 2013, 12:18:05 amThats not a problem ... recenlty due to your help guys i learned that using a Smoothing Capacitor can smooth the bumpy rideAlso the capacitive method wouldnt request more time to build and test?And about the third thing .... i did not got it ... its because i am sleepy... or retarted

author: c4757p
author_rank: Super Contributor
timestamp: May 12, 2013, 12:22:59 am
content: Quote from: ChrisGreece52 on May 12, 2013, 12:21:45 amYes.

author: IanB
author_rank: Super Contributor
timestamp: May 12, 2013, 12:24:58 am
content: Quote from: ChrisGreece52 on May 12, 2013, 12:14:44 amThat looks neat, except if that is drinking water you must be careful about what you make the electrodes out of. By placing 6 V between the electrodes you will get galvanic corrosion and some metal electrodes may release metal ions into the water. Some metals, like copper, are rather poisonous and you really don't want copper in your water supply. Make your electrodes out of something safe, like carbon or zinc.(And I missed the obvious because I didn't expect it--but now I see 6 V AC? AC? What? That should be +6 V DC, please. Of course AC will reduce electrode corrosion, but it won't do much for the operation of the transistors.)

author: IanB
author_rank: Super Contributor
timestamp: May 12, 2013, 12:25:45 am
content: Quote from: ChrisGreece52 on May 12, 2013, 12:21:45 amDefinitely retarted

author: c4757p
author_rank: Super Contributor
timestamp: May 12, 2013, 12:29:31 am
content: Quote from: IanB on May 12, 2013, 12:25:45 amIs that where you realize your pastry isn't quite done and stick it back into the oven, or where you return to the brothel for the second time in a day?

author: ptricks
author_rank: Frequent Contributor
timestamp: May 12, 2013, 12:33:33 am
content: Ir emitter and IR sensor work great and is non contact as well.Distance from IR emitter reflection from surface gives you an analog voltage output.I use the system on large aquariums exposed to salt and other corrosives and it works well.If the distance is far you can use a low power 5mw laser with the beam out of focus so it illuminates a larger area.

author: Apothus
author_rank: Contributor
timestamp: May 12, 2013, 08:49:31 am
content: I remember reading about a circuit in Silicone chip several years back now where they used an air pressure sensor.Essentially they ran a piece of pipe up from the outlet tap at the bottom of the tank towards the top, the most classic method of visually measuring a tank there ever was. However instead of leaving the top of the pipe open to the air they sealed in a pressure difference sensor. So as the tank drained the air at the top would form a small vacuum whilst when it was filled above its original high registration point it would develop a positive pressure.If you really want more info i could try and dig it up but it is cold and wet outside and I am just not motivated for that on a Sunday.

author: ChrisGreece52
author_rank: Frequent Contributor
timestamp: May 12, 2013, 11:05:57 am
content: Quote from: IanB on May 12, 2013, 12:24:58 amRight also he could just use a 3 volt supply and no resistors in series with the leds.That should slow down corosion

author: ChrisGreece52
author_rank: Frequent Contributor
timestamp: May 12, 2013, 11:07:59 am
content: Quote from: ptricks on May 12, 2013, 12:33:33 amDidn't think of this solution... pretty good and simple.But in order for this method to work he should install many recievers and emiters.

author: VEGETA
author_rank: Super Contributor
timestamp: May 12, 2013, 11:16:41 am
content: putting the transistors isn't gonna be enough for me, I want to determine the exact level like 55% or so, not just a simple indicator.about that ultrasonic module, will it be enough to measure up to 1m? I use PIC microcontroller so it's not necessary to use Arduino for it right?

author: ChrisGreece52
author_rank: Frequent Contributor
timestamp: May 12, 2013, 11:37:33 am
content: Quote from: VEGETA on May 12, 2013, 11:16:41 amno but there are more projects as far as i know with arduino than any other microcotroller ... i think that is because the arduino community is a lot bigger , the actual product it self is more user friendly and you can find the platform that suits your needsAnyway if you are remotely thinking of using an arduino for this project take a look at this :http://www.open-electronics.org/water-tank-level-display-with-arduino/

author: VEGETA
author_rank: Super Contributor
timestamp: May 12, 2013, 11:44:25 am
content: I found this sensor:http://www.dfrobot.com/wiki/index.php/URM37_V3.2_Ultrasonic_Sensor_%28SKU:SEN0001%29it's not that much pricy but it's control seems a bit harder than usual. Also, it will be harder to deal with using PIC.the reason I wanna use PIC here is that I want the product to be as cheap as possible. Arduino Uno will cost about 25$ where I can buy PIC16F877A with about 5$ or less.

author: ChrisGreece52
author_rank: Frequent Contributor
timestamp: May 12, 2013, 11:58:03 am
content: Quote from: VEGETA on May 12, 2013, 11:44:25 amYou got that wrong !!!You DONT need to buy an official arduino UNO for 25 usd!!! Thats because it is open source hardware so you can buy any arduino model for more less .I got my funduino (also the producer give them custom names) mega 2560 pretty cheap from ebay.And my ultrasonic sensor for just 2 or 3 bucksTake a look at this cheap arduino:The original arduino UNO r3 only for 11 usdhttp://www.ebay.com/itm/Latest-Version-Original-Arduino-Uno-R3-MEGA328P-ATMEGA16U2-USB-Cable-/171038981716?pt=LH_DefaultDomain_0&hash=item27d2b7be54And a cheap ultrasonic sensor only for 2 usdhttp://www.ebay.com/itm/1pcs-Ultrasonic-Module-HC-SR04-Distance-Measuring-Transducer-Sensor-for-Arduino-/261009210866?pt=LH_DefaultDomain_0&hash=item3cc55c7df2I got the excact same sensor but i got this "arduino":http://www.ebay.com/itm/1-Funduino-Mega-2560-ATmega2560-16AU-Board-Arduino-compatible-Free-USB-Cable-/251143019741?pt=LH_DefaultDomain_0&hash=item3a794a5cddAnd if you are looking for an extremely cheap solution think about this :http://www.ebay.com/itm/New-Pro-Mini-atmega328-5V-16M-Replace-ATmega128-Arduino-Compatible-Nano-/130839929399?pt=LH_DefaultDomain_0&hash=item1e76aae237Smaller memory but pretty much same specsThese are all the versions and you can compere them to see what is the best match for youhttp://arduino.cc/en/main/boards

author: VEGETA
author_rank: Super Contributor
timestamp: May 12, 2013, 12:18:10 pm
content: I prefer not to do all these, as they aren't available in my country.Is there a good way to deal with that sensor in PIC?

author: ChrisGreece52
author_rank: Frequent Contributor
timestamp: May 12, 2013, 12:26:49 pm
content: Quote from: VEGETA on May 12, 2013, 12:18:10 pmI have no experience on PIC microcontrollers but if you chose to go with Atmel ones i could help you with some basic things.

author: ChrisGreece52
author_rank: Frequent Contributor
timestamp: May 12, 2013, 12:28:47 pm
content: Quote from: VEGETA on May 12, 2013, 12:18:10 pmYou can also find stuff that ARE available in your country ... where do you live???Also you could make your own arduino with parts ordered from tayda (VERY CHEAP this site has saved my life and it has cheap shipping fees for Greece at least)http://arduino.cc/en/Main/Standalonehttp://www.taydaelectronics.com/

author: ptricks
author_rank: Frequent Contributor
timestamp: May 12, 2013, 04:46:06 pm
content: Quote from: VEGETA on May 12, 2013, 11:16:41 amThe IR method is extremely accurate it can measure distance to 1mm accuracy. Think of it like placing a photocell in a box with a light and then shrinking the size of the box, the intensity of the light changes as the size of the box changes , changing the resistance of the photocell, on a cheap DAC you can get a 0-4096 value range.I found ultrasound a bad choice for water measurement because water is usually contained in something that bounces the sound around screwing up the results, careful placement was needed.

author: ChrisGreece52
author_rank: Frequent Contributor
timestamp: May 12, 2013, 07:12:51 pm
content: But whats the electronics part of this method

author: mianchen
author_rank: Regular Contributor
timestamp: May 12, 2013, 08:30:24 pm
content: QuoteThis is not a genuine original Arduino. Almost none of them are genuine if you buy from China. Do they work? Of course.Sent from Mars

author: ddavidebor
author_rank: Super Contributor
timestamp: May 12, 2013, 09:05:52 pm
content: almost ANY arduino on ebay that is send to you without arduino sticker and little case is original.

author: VEGETA
author_rank: Super Contributor
timestamp: May 12, 2013, 11:53:21 pm
content: "ptricks"OK, what sensor to buy for this IR method?

author: glatocha
author_rank: Regular Contributor
timestamp: May 13, 2013, 03:23:16 am
content: Quote from: ChrisGreece52 on May 12, 2013, 12:17:54 amDepends on the sensor. But the pressure based level monitoring is widely use in the industry. You can even use it for safety purpose application. We monitor emergency cooling water tank with it and it is SIL4 safety category. So the method is accurate. You chose the sensor range and accuracy. Remember 1 bar per 1 meter.

author: ChrisGreece52
author_rank: Frequent Contributor
timestamp: May 13, 2013, 12:15:35 pm
content: Quote from: mianchen on May 12, 2013, 08:30:24 pmNo this IS the genuine original Arduino because of its logo . Mine is not so instead of Arduino it just sais Funduino and then Mega ... This one has the Official Arduino mark and if it is not the original one Arduino have the right to sue them so i think it is .(sr if i was confusing)

author: ChrisGreece52
author_rank: Frequent Contributor
timestamp: May 13, 2013, 12:18:54 pm
content: Quote from: VEGETA on May 12, 2013, 11:53:21 pmThe best thing i found was thishttp://www.circuitstoday.com/ir-level-detectorbut it is a bit confusing and requires many parts!!!

author: nuhamind2
author_rank: Regular Contributor
timestamp: May 13, 2013, 03:17:26 pm
content: Quote from: ChrisGreece52 on May 13, 2013, 12:15:35 pmThey are not original.

author: kripton2035
author_rank: Super Contributor
timestamp: May 13, 2013, 03:25:06 pm
content: Quote from: ChrisGreece52 on May 13, 2013, 12:18:54 pmlook at the comments at the bottom : it doesnt seems to work !

author: G7PSK
author_rank: Super Contributor
timestamp: May 13, 2013, 03:29:55 pm
content: How about a load sensor underneath the tank no water involved other than that in the tank, so no need for water tightness one liter of water weighs one KG so a direct weight read out tells you how much water is in the tank. Slip a strain gauge under neath one end, no need to bother with the pipes as the movement is so small they will flex sufficiently.

author: ddavidebor
author_rank: Super Contributor
timestamp: May 13, 2013, 03:35:59 pm
content: Quote from: ChrisGreece52 on May 13, 2013, 12:15:35 pmBullshit , arduino chinese clone are identical.

author: DrGeoff
author_rank: Frequent Contributor
timestamp: May 14, 2013, 03:40:28 am
content: Ultrasonic works fine, and is cheap. I have one in a 3m water tank. It's a sealed ultrasonic transducer like this:http://www.ebay.com.au/itm/Waterprof-Ultrasonic-Distance-Measuring-Detector-Module-/130556433296?pt=AU_B_I_Electrical_Test_Equipment&hash=item1e65c51390

author: lesaid
author_rank: Contributor
timestamp: May 14, 2013, 11:02:36 pm
content: I'm setting up something similar to measure levels in a water butt. I'm measuring a combination of the capacitance between partially covered wires and the water, and the resistance of the water between two wires - controlling the frequency of an RC oscillator with that setup instead of a capacitor. The capacitance is between the conductors and the water with the insulation as the dialectric - the water itself is not the dialetric.The oscillator output is dumped into a capacitor, and I monitor remotely the current drawn. Still calibrating but seems to work well and uses cheap components. My interest is in cutting out a pump when the butt level falls too low, but I'm pretty sure it could be adjusted to give a %full measurement.

author: ptricks
author_rank: Frequent Contributor
timestamp: May 18, 2013, 01:13:45 am
content: Quote from: VEGETA on May 12, 2013, 11:53:21 pmSensor depends on how big an area you need to cover. One of the most effective methods I used was to place an IR LED in a small tube just slightly longer than the diode itself. In a second small tube place a photo transistor. The reason for the tubes is to prevent the light from the IR source registering on the sensor because the two are next to each other.The IR source leaves the tube, reflects off the liquid surface and returns to the transistor where it allows a current depending on how strong the IR. You could also use a CDS photocell for the sensor and a visible light source like a white led. The closer the water, the more light returned and the resistance will change on the photocell.Circuits for these are everywhere, you are basically just taking an IR proximity sensor and extending the range.

author: cthree
author_rank: Frequent Contributor
timestamp: May 24, 2013, 04:00:44 am
content: This article gives a good overview of many fluid level measurement options.http://www.sensorsmag.com/sensors/leak-level/a-dozen-ways-measure-fluid-level-and-how-they-work-1067