1

I am completely baffled. When I wire the thermistor into my Nano, everything reads completely fine. Then when I switch to the Uno Wifi Rev 2, I get negative numbers -40 to -80 when I was reading 24 on the Nano.

Wiring Diagram is:

           Thermistor
           |       |
Gnd---Resistor     Vcc  
           |
       A6/A0 (6 for nano, 0 for Uno) 

Code is:

#include <thermistor.h>
#define pin A6 //I change this to A0 on the WIfi. This is the only change
float temp;
uint32_t timeout = millis();
THERMISTOR thermistor(pin, //Analog pin
                  9800,    //Nominal res at 25 ºC
                  3559,    //Thermistor's B value
                  10000);  //Value of the resistor
void setup() {
  Serial.begin(9600);
}

void loop() {
  delay(1000);
  temp = thermistor.read();
  Serial.println(temp);
}
2
  • @timemage I just linked each boards store page, if thats what you wanted Mar 23, 2021 at 23:38
  • It was. There are significant differences between different boards carrying "Nano" and "UNO" in their names.
    – timemage
    Mar 23, 2021 at 23:45

1 Answer 1

1

The Arduino UNO WiFi Rev2 defaults to an internal analog reference of 0.55V where the classic (non-"Every") Nano defaults to the external VCC voltage as a reference, which is usually around 5V, often a little lower because of the diode it uses between USB and "5V".

Either you need to be using the same voltage reference by selecting a common one with analogReference, or you need to use different references and calculate differently (or provide different values to the thermistor library) according to each reference.

If you've been using the VCC on the normal Nano board, you could try analogReference(VDD); on the UNO Wifi Rev 2. This isn't necessary a great way to do it (probably using internal references would be better), but it is a simple way to get similar results on a UNO Wifi Rev2 without changing more than a single line to set the reference.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.