Oil Level sensing design help..... - Page 1
Forum section: electronics / projects

author: Nimesh Silva
author_rank: Newbie
timestamp: June 23, 2012, 06:56:15 am
content: Hi all,I'm recently doing a project which require to sense the oil level of a bottle. (to be precise, the bottle is filled by a small pipe fixed in to the machine, which I designed, and should stop filling as soon as it reaches a set level. I've already done the control software for the microcontroller and the mechanical parts. The big problem is, the oil is not conducting. so the level sensing becomes difficult. I've tried several ways (Using IR sensing, Laser beam, etc..) but failed (some are doing the job, but very less repeatability). after the filling pipe (which goes in through the bottle mouth) is in, there is no space to fix a floater or an optical level sensor on the filling pipe. the other problem is it should be low cost solution. So I'm out of thoughts. Can you guys suggest a method for me?? it would be a great help.ThanxNimesh

author: Rerouter
author_rank: Super Contributor
timestamp: June 23, 2012, 07:17:51 am
content: there is one method you skipped clear past, capacitive, most oils hold a fairly high dielectric constant, so dip 2 bare but not touching wires in the solution, (solidcore perhaps for rigidity) and measure the capacitance between them, (hold 1 wire to GND, the other switched between the ADC input and 5V, you end up with a charge divider, where a very low capacitance from the wires in air results in a very low reading on the adc, when the oil contacts both, it acts as an electrolyte and you will immediatly see a very strong peak, depending on the oil probably in the upper 3% of your values,

author: muvideo
author_rank: Frequent Contributor
timestamp: June 23, 2012, 07:18:06 am
content: Edit: Rerouter I didnt read your answer in timeI've never done it personally, but read aobut this around:Capacitive perhaps? Oil dielectric constant should be around 2.If oyu can arrange to detect small capacitance readings.The sensor itself will be simple: two conductors (flat or coax)spaced apart just enough to let the oil not be trapped by capillarity.Fabio.

author: amspire
author_rank: Super Contributor
timestamp: June 23, 2012, 08:05:57 am
content: I had some old 300ohm flat TV antenna cable, so I thought I would give the idea a try.Capacitance of 12 inches in air - about 6.0pF including connection capacitance.Capacitance with half the wire in oil - 7.2 pfI think two parallel strips of brass shim mounted in a brass tube would work very nicely. Attach with a dual core coax - shield going to the brass tube. Drive one if the strips with 100Khz/5V. Attach the other strip to an inverting opamp input, with a feedback resistor of somewhere around 470K. Non inverting input to half the supply volts supply volts. Worth experimenting I think.Another way would be a loop of fine wire or fine tracks on a PCB. Put 100mA through the wire for a minute, and then measure the amount the resistance reduction after removing the 100mA. There will be a more significant drop with the wire in the air. How much difference between oil submersed wire and oil coated wire? Not sure about that.Richard.

author: muvideo
author_rank: Frequent Contributor
timestamp: June 23, 2012, 08:14:50 am
content: Quote from: amspire on June 23, 2012, 08:05:57 amYou are right, for simple level switch a thermistor would be even easier to use: as easy as inject a known currentand check the voltage. The capacitance method can be used to return the actual level, but it will be a bit trickyto setup, the capacitances are small.Fabio.

author: G7PSK
author_rank: Super Contributor
timestamp: June 23, 2012, 08:38:11 am
content: Weight. Put a strain gauge underneath.

author: bilko
author_rank: Frequent Contributor
timestamp: June 23, 2012, 09:00:49 am
content: You could use a fixed displacement pump instead, or use a flow counter/meter

author: Psi
author_rank: Super Contributor
timestamp: June 23, 2012, 09:01:39 am
content: You're going to want a fail-safe systemOtherwise a fault may cause it to keep pumping while oil is overflowing everywhere.

author: Nimesh Silva
author_rank: Newbie
timestamp: June 23, 2012, 09:16:53 am
content: Thanx guys for your valuable ideas..I'll try the capacitive thing, but as a quick and dirty check, I put my DMM to capacitance scale and dip 2 probes in the oil. (Actually the oil used here is "coconut oil") but unfortunately it didn't change a single nf. however, I'm not sure that I can detect the capacitance change in pf range with the noises out there.but I'm unable to get weight coz the bottles are feeding along a conveyer belt and there is a requirement to feed different sizes of bottles, so its bit hard..yep, I planned to use a flow sensor, those are quite expensive. since this is not a commercial product, and at most 6 bottles are filling simultaneously, 6 flow sensors counts big, so, its not much practical.Psi is very correct, it needs to be very accurate and high repeatability. otherwise......Any other thoughts???

author: bilko
author_rank: Frequent Contributor
timestamp: June 23, 2012, 09:35:30 am
content: I don't know if its feasible but could you insert the dispensing tube into the bottle and measure the back pressure when the oil level rises and hits the tube ?

author: SeanB
author_rank: Super Contributor
timestamp: June 23, 2012, 09:51:36 am
content: You are doing a FMCG filler, and need to use a proper sensor, or bite the bullet and use a variable displacement pump for each station.Sensing the fill level with a thermistor driven to self heat to about 30C above ambient is a possible solution, if you use a small enough thermistor ( a tiny glass bead one of around 100R at 25C will do, provided that the wires for the first few cm are very fine and insulated in a thin PTFE sleeve as well to make it not accumulate a thin oil film) the response time will be quite fast, though it may not be fast enough.Most fillers use either a pump, or do an eyeline fill using an optical sensor or line camera through the bottle neck. Nothing else is fast enough to handle a line running at a bottle per second

author: Nimesh Silva
author_rank: Newbie
timestamp: June 23, 2012, 11:32:59 am
content: Thanxx...The thermister thing seems bit practical.. I'll try it

author: amspire
author_rank: Super Contributor
timestamp: June 23, 2012, 01:21:18 pm
content: Quote from: Nimesh Silva on June 23, 2012, 09:16:53 amYou can accurately measure the capacitance as long as you use the circuit I described above. It can easily measure sub-picofarad very accurately. I said 100KHz. 10Khz may even work out more accurate. You will need a fast opamp - 10Mhz would be good, but at least 3Mhz I think.I wouldn't expect much from two probes stuck in the oil. Richard.

author: ejeffrey
author_rank: Super Contributor
timestamp: June 23, 2012, 08:00:40 pm
content: Quote from: Nimesh Silva on June 23, 2012, 09:16:53 amThe capacitance meter in almost all DMMS is next to worthless for small values. Most industrial meters have 1 nF resolution, and while many electronic meters have 1 pF resolution they are still not very stable or accurate. There are several ways to measure ~pF level capacitance with sufficient resolution. Most micro-controller manufacturers have app notes on measuring small capacitance values using only the onboard hardware (timers, ADC, and digital pins). You can also roll your own, or buy one of Analog Devices capacitance to digital converter ICs.

author: G7PSK
author_rank: Super Contributor
timestamp: June 25, 2012, 09:34:09 pm
content: I was in my car today and the automatic wipers came on and it gave me an idea, light back scatter that is how the wipers work on my car. The sensor shines an infra red light out through the windscreen in front of the rear view mirror when water lands on the area it affects the back scatter and switches on the wipers, the same would work with bottles being filled once oil passed the limit light would be reflected back at increased levels and the fill would be stopped.

author: vk6zgo
author_rank: Super Contributor
timestamp: June 25, 2012, 11:58:19 pm
content: Back in the day,while I was on a working holiday in the UK,I worked for a while at a bulk wine importer.They had ideas of breaking into the bottled wine market,so set up a pilot bottling plant.This had a filler consisting of a two concentric tubes.One tube was fed with wine,& the other went to a vacuum pump.The air being withdrawn from the bottle set up a vacuum,so the wine was drawn into the bottle.When the bottle was nearly full,the volume of air being withdrawn from it was insufficient to continue drawing wine into the bottle,so the flow ceased.This system also had the advantage of detecting faulty bottles.Amazingly,there were quite a few!

author: Nimesh Silva
author_rank: Newbie
timestamp: June 29, 2012, 02:16:21 pm
content: Hi all..Thank you all guys to helping me out. I appreciate it very much.I've tested out some methods you've suggested and happily one worked. and I think its the best one suited for my project. It was the thermistor thing. I kept thermistor in an elevated temp, with 100 Ohms resistor in series, forming a voltage divider (about 70mA through @ 12V, I took NTC). and used LM393 to compare the voltage with the set-point. and BINGO.. it worked !!!!!!!!after it is dipped in the oil, the temp of the thermistor is reduced very fast, and the voltage changes, the level is detected by the uC. (Of course I put some filtering and used 74HC14 to interface to the uC)But the only problem is, the thermistor is taking little longer to heat up again and ready for the next bottle batch. so I had to hold the next batch until the thermistors heat up. Any suggestions to reduce the heat up time without affecting the voltage divider??

author: muvideo
author_rank: Frequent Contributor
timestamp: June 29, 2012, 02:34:53 pm
content: What is the time we are talking about? I imagine that once the bottles are filled,there is some bottle change and new refill process, is this time too short for reheat the sensor?In general I would suggest to reduce the sensor mass and temp. differential as much as pratical,the thermistor voltage will change noticeably already with small temperature variation of only few °C.You can also try to use the micro to sense directly the voltage at thermistor and check for fastvoltage variations (voltage differential) instead of absolute values.Fabio.

author: Nimesh Silva
author_rank: Newbie
timestamp: June 29, 2012, 06:04:49 pm
content: Hi..Thanks muvideo, but the problem is, in my circuit, the connections are like this. There are 6 channels(6 bottles are filling simultaneously, so 6 thermistors and 3 LM393 s and some passives) LM393 O/P -> 74HC14 (Low pass filtering and shaping) -> 74HC165 -> uC. Since all the IO pins are now occupied (for other tasks, I'm using a small 28pin micro) I have to connect it in this way. So I scan the 74HC165 once a while and detect the levels. So I'm unable to check for the differential values.

author: SeanB
author_rank: Super Contributor
timestamp: June 29, 2012, 06:25:42 pm
content: Wind up the thermistor voltage a little, try 15V. The faster heating will increase sensitivity, you can up the voltage to the point where the thermistor reaches its power dissipation limit. Datasheet should give that voltage.

author: PuterGeek
author_rank: Regular Contributor
timestamp: June 30, 2012, 12:34:51 am
content: My former company sold sensors for engine oil that did this and they used either capacitance or heated wire.There were two types of capacitive sensors:1) The first was a perforated metal shield with a gap to a center electrode (probably too big for what you are doing).2) The other was a PCB with two triangular planes separated by a small gap. As the oil rose the capacitance changed and they could actually determine the level.One trick to using the capacitance is to use it as part of an oscillator circuit. As the capacitance changes so will the frequency which is easy to measure with a uC.The heated wire used a nichrome wire that they pulsed with a current and then measured the resistance. This one could also determine the level.Competing products used refraction and ultrasonic measurement. The refractive ones had problems with their lenses getting dirty which require periodic cleaning and the ultrasonic ones couldn't measure very shallow depths (3 or 4 inches).Hope that gives you some ideas.

author: MikeK
author_rank: Super Contributor
timestamp: June 30, 2012, 12:43:38 am
content: Could you do what a washing machine does? A tube at the bottom of the tub is connection to a diaphragm. The amount of fluid in the tub produces an proportional pressure at the diaphragm, which displaces proportionally. It's quite a simple and reliable mechanism.

author: vk6zgo
author_rank: Super Contributor
timestamp: June 30, 2012, 01:19:47 am
content: Quote from: MikeK on June 30, 2012, 12:43:38 amI think he wants to do it with only Electronics.Sometimes the least complex option is retro-style,like yours,& mine about the wine bottle filler in an earlier posting.After all,both these methods have been used for over 50 years with no dramas.

author: bradleytron
author_rank: Regular Contributor
timestamp: June 30, 2012, 01:42:46 am
content: Just wondering...If the coconut oil is intended for use as a food product, for human consumption, is there any potential issue with bacteria and cross contamination. I would have though that certain periodic sterilization procedures would be required and if so how difficult would it be to clean the sensors mentioned thus far. I assume that the non electronic solutions mentioned would be much more easily removed and cleaned if contamination is a potential problem.

author: Nimesh Silva
author_rank: Newbie
timestamp: July 03, 2012, 08:14:56 am
content: Quote from: SeanB on June 29, 2012, 06:25:42 pmYes, SeanB, I'm driving it with 12V @ 70mA after the thermistor is fully warmed up. I'm using a ceremic capacitor like thermistor, but if I'm able to find a thermistor like 1N1418 diode, then with the reduced mass, i'll be able to heat it up quickly. but the problem is they are hard to find here in sri lanka...Quote from: vk6zgo on June 30, 2012, 01:19:47 amNo MikeK, I'm unable to do that, coz the oil is filled in different bottles. and subsequently they go to the market. and vk6zgo is right. it is lot easier to do it in electronics rather than mechanical methods, coz here in sri lanka, there are less facilities to make mechanical parts as such..Quote from: bradleytron on June 30, 2012, 01:42:46 amYes bradleytronIts for human consumption and I'm taking maximum effort to sterilize the thermistors and other parts which are submersing in the oil. and hope to use the thermistors which, the outer shell is made out of glass. and educate the machine operator to clean up the sensors before starting the day.

author: SeanB
author_rank: Super Contributor
timestamp: July 03, 2012, 03:28:42 pm
content: If you have air to run the machine ( I would assume you do as most fillers use pneumatics, then you can just use a air bleed via a needle valve ( and put a 2 bar filter regulator ahead of it with a microfilter, 2 micron or less, oil coaleascing) and feed this into the bottle with the fill nozzle using a stainless steel thin wall 2mm tube. Then you can detect the change in pressure when oil covers the end, and use a pressure sensor to detect the rise in pressure. This will be a reliable method, just differentiate the output signal ( and add a comparator for redundancy) and detect the rising pressure to trigger the end of filling. You probably will have to have a reset contact to reset the differentiator per cycle so it starts at zero voltage for each fill.

author: aruna1
author_rank: Regular Contributor
timestamp: July 03, 2012, 04:37:59 pm
content: machan,use capacitive method.make an oscillator with 7414 schmitt trigger,resistor and your oil can as the capaciitor. measure the frequency with the PIC,I have done this to sense fuel level in a fuel level meter. it works and it is pretty accurate