water flow meter..


Closed Thread
Results 1 to 10 of 10
  1. #1
    ecca's Avatar
    ecca Guest

    Default water flow meter..

    Hi everyone,
    I'm looking for ideas.
    I want to use a flow sensor to measure incoming water flow using a PIC chip.
    I have Pic basic pro.
    The sensor I have, and it delivers 3000 odd pulses per litre.
    I want to display on a LCD display the amount of water flowed, in litres.
    I want the data to be retained when the power is switched off and I want a reset switch to zero it.
    I'm not bothered about the hardware aspects of it but would appreciate help with the program writing.
    Anyone help me ?
    Cheers
    Ecca

  2. #2
    Join Date
    Sep 2005
    Location
    Campbell, CA
    Posts
    1,107


    Did you find this post helpful? Yes | No

    Default

    For starters -

    Upon power up, read the LITRES counter out of two bytes of EEPROM (a WORD variable), write that value to LCD. Then sit in a loop and count the number of pulses and watch the switch. When 3000 pulses have been counted, clear that counter and increment the LITRES counter. Write that value back to EEPROM and update the LCD.
    When you detect that a button has been pushed, clear the LITRES counter, updated the LCD and write the ("0") value back to EEPROM.
    Charles Linquist

  3. #3
    Join Date
    Oct 2004
    Location
    Hangover, Germany
    Posts
    289


    Did you find this post helpful? Yes | No

    Default

    Don't write to often to the EEPROM on the same position !
    Think about a ring-buffer !

    Maybe:
    Get the olf value.
    Count...
    Write the new value to the next position and a checksum out of the new and the old value (asume a fixed value for non-existing old values!). If you reach the end of EEPROM, begin on the first position.

    After Power-On
    0: store 0 as backup-value.
    1: read a value, check checksum.
    2: if checksum is ok, store the value as Backup, goto 1
    3: if checksum is bad, use the backup-value and exit

    Just read to manual !
    Maybe you can build hardware to buffer the pic fpr around 10ms to write the eeprom and then turn off. Use the Brown-Out-Reset !!!!
    PBP 2.50C, MCS+ 3.0.0.5, MPLAB 8, MPASM 5.14, ASIX Presto, PoScope, mE mikroBasic V7.2, PICKIT2

  4. #4
    Join Date
    Sep 2004
    Location
    Mentor, Ohio
    Posts
    352


    Did you find this post helpful? Yes | No

    Default

    Hi Ecca,

    Can you provide us with some information on the flow meter, such as the manufacturer and part number, perhaps a web site to look at this sensor closer?

    Thanks,


    BobK

  5. #5
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    For saving to the EEPROM, choose a PIC with a LVD (Low Voltage Detect) interrupt.

    When the power is turned off, the interrupt gets triggered, quickly save to EEPROM while the chip is still running on the capacitor charge.

    The rest of the time, the value is available in RAM. No need to save it on every loop.
    <br>
    DT

  6. #6
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    Or a comparator interrupt OR modify the power supply. You place a diode between the bridge and the capacitor, then send the bridge side on a interruptable pin.

    Just another idea

    How many different ways exist to skin a cat?
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  7. #7
    Join Date
    Sep 2005
    Location
    Campbell, CA
    Posts
    1,107


    Did you find this post helpful? Yes | No

    Default

    The 18F8722 datasheet claims the EEPROM is typically good for a million write cycles. I would probably trust it for 500K cycles.
    Charles Linquist

  8. #8
    ecca's Avatar
    ecca Guest


    Did you find this post helpful? Yes | No

    Default

    Right then, having returned from holidays..... I continue.
    I only require a 3 digit LCD with about 12mm digits.
    What's around at the moment ?
    Thanks for help all,
    Ecca

  9. #9
    Join Date
    Mar 2009
    Location
    Colorado
    Posts
    378


    Did you find this post helpful? Yes | No

    Smile Please forward info for your flow sensor!

    Quote Originally Posted by ecca View Post
    Hi everyone,
    I'm looking for ideas.
    I want to use a flow sensor to measure incoming water flow using a PIC chip.
    I have Pic basic pro.
    The sensor I have, and it delivers 3000 odd pulses per litre.
    ecca, in hopes you will still receive this notice on this old thread, I have a similar reqirement and would greatly appreciate any info you have on your flow sensor....better yet even a data sheet. Please forward info to me at [email protected].

  10. #10
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    3,803


    Did you find this post helpful? Yes | No

    Default

    In similar cases I use magnetic flow sensors from Krohne. They do not have any moving parts and only require metal pipes or metal rings to work.

    Ioannis

Similar Threads

  1. Hall Effect flow meter with 16F876
    By revelator in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 10th March 2010, 20:42
  2. Can't ID interrupt source with this IntHandler??
    By jellis00 in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 3rd June 2009, 02:35
  3. NMEA 2000 Flow Meter
    By Joe Rocci in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 6th August 2008, 00:35
  4. Electric water valve
    By Christopher4187 in forum Off Topic
    Replies: 2
    Last Post: - 6th April 2008, 21:41
  5. hot water flow sensor
    By jessey in forum Off Topic
    Replies: 16
    Last Post: - 24th January 2007, 04:05

Members who have read this thread : 1

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts