My main question is not the code, but how to start to think.
The millis() function returns the number of milliseconds since the Arduino was powered up or reset. With that in mind you could do something like the following
save millis() value as start time
while the weight is less than the target
pouring rate = current weight / (current millis() - start time)
end while
XenoBen:
IMO I need to know how much mass is pouring in given time. Right?
Or, how much time it takes to pour a given mass.
Which you use depends on things like how fast mass is changing, how often you want to update the computed mass flow rate, and how close you want the computed mass flow to be to the INSTANTANEOUS rate verses the AVERAGE rate.
PaulS:
I'm curious why you are trying to measure the flow rate using such a crude setup. What value will the results have?
:D:D:D Thanks
I know it's a crude setup, but it's a subtask of a scale. I cannot use flow rate sensors.
results are in [g/sec]
gfvalvo:
Or, how much time it takes to pour a given mass.
Which you use depends on things like how fast mass is changing, how often you want to update the computed mass flow rate, and how close you want the computed mass flow to be to the INSTANTANEOUS rate verses the AVERAGE rate.
hmmm, yes I don't know right now if the instantaneous is better or the average I need to test the two to see which is better for understanding what's happening
With the change in mass known, and knowing when you got this reading vs. when you got the last one, you have dm and dt, so you can calculate the flow rate.
With the change in mass known, and knowing when you got this reading vs. when you got the last one, you have dm and dt, so you can calculate the flow rate.
Ah thanks, I'm really new to programming, this is why, but thank you.