Chat freely about anything...

User avatar
By tytower
#20122 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)

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 all913.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
User avatar
By tytower
#20140 Yeh well you just say that in your thread . I'm questioning it because I am seeing something different. The voltage on the ADC pin is 2.85 with my sensor attached and my supply is 3.3V. I am using a temperature sensor LM335 set up with a 10K pot on the adjusting pin and appear to be getting accurate readings . They may be right or they may be wrong ,time will tell . I'm using an ESP12 so maybe they are different to what you know?