I'm currently working on a project that involves outputting the pH reading in the serial monitor.
Here's the code:
int potPin = 0;
float phSense = 0;
void setup()
{
Serial.begin(9600);
Serial.println("PH sensor ");
analogReference(INTERNAL);
}
void printTenths(int value) {
// prints a value of 123 as 12.3
Serial.print(value / 10);
Serial.print(".");
Serial.println(value % 10);
}
void loop() {
int span = 20;
int aRead = 0;
for (int i = 0; i < span; i++) {
aRead = aRead+analogRead(potPin);
}
aRead = aRead / 20;
phSense = ((0.0592*1.1*aRead)/1024)*10;
// convert voltage to pH
Serial.print("Analog in reading: ");
Serial.print(long(aRead));
// print pH value on serial monitor
Serial.print(" - Calculated pH Level: ");
printTenths(long(phSense));
delay(500);
}
btw, I got this code from a book and modified it a littleAs for the pins connection to arduino, I've directly connected
pin 2 to GND,
pin 5 to 5V, and
pin 6 to A0.
Here's the output from the serial monitor:

As you can see, there is no output. I've checked my connections and nothing's loose or anything. As for the code, it was previously used for displaying temp on the serial monitor but I've modified it for my pH sensor. I'm wondering what's wrong here. Is it the connections or is it the code? Do I need to use other pins of the pH sensor (seeing that I've only used three of them).
For further reference on the probe that I'm using: