So you're a Noob? Post your questions here until you graduate! Don't be shy.

User avatar
By Moose2
#73740 Hi. I have connected a tmp36 analog sensor to the ADC of the ESP12f. The actual voltage reading on a voltmeter is .7v but the chip outputs 2.6v in the serial monitor. Please help....I have no hair left

void loop(){
int reading = analogRead(temperaturePin);
float voltage = reading * 3.3;
voltage /= 1024.0;
float temperatureC = (voltage - 0.5) * 100;
Serial.print(voltage); Serial.println(" volts");
Serial.print(temperatureC); Serial.println(" degrees C");
User avatar
By trackerj
User avatar
By btidey
#73772 It is good to understand the ADC but if you are trying to measure temperature then you are much better of using a digital temperature sensor like a ds18b20 instead of an analog device like the tmp36.

Advantages are easy to use with library support, high accuracy, very cheap.