-
Notifications
You must be signed in to change notification settings - Fork 0
Home
I wanted to check my heating oil tank from anywhere and anytime and not worry about running to the basement to check oil level. I also wanted to prevent middle-of-the-night run-outs, especially during cold weather. This enables me to track heating oil usage by the hour, quarter hour, whatever data capture frequency I wish. I can now know how much oil burned exactly throughout the day, and adjust the thermostat to conserve fuel. The website showing current oil level in the tank and initial analytics page are located at http://myoilguage.com
Currently the raspberry pi sits on top of a glove. This provides cushioning, and simple insulation from the tank as to prevent shorting the pi. It is connected to the home network via wifi, behind a firewall, and sends data whenever a measurement is taken to the web server that stores the operational database.
As time allows, I will continue to improve code. Currently I'm planning on the following:
- Improved dashboard analytics
- Improved alerting - Receive an e-mail notification when the level reaches ½ tank, 1/3 tank etc.
Building the enclosure was a simple process.
The required components for this were available at local Home Depot.
- 2 inch NTP pipe @ $5.56 from Supply House
- LDR Industries 2 in Black Iron Cap 310 CA 2 @ $5.86 from Home Depot
- 100% Silicone Tube from Home Depot
- Pipe thread sealer from Home Depot
- Jumper Wires from Adafruit
- and of course the sensor itself, and two 10K resistors from Adafruit
- last but not least, Jar lid from your favorite jam.
- 1/4" Metal Drill Bit
- 5/8" Metal Drill Bit
- Sheet Metal Snips
- Bench Drill or Hand Drill
- thin permanent marker
Note : you may need a Special Adapter if your tank has for Tanks with 1.5″ NPT Fittings.
Safety 1st: Whenever drilling or cutting ensure to you proper personal safety equipment ( gloves, and eye protection )
- Use marker to draw the outline of the sensor and required sensor holes on the jar lid.
- Use the 5/8" Drill bit to drill the holes for the Sensor to fit in.
- Use 2" pipe to draw the outline of the pipe on the jar lid.
- Cut out the 2" outline of the pipe, with the holes centered. I practiced on plastic 1st. here's what it should look like
- you can now gently fit the sensor into the prepared jar lid cover.
- next, use the 1/4" drill bit to drill a hole in cast iron cap.
- run your wires through the 1/4" hole one by one, and connect them to the sensor.
- Push the lid into the cap gently, and ensure it is a snug fit and that both the sending and receiving sensor have are at the same depth from bottom of cap.
- screw in the 2" pipe into the cap by hand. This will secure the jar lid cut out and sensor in place inside the cap. You can tighten it with a tool of choice when you install it on your tank, but don't overdo it as not to crush the sensor circuitry.\
- fill the hole on top of the cap with 100% silicone
- at this point you can fit your enclosure(sensor included) to the tank. It should look like this.
- remove it again after fitting if you plan to solder and use heat shrink tubing.
Adafruit Circuit Diagram Examples
- Pi 5v to sensor VCC
- Pi D5 to sensor trig
- Pi D6 to 10k resistor - other side to GND
- Sensor echo to 10k resistor - other side to D6
- Pi GND to breadboard ground rail
- Sensor GND to breadboard ground rail The HC-SR04 requires a voltage divider to allow the sensor 5V logic to work with 3V logic.
I ended up removing the breakout board, and soldered the resistors to the wires, following the circuit map.
I also used heat shrink tubing to insulate the resistors and prevent any shorts.
The sensor was calibrated by dipping copper pipe in the tank opening and getting an exact measurement of oil in tank. In addition this allowed for measuring the exact distance of sensor from bottom of tank.
Having built the enclosure it was time to code something up. I recruited my rising 9th grader and had her figure out how to determine volume based on tank size and measurement data. Our math notes for posterity, on back of a chocolate bar wrapper.