Arduino nano prints random characters

I have an arduino nano which I am trying to use to control an LCD display, but for some reason no code works on it. I then move to try serial monitor but whenever it tries to print something it only shows up as weird "x", "?", and square symboles. I used the same code on an uno and it worked fine. I tried multiple nanos and they all do the same thing. I also unplugged everything to try it and no luck. And I have looked at other forums which say to check baud rate, and I also made sure it was correct.

image

heres the sketches I used to test LCD and the Serial monitor (the example sketches) :

/*
  LiquidCrystal Library - Serial Input

 Demonstrates the use a 16x2 LCD display.  The LiquidCrystal
 library works with all LCD displays that are compatible with the
 Hitachi HD44780 driver. There are many of them out there, and you
 can usually tell them by the 16-pin interface.

 This sketch displays text sent over the serial port
 (e.g. from the Serial Monitor) on an attached LCD.

 The circuit:
 * LCD RS pin to digital pin 12
 * LCD Enable pin to digital pin 11
 * LCD D4 pin to digital pin 5
 * LCD D5 pin to digital pin 4
 * LCD D6 pin to digital pin 3
 * LCD D7 pin to digital pin 2
 * LCD R/W pin to ground
 * 10K resistor:
 * ends to +5V and ground
 * wiper to LCD VO pin (pin 3)

 Library originally added 18 Apr 2008
 by David A. Mellis
 library modified 5 Jul 2009
 by Limor Fried (http://www.ladyada.net)
 example added 9 Jul 2009
 by Tom Igoe
 modified 22 Nov 2010
 by Tom Igoe
 modified 7 Nov 2016
 by Arturo Guadalupi

 This example code is in the public domain.

 http://www.arduino.cc/en/Tutorial/LiquidCrystalSerialDisplay

*/

// include the library code:
#include <LiquidCrystal.h>

// initialize the library by associating any needed LCD interface pin
// with the arduino pin number it is connected to
const int rs = 12, en = 11, d4 = 5, d5 = 4, d6 = 3, d7 = 2;
LiquidCrystal lcd(rs, en, d4, d5, d6, d7);

void setup() {
  // set up the LCD's number of columns and rows:
  lcd.begin(16, 2);
  // initialize the serial communications:
  Serial.begin(9600);
}

void loop() {
  // when characters arrive over the serial port...
  if (Serial.available()) {
    // wait a bit for the entire message to arrive
    delay(100);
    // clear the screen
    lcd.clear();
    // read all the available characters
    while (Serial.available() > 0) {
      // display each character to the LCD
      lcd.write(Serial.read());
    }
  }
}
void setup() {
    Serial.begin(9600); // Set baud rate to 9600
    delay(1000); // Short delay to allow Serial Monitor to start
    Serial.println("hello");
}

void loop() {

}

I have a 4 pin LCD display which has
VCC > 5v
GND > GND
SDA > A4
SCL > A5

Can be anything

please post

  • a minimal sketch that shows the problem
  • a schema how you connected it
  • type of the LCD

I updated it

Is your serial Monitor window set to 9600 baud?
Do you have things wired to pins 0 or 1?

yes it is set to 9600 and I tried it with nothing plugged in

There are so many "Nano" boards around, which one you have? If it works on Uno R3, it should work with classic Nano as well.

I believe its the classic, V3.1

So you upload the "hello" sketch to nano and you don't get any errors?
Then you open serial monitor and you get symbols printed once?

correct

Try the following Serial Monitor baud rates, test each one at a time:
4800 (indicates clock is 8 MHz)
2400 (indicates clock is 4 MHz)

I the simple sketch you wrote to print "hello" to the serial monitor does not work, yielding a lot of strange characters, then there is little point in experiments with the LCD. Address that point on its own first because that is really basic.

just tried them all and they all do the same thing but changes the order of the weird characters

what don't you think works?

Try the blink sketch with 10000ms delays and count how long is the real interval.

It appears to be some sort of timing error. But this:

Is this a normal classic Nano or one with a clone chip such as the LGT8F328P ?
Which version of the Arduino IDE are you using ?

Photos of top and bottom of board would help. Make sure they're focused, and high resolution.

its blinking at 40sec instead of 10 for some reason

I believe I have a real one. I bought a pack of 5 from amazon, it looks like a normal classic and says nano in the middle. my ide version is 2.3.6


It looks like these clones are known:

Are there any markings at all visible on the main chip.? I'd be interested to see how these clones can be visually identified.