Uno and Nano disagree with eachother

So.. Here we go.

I'm using a thermocouple with an amplifier as part of a larger system. This was prototyped using an Uno, which worked (still works actually) just fine. To make the system smaller my team is hoping to move to a Nano, however when taking readings, the nano thinks it's about 20 deg. warmer in the room. Same code, same medium being measured (in the screenshots below I'm measuring the temperature of bottle of water, the screenshots were taken within a minute of each other)

Any ideas? The Uno is measuring the temperature accurately (within a degree, which is within tolerance for the thermocouple and amplifier)

Nano
Uno

Sorry for the links, I think using the img command won't work because they're PNG's

Thermostat.ino (1.49 KB)

You can just tell us the readings. A screenshot doesn't tell it better. It would be more useful to know which amplifier and how you wired it up. Can you give us a schematic please? A cellphone photo of a hand drawing is acceptable.

The Uno and Nano use that same chip at the core. The chances of getting a defective chip are one-in-a-million. Your schematic and wiring are likely the problem.

The Serial uses pin 0 for RX and pin 1 for TX. After Serial.begin(), you should not do anything with those pin, but you set TX as input.

The section that is commented out has bugs. You mess with PORTD, but the reset, RX and TX are all on PORTD. Please use normal digitalWrite().

The picture of the output does not match the sketch you gave, because it uses the section that is commented out.

Can you rewrite the sketch and show it to us ? and show us the schematic and your wiring as MorganS wrote.

float Vin = ( 5.0 * reading ) / 1024.0; // converts and stores ADC value to voltage seen by A1 pin

The Nano has a blocking diode in the power supply that drops the voltage about 0.3 volts, test your AREF pin with an accurate DMM and change the (5.0 * reading) to match.

I always make a global float variable like:

float aRef = 4.82;

change it to suit whichever board I'm programming and use that instead of the 5.0, like:

float Vin = ( aRef * reading ) / 1024.0;

Returned A/D value depends on the analogue input and Aref.
Default Aref is the 5volt supply, and that is indeed a schottky diode drop lower on the Nano.
Lower Aref is higher A/D value (with the same analogue input voltage).

Bad practice to use default Aref for accurate temp (or other) measurements.
It's never quite the same, and so it the temp readout.

Better to use the internal 1.1volt bandgap Aref for stable measurements.

That value varies from Arduino to Arduino, but at least it's stable and independent of supply.
I also use a global variable for that, and write it on the Arduino board.

You might have to drop your sensor output to 0-1.1volt with a voltage divider.
Leo..

Thermocouple Amp is an AD8495

here's a photo of the setup

Wawa:
Returned A/D value depends on the analogue input and Aref.
Default Aref is the 5volt supply, and that is indeed a schottky diode drop lower on the Nano.
Lower Aref is higher A/D value (with the same analogue input voltage).

Bad practice to use default Aref for accurate temp (or other) measurements.
It's never quite the same, and so it the temp readout.

Better to use the internal 1.1volt bandgap Aref for stable measurements.
analogReference() - Arduino Reference
That value varies from Arduino to Arduino, but at least it's stable and independent of supply.
I also use a global variable for that, and write it on the Arduino board.

You might have to drop your sensor output to 0-1.1volt with a voltage divider.
Leo..

outsider:
The Nano has a blocking diode in the power supply that drops the voltage about 0.3 volts, test your AREF pin with an accurate DMM and change the (5.0 * reading) to match.

I always make a global float variable like:

float aRef = 4.82;

change it to suit whichever board I'm programming and use that instead of the 5.0, like:

float Vin = ( aRef * reading ) / 1024.0;

What you are saying is that by using 5V in my calculation inside the code, but the amp receiving less than 5V from the nano is messing up the reading, and I should use a reference voltage as a variable instead?

Is there a way to read the actual voltage coming from the board and use this? I'm worried that once this system becomes battery powered that voltage will drop, and this issue will arise again.

Koepel:
The picture of the output does not match the sketch you gave, because it uses the section that is commented out.

Can you rewrite the sketch and show it to us ? and show us the schematic and your wiring as MorganS wrote.

I assure you, the sketch I uploaded was the one used to take the screenshots, the commented out section was commented out to troubleshoot this issue. I will re-work the sketch now, I wanted to use PORTD to help avoid confusion as to what pins are on and off, and save some time. Currently this is only using two output pins, so digitalWrite() wouldn't be hard to replace it with, however once it works we will be using 4 or 5 outputs.