Measure water tank volume with flow sensor
Moderator: leecollings
-
olleman
- Posts: 107
- Joined: Thursday 01 January 2015 18:56
- Target OS: Linux
- Domoticz version:
- Contact:
Measure water tank volume with flow sensor
Hi!
I'm looking into a nice project for my boat where I'd like to monitor the volume in my water tank that holds 100l. Ideally I would like to present this as "how many litres are left in the tank" and I would also need someway to "fill" the tank virtually. Is this possible in domoticz or can anyone recommend anything else?
Edit Using an incremental counter would be a way to go but I need a way to reset it every time I "fill" the tank. I can't find any way to reset an incremental counter. Is it even doable, perhaps with LUA?
I will be sending the data from a 8266 device.
,Olle
I'm looking into a nice project for my boat where I'd like to monitor the volume in my water tank that holds 100l. Ideally I would like to present this as "how many litres are left in the tank" and I would also need someway to "fill" the tank virtually. Is this possible in domoticz or can anyone recommend anything else?
Edit Using an incremental counter would be a way to go but I need a way to reset it every time I "fill" the tank. I can't find any way to reset an incremental counter. Is it even doable, perhaps with LUA?
I will be sending the data from a 8266 device.
,Olle
-
SweetPants
Re: Measure water tank volume with flow sensor
How do you measure the water level in the tank?
If you measure it 'actively' there is no need to reset a counter
Using the HC-SR04 can give you the information, but it is not waterproof.
If you measure it 'actively' there is no need to reset a counter
Using the HC-SR04 can give you the information, but it is not waterproof.
-
olleman
- Posts: 107
- Joined: Thursday 01 January 2015 18:56
- Target OS: Linux
- Domoticz version:
- Contact:
Re: Measure water tank volume with flow sensor
SweetPants wrote: Monday 18 June 2018 16:05 How do you measure the water level in the tank?
If you measure it 'actively' there is no need to reset a counter
Using the HC-SR04 can give you the information, but it is not waterproof.
-
olleman
- Posts: 107
- Joined: Thursday 01 January 2015 18:56
- Target OS: Linux
- Domoticz version:
- Contact:
Re: Measure water tank volume with flow sensor
I will meassure it by subtracting the value reported from the water flow sensor from a utillity sensor, or at least, that's what I'm aiming for.SweetPants wrote: Monday 18 June 2018 16:05 How do you measure the water level in the tank?
If you measure it 'actively' there is no need to reset a counter
Using the HC-SR04 can give you the information, but it is not waterproof.
-
SweetPants
Re: Measure water tank volume with flow sensor
But then you still don't know when the water tank is full, only by manual update. You can do that with a dummy push button and using persistent data and dzVentzolleman wrote: Monday 18 June 2018 21:28I will meassure it by subtracting the value reported from the water flow sensor from a utillity sensor, or at least, that's what I'm aiming for.SweetPants wrote: Monday 18 June 2018 16:05 How do you measure the water level in the tank?
If you measure it 'actively' there is no need to reset a counter
Using the HC-SR04 can give you the information, but it is not waterproof.
-
olleman
- Posts: 107
- Joined: Thursday 01 January 2015 18:56
- Target OS: Linux
- Domoticz version:
- Contact:
Re: Measure water tank volume with flow sensor
Sounds exactly like what I want but I have no idea howto move along with persistent data and events. Some start up help would be much appreciated:)SweetPants wrote: Monday 18 June 2018 21:34But then you still don't know when the water tank is full, only by manual update. You can do that with a dummy push button and using persistent data and dzVentzolleman wrote: Monday 18 June 2018 21:28I will meassure it by subtracting the value reported from the water flow sensor from a utillity sensor, or at least, that's what I'm aiming for.SweetPants wrote: Monday 18 June 2018 16:05 How do you measure the water level in the tank?
If you measure it 'actively' there is no need to reset a counter
Using the HC-SR04 can give you the information, but it is not waterproof.
-
SweetPants
Re: Measure water tank volume with flow sensor
Take a look at the dzVentz wiki. https://www.domoticz.com/wiki/DzVents:_ ... _scripting it explains the use of persistent data.
-
olleman
- Posts: 107
- Joined: Thursday 01 January 2015 18:56
- Target OS: Linux
- Domoticz version:
- Contact:
Re: Measure water tank volume with flow sensor
Thankyou, I had a look and I'm afraid that's way out of my league to do on my own. Would anyone be interested in getting me started?
-
olleman
- Posts: 107
- Joined: Thursday 01 January 2015 18:56
- Target OS: Linux
- Domoticz version:
- Contact:
Re: Measure water tank volume with flow sensor
I've done some more research into this and I assume that this would be a way to do it (bare in mind, I have never scripted or worked with Lua before).
1. Store every reading in volume from flow sensor (the sensor wull actually report a volume counted for a specified amount of time) in a variable with a historic data table.
2. Make calculations of the sum of each value in the table and when it reaches, for example 25 litres. Set a dummy sensor with percentage to 75% To indicate that the tank now is 75% full.
3. Repeat step 2 but with 50l/50%, 75l/25% and 100l/0% (since my tank holds roughly 100l)
4. When virtual switch "filled my water tank" is switched on (will automaticly switch off again after 3 seconds). Erase all data in the table, set dummy percentage sensor to 100% and start from step 1 again.
Is this what you had in mind? I really don't know how to put all this together though...
1. Store every reading in volume from flow sensor (the sensor wull actually report a volume counted for a specified amount of time) in a variable with a historic data table.
2. Make calculations of the sum of each value in the table and when it reaches, for example 25 litres. Set a dummy sensor with percentage to 75% To indicate that the tank now is 75% full.
3. Repeat step 2 but with 50l/50%, 75l/25% and 100l/0% (since my tank holds roughly 100l)
4. When virtual switch "filled my water tank" is switched on (will automaticly switch off again after 3 seconds). Erase all data in the table, set dummy percentage sensor to 100% and start from step 1 again.
Is this what you had in mind? I really don't know how to put all this together though...
-
olleman
- Posts: 107
- Joined: Thursday 01 January 2015 18:56
- Target OS: Linux
- Domoticz version:
- Contact:
Re: Measure water tank volume with flow sensor
After A LOT of trial and error I think I've come up with something that actually works. The code is most likely real uggly but it seems to be working. Tought I would share it.
- Spoiler: show
Who is online
Users browsing this forum: No registered users and 1 guest