I have a TMP36 connected to an analog pin of an Atmega328p-pu on a breadboard (with Arduino bootloader), everything is powered w/+5V from an Arduino Uno R3 (which is used as a programmer).

The reading I get are steady, but when I connect a piezo buzzer to a pwm pin, the temperature reading jumps higher, when I disconnect the piezo jumper wire, the temperature drops down again.

What is going on? I suspect that the current is not sufficient for the atmega chip and the buzzer and the tmp36, but I don't know whether that's true... how would you solve this?

• Hrm. It looks like the '328P doesn't have an internal 2.56V reference, or allow Vdd as a reference (but uses AVcc instead). The reference is chosen via REFS[1:0] in ADMUX, p.134 of the datasheet. You need a voltage divider on Vout of the TMP36 in order to reduce the voltage to within the reference voltage. I recommend using a shunt regulator such as a TL431 on Aref so that you get a stable reference voltage. Nov 20, 2013 at 17:47