Go Down

Topic: Wrong data reception on Arduino Mega 2560 UART (Read 1 time) previous topic - next topic

gvelasquez85

Hello to all.... I am interfacing a Heart Rate Sensor from Nonin (the Xpod) and the sensor sends 3 bytes once a second, I receive 3 bytes, but completely wrong, don't know why. I'm doing a passtrough but don't know why... I expect to receive <163><127><127> and I receive <46><64><64>.... do you know why?... I'm working with the Arduino Mega 2560, and using a Hardware UART on it (N°1), the sketch is very simple
Code: [Select]

char incoming_char;

void setup{
  Serial.begin(9600);
  Serial1.begin(9600);
}

void loop{
 
   if(Serial1.available()){
     incoming_char()=Serial1.read();
     Serial.print(incoming_char);
     }

}


Any help will be appreciated... Or some example sketch will be very very useful.... Thanks to all....

Grumpy_Mike

What sort of output has your Heart Rate Sensor. Is it RS232?
If so then you need a level converter chip like a MAX202 to convert the RS232 signal levels into TTL signal levels. The level translation also includes a logic inversion and this is why you are seeing rubbish data.

gvelasquez85

All that Nonin says is "The output is TTL"... that is weird....because the Mega (and all arduino boards) have TTL UART's.... any ideas?. By the way, I have a logic level converter form Sparkfun Electronics...

gvelasquez85

Solved: I disconnected the level shifter on the Xpod evaluation cable and now everything is fine.

Thanks to all!

Go Up