Oil level monitoring system

In this subforum you can show projects you have made, or you are busy with. Please create your own topic.

Moderator: leecollings

Post Reply
Kouseri
Posts: 57
Joined: Sunday 04 January 2015 21:24
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Finland
Contact:

Oil level monitoring system

Post by Kouseri »

Hi,

I've done a oil level monitoring system for my brother with Arduino and Domoticz. The Domoticz is running in a Raspberry Pi 2 at my brothers house
and takes care of normal house monitoring stuff including temperarature measurements and oil tank fill rate monitoring. The Arduino based oil level monitoring system takes care of fill rate of the oil tank.
The oil tank monitoring system consists following components (Raspberry Pi 2 is excluded from the list)
  1. Arduino Uno
  2. WiFi shield
  3. DS18B20 digital temperature sensor
  4. Ultrasonic sensor MB1010 from MaxBotix
DS18B20 digital temperature sensor is connected to the Arduino with OneWire bus. The Ultrasonic sensor is connected to the Arduino with single GPIO and is used in pulse width mode.
Ultrasonic sensor measures Time of Flight (ToF) data which can be converted to distance between the ultrasonic sensor and level of oil. Temperature data is used in calculations
about actual distance from the sensor to the level of oil because speed of sound changes in a function of temperature. Thermal expansion of the oil is not taken into account.

All the data to the Domoticz is transmitted via WiFi in LAN using the MQTT protocol. In practice all the "intelligence" is in the Domoticz and therefore for example decision about is oil tank empty
enough for notification to end user is done by the Domoticz.

The DS18B20 is connected to the Arduino system via two wire cable and RCA connector. The ultrasonic sensor is placed in a small enclosure which is fixed on top of manhole's hatch.
The connection between the ultrasonic sensor and the Arduino is taken care with three wire cable and 3.5mm AV connector.

In the following pictures one can see key components of the monitoring system.
Oil level logger
Oil level logger
Oil_level_logger.jpg (375.39 KiB) Viewed 6315 times
Sensors installed on the oil tank
Sensors installed on the oil tank
Installed_sensors.jpg (390.91 KiB) Viewed 6315 times
Arduino installed
Arduino installed
Arduino_installed.jpg (107.18 KiB) Viewed 6315 times
More information including codes and schematics about the Arduino based oil level monitoring system can be found from the GitHub.

https://github.com/MikaPetteriLundgren/ ... vel-Logger
dwmw2
Posts: 52
Joined: Thursday 03 December 2015 12:42
Target OS: Linux
Domoticz version:
Contact:

Re: Oil level monitoring system

Post by dwmw2 »

Impressive work.

Please could you describe the Domoticz side of the setup in a little more detail? I've posted a script at http://www.domoticz.com/wiki/Lua_-_Oil_Tank_Monitor which turns ultrasonic depth readings into percentages and a volume in litres, although I think I'm using the wrong virtual sensor type for the latter. It would be good to compare with what you've done.
Kouseri
Posts: 57
Joined: Sunday 04 January 2015 21:24
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Finland
Contact:

Re: Oil level monitoring system

Post by Kouseri »

Thanks.

Actually I've created a percentage and temperature sensors (virtual sensors) for this purpose that are updated by the Arduino via MQTT protocol. The Arduino calculates the level of oil tank in percentage so
Domoticz doesn't need to take care of it. Temperature sensor is only for nice to know information and is not used by the Domoticz for any calculations.
Oil tank percentage sensor
Oil tank percentage sensor
Utility_sensors.png (27.39 KiB) Viewed 6033 times
There is a lua script running in the Domoticz which monitors the level of the oil tank. The script sends an email and a notification if the level of the oil tank is lower than a pre-defined limit.
The script can be found from the Github

So the Domoticz side of implementation is pretty simple.
dwmw2
Posts: 52
Joined: Thursday 03 December 2015 12:42
Target OS: Linux
Domoticz version:
Contact:

Re: Oil level monitoring system

Post by dwmw2 »

Thanks. I've filed a feature request for a sensor type which would allow us to report a value in litres instead of just a percentage: http://www.domoticz.com/forum/tracker.php?p=2&t=657

Out of interest, are you compensating for expansion of the oil with temperature? 1000l of oil at -10°C will expand to 1035l by 25°C. Which is small, but not negligible. Once I've got the graphs running properly, I'll be able to work out if the compensation adds noise, or smooths it out.
Kouseri
Posts: 57
Joined: Sunday 04 January 2015 21:24
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Finland
Contact:

Re: Oil level monitoring system

Post by Kouseri »

dwmw2 wrote:Thanks. I've filed a feature request for a sensor type which would allow us to report a value in litres instead of just a percentage: http://www.domoticz.com/forum/tracker.php?p=2&t=657
Great, hopefully this will be implemented...

Currently I'm doing temperature compensation only in ToF (Time of Flight) calculations. The compensation is based on Maxbotix's application guide.

I've been planning to take care thermal expansion of the oil into account but implementation is still missing... :D
I've done an excel based "calculator" which can be used to estimate an affect of temperature to amount of oil. The "calculator" can be found via following link: http://1drv.ms/1K7JR20
pkriek
Posts: 6
Joined: Monday 28 March 2016 11:49
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Oil level monitoring system

Post by pkriek »

i

I am working on the same, and do have an distance meter installed on the oil tank using the mysensors gateway.
So in domoticz I have a sensor reporting distance.

I want to convert the distance into percentage and volume, I looked at the script to posted here, http://www.domoticz.com/wiki/Lua_-_Oil_Tank_Monitor

this looks what I am looking for, but I dont understand how to use it. I have the distance in Domoticz already, what do I do next??
I tried the output sensor commands, but tris does not work, most likely because I do not now how to use and where to run them.

can you set me in the right direction?

thanks

Patrick
Kouseri
Posts: 57
Joined: Sunday 04 January 2015 21:24
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Finland
Contact:

Re: Oil level monitoring system

Post by Kouseri »

pkriek wrote:i
I want to convert the distance into percentage and volume, I looked at the script to posted here, http://www.domoticz.com/wiki/Lua_-_Oil_Tank_Monitor

this looks what I am looking for, but I dont understand how to use it. I have the distance in Domoticz already, what do I do next??
I tried the output sensor commands, but tris does not work, most likely because I do not now how to use and where to run them.

can you set me in the right direction?
What about sending percentage to the Domoticz instead of the distance? Currently I'm doing distance to percentage calculations in the Arduino which is taking care of the distance measurements. I do have a lua script in Domoticz which informs a user if level of oil tank is lower than a predefined limit. That script will convert percentage to volume (liters) and adds the volume information to the notifications. The script can be found from the github: script_device_oiltank.lua
stuiow
Posts: 139
Joined: Saturday 18 April 2015 18:56
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.6857
Location: Isle of Wight, United Kingdom.
Contact:

Re: Oil level monitoring system

Post by stuiow »

How is this project going?
I ordered a cheap dvb-t receiver to receive data from my Apollo smart and i see support has been added to Domoticz for tank capacities and moisture measurements (as of a recent beta anyway).
Now setup on a RPI3.
Also using Evohome HGI80, RFXTRX433E and a Aeotec Gen5 stick. Mainly a Gen5 Z-Wave system.
My weather (Davis vantage Pro2) data is obtained by weatherunderground
Now collecting rtl_433 data from Apollo Ultrasonic meter
Kouseri
Posts: 57
Joined: Sunday 04 January 2015 21:24
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Finland
Contact:

Re: Oil level monitoring system

Post by Kouseri »

stuiow wrote:How is this project going?
I ordered a cheap dvb-t receiver to receive data from my Apollo smart and i see support has been added to Domoticz for tank capacities and moisture measurements (as of a recent beta anyway).
This project has been in "production" already about 6 months and has been working pretty well. I have added a median filter and thermal expansion of oil features to the Arduino code and those features seem to be working as they should.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest