I am trying to read an NTC 100k thermistor with an AtTiny85 module, but failing. I have tried it with a pro-micro and it works perfect, but with attiny I just get a random reading that does not change if I hold the thermistor with my fingers. I think I am reading the correct pin: if I connect it directly to ground, it reads 0 as expected; if connected to vcc, it reads around 1000.
Circuit is pretty simple: attiny connected to an oled module via i2c (AtTiny board pins 0 and 2, this is working ok), then one wire of the thermistor is connected to gnd and the other to pin 3 on AtTiny board, and also there is a 100k resistor between pin 3 and vcc.
I have also tried with 2 different AtTiny boards, same results.
When you measure voltage on that pin with your DMM, do you get the expected value?
I'm going to guess that you have a bad connection somewhere between the thermistor and the point at which you're connecting Vcc or Gnd to test it with.
I've even experienced cold solder joint between pin of SMD part and the pad, where there was no connection normally, but even slight pressure - from, say, the pointy end of a jumper connected to vcc or gnd, or the tip of a scope probe, would move it enough that it made contact... That one took me a while to figure out, though now it's on my checklist.
I've also seen some shoddy dupont jumpers (as it happens, they were the ones included with the serial adapters I use) which wouldn't make reliable contact if you just casually connected them (pushing the wire down would fix it - it seemed to be the housings being a little too long). Intensely irritating, especially since I was visiting my parents, and figured "oh, i'll just bring a few of these sets of jumpers", and didn't have any good ones with me...
it is recommended that whatever you connect to the A/D have an output impedance of 10k or less for best accuracy. This is to allow the A/D input capacitor on the sample and hold to charge up in the time allotted to it between switching the input multiplexer over and starting the conversion. Try adding a small cap to ground on the sensor output. If that does not work use an op-amp like the LM358 as a buffer (unity gain configuration).
That's a good point - I would read it a bunch of times, throwing away the result, before doing the actual reads.