Flow Meter monitor and Dosing pump controller

Discussion in 'Embedded Systems and Microcontrollers' started by ka1mwp, Feb 4, 2015.

  1. ka1mwp

    Thread Starter New Member

    Feb 3, 2015
    2
    1
    I am looking for some ideas to toss around for a project I am doing that will watch a hall effect fluid meter sensor (just a pulse which I conditioned to go to 5v to 0) and respond with correct dosing. Right now I am watching an interrupt on portb2 of a 18f4550 for one second and counting the pulses.
    For controlling the pump, I was considering using the PWM to pulse the pump, which has the following conditions, 28ms and no more than 180 pulses per minute (or 3hz). I cant get the pwm to run that slow (yet) and also during the interrupt of one second watching the flow input, it ties up the processor...so what other than PWM is an option that would keep the pump running...and what other options would i have for counting the input pulses? My problem was the flow meter can run from 0 (stopped) to 30k pulses per minute (500hz) yea, it clips along...I have the pic clocked at either external 16mhz or internal is OK too I don't need any speed. I selected this pic due to later on using USB..anyway ask questions, let me know thoughts don't be too harsh on me LOL thanks! Chuck
     
  2. ErnieM

    AAC Fanatic!

    Apr 24, 2011
    7,386
    1,605
    Some of the internal PIC timers expose the timer clock to an outside pin. You can use that as a high speed counter; clear it, wait 1 second (I suggest a timer based fast interrupt) then read the total counts. If the timer/counter overruns choose a smaller window.

    For the slow PWM, do it in software. Use the timer you have to count up to 1 second to wiggle the slow pin.

    Since one day you'll ass USB start with an appropriate clock so you need not tweak anything (well, not much) later.

    And welcome to the forums!
     
  3. ka1mwp

    Thread Starter New Member

    Feb 3, 2015
    2
    1
    Thanks, yea looking it over I think I will just pulse a pin using timer3 and turn the timer on and off and also adjust how fast/slow it goes, certainly shouldn't be hard. Something to work on with this 4' of snow we have here in MA! and more on the way.
     
    ErnieM likes this.
Loading...