I have a very simple Arduino Nano circuit to measure temperature. A thermistance is powered by a 3v3 pin and connected to an analog pin (see circuit diagram below).
The problem is that I'm having unexpected readings on the analog pin. 1.6V between A7 and ground gives a reading of ~1400, while 3.3V gives a maximum reading of ~2885. This is weird to me, as the reading is supposed to be in 10bits (no higher than 1024).
Here is my code:
int ThermistorPin = A7;
float Vo = 0;
void setup() {
Serial.begin(19200);
}
void loop() {
Vo = analogRead(ThermistorPin);
Serial.println(Vo);
}
Notice that I set the baud rate to 19200, and am using 4800 baud in the serial monitor. Other baud rates (like 9600) output gibberish. I believe this is related to my Arduino's clock rate, but I'm not sure if it is related to my current issue.
Any help or guidance would be greatly appreciated, as I am fairly new to Arduino projects. Thank you!
Edit: A 5V voltage gives a 4095 reading. This may just be that my readings are in 12 bit.
As you see in the code, I set the Arudino baud rate to 19200 with the line Serial.begin(19200);. However, setting the same baud rate in the serial monitor outputs nonsense:
It is only when setting the baud rate in the serial monitor window to 4x smaller than the one set in the code (19200/4 = 4800) that I get a proper output:
Your readings and diagram don't make sense if you're using the Nano V3.0 in your Fritzing picture.
They do if you're using one of the later Nano models, like the Nano BLE.
"Nano" is used for an extended family of Arduino boards.
Tell us exactly which Nano you have.
Which will damage the board if it's a newer 3.3volt-logic Nano.
Which with 12-bit readings it clearly is.
Leo..