I have an attiny hooked up to a TMP36 sensor and a 315 MHz transmitter to remotely monitor temperature.
I changed the reference voltage to 1.1V to get better resolution from the TMP36.
From my spare parts box, I found a Light Dependent Resistor and measured the resistance in light 0.8 kOhm and dark 600 kOhm.
So I used this image and replaced R1 with my LDR and R2 with a fixed resistor. Using the formula to solve for a maximum Vout of 1.1V when Vin is 5.25V gives R2 as 220 Ohm.
I connected to the power rails but before connecting Vout to a pin on the attiny, I checked with a voltmeter and Vout varied from 0 to 1.1V. So far so good.
The problem is that the temp readings jumped from 20 C to 37C (the room was still 20C). After disconnecting then reconnecting power the temperature readings slowly came back down to 28C but another thermometer shows the room is actually 18C. The voltage on the TMP36 analog out pin is 690 mV (i.e. 19C) which is correct given the room temperature.
What happened to the attiny? What happened to the power rails to alter the ADC?