WiFi Oil Tank Monitor
Introduction: WiFi Oil Tank Monitor
There are several ways to check how much fuel is left in the heating oil tank. The simplest way is to use a dipstick, very accurate but not much fun on a cold winter’s day. Some tanks are fitted with a sight tube, again giving a direct indication of oil level but the tube yellows with age making reading difficult. Worse still, they can be a cause of oil leaks if they are not isolated. Another type of gauge uses a float which drives a dial. Not particularly accurate and the mechanism can seize up over time.
Those with deep pockets can buy a remote sensor which can be viewed inside the house. A battery driven sensor, usually ultrasonic, transmits the oil depth to a receiver in the house. A stand-alone mains driven receiver may be used to view the oil level or the receiver may be connected to the internet for remote monitoring.
What is needed is a battery driven WiFi connected sensor that can monitor the tank for years at a time and send email reminders when the oil level gets low. Such a device is described in this Instructable. A sensor measures the oil depth by timing how long it takes for light to reflect back from the oil surface. Every few hours an ESP8266 module polls the sensor and transmits the data to the internet. The free ThingSpeak service is used to display the oil level and send a reminder email when the oil level is low.
Supplies
The main components used in this project are listed below. The most expensive item is the depth sensor, a VL53L1X module which can be found online for about $6. Be careful not to select the previous generation VL53L0X, although cheaper, it has inferior performance and requires different software. The other key item is the ESP8266 module. 459
The versions with onboard voltage regulators and USB interface are certainly easier to use but at a premium of higher standby current, not ideal for battery operation. Instead, the basic ESP-07 module is used with the option of an external antenna for extra range.
The components used in this project are:
* AA battery holder
* VL53L1X ranging module
* BAT43 Shottky diode
* 2N2222 transistor or similar
* 100nF capacitor
* 2 x 5k resistors
* 1 x 1k resistor
* 2 x 470 Ohm resistors
* FT232RL serial adapter module
* AA size Lithium Thionyl Chloride Battery
* ESP-07 microcontroller module
* Sundries, wire, box etc.
Step 1: Choice of Sensor.
Ultrasonic sensors are generally used for oil level measurement both commercially and in DIY projects. The readily available ultrasonic HC-SR04 or the newer HS-100 are often used in homemade monitors at a cost of about $1 or so. They worked fine on the bench but gave random readings when pointed down the oil tank vent pipe to locate the oil surface. This was probably due to reflections from the different surfaces in the steel tank, a plastic tank may work better. As an alternative, a VL53L1X Time of Flight optical sensor was tried instead. The readings from the tank were much more stable and so this type of sensor was pursued as the alternative.
The data sheet for the VL53L1X gives information about the resolution of this sensor under differing measurement conditions, see the picture. Using a sampling time of 200ms gives a resolution of a few mm. No doubt the data sheet numbers where taken under the best possible laboratory conditions and so the sensor was given a quick test to check the resolution. The sensor was positioned over the oil tank vent pipe and a few thousand readings logged using a timing budget of 200 ms. A distribution plot of the readings in the tank confirms that this sensor can measure the oil level with a resolution of about +/- 2mm.
Over longer time period, there is a daily trend where the oil level drops by a few mm overnight and recovers during the day. The most likely cause being the oil contracting as it cooled overnight and expanding again in the warmth of daytime. Perhaps the story about buying oil by volume on a cold day is true after all.
Step 2: Circuit Diagram
The circuit diagram shows how the ESP-07 module is connected to the VL53L1X. An FT242 USB adapter is temporarily connected to the ESP-07 for uploading the software and checking the operation. When the ESP-07 is put into deep sleep, the current drops to about 20 uA, a wake up signal resets the device via the diode.
It is possible to put the sensor into standby using the XSHUT pin but it proved easier to power the sensor on and off using a transistor. When the ESP-07 wakes up, the sensor is powered up and then switched off once a reading is taken. 152