I want to calculate the water consumption in a given period (e.g. 10min or 1h). The output of the sensor is given at lt/s
How do I measure the water consumption with analog sensors? I have experience with digital sensors where the manufacturer usually provides the ticks per liter (so I have to measure ticks or pulses)
In the case of the analog sensor, if I need for instance to measure the water consumption for a period of 5min what is the procedure in terms of programming I should follow? I have to just read the analog input every 1s and accumulate the readings for the period of 5min?
JCA34F:
You will need a voltage divider to lower the 0.5 to 10V output to suit your unknown Arduino.
I have taken care of the hardware part, thanks!!
aarg:
...and make sure the divider doesn't draw more than the specified 1mA.
xm.. thanks for your advice, I didn't consider voltage divider's current..
hammy:
Take the average of the flow over your measurement time, then total flow becomes: (litre/min)*minutes . Or whatever units you have
But in case I take the average flow, the total consumption over time won't be as accurate, isn't it?
The scenario of reading the flow every second and just aggregates the values over time?
You have a flow rate meter, not a totalising meter -you have to decide how often you read the meter and average the reading to get the result you want -there is no way around this.
hammy:
You have a flow rate meter, not a totalising meter -you have to decide how often you read the meter and average the reading to get the result you want -there is no way around this.
Thank you for your support hammy!! For example, if the readings are every second then I have to aggregate the readings every second, then divide by the total readings (to calculate the average water flow) and finally multiply by the time (to receive liters), isn't it?
Gey a bucket
Run on full open for 60:00:00 seconds
Again but at 50% open for 120 seconds
Then at one quarter open for 4 minutes.
If each fills to the same level
Then it is linear.
If your results are as you expect then your confidence of a accuracy will be high.