Hall Effect flow meter with 16F876


Closed Thread
Results 1 to 3 of 3
  1. #1
    Join Date
    Mar 2009
    Location
    FLA
    Posts
    9

    Default Hall Effect flow meter with 16F876

    I've been trying t read a Seametrics SEB 3/4" flow meter which produces 330 pulses per gallon with a 16F876. This flow meter is a hall effect with three wires : Red 5-32 VDC, Wht (signal), and Blk Negative. I'm trying to use TIMER0 (pin 6 on the 16F876 RA4/TOCK1) to count to say 40 pulses then start a process.

    I see that I can set pullup on the OPTION_REG but tried that with no reads. The other option is to hard wire a resistor (1-10k) to vdd and not use the pullup option. Is that typicaly what's used for a hall effect sensors?

    Another question of confusion: Suppose I have a high flow rate of say 10 gals/minute on this flow meter, ~55 pulses/sec. Does Timer0 keeps tack of incoming pulses while the processor is running about with other tasks in the program, say reading a digital temp sensor in the main program loop.

    Does it make a difference in the above if I'm using Timer0 interrupts or not. Would I miss pulses if I'm not using interupts?

    First time using timers.....

    thanks

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


    Did you find this post helpful? Yes | No

    Default

    For a 16F876, the internal pull-ups are only on PORTB.
    So you'll need an external pull-up resistor.

    Yes, Timer0 will keep counting while the program is off doing other things, but it will only count to 255 on it's own, and you have to keep comparing the value in your program to know when the required amount has been dispensed.

    If you use Timer1 instead using the T1CKI input, then it can count up to 65535 and you can put a CCP module in COMPARE mode which will watch for the Timer value to match what you've placed in the CCPR1L:H registers.
    When it gets a match, it will fire a CCP interrupt that can immediately turn off the solenoid valve.

    Actually responding to interrupts will be the fastest, or you can just poll the CCPIF flag in the main loop.

    hth,
    DT

  3. #3
    Join Date
    May 2008
    Location
    Italy
    Posts
    825


    Did you find this post helpful? Yes | No

    Default

    ....I see that I can set pullup on the OPTION_REG but tried that with no reads
    Internal pullups apply only to portB.

    ...Does it make a difference in the above if I'm using Timer0 interrupts or not
    Yes it does. Since Timer0 will count up to 255 then start from zero again, The interrupt (will happen with an overflow) will tell you that you have to add 256 to the count following the overflow to obtain the total count.

    ...Suppose I have a high flow rate of say 10 gals/minute on this flow meter, ~55 pulses/sec. Does Timer0 keeps tack of incoming pulses while the processor is running about with other tasks in the program, say reading a digital temp sensor in the main program loop.
    Yes it does.

    Timer1 is a 16 bits counter and can count up to 65536 before overflow, it will give you planty of time for your count.

    Al.
    All progress began with an idea

Similar Threads

  1. water flow meter..
    By ecca in forum mel PIC BASIC Pro
    Replies: 9
    Last Post: - 27th May 2010, 10:11
  2. Replacing Hall Effect throttle with PIC
    By idtat in forum General
    Replies: 4
    Last Post: - 22nd October 2009, 21:55
  3. Hall effect reading
    By ewandeur in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 26th November 2008, 15:49
  4. NMEA 2000 Flow Meter
    By Joe Rocci in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 6th August 2008, 00:35
  5. hall effect
    By dragons_fire in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 10th April 2007, 15:49

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