#define TDS 2
#define PH 15
#define Temp 36
void setup() {
Serial.begin(115200);
pinMode(TDS,INPUT);
pinMode(PH,INPUT);
pinMode(Temp,INPUT);
}
void loop() {
//Read alnalog value from ADC converter
int16_t tdsValue = analogRead(TDS);
//Find voltage at the pin
float voltage = tdsValue * (5 / 4095.0);
//Find actual value as sensor's max voltage is 2.3
int16_t mappedTdsValue = (voltage / 2.3) * 1000;
//Read analog value from PH_PIN
int16_t phValue = analogRead(PH);
int16_t tempValue = analogRead(Temp);
Serial.print("TDS: ");
Serial.print(tdsValue);
Serial.print(" ph: ");
Serial.print(phValue);
Serial.print(" Temp: ");
Serial.println(tempValue);
// put your main code here, to run repeatedly:
delay(1000); // this speeds up the simulation
}