Temperature/Light data sketch

Adafruit Ethernet, Motor, Proto, Wave, Datalogger, GPS Shields - etc!

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
ohnoitsmrbill
 
Posts: 33
Joined: Mon Sep 17, 2012 7:50 pm

Temperature/Light data sketch

Post by ohnoitsmrbill »

I just built up the temperature and light data logger. I am using the sketch and data set from the tutorial found here: http://www.ladyada.net/make/logshield/lighttemp.html. I am confused by the data set from the fridge example and data set that is created on the data logger.

The fridge data tracks the ref voltage as nearly 5Vs. However, the data logger that I have is only providing about 1.4V readings. I could not figure out from the code why the delta. Also, DMM reading is 3.3 at pin 14. So why is this different?

Also, how do you set the time?

From Fridge data:
millis stamp datetime light temp vcc
2000 1273007391 "2010/5/4 21:9:51" 233 80.97 3.54
3000 1273007392 "2010/5/4 21:9:52" 235 80.97 3.99

From my datalogger:
millis,stamp,datetime,light,temp,vcc
999, 946684800, "2000/1/1 0:0:0", 906, 74.26, 1.24
1998, 946684800, "2000/1/1 0:0:0", 904, 74.26, 1.24

User avatar
ohnoitsmrbill
 
Posts: 33
Joined: Mon Sep 17, 2012 7:50 pm

Re: Temperature/Light data sketch

Post by ohnoitsmrbill »

Never mind on the time set, found that in the examples.. All set there. However, still not sure about the VCC ref voltage line.

Bill

User avatar
adafruit_support_bill
 
Posts: 88093
Joined: Sat Feb 07, 2009 10:11 am

Re: Temperature/Light data sketch

Post by adafruit_support_bill »

The fridge data tracks the ref voltage as nearly 5Vs. However, the data logger that I have is only providing about 1.4V readings. I could not figure out from the code why the delta. Also, DMM reading is 3.3 at pin 14. So why is this different?
Not sure if I understand the question. The SensorTest sketch you linked does not log the reference voltage.
And which "pin 14" are you referring to?

User avatar
ohnoitsmrbill
 
Posts: 33
Joined: Mon Sep 17, 2012 7:50 pm

Re: Temperature/Light data sketch

Post by ohnoitsmrbill »

The code in question is in the lighttemplogger.pde. The code specifically is:

Starting at line 27
#define BANDGAPREF 14 // special indicator that we want to measure the bandgap
#define aref_voltage 3.3 // we tie 3.3V to ARef and measure it with a multimeter!
#define bandgap_voltage 1.1 // this is not super guaranteed but its not -too- off

Starting at line 193
// Log the estimated 'VCC' voltage by measuring the internal 1.1v ref
analogRead(BANDGAPREF);
delay(10);
int refReading = analogRead(BANDGAPREF);
float supplyvoltage = (bandgap_voltage * 1024) / refReading;

logfile.print(", ");
logfile.print(supplyvoltage);

Fridge data is here: http://www.ladyada.net/make/logshield/fridgelogdata.zip
I just noticed that the picture in the fridge does not have the Aref connection and is connected to 5VDC. http://www.ladyada.net/images/logshield ... logger.jpg

In the example data sets, this value returns ~4 to ~5 volts. With the datalogger built with the 3.3VDC per the tutorial connected to ref, the return is 1.4VDC. 1.4 does not equal the example data sets nor is it 3.3VDC expected. I would like to know if these values are expected to be adjusted for 3.3VDC reference on BANDGAPREF instead of 5VDC. Or is there something else incorrect?

User avatar
adafruit_support_bill
 
Posts: 88093
Joined: Sat Feb 07, 2009 10:11 am

Re: Temperature/Light data sketch

Post by adafruit_support_bill »

The lighttemplogger sketch in GitHub sets the analog reference to EXTERNAL. So it is expecting a reference voltage on the AREF pin. If you have 3.3v connected to AREF, the bandgap-based VCC calculation should yield about 3.3v. (1.1 * 1024) / (1024 / 3) However, the bandgap reference is known to be a bit noisy.

With nothing connected to AREF, the results of an analog read would be unpredictable.

Locked
Please be positive and constructive with your questions and comments.

Return to “Arduino Shields from Adafruit”