Atlas Scientific pH stamp with arduino

Hi arduino gurus

I have ITEADUINO V2.1 WITH ATMEGA328 which same as the old Duemilanove. I also have the Atlas Scientific pH stamp. I would like to do a very simple project but since I am a complete noob, I will need help from you guys.

I would like to trigger some Leds and Buzzer when a certain range of pH is reached. I also want to display the pH on LCD

Here’s my question:

1)Do i need to modify the code given by Atlas ??
2)I got this code from some one. Once i got the pH to float, I can display it on LCD…but the problem is got erros using this code. Here’s the code

// ------------------------------------------------------------------------------- 
// Simple way to get Atlas Scientific serial PH stamp value to LCD or PC 
// Author: Eric van Riet - The Netherlands 
// ***************ONLY THE PART FOR PH IS LISTED!***************** 

// -------------------------Set measurement interval------------------------------ 
long phReadInterval = 1000; 
long previousMillisPH = 0; 
int PHState = HIGH; 
// ------------------------------------------------------------------------------- 

// ---------------Variable to hold PH value--------------------------------------- 
float PH_Val; 
// ------------------------------------------------------------------------------- 

void setup() 
  Serial.begin(38400);         // Set baudrate for hardware serial port 0 (PC) 
  Serial1.begin(38400);        // Set baudrate serial port 1 to 38400 (PH) 
  lcd.begin (20,4);            // initialize the lcd  

// -------------Get PH value from Atlas Scientific PH serial stamp---------------- 
void getPHvalue()  {                //get PH every interval (1000 ms) 
  unsigned long currentMillisPH = millis(); 
  if(currentMillisPH - previousMillisPH > phReadInterval) { 
    previousMillisPH = currentMillisPH;   
    if (PHState == HIGH)  { 
        PHState = LOW; 
    else  { 
        PHState = HIGH; 
        Serial1.print("r\r");  // 'R' reads one value, see stamp doc 
        while (Serial1.available() > 0) { 
                // Serial1.parseFloat looks for the next valid float number 
        // in the serial stream. In this case on hardware serial 1 
        PH_Val = Serial1.parseFloat(); 
        // look for the carriage return. That's the end of your sentence: 
        if ( == '\r') { 
        Serial.println(PH_Val);  // can be used for debug, pc display etc. 
// ------------------------------------------------------------------------------- 

void loop()  

    lcd.print("PH value: "); 


and here’s the error:

EZ_com.ino: In function ‘void setup()’:
EZ_com:22: error: ‘Serial1’ was not declared in this scope
EZ_com:23: error: ‘lcd’ was not declared in this scope
EZ_com:27: error: a function-definition is not allowed here before ‘{’ token
EZ_com:61: error: expected `}’ at end of input


Moderator edit:
</mark> <mark>[code]</mark> <mark>

</mark> <mark>[/code]</mark> <mark>
tags added.

"Serial1" is a feature of the Arduino Mega. If you are using an Arduino clone with an ATmega328 you will need to use SoftwareSerial to communicate with a serial device.

yup i got that.

but how do i get the pH values to float??

but how do i get the pH values to float?

A large bucket of water.

Please don't cross-post. It wastes time.

sorry bro.....i guess a noob deserve that joke

some answers can be found here -,104096.0.html -

thanks everybody. i managed to complete it. but how do i connect arduino with Labview? or any other medium so i can display in graphical form?

You can send measurements over serial to labview. I assume it is capable of reading values that come in over a serial line. See - -

Please post the final sketch for future reference.