I'm basically plugin my wires into the same pins.
Analog data to A0
Negative to Ground
Positive to 3.3v
I have my own piece of code with some other rules and all that, but when I saw it wasn't working I tried with a very simple one but still having the same issue.
Here you have the sketch I'm using to test it out.
Again, this worked fine on my arduino board but I get 0 when I connect it to my esp8266.
#include <EEPROM.h>
#include "GravityTDS.h"
#define TdsSensorPin A0
GravityTDS gravityTds;
float temperature = 21,tdsValue = 0,ec = 0, ppm700 = 0;
void setup()
{
Serial.begin(115200);
gravityTds.setPin(TdsSensorPin);
gravityTds.setAref(3.3); //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
ec = gravityTds.getTdsValue()/500; // ec value
ppm700= ec*700; //ppm700 value
Serial.print(tdsValue,0);
Serial.println(" ppm500");
Serial.print(ppm700,0);
Serial.println(" ppm700");
Serial.print(ec,2);
Serial.println(" EC");
Serial.print("\n");
delay(10);
}
Thanks in advance!