Nano RP2040 Connect temp reading never changes #9454
-
Hi, I have a Arduino Nano RP2040 Connect utlising a 10K thermistor & 10K resistor. Its input is on A0. The MicroPython code I'm using continously displays 24C (varying only +/- 0.02C) in Thonny's serial monitor. It does this even when I completely disconnect the thermistor. My programmer is conversant in Python, but new to MicroPython, and microcontrollers. Code:
|
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 7 replies
-
First thing I would do is: print (str(VT)) and touch the thermistor. Is pin 26 allowed for an ADC? On the ESP32 you can't use ADC2 ... maybe there are some restrictions on your port. |
Beta Was this translation helpful? Give feedback.
-
The line
should probably be
since read_u16() returns 0 .. 65535. I have known-good thermistor code here that will need a little adaptation to your use case. I really should finish writing that generic thermistor module ... |
Beta Was this translation helpful? Give feedback.
-
That looks like a wiring error. Lacking a thermistor, I made the setup using an LDR. That shows varying values by changing the brightness and a slight change of your code:
|
Beta Was this translation helpful? Give feedback.
-
The first thing I would do is print the raw reading from the ADC. You should then be able to see if the problem is with the readings not varying or an issue with the conversion code. |
Beta Was this translation helpful? Give feedback.
The line
should probably be
since read_u16() returns 0 .. 65535.
I have known-good thermistor code here that will need a little adaptation to your use case. I really should finish writing that generic thermistor module ...