ph sensor

#include #include LiquidCrystal lcd(6, 7, 8, 9, 10, 11); int int int int int R1= 1000; Ra=25; //Resistance of powering

Views 121 Downloads 1 File size 24KB

Report DMCA / Copyright

DOWNLOAD FILE

Recommend stories

Citation preview

#include #include LiquidCrystal lcd(6, 7, 8, 9, 10, 11); int int int int int

R1= 1000; Ra=25; //Resistance of powering Pins ECPin= A1; ECGround=A2; ECPower =A3;

#define vehisw 12 boolean sms_flag=1; float PPMconversion=0.7; float TemperatureCoef = 0.019; //this changes depending on what chemical we are measuring float K=2.88; float Temperature=10; float EC=0; float EC25 =0; int ppm =0; float float float float float

raw= 0; Vin= 5; Vdrop= 0; Rc= 0; buffer=0;

const int analogInPin = A0; int sensorValue = 0; unsigned long int avgValue; float b; int buf[10],temp; void setup() { Serial.begin(9600); pinMode(vehisw, OUTPUT); pinMode(ECPin,INPUT); pinMode(ECPower,OUTPUT);//Setting pin for sourcing current pinMode(ECGround,OUTPUT);//setting pin for sinking current digitalWrite(vehisw, LOW); digitalWrite(ECGround,LOW);//We can leave the ground connected permanantly delay(100);// gives sensor time to settle delay(100); R1=(R1+Ra);// Taking into acount Powering Pin Resitance

lcd.begin(16, 2); lcd.clear(); lcd.print("Arduino Based .."); lcd.setCursor(0,1); lcd.print("Water Purificatio"); delay(2000); lcd.clear(); lcd.print(" RCPIT Shirpur.."); lcd.setCursor(0,1); lcd.print("Please Wait....."); delay(2000); lcd.clear(); lcd.print("PH Value :"); lcd.setCursor(0,1); lcd.print("PPM Valu :"); //gsm_init();

} void loop() { for(int i=0;i0) { if(Serial.find("OK")) echo_flag=0; } delay(1000); } lcd.clear(); lcd.print("Echo OFF"); delay(1000); lcd.clear(); lcd.print("Finding Network..");

}

boolean net_flag=1; while(net_flag) { Serial.println("AT+CPIN?"); while(Serial.available()>0) { if(Serial.find("+CPIN: READY")) net_flag=0; } delay(1000); } lcd.clear(); lcd.print("Network Found.."); delay(1000); lcd.clear();

void init_sms() { Serial.println("AT+CMGF=1"); delay(400); Serial.println("AT+CMGS=\"+918007480377\""); delay(400); } void send_data(String message) { Serial.println(message); delay(200); }

void send_sms() { Serial.write(26); } void lcd_status() { lcd.clear(); lcd.print("Message Sent"); delay(2000); lcd.clear(); lcd.print("System Ready"); return; }

void trackingsp()

// use your 10 digit cell no. here

{

}

init_sms(); send_data("Filter Water Quality "); send_data("IS not good"); send_data("Please take some action soon..\nThankyou"); send_sms(); delay(2000); lcd_status(); sms_flag = 0;