Wednesday, January 11, 2017

arduino water flow


Features:
Model: YF-S201
Working Voltage: 5 to 18V DC (min tested working voltage 4.5V)
Max current draw: 15mA @ 5V
Output Type: 5V TTL
Working Flow Rate: 1 to 30 Liters/Minute
Working Temperature range: -25 to +80?
Working Humidity Range: 35%-80% RH
Accuracy: ±10%
Maximum water pressure: 2.0 MPa
Output duty cycle: 50% +-10%
Output rise time: 0.04us
Output fall time: 0.18us
Flow rate pulse characteristics: Frequency (Hz) = 7.5 * Flow rate (L/min)
Pulses per Liter: 450
Durability: minimum 300,000 cycles
Cable length: 15cm
1/2" nominal pipe connections, 0.78" outer diameter, 1/2" of thread
Size: 2.5" x 1.4" x 1.4"



using interupt pin 

const int PinSensorWaterFlowTaman=2;// intr 0 // pin 2 
float flow_countertaman,litertaman,adcph,teg,ph;
const int PinKranTaman =9;//// kran untuk taman 
void setup()
{
 pinMode(PinSensorWaterFlowTaman, INPUT);
        digitalWrite(PinSensorWaterFlowTaman, HIGH); 
        attachInterrupt(0, flowtaman, RISING); // Setup Interrupt 0 pada pin 2
 Serial.begin(9600); 
  pinMode(PinKranTaman,OUTPUT);
        digitalWrite(PinKranTaman,LOW);

}

void loop()
{
 Serial.println(flow_countertaman);
 Serial.println(litertaman);

delay(1000); 
}  

void flowtaman () // Interrupt function taman
    {
      flow_countertaman++;
       litertaman=flow_countertaman/450;
}

No comments:

Post a Comment