Tds ppm reading

Hey all im very new to all this stuff and i need alittle advice i built a little monitor for water quality with a gravity tds meter v1 and used the sample code that come with it got it all working and printing fine but i was wondering if there is a way to print the PPM reading into EC reading by dividing the PPM reading by 500 and then having it print the calculated EC reading
Example if the tds meter is reading 700ppm and i divide that by 500 it equals 1.4 EC and then having that 1.4 ec print serial/lcd

I'm not sure if thats a thing but it would be handy thanks in advance

Trying to make Your post contain sentences, not one continues string of words.

Now read and follow this link: How to get the best out of this forum - Using Arduino / Project Guidance - Arduino Forum

Not all helpers are mind readers and psychics, mediums.

If you want to add a simple calculation to existing code, and need help, post the code you are currently using.

I'm currently on my phone atm but here is the sample code i am using to measure the PPM

/***************************************************
 DFRobot Gravity: Analog TDS Sensor/Meter
 <https://www.dfrobot.com/wiki/index.php/Gravity:_Analog_TDS_Sensor_/_Meter_For_Arduino_SKU:_SEN0244>

 ***************************************************
 This sample code shows how to read the tds value and calibrate it with the standard buffer solution.
 707ppm(1413us/cm)@25^c standard buffer solution is recommended.

 Created 2018-1-3
 By Jason <jason.ling@dfrobot.com@dfrobot.com>

 GNU Lesser General Public License.
 See <http://www.gnu.org/licenses/> for details.
 All above must be included in any redistribution.
 ****************************************************/

 /***********Notice and Trouble shooting***************
 1. This code is tested on Arduino Uno with Arduino IDE 1.0.5 r2 and 1.8.2.
 2. Calibration CMD:
     enter -> enter the calibration mode
     cal:tds value -> calibrate with the known tds value(25^c). e.g.cal:707
     exit -> save the parameters and exit the calibration mode
 ****************************************************/

#include <EEPROM.h>
#include "GravityTDS.h"

#define TdsSensorPin A1
GravityTDS gravityTds;

float temperature = 25,tdsValue = 0;

void setup()
{
    Serial.begin(115200);
    gravityTds.setPin(TdsSensorPin);
    gravityTds.setAref(5.0);  //reference voltage on ADC, default 5.0V on Arduino UNO
    gravityTds.setAdcRange(1024);  //1024 for 10bit ADC;4096 for 12bit ADC
    gravityTds.begin();  //initialization
}

void loop()
{
    //temperature = readTemperature();  //add your temperature sensor and read it
    gravityTds.setTemperature(temperature);  // set the temperature and execute temperature compensation
    gravityTds.update();  //sample and calculate
    tdsValue = gravityTds.getTdsValue();  // then get the value
    Serial.print(tdsValue,0);
    Serial.println("ppm");
    delay(1000);
}

Try this..

void loop()
{
    //temperature = readTemperature();  //add your temperature sensor and read it
    gravityTds.setTemperature(temperature);  // set the temperature and execute temperature compensation
    gravityTds.update();  //sample and calculate
    tdsValue = gravityTds.getTdsValue();  // then get the value
    Serial.print(tdsValue,0);
    Serial.print("ppm     ");
    float EC = tdsValue/500;
    Serial.print(EC,0);
    Serial.println("EC");
    delay(1000);
}

Well, it seems quite trivial. Try changing this:

Serial.print(tdsValue,0);
Serial.println("ppm");

To:


Serial.print(tdsValue,0);
Serial.print("ppm   ");
Serial.print(tdsValue / 500.0 );
Serial.println(" EC");

Edit

@JohnRob types faster than me.

1 Like

I took typing in high school :slight_smile: On electric typewriters !

Thank you i will try it when i get home

My writing isn't the best im dyslexic and had to get a job at a young age to support myself so i didn't finish my schooling but thanks for pointing it out

Thanks to the 2 that actually helped me

That was meant to be replied to the first comment on this post i seriously am hopless on a mobile phone :sweat_smile:

No worries :slight_smile: I'm happy you asked a question and received help. Don't ever feel bad about asking a question. IMHO the only bad question is the one you didn't ask.

BTW I can't do that much on a phone either :slight_smile:

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.