My LCD work fine with Uno but weird letter come up when connected to Nano

I am very new to Arduino and I am trying to make a digital thermometer. I have a NHD-0216BZ-RN-YBW LCD it work fine when I connect it to my Arduino Uno but when I connect it to my Nano it displays weird letters. I think I might have broken the Nano when soldering but I am not sure. I have tried many different tutorials but every time it always shows weird letters. Here is my code I am pretty sure it is right because it work on Uno but here it is.

#include <LiquidCrystal.h>

int ThermistorPin = 0;
int Vo;
float R1 = 10000;
float logR2, R2, T;
float c1 = 1.009249522e-03, c2 = 2.378405444e-04, c3 = 2.019202697e-07;

LiquidCrystal lcd(12, 11, 5, 4, 3, 2);

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

void loop() {

  Vo = analogRead(ThermistorPin);
  R2 = R1 * (1023.0 / (float)Vo - 1.0);
  logR2 = log(R2);
  T = (1.0 / (c1 + c2 * logR2 + c3 * logR2 * logR2 * logR2));
  T = T - 273.15;
  T = (T * 9.0) / 5.0 + 32.0;

  lcd.print("Temp = ");
  lcd.print(T);
  lcd.print(" F");

  delay(500);
  lcd.clear();
}

Here is my schematics I connected the Nano just like this but obviously using the Nano instead of Uno

obviously you should show us clear pictures of YOUR Nano and your LCD in such a manner, that we can identify each and every wire between the Nano and the LCD.
And add a picture of your weird letters.
And finally - put your code into code tags.

If you think you broke the Nano - is the 328P chip getting hot to the touch? That's a sign of a damaged chip.

Can you remove the display and connect to the Nano with removable pins?
Gravitech sells a screw terminal adapter that you could use to confirm everything is good before soldering wires to the board. Set up a Nano on one as a test bench. Be useful for future projects as well.

If the display is showing any letters, it is most unlikely that you have actually damaged the Nano.

Given the same code, this sounds like a wiring mistake, which can include an open-circuit jumper wire. Two things you should try, disconnecting the display and re-wiring it using a different set of jumper wires, and testing the jumpers by connecting them all in a series chain and connecting that chain in series with the backlight on the LCD (which for some curious reason, you have not illustrated - pins 15 and 16) to determine if one or more is faulty.

Also you will find it convenient to correct a longstanding and stupid blunder in the circuits published. Do not connect the potentiometer to 5 V - Vcc. If using a 10k potentiometer, you can actually connect both ends to ground. This will make it easier to set the contrast suitably. :grinning:

If you are looking for differences between the Nano and Uno which might be relevant here, Nanos have a Schottky diode in the 5volt path which may reduce the voltage to about 4.6 volts.

Incidentally, it is not a bad "Fritzing" diagram. It is sharp, well laid out and none of the pin numbers are obscured by wires. Naturally, not as good as a proper schematic but certainly usable.

Paul__B:
Also you will find it convenient to correct a longstanding and stupid blunder in the circuits published. Do not connect the potentiometer to 5 V - Vcc. If using a 10k potentiometer, you can actually connect both ends to ground. This will make it easier to set the contrast suitably. :grinning:

????
Contrast voltage would always be 0V, for me that does not make sense. Usually contrast voltage should be about +0.5 V, so the pot used as voltage divider is i.m.h.o. needed.
-richard

Or do you want a variable resistor between RS and GND? In mid-position of the pot you'd have 2,5 k, going to 0 by turning into either direction. Why?

r_a_mueller:
Contrast voltage would always be 0V, for me that does not make sense. Usually contrast voltage should be about +0.5 V, so the pot used as voltage divider is i.m.h.o. needed.

So you are saying that you simply do not comprehend how the contrast voltage works?

OK, take a look at your "1602" LCD module. Note a group of resistors "R1" to "R5" with value "222" or 2.2k.

Expand.

These are the "contrast ladder" corresponding to the diagram on page 37 of the HD44780 datasheet where they connect on the module between Vcc - 5 V - and "Vo" - pin 3. You need to provide a (1k) variable resistor - not a potentiometer - between pin 3 and ground. As I explained back in 2016 if not before, the current drawn by the 5 V leg of the potentiometer serves absolutely no useful purpose and indeed, makes contrast setting twice as difficult. That current may be only 500 µA for a 10k potentiometer, but that is a completely useless 500 µA being drawn from your battery if a battery is used or indeed any other power supply.

Disconnecting the trace from the 5 V leg of the potentiometer is always a very sensible modification. Just incidentally, the reference to -5V in the datasheet relates to displays working at lower temperature and requiring a greater contrast voltage - in the case of all the "1602" displays we commonly encounter, that is not a concern and the variable resistor returns to ground for the 5 V versions of the module.

And in case you are curious, "R6" is the clock oscillator resistor (91k) for the HD44780, jumper "R7" is part of the selection for the 3.3 V version of the module along with U3 (ICL7660) and all the adjacent pads, while "R8" (and/ or "R9" if present) is the current setting resistor for the backlight, "101" or 100 Ohms setting it to about 22 mA which is within the capability of an Arduino pin to control directly. :grinning:

OK, I understood your answer to the TO as it would be necessary to connect both outer pins of the pot to GND, you emphasized "both". Now I see (thanks for your clarifying) that this way you turn the 10k pot into a 2.5k variable resistor in case the TO has no smaller value available. Sorry for being off topic, but now everything should be cleared.
-richard

Thank you to all of you. I think the problem was a soldering problem. I soldered the board again and now it works :smiley: