Arduino Electrical Conductivity (EC - PPM - TDS) Meter
Bu sitedeki duzeneği yapmaya calışıyorum ve aynı kodları ve bağlantıları yapıyor ama istediğim gibi ppm vermiyor. Lutfn bir bakabilir miyiz kac gundur bir sonuca varamadım.







Kodlarım:

[CODE title="tds"]/*
ElCheapo Arduino EC-PPM measurments.

This scrip uses a common USA two prong plug and a 47Kohm Resistor to measure the EC/PPM of a Aquaponics/Hydroponics Sytem.
You could modift this code to Measure other liquids if you change the resitor and values at the top of the code.

This Program will give you a temperature based feed controller. See Read me in download file for more info.

28/8/2015 Michael Ratcliffe [email protected]

This program is free software: you can redistribute it and/or modify.
it under the terms of the GNU General Public License as published by.
the Free Software Foundation, either version 3 of the License, or.
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of.
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the.
GNU General Public License for more details.

You should have received a copy of the GNU General Public License.
along with this program. If not, see .

Parts:
-Arduino - Uno/Mega
-Standard American two prong plug.
-1 kohm resistor.
-DS18B20 Waterproof Temperature Sensor.

Limitations:
-
-

See www.MichaelRatcliffe.com/Projects for a Pinout and user guide or consult the Zip you got this code from.

*/

//************************** Libraries Needed To Compile The Script [See Read me In Download] ***************//
// Both below Library are custom ones [ SEE READ ME In Downloaded Zip If You Dont Know how To install] Use them or add a pull up resistor to the temp probe.

#include
#include

//************************* User Defined Variables ************************************************** ******//

//################################################## ################################
//----------- Do not Replace R1 with a resistor lower than 300 ohms ------------
//################################################## ################################

int R1= 1000;
int Ra=25; //Resistance of powering Pins.
int ECPin= A0;
int ECGround=A1;
int ECPower =A4;

//*********** Converting to ppm [Learn to use EC it is much better**************//
// Hana [USA] PPMconverion: 0.5
// Eutech [EU] PPMconversion: 0.64
//Tranchen [Australia] PPMconversion: 0.7
// Why didnt anyone standardise this?

float PPMconversion=0.7;

//*************Compensating for temperature ************************************//
//The value below will change depending on what chemical solution we are measuring.
//0.019 is generaly considered the standard for plant nutrients [google "Temperature compensation EC" for more info.
float TemperatureCoef = 0.019; //this changes depending on what chemical we are measuring.

//********************** Cell Constant For Ec Measurements *********************//
//Mine was around 2.9 with plugs being a standard size they should all be around the same.
//But If you get bad readings you can use the calibration script and fluid to get a better estimate for K
float K=2.88;

//************ Temp Probe Related *********************************************//
#define ONE_WIRE_BUS 10 // Data wire For Temp Probe is plugged into pin 10 on the Arduino.
const int TempProbePossitive =8; //Temp Probe power connected to pin 9
const int TempProbeNegative=9; //Temp Probe Negative connected to pin 8

//***************************** END Of Recomended User Inputs ************************************************** ***************//

OneWire oneWire(ONE_WIRE_BUS);// Setup a oneWire instance to communicate with any OneWire devices.
DallasTemperature sensors(&oneWire);// Pass our oneWire reference to Dallas Temperature.

float Temperature=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;

//*********************************Setup - runs Once and sets pins etc ************************************************** ****//
void setup()
;
//******************************************* End of Setup ************************************************** ********************//

//************************************* Main Loop - Runs Forever ************************************************** *************//
//Moved Heavy Work To subroutines so you can call them from main loop without cluttering the main loop.
void loop()

//************************************** End Of Main Loop ************************************************** ********************//

//************ This Loop Is called From Main Loop************************//
void GetEC()
//************************** End OF EC Function ***************************//

//***This Loop Is called From Main Loop- Prints to serial usefull info ***//
void PrintReadings();[/CODE]



Arkadaşlar ppm prob kablosuna gore değişiyor diye yazı okumuştum
K değerini değiştrdim ama tam istediğim gibi sonuc alamadım k=0.70;
Yaptım birincisi ceşme suyu ikincisi az olan arıtılmış su --> ceşme suyu 165 civarı ve artı. S. 35 civarı olması lazım 0.75 yapıyourm değerler azalıyor tam tutturamadım.