Arduino nano Serial printing out ascii garbage

I am using an arduino nano trying to print out just "Hello world" and it is printing out corrupted ascii. I have baud rate set correctly, swapped boards, unplugged everything, used a different connector, used a different usb port. I'm lost.

Hi, @dmarky
Welcome to the forum.

Can you please post your code as per the instructions in the above link.

Thanks.. Tom.. :grinning: :+1: :coffee: :australia:

#include <SoftwareSerial.h>

#define SOFTSERIAL_RX_PIN  2
#define SOFTSERIAL_TX_PIN  3

SoftwareSerial softSerial(SOFTSERIAL_RX_PIN,SOFTSERIAL_TX_PIN);



void setup()
{
    delay(2000);
  Serial.begin(9600);
  // softSerial.begin(9600);
  // softSerial.listen();
}

void loop()
{
  // char cmd;

  // if(softSerial.available())
  // {
  //   cmd = softSerial.read();
  //   Serial.println(cmd);
  // }
  Serial.println("Hello World"); 
  delay(500);
}

Thank you for your help sir.

Hi,
I just tried your code on my UNO, the IDE is 1.8.19, Win 10.

It compiled and ran, 9600 baud and I got the "Hello World" message every 500ms.

Do you get continuous corrupted ASCII or groups with 500ms gaps.?

Have you tried a different USB cable?

What IDE are you using?

Tom.. :grinning: :+1: :coffee: :australia:

I am using an arduino nano. Do you happen to have one to try?

In my post I said I had and it work correctly on a UNO, I have since tried it on a Nano and it works correctly also.

What IDE are you using and what OS?
Have you tried using a different USB cable?

Tom.. :grinning: :+1: :coffee: :australia:

I am using arduino IDE, windows 11. I have tried a different cable. It’s just a garbled mess that comes out. Nothing comprehensive.

Not quite clear, do you have the problem with both boards, or only one specific Nano?

I know you said the baud rate was set correctly, but want to verify if you are using the serial monitor in the Arduino IDE, with the baud rate set to 9600?

When you upload the sketch to the Nano, does the IDE show any error messages?

If this a test for Serial, why did you included this in the code:

Hello David,

The problem was with both boards. I changed boards and changed USBs and the problem persisted. Is there anything special you need to do before programming with a Nano? I’m lost.

Thanks for your help.

I’m trying to do a vocal recognition for lights project so I included that for the module I’m using. I tried it before with a blank sketch and just the code to print and had the same issue.

Can you post a link to the specific nano board that you have?

Can you upload the Blink example sketch and have the LED blink at the proper rate (1 second ON, 1 second OFF)?

Sure, I get home at around 5;30 and will do it then. Thanks for your help David.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.