household water meter using a basicstamp 2???
tercou1
Posts: 25
I have been given a project to build a household water meter, where I have to design it myself. I have decided to use a bs2 to process the data from the water flow meter to a parallax serial LCD and was wondering if anyone has interfaced one with a Basic Stamp before. I am interested in measuring the real time flow and a totalized flow to start with and then maybe a freeze alarm, a no flow alarm and a back flow alarm. If anyone has any links or has tried something similar I would appreciate any info they may have.
The water flow meter I am using is a turbine 1/2" magnetic pulse Hall effect sensor with digital output.
The water flow meter I am using is a turbine 1/2" magnetic pulse Hall effect sensor with digital output.
Comments
As for backflow- does it need to be allowed to do that? I'd just suggest including a backflow preventer, and you no longer need to account for that.
Happy to help if I can, just ask.
Dave
something like: count for 1 sec,,,
if count < 5(pulses per sec) then real time flow is 1.5 L/min (output on pin ?)
if count >= 5 && count < 30 then real time flow is 6 L/min
if count >= 30 && count < 65 then real time flow is 15 L/min
if count >= 65 then real time flow is 20 L/min
as you have probably guessed I'm a complete newbie but I'm a very fast learner... I really appreciate any time that you guys can spend with me on this... I'll update my progress and if I'm going off the beaten track, can you nudge me back in the right direction??
falcon
http://www.futurlec.com/FLOW25L0.shtml
Thanks for the link. I started off getting just the flow sensor and before I was finished I had a cart full of stuff.
I'll be monitoring this thread because I have a plan similar to yours.
Thanks,
falcon
I don't know the specs on your flowmeter, but mine runs around 220 pulses per gallon. So I set my ppg VAR to 220 and here's the rest of the goodies I do to get my count:
I've got some GOSUBS in there, but the stuff you're interested in is all there - how I count pulses, figure gallons, and do it to a 1/10th gallon accuracy. I could go more accurate, but the client isn't that concerned about anything less than a tenth.
Let me know if it all makes sense to you.
Dave
Dave
' =========================================================================
'
' File...... Domestic Water Meter.BS2
' Purpose... To measure current flow rate and total flow rate
' in liters per second through a flow sensor
' Student... B00008869
' Started... 10 Nov 2011
' Updated... 14 Nov 2011
'
' {$STAMP BS2}
' {$PBASIC 2.5}
'
' =========================================================================
'
'
'
[ I/O Definitions ]
SpeedIn PIN 14 'Receive Input from Hall Sensor
'
[ Constants ]
Capture CON 1000 ' Num of msec to listen for input
ppl CON 216 ' pulses per liter
'
[ Variables ]
remains VAR Byte
literspumped VAR Word ' total pulses after 10 secs
pulses VAR Word ' input pulses from flow sensor
average VAR Word ' average of pulses over 10 secs
totalLiters VAR Word
'
[ Initialization ]
pulses = 0
literspumped = 0
totalLiters = 0
DO
COUNT SpeedIn, Capture, pulses
pulses = pulses + remains
literspumped = pulses / ppl
remains = pulses - (literspumped * ppl)
totalLiters = totalLiters + literspumped
DEBUG CR, "Pulses = ", DEC pulses, CR
DEBUG CR, "liters pumped = ", DEC literspumped, CR
DEBUG CR, "total pumped = ", DEC totalLiters, CR
PAUSE 1000
LOOP
END
seems to be working pretty well... but i'm still not sure how the "remains" variable works... it seems to me that it is the equivalent of subtracting pulses from pulses, so how does it have a value?? can you enlighten me dave, or anybody else. thanks in advance
Did I explain this well enough? Just let me know.
Dave