NotesWhat is notes.io?

Notes brand slogan

Notes - notes.io

#include <Wire.h>
#include <LiquidCrystal_I2C.h>
#include <OneWire.h>
//#include <BH1750.h>
#include <DallasTemperature.h>
#include <SI7021.h>

int siviseviyePin = A7;
int siviseviyesi;

int pH_Value;
float Voltage;
unsigned long int avgValue;
float b;
int buf[10],temp;

int R1= 1000;
int Ra=25;
int ECPin= A4;
int ECGround=A5;
int ECPower =A6;

float PPMconversion=0.7;
float TemperatureCoef = 0.019;
float K=2.88;

#define ONE_WIRE_BUS A0
const int TempProbePossitive =8;
const int TempProbeNegative=9;

#define SensorPin A1


OneWire oneWire(ONE_WIRE_BUS);
DallasTemperature sensors(&oneWire);

float susicaklik=10;
float EC=0;
float EC25 =0;
int ppm =0;

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


//BH1750 lightMeter;

//random rastgele = new Random (20,40);

void setup()
{
Serial.begin(9600);
pinMode(TempProbeNegative , OUTPUT );
digitalWrite(TempProbeNegative , LOW );
pinMode(TempProbePossitive , OUTPUT );
digitalWrite(TempProbePossitive , HIGH );
pinMode(ECPin,INPUT);
pinMode(ECPower,OUTPUT);
pinMode(ECGround,OUTPUT);
digitalWrite(ECGround,LOW);
delay(100);
sensors.begin();
R1=(R1+Ra);

pinMode(5,OUTPUT);
pinMode(6,OUTPUT);
pinMode(7,OUTPUT);

pinMode(A2,OUTPUT);
Serial.begin(9600);
Wire.begin();

//Serial.begin(9600);
sensors.begin();

// lightMeter.begin();

pinMode(siviseviyePin, INPUT);
Serial.begin(9600);
// Serial.println("Hazır !");
}

void loop()
{
GetEC();
delay(800);
for(int i=0;i<10;i++)
{
buf[i]=analogRead(SensorPin);
delay(10);
}
for(int i=0;i<9;i++)
{
for(int j=i+1;j<10;j++)
{
if(buf[i]>buf[j])
{
temp=buf[i];
buf[i]=buf[j];
buf[j]=temp;
}
}
}
avgValue=0;
for(int i=2;i<8;i++)
avgValue+=buf[i];
float phValue=(float)avgValue*5.0/1024/6;
phValue=3.5*phValue;


digitalWrite(5,LOW);
delay(4000);
digitalWrite(5,HIGH);
delay(1000);
digitalWrite(6,LOW);
delay(4000);
digitalWrite(6,HIGH);
delay(1000);
digitalWrite(7,HIGH);
delay(1000);
digitalWrite(A2, HIGH);
delay(800);
digitalWrite(A2, LOW);

//int lux = lightMeter.readLightLevel();
//double susicaklik = (sensors.getTempCByIndex(0));

Serial.print(siviseviyesi);
Serial.print(" / ");
Serial.print(susicaklik);
// Serial.print(" *C ");
Serial.print(" / ");
// Serial.print(" pHDeger ");
Serial.print(phValue);
Serial.print(" / ");
// Serial.print("Rc: ");
Serial.print(Rc);
Serial.print(" / ");
// Serial.print(" EC: ");
Serial.print(EC25);
Serial.print(" / ");
// Serial.print(" Simens ");
Serial.println(ppm);
// Serial.print(" / ");
// Serial.println(" ppm ");
delay(400);}

void GetEC(){
sensors.requestTemperatures();// Send the command to get temperatures
susicaklik=sensors.getTempCByIndex(0); //Stores Value in Variable


digitalWrite(ECPower,HIGH);
raw= analogRead(ECPin);
raw= analogRead(ECPin);// This is not a mistake, First reading will be low beause if charged a capacitor
digitalWrite(ECPower,LOW);

Vdrop= (Vin*raw)/1024.0;
Rc=(Vdrop*R1)/(Vin-Vdrop);
Rc=Rc-Ra; //acounting for Digital Pin Resitance
EC = 1000/(Rc*K);

EC25 = EC/ (1+ TemperatureCoef*(susicaklik-25.0));
ppm=(EC25)*(PPMconversion*1000);

;}
void PrintReadings(){
Serial.print("Rc: ");
Serial.print(Rc);
Serial.print(" EC: ");
Serial.print(EC25);
Serial.print(" Simens ");
Serial.print(ppm);
Serial.print(" ppm ");
Serial.print(susicaklik);
Serial.println(" *C ");
};

//float lux = lightMeter.readLightLevel();
//Serial.print("Light:");
// Serial.print(lux);
//Serial.println(" lx");
//delay(1000);

// siviseviyesi = analogRead(siviseviyePin);
// Serial.print("Sıvı Seviyesi: ");
//Serial.println(siviseviyesi);
//Serial.print("/");
//delay(850);

//sensors.requestTemperatures();
//Serial.print(sensors.getTempCByIndex(0));
//Serial.print(sensor.getTempCByIndex(0));
//Serial.println("C");
// delay(800);

/* float temp = sensor.getCelsiusHundredths();
Serial.print("Sıcaklık : ");
Serial.print(temp);
Serial.println("C");
delay (1000);

/ float humi = sensor.getHumidityPercent();
Serial.print("Nem : ");
Serial.print(humi);
Serial.println("");
delay(1000);*/
     
 
what is notes.io
 

Notes is a web-based application for online taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000+ notes created and continuing...

With notes.io;

  • * You can take a note from anywhere and any device with internet connection.
  • * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
  • * You can quickly share your contents without website, blog and e-mail.
  • * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
  • * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.

Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.

Easy: Notes.io doesn’t require installation. Just write and share note!

Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )

Free: Notes.io works for 14 years and has been free since the day it was started.


You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;


Email: [email protected]

Twitter: http://twitter.com/notesio

Instagram: http://instagram.com/notes.io

Facebook: http://facebook.com/notesio



Regards;
Notes.io Team

     
 
Shortened Note Link
 
 
Looding Image
 
     
 
Long File
 
 

For written notes was greater than 18KB Unable to shorten.

To be smaller than 18KB, please organize your notes, or sign in.