PH PROBE atlas-scientific - Arduino 1 -

Hi all,
i'm trying to interface this probe (http://atlas-scientific.com/_documents/Wiringdiagram.pdf) with arduino 1.

I have followed the diagram of:

This is the code: http://atlas-scientific.com/_documents/Wiringdiagram.pdf

When i Compile it is OK, but when i try to upload i have this error: avrdude: stk500_recv(): programmer is not responding.
Only If I disconnect cable RX and TX i can upload !

I have Arduino 1 and Ethernet Shield.

This is the code (is it correct to use 2,3 ??? In Arduino 1, RX is below label 0 and TX is below label 1):

#include <NewSoftSerial.h>               //this will let the software take advantage of the "newsoftserial" library.                    
 
NewSoftSerial mySerial =  NewSoftSerial(2, 3);  //setup and rename soft uart.
    //RX|TX 2,3
 
char stamp_data[15];          //this is where the data from the stamp is stored. The array is 15 char long because
                                                //if no pH probe is connected, the message "check probe" is transmitted.
                         //Having an array that is too small will cause data corruption and could cause the Arduino to crash. 
 
byte holding;                       //used to tell us the number of bytes that have been received by the Arduino and are
              //holding in the buffer holding
byte i;                                  //counter
byte startup=0;                //used to control the start-up sequence 
 
void setup(){
  mySerial.begin(38400);                     //set up the soft serial to run at 38400              
  Serial.begin(38400);                          //set up the hardware serial port to run at 38400
          }
           
           
          
void loop() {                                       //main loop
 
if(startup==0){                                  //if the start-up sequence has not been run
  for(i=1; i <= 2;i++){                        //we go through this for-loop twice, turning on/ off the stamp leds 
      delay(1000);                               //wait 1 second
      mySerial.print("l0");                 //turn off the led
      mySerial.print(13,BYTE);         //ALWAYS end a command with <CR> (which is simply the number 13) or
           // (print("/r")
      delay(1000);                              //wait 1 second
      mySerial.print("l1");                //turn on the led
      mySerial.print(13,BYTE);        //ALWAYS end a command with <CR> (which is simply the number 13) or
          //(print("/r")
  }
  startup=1;                                    //stop the star-up loop from happening by setting the start-up var to 1
 
  delay(1000);                                  //after the stamp leds flashed twice, lets wait 1 second before we give the
         // stamp a new command
           
  mySerial.print("c");                   //the command "c" will tell the stamp to take continues readings
  mySerial.print(13,BYTE);          //ALWAYS end a command with <CR> (which is simply the number 13) or
        //(print("/r")
  
   //to take a single reading
   //you would simple send the command
   //mySerial.print("r");    
   //mySerial.print(13,BYTE);
  
   //to take a temperature dependent reading
   //send the temperature in celsius, let's say
   //the temperature in celsius is 18.5
  
   //mySerial.print("18.5");    
   //mySerial.print(13,BYTE);
}
 
 
 
 
 if(mySerial.available() > 3) {              //if we see the more than three bytes have been received by the Arduino
    holding=mySerial.available();            //lets read how many bytes have been received
   
    for(i=1; i <= holding;i++){                     //we make a loop that will read each byte we received
        stamp_data[i]= mySerial.read();     //and load that byte into the stamp_data array
    }
   
    for(i=1; i <= holding;i++){                      //we now loop through the array        
        Serial.print(stamp_data[i]);             //printing each byte we received  through the hardware UART
       }
       Serial.println("");                               //once we finished, we print a null char with the <CR><LF> command.
  //     Serial.println(" DONE");  
    }
//Serial.println(" NOTHING TO DO");
}

I have solved using digital PIN 2 as RX and 3 as TX, but still a question... why I can't use PIN 0 and 1 ?

Marco

Port 0,1 is hardware Serial

you must use Serial.print Serial.read() etc to use the HW serial

In the header of the sketch you have defined NewSoftSerial MySerial (2,3) this defines an instance of a software serial port on pin 2 and 3. The rest of the code uses this MySerial.

Furthermore is you post code , please use the [ code] tags (modify your first post, select code and press the # button. looks so much better)

Thanks, now I'm understanding.

Is it possible to use this library to add 2 other software serial port ?

#include <NewSoftSerial.h>

I have a parallel LCD and i'm going to buy a Serial Enabled LCD Backpack - SerLCD 2.5 to save digital PIN.

http://www.robot-italy.com/product_info.php?products_id=865

Thanks,
Marco

Yes, definitely possible,

A nice trick for a serial LCD is to define the serial port as : NewSoftSerial nss(4, -1) ;

The lib allocates pin 4 for TX but for the RX no PIN is used. Keeps a pin free.

Be carefull not to add to many softserials with high speed as they may interfere with each other. Check its homepage - NewSoftSerial | Arduiniana - for details about this.

Rob

If I could piggyback on this. I just got my pH stamp today and after wasting plenty of time to find out not to use the marked Tx/Rx pins (0,1) on my Mega1280 I used pins 6,7 (random free pins) to finally get it to upload. But once it's uploaded it does nothing.

Using code from this page:
http://atlas-scientific.com/arduino-test-code.htm

Last time I had an issue like this it was because I was using a Mega1280 with specific pins for SCL and SDA (RTC I'm looking at you) and once it was sorted out everything worked great. I notice that my arduino has Rx1,Tx1, Rx2,Tx2, pins, should I use those? Actually I tried a set of those, 18, 19 I think and had no success after upload as well.

Thoughts?

But once it's uploaded it does nothing.

Add some sprint statements of let LED13 blink, code might be blocking!

e.g. Add Serial.println(mySerial.available(), DEC); in the loop to see bytes are received... code might be blocking on if (mySerial.available() > 3)

robtillaart:

But once it's uploaded it does nothing.

Add some sprint statements of let LED13 blink, code might be blocking!

e.g. Add Serial.println(mySerial.available(), DEC); in the loop to see bytes are received... code might be blocking on if (mySerial.available() > 3)

That gave me a response at least. It spewed 0's, one per line, infinitly.

It looks like the green LED does it's flash and then stays on, but the red flashes more or less continuosly.

Does that mean that it's not seeing probe? It has to see the stamp at least to get the green LED to flash, I assume. What should I next?

Does that mean that it's not seeing probe?

That means that there is nothing received at all!

Chance is that you mixed up the TX and RX line . You could change them and see if bytes arrive....

robtillaart:

Does that mean that it's not seeing probe?

That means that there is nothing received at all!

Chance is that you mixed up the TX and RX line . You could change them and see if bytes arrive....

If they are switched then I get no flashes or red, just a solid green light. And 0's.

Any further advice?

Hi, i'm still developing my controller. I'm blocked in this moment, i am not able to have a valid value of PH controller and Temperature. I think i'm not right about wiring... I have connected a PH STAMP, ORP STAMP, serial LCD, MCP9700A, Arduino ethernet shield on Arduino UNO.

Could you suggest to me an ide open source to design circuit, so i can post for your suggestion ?

Thanks,
Marco

I'm not sure if this helps mamari(or any one), I have started pH sensor interface "tutorial" at http://www.sparkyswidgets.com/Projects/pHInterface.aspx based on a project that I have been working on for well over a year now. It is still a work in progress but will be finished very soon. Our designs are also open hardware so feel free to adapt them to your needs or improve them as we know they could use it :), our newest pH interface contains an atmega to allow signal digitization for communication over serial,i2c etc...

Basically these interfaces are usually ultra low input bias op-amps (dual rail mode) one to provide gain and one to offset the signal to make it ADC friendly. To test probes against themselves you could use an lmc6041 in unity mode and a good multimeter. The perfect probe will read 0v at 7ph, .414v at 0pH and -.414 at 14pH and have a slope of -59mV at room temp.

Quote
Does that mean that it's not seeing probe?

That means that there is nothing received at all!

Where did you get this information? I am using the pH stamp version 3.0. I see a continuous blinking too if I leave the LEDs on (can't get proper readings yet either), and there is nothing about that in the data sheet. According the instructional video made by Atlas this means the the stamp received a null command followed by a carriage return (http://www.youtube.com/watch?v=o7xVdgHzmSc), but I am not sure why my pH stamp keeps blinking if I leave the LEDs on.