Thanks for your responses,
robtillaart:
This relates to this thread but is an other subject - pH monitoring with Atlas Scientific pH stamp - Home Automation - Arduino Forum -
Yes it does, but I found in the old forum something very similar today under the category "Interfacing w/ Software on the Computer", so I just wanted to put this in the right place.
as a matter of fact, PaulS, you helped a lot in that post:
http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1294830203
This code? What code?
#include <SoftwareSerial.h>
#define rxpin 2
#define txpin 3
SoftwareSerial myserial (rxpin, txpin);
String inputstring = "";
String sensorstring = "";
boolean input_stringcomplete = false;
boolean sensor_stringcomplete = false;
float pH_val = 0.0;
void setup(){
Serial.begin(38400);
myserial.begin(38400);
inputstring.reserve(5);
sensorstring.reserve(30);
}
void serialEvent() {
char inchar = (char)Serial.read();
inputstring += inchar;
if(inchar == '\r') {input_stringcomplete = true;}
pH_val = atof(inch);
}
void loop(){
if (input_stringcomplete){
myserial.print(inputstring);
inputstring = "";
input_stringcomplete = false;
}
while (myserial.available()) {
char inchar = (char)myserial.read();
sensorstring += inchar;
if (inchar == '\r') {sensor_stringcomplete = true;}
}
if (sensor_stringcomplete){
Serial.print(sensorstring);
sensorstring = "";
sensor_stringcomplete = false;
}
}
robtillaart also helped me a lot and got this more straightforward code to work
#include <SoftwareSerial.h>
#define rxph 2
#define txph 3
SoftwareSerial pH (rxph, txph);
void setup()
{
Serial.begin(38400);
pH.begin(38400);
}
void loop()
{
if (pH.available() >0)
{
char incharPH = (char)pH.read();
Serial.print(incharPH);
}
}
but I am still having calibration issues: stamp is supposed to read pH7 in a test solution but only reads 6.8 and then in another test solution of pH 10, it reads 12...
According to the datasheet, I should be able to send some commands to be able to calibrate the stamp, but I have yet to succeed...
I'm getting a continuous serial read, but I can't seem to use the values to run a comparaison with my preset values...
Why not? It doesn't matter how often you get a value.That sensor, by the way, can be configured to only provide a value when you request one.
I'm really not sure how to do that... :~
thanks a lot for your help and sorry for the missunderstanding