I have just tested my code on Arduino UNO (supply of 5v) as opposed to Arduino fio 328 (supply of 3.3v)
and it works like a charm, no garbage characters
I figured the serial out from the ph stamp is at a different level somehow to the arduino fio..
any help to get it to work with the fio
I have already tried the HEF4050 with both 3.3 and 5v as supply but still same garbage coming out...
First time on here and new to Arduino programming, hoping to get some help or advice.
It looks like Atlas Scientific has been changing the pH stamp commands with each new version. I am using version 3.0, the latest version, in which the data sheet says the output can return up to 12 ASCII characters. According the the sellers instructional video, the null command is used to make an LED blink on the pH stamp (- YouTube), and from reading forums like this I have learned it is also needed to make an array (no idea why). I finally have my Arduino Uno displaying readable text on the serial monitor using a slight variation from the sample code provided by Atlas (as it looks like you guys have been discussing on here). The problem is that the data I am receiving does not appear to be pH readings, I get continous lines (in the serial monitor) of:
mySerial.print('r'); //take a reading from the sensor, end with carriage return
mySerial.print(13,BYTE);
delay(5000); //delay to read serial monitor
int holding;
int i;
char stamp_data[25];
if(mySerial.available() > 3) { //if we see the more then 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*= 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*); //printing each byte we recived through the hardware UART* * }* * Serial.println(""); //once we finished, we print a nul char with the command.*
Notice how half of your post is in italics? Modify your post, select your code, and press the # icon on the second row, and save.
Some questions. Why are you waiting specifically for 3 bytes to arrive, when clearly there are a lot more than 3 arriving? Where did you get the 12 character value from? What you show as your output has more than 12 characters.
ossama:
I have just tested my code on Arduino UNO (supply of 5v) as opposed to Arduino fio 328 (supply of 3.3v)
and it works like a charm, no garbage characters
I figured the serial out from the ph stamp is at a different level somehow to the arduino fio..
any help to get it to work with the fio
I have already tried the HEF4050 with both 3.3 and 5v as supply but still same garbage coming out...
ossama,
I am experiencing exactly the same problem as you (the garbage characters), same Arduino Fio 328p. Haven't tried on a 5v model yet(unfortunately I made a Fio specific PCB).
Have you eventually found a workaround?