??? 05/12/05 22:30 Modified: 05/12/05 22:34 Read: times |
#93362 - Not so bad... Responding to: ???'s previous message |
M.jawed Iqbal said:
Hi, all..
I am facing problem to interface a liquid flow sensor having only three wires for interfacing to the MCU/MPU. these are found as follow; 1- +5v (VCC) 2- output (752 pulses per litter) 3- 0V (GND) it can sustain a pressure of about 20 bars also. as the output in pulse form and limited to 752 pulses for one litter of liquid flow, which technique could be used to calculate the real time flow of the said liquid from the sensor. (note : the sensor works on IR detection) I want to show the calculated results on a 20x2 LCD module, in the form of ; a- total liquid flow b- current flow rate please guide me for the simple and effective asm code or any regarding methods... thanks all...... /M.Javed// It doesn't sound so bad, assuming the output pulses are nice square waves with adequate slew rate. If not, use amplifiers, comparators, and hysteresis elements/buffers, as necessary. Obtaining total liquid flow sounds like a simple matter of counting the number of pulses received. You might want to use a timer as a counter for this. If you need to add signal conditioning code, it might be wiser to use a general purpose external interrupt and do any necessary signal conditioning inside your ISR. The latter approach might be more convenient since you also need to calculate the flow, as described below; you'll probably want to put some of that code in your ISR as well. Calculating the flow is a bit trickier. You need to have some notion of a timestamp associated with each pulse so you can calculate pulses per unit time, which gives you your flow. In reality, you will only need to have timestamps for the last few pulses you've received, over which you'll be calculating the flow; a circularly indexed array would work well for this task. You'll probably want to use at least a few pulses so as to prevent your average from being excessively distorted from very brief irregularities in the flow; this will likely also add the benefit of preventing your average from changing more often than you can update your display. As for the timestamps themselves, these could easily be timer ticks from an 8051 timer that's running freely, or, if available, a timestamp from a real-time clock (assuming adequate resolution is available on your RTC). You're going to have to write your own code for this though; a fair amount of the work isn't going to be writing code (it should be pretty simple), but will have to do with adopting a design approach and testing out parameter sets that work well for your application (i.e., range of flows possible in application, amount of jitter present in flow, etc.) --Sasha Jevtic |
Topic | Author | Date |
interfacing liquid flow sensor... | 01/01/70 00:00 | |
Not so bad... | 01/01/70 00:00 | |
Flow rate is pretty easy... | 01/01/70 00:00 | |
Software method! | 01/01/70 00:00 | |
a few things | 01/01/70 00:00 | |
flow sensor | 01/01/70 00:00 | |
Search RS Stock | 01/01/70 00:00 | |
get this ... | 01/01/70 00:00 | |
Turbine type | 01/01/70 00:00 | |
thanks!! | 01/01/70 00:00 | |
inputs | 01/01/70 00:00 | |
Schmitts![]() | 01/01/70 00:00 |