Serial output ok in monitor, not in terminal

Hi Everyone,

I'm using an Arduino Uno for some simple serial communications with a device using AT commands.

After coding what i wanted to do and uploading, i tested it out in serial monitor and everything worked ok.

However, when i connected the serial device nothing was happening. I connected the Uno Tx and Rx pins to a comm port on my computer and the output was all garbled like the baud rate was wrong. I checked again in serial monitor and everything looked ok there.

So as a test i wrote a very basic program to write Testing!!! to the serial output at a baud rate of 38400.

void setup() {
  // put your setup code here, to run once:
  Serial.begin(38400);
}

void loop() {
  // put your main code here, to run repeatedly:
  Serial.println("Testing!!!");
  delay(1000);
}

You can see in the attached screenshot that the serial monitor in the IDE displays the correct output. My putty session on the Uno's output is garbled.

I've tried multiple baud rates and with the uno powered from it's DC jack (no usb connected). I'm not sure what I may be missing here.

Any help appreciated.
Thanks

. I connected the Uno Tx and Rx pins to a comm port on my computer

via a level shifter/inverter, of course

AWOL:
via a level shifter/inverter, of course

So i take it the uno is using TTL logic levels?

Did you connect the grounds? You need to connect the grounds as well as Tx/Rx for serial communication to work.

(also, the serial port has to be TTL, not RS232 voltage levels (or you need RS232 to TTL converter, ex MAX232) - I don't know if this is the case with all computer serial ports)

From the picture it looks that PUTTY is using a different com port than the IDE?

PUTTY should also connect to COM11

So i take it the uno is using TTL logic levels?

Yes. To connect an Arduino to a 'real' rs232 serial port, you'll need an rs232 level converter, or at least some form of signal inversion. (theoretically, a "1" on rs232 is -3V (or less) and a 0 is +3V (or more), but there's been a lot of cheating "recently", and 0V/5V "rs232" is pretty common.)

westfw:
Yes. To connect an Arduino to a 'real' rs232 serial port, you'll need an rs232 level converter, or at least some form of signal inversion. (theoretically, a "1" on rs232 is -3V (or less) and a 0 is +3V (or more), but there's been a lot of cheating "recently", and 0V/5V "rs232" is pretty common.)

Thanks,

I picked up a MAX232 IC this morning and now it's all good.