Analog Pin on ESP12-Only one
Posted: Thu Jun 11, 2015 1:16 am
I'm a little confused now . There was a discussion about not putting more than 1 Volt on the ADC pin . When you do so it is supposed to stop being accurate above 1. something or other Volts. See this thread
viewtopic.php?f=29&t=3341
Now I have put a LM335 temp sensor on one of my chips to send to Ubidots . The sensor is connected with the appropriate resistors as you would on a 5 V arduino to see what happens .
Printing off the values I get this:-
(The starred line is the print statement)
And this is the result :-
The incorrect valuesfor Kelvin etc I think are because I had to alter the silly unnecessary library that someone dreamed up. I used it but altered it in places
My conclusion from that is that the ADC pin can read the full running voltage range! To 3.3 V not just to 1 Volt
viewtopic.php?f=29&t=3341
Now I have put a LM335 temp sensor on one of my chips to send to Ubidots . The sensor is connected with the appropriate resistors as you would on a 5 V arduino to see what happens .
Printing off the values I get this:-
(The starred line is the print statement)
Code: Select all
double readValue=(analogRead(A0));
Serial.println(readValue);
double volts= ((readValue/1023)*3.3);
Serial.print("volts=:");
Serial.println(volts); *******************************************
InsideTemp.ReadTemp();
Serial.print("Fahrenheit: ");*****************************************
//functions to get the temperature in various unitsfs
Serial.println(InsideTemp.Fahrenheit());*****************************
Serial.print("Celsius: ");
Serial.println(InsideTemp.Celsius());********************************
Serial.print("Kelvin: ");
Serial.println(InsideTemp.Kelvin());********************************
float value = (((readValue / 1023) * 3.3) * 100 -273); // convert
ubiSave_value(String(value));
And this is the result :-
Code: Select all
913.00
volts=:2.95
Fahrenheit: -241.00
Celsius: -273.00
Kelvin: 0.00
ubidots connection failed
HUbidots data
21.52
Going to Sleep for a while !
915.00
volts=:2.95
Fahrenheit: -241.00
Celsius: -273.00
Kelvin: 0.00
connected ubidots
POST /api/v1.6/variables/557726d576254268685b6af6/values HTTP/1.1
Content-Type: application/json
Content-Length: 16
X-Auth-Token: Te0UTnZAsDajfAVSaTT4WHqLnKXH1vQG6fDrmBriWiUx3FBA9LxOzEMD5ij0
Host: things.ubidots.com
{"value": 22.16}
Ubidots data
22.16
Going to Sleep for a while !
The incorrect valuesfor Kelvin etc I think are because I had to alter the silly unnecessary library that someone dreamed up. I used it but altered it in places
My conclusion from that is that the ADC pin can read the full running voltage range! To 3.3 V not just to 1 Volt