Every time you hit a brick wall, and need help, you need to post your latest code.
I went back to the original manufacturer's code because now it works perfectly with both of my pH and ECC probes (for now I only took care of the pH part):
#include <SoftwareSerial.h> //add the soft serial libray
#define rxph 2 //set the RX pin to pin 2
#define txph 3 //set the TX pin to pin 3
SoftwareSerial pH (rxph, txph); //enable the soft serial port
String inputstringPH = ""; //a string to hold incoming data from the PC
String sensorstringPH = ""; //a string to hold the data from the Atlas Scientific product
boolean inputPH_stringcomplete = false; //have we received all the data from the PC
boolean sensorPH_stringcomplete = false; //have we received all the data from the Atlas Scientific
//product
void setup(){ //set up the hardware
Serial.begin(38400); //set baud rate for the hardware serial port to 38400
pH.begin(38400); //set baud rate for software serial port to 38400
inputstringPH.reserve(5); //set aside some bytes for receiving data from the PC
sensorstringPH.reserve(30); //set aside some bytes for receiving data from the Atlas Scientific product
}
void serialEvent() { //if the hardware serial port receives a char
char incharPH = (char)Serial.read(); //get the char we just received
inputstringPH += incharPH; //add it to the inputStringPH
if(incharPH == '\r') {inputPH_stringcomplete = true;} //if the incoming character is a <CR>, set the flag
}
void loop(){ //here we go...
if (inputPH_stringcomplete){ //if a string from the PC has been recived in its entiery
pH.print(inputstringPH); //send that string to the Atlas Scientific product
inputstringPH = ""; //clear the string:
inputPH_stringcomplete = false; //reset the flage used to tell if we have recived a comp[lete string from the PC
}
while (pH.available()) { //while a char is holding in the serial buffer
char incharPH = (char)pH.read(); //get the new char
sensorstringPH += incharPH; //add it to the sensorstring
if (incharPH == '\r') {sensorPH_stringcomplete = true;} //if the incoming character is a <CR>, set the flag
}
if (sensorPH_stringcomplete){ //if a string from the Atlas Scientific product has been received in its entirety
Serial.println(sensorstringPH); //use the hardware serial port to send that data to the PC
sensorstringPH = ""; //clear the string:
sensorPH_stringcomplete = false; //reset the flag used to tell if we have received a completed string from the Atlas Scientific product
//pH_val=atof(sensorstringPH); //convert the pH string to a float
}
}