Oil fill sensor

I wanted a way to automatically detect how much fuel oil I have. There are some off-the-shelf remote sensors of varying cost, but I wanted something that could interface with my computerized environmental monitoring and notification system and wasn't too expensive.

There are two common types of sensors, a magneto-resistive sensor with a float and an ultrasonic sensor. Ultrasonic is neat, but the ones designed for use in fuel tanks are quite expensive, so I went with the less expensive float sensor.

I got one from Syba Systems for $ 129. I got the 0 - 5 VDC output model, 42" long, for a vertical 275 gallon tank. It's accurate to about 1/2" which isn't great, but is acceptable for my purposes. It fits in a 1 1/2" NPT hole, but my tank had a 2", so there's a reducing adapter as well. There was previously a 2" plug in that hole. That does raise the sensor up a little so there's probably a little bit more oil than the sensor would indicate, but that's not really a problem.

This is what it looked like before installation. The black thing on the left is the float, which slides up and down the stainless steel rod.

It requires a power supply of 12-24 VDC. Normally you'd need a 12 VDC adapter, but I already had one with sufficient capacity that powers the existing proximity sensor and electronic lock at my front door.

The 0 - 5 VDC sensor analog output I decided to attach it to my existing Phidgets 8/8/8 USB-based analog and digital I/O board. That board has 5 V analog inputs and is already integrated with my server infrastructure, so that was a logical choice.

If I were starting out from scratch, I'd probably use a SparkCore instead of Phidgets. It's less expensive, and has built-in Wi-Fi. There's one caveat to this - it has 3.3V analog inputs, but that's not that big of a deal, as I'll explain. 

I'm glad I tested the sensor, because it seems that it can output more than 5 VDC - I got 6.19 volts!

To be safe I put a resistor voltage divider made with 10K resistors in front of the ADC (analog to digital converter) input. This will result in a maximum of around 3V, but since the Phidgets ADC is 10-bits, there's still plenty of resolution. This is also the solution to using a SparkCore since that will be sure to keep the input below 3.3V.

divider.jpgThis is the Phidgets installation.

The Phidgets ADC outputs a value of 0-1000, I think. With my voltage divider I seem to get something around 0-619, which seems about right.

The other issue is when translating the gallons, the curvature of the tank. This is just a simple math problem, the area of a circular segment given its height. I didn't remember the formula, but it only took a few seconds of searching to find it.

I already have an infrastructure where my Apache Tomcat webapps can send Apple Push Notifications to a custom app (called "Lock") on my iPhone. Here it is letting me know I'm low on oil:

And that the tank is currently being filled:

One of the problems I'm having is that the data from the sensor is not particularly stable. I'm not sure whether it's the sensor or the ADC, but I'm tracking it to see how best to smooth the data. Well, samples 11-19 are during filling, so it's expected that those would be varying, but the other ones are more concerning. Maybe I should have gone with ultrasonic!

Until I figure out how to smooth the data and get a larger sample of data, I'll wait before implementing the next part, an analysis of how much oil I'm consuming. I have accurate outdoor temperature values by the hour from my weather station, so I should be able to accurately calculate heating degree days for comparison, as well.

About this Entry

This page contains a single entry by Rick Kasguma published on October 27, 2014 6:24 PM.

Spotify Next Track Button was the previous entry in this blog.

NEC IR Remote Decoder for SparkCore is the next entry in this blog.

Find recent content on the main index or look in the archives to find all content.