Wifi Enabled, Arduino Based Fuel Oil Gauge

Wifi Enabled, Arduino Based Fuel Oil Gauge

I had been wanting to have a remote Fuel Oil Gauge for a long time, as it’s really a pain to get down to my basement to check the oil level.  We don’t do automatic fill and only get oil when we need it.  I’ve found remove sensors available, but they seem to be rather overpriced for what they really are, especially the ultrasonic model.  None of them actually give you a good idea on how much oil, they basically give you 4 indicator lights letting you know whether you’re full, 3/4, 1/2 or 1/4 full.  Not really useful in my opinion.

Construction

At the heart of this is the Arduino Pro Mini connected to the UltraSonic Level sensor through it’s on board serial port as well as connected to the ESP-01 through a software serial port.  On the circuit board is a 5v and 3.3v regulator to power the Arduino and ESP-01 respectively.  A 2×16 LCD display shows the current level from the top in inches as well as a bar graph so you can see at a glance the level of the tank.  I used this Ullage table to translate inches to gallons based upon my tank size.  The board I etched myself using my UV Light Box to transfer the image.

The UltraSonic sensor head is mounted in a 3/4″ ID bushing, which is then screwed upside down into a 2″ galvanized bushing that screws into the top of the tank.  The sensor was actually a perfect fit and I only needed to use a little bit of silicone sealer to hold it in place.  My tank had an available cap that was easily removed for this to screw directly into.  The manufacturer claims that this is water proof, and it probably is, I don’t know how well it’ll do being exposed to fuel oil though, but there really aren’t too many other cost effective options out there.  It’s  very low voltage unit, so the chances of sparking are slim.

Program Flow

The ESP-01 is programmed to connect to the Wireless network and play man in the middle with the Arduino and the Database that resides on my webserver.  The Arduino takes a measurement every second, then averages the readings and sends it every 15 minutes  to the ESP-01, which then passes that data to a PHP file on my webserver.  That PHP file then uploads the data to a database where it can be monitored in a gauge as well as graphed.

The PHP file also has logic built into to it to determine if the level is as the point that an email alert needs to be sent out.  If the level gets too low, it will update the JSON file that the ESP-01 is monitoring.  When the file is updated the ESP-01 will send out a preprogrammed alert message indicating the current level of the tank.  It will then respond back to the webserver letting it know it sent the email and the webserver turns off the alert in the JSON file.

Other Images

  • Sensor installed in the Tank
    Sensor installed in the Tank
  • Box hanging on electrical box with magnet
    Box hanging on electrical box with magnet
  • Sensor sealed with silicone
    Sensor sealed with silicone
  • Magnet epoxied onto the back
    Magnet epoxied onto the back
  • Oil Level Graph
    Oil Level Graph
  • Sensor Circuit
    Sensor Circuit

Over all I’m happy with the way it turned out.  The etched board wasn’t perfect, I did have a void that needed fixed, but it’s functional.  There’s probably some improvements that will be needed in the code, but I’m going to let it run for a while to see how it behaves.  I’ll post up the code for the Arduino and ESP-01 as well a webserver package once I’ve determined that it’s running stable enough for public use.

(Visited 13 times, 1 visits today)

Leave a Reply

%d bloggers like this: