CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

Flow sensor

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
Roger
Guest







Flow sensor
PostPosted: Wed Apr 14, 2004 12:32 pm     Reply with quote

Dear All,

I need help!!

I need to interface a liquid flow sensor to a PIC interrupt.

BUT the sensor gives a train of square wave pulses.

I do not want to measure them just need to know that some liquid is flowing

Can anyone suggest a circuit, Low pass filter???

Best Regards,

Roger
dyeatman



Joined: 06 Sep 2003
Posts: 1934
Location: Norman, OK

View user's profile Send private message

Liquid Flow Meter
PostPosted: Wed Apr 14, 2004 12:51 pm     Reply with quote

You didn't say which PIC you were using or the voltage range of the square wave. You could, for example, simply tie a 5V square wave signal directly to pin RB0 and set it for L to H Interrupt trigger. Depending on impedence you need to include a resistor (330 ohms for example) between the two just for protection of the PIC input.

If the square wave signal is more than 5V a two resistor voltage divider can be used to get it within the 5V range and then you wouldn't need to use the protection resistor.
Roger
Guest







PostPosted: Wed Apr 14, 2004 1:08 pm     Reply with quote

PIC16f874

I am sorry if I confused you.

I only want there to be an interrupt IF the pulse train stop!!! (USING BO)



Regards
Neutone



Joined: 08 Sep 2003
Posts: 839
Location: Houston

View user's profile Send private message

PostPosted: Wed Apr 14, 2004 1:26 pm     Reply with quote

Roger wrote:
PIC16f874

I am sorry if I confused you.

I only want there to be an interrupt IF the pulse train stop!!! (USING BO)



Regards


When the edge interupt interupt occures set a timer to zero. When timer interupts you have no flow.
dyeatman



Joined: 06 Sep 2003
Posts: 1934
Location: Norman, OK

View user's profile Send private message

Flow Sensor
PostPosted: Wed Apr 14, 2004 1:56 pm     Reply with quote

To expand some on what Neutone said....

How fast do the pulses occur?

Example:
If they are twice per second then start a 700ms (something more than 500ms) timer at the first interrupt. Reset the timer every time a new edge comes in. If 700ms passes without an edge, the timer times out, a timer interrupt will occur and you can react.
SherpaDoug



Joined: 07 Sep 2003
Posts: 1640
Location: Cape Cod Mass USA

View user's profile Send private message

PostPosted: Wed Apr 14, 2004 2:02 pm     Reply with quote

Roger wrote:
PIC16f874

I am sorry if I confused you.

I only want there to be an interrupt IF the pulse train stop!!! (USING BO)



Regards


It might be worth considering a hardware solution. Maybe a diode from the signal to the PIC pin and a capacitor and resistor from the PIC pin to ground would do the trick. That is three cheap components that whould give a logic 1 if fluid was flowing, and a logic 0 when it stopped. A web search for a "peak detector" should give you more info. If you give us info such as the pulse train voltage and frequency, and how soon you must know if flow stopped, we can probably design the circuit here!
_________________
The search for better is endless. Instead simply find very good and get the job done.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group