I have recently discovered these pH and ORP stamps made by Atlas-Scientific: https://www.atlas-scientific.com/Embedded_Solutions.html

They seem to work as RS232 using low voltage so no need for any interfacing with an Arduino UART ports.

Where I am a bit confused is the data reading part. It looks like the temperature argument needs to be passed for a temperature corrected pH value; i.e. read(26.5) where 26.5 is the temperature in Celsius.

Would a line like this work with the serial library:val_pH = Serial.read(26.5)

Would a line like this work with the serial library:val_pH = Serial.read(26.5)

No. The Serial.read() function does not take any arguments. It simply reads whatever is on the serial port.

You send the device commands, like "read(someTemp)" using Serial.print() assuming that you have the device connected to the serial port pins. It responds with character data that you read using Serial.read(), one character at a time.

Quote

They seem to work as RS232 using low voltage so no need for any interfacing with an Arduino UART ports.

A serial device without the need to use the serial port. How's that working for you?

Paul, thank you very much for your answer.I have connected the stamp to the Rx/Tx of Arduino and the green led for transmission blinks. I assume somehow serial data is available.

I am not an expert at this (the first time programming for the serial port) so bear with my innocence.

I was under the assumption that the inData cycle will read on bit at a time from the serial device and will store it in this vector. After that I thought that atoi() will convert the char string into a decimal value.Are all this correct ? Can you please help me understand how to read the ORP from this stamp.

I don't' have the physical ORP probe connected, but the stamp should change the output when the probe pin goes to gnd.

Can you please help me understand how to read the ORP from this stamp.

Sure. First, you request information. Then, you read the response. Like this:

Arduino: "Hey, stamp! What is the temperature there?"Stamp: "The temperature is mighty cold"

You use Serial.print() to send messages to the stamp. You look at the link you provided way back when, to see what messages to send. I'm pretty sure that "Hey, stamp! What is the temperature there?" isn't valid, but the document you linked to does have the correct messages.

Then, the code that you have will listen for a response. That response might be just an integer value as a string, or it might not. You'll probably want to connect the stamp to a different pair of pins, and use NewSoftSerial to talk to it, so you can use the main serial port to talk to the Serial Monitor, to confirm what you get back from the stamp, before you can figure out how to parse the reply.

As you can see there are some intermittent glitches. It looks like the '\0' is not present all the time. Should I impose inData[23] = 0

And the biggest problem now (at least for me since I have zero experience handling strings) the stamps for some reason respond prefixing the measurements with "ORP=" and "pH=" followed by the numerical value. How can I extract only the numerical value ?pH and ORP measurement are not instantaneous measurements they are suppose to be averaged over some time.