What lies below this introduction is the paper that my good friend V and I wrote for our Action Research Project in 9th grade Honors Earth Science at Ames High School.
The Correlation Between Light Intensity and Temperature
Our original hypothesis was that light intensity and temperature would have a direct correlation and that such a correlation would present itself when both variables are graphed over time. After conducting the experiment we laid out in the proposal, this hypothesis has been proven true. The experiment also went largely as planned, with only a few anomalies.
In this paper, we'll outline the experiment and its results, our analysis of the data, and the conclusions we drew from this analysis.
We first decided that comparing light intensity and temperature would be a worthwhile experiment. We decided to do this because we didn't know if the correlation existed, and we wanted to find out for ourselves. We started investigating on the Web to get some background information on our two variables. This investigation yielded the various measurements of light intensity, which are lumens/in2, foot-candles, and the more common lux. We decided to use lux, because most scientists tend to use lux. We also found out average lux values in various environments such as: a bright office, a moonlit night, and a sunny day.
After we had the background information, we had to decide on our medium of data collection. We could, of course, have used a thermometer for the temperature, but we simply couldn't think of a way to measure lux. We started to investigate more on methods of collection. The Google search "light intensity sensor" led us to Phidgets.com.
Phidgets are small devices designed for building robots. They consist of a computer interface board (called an InterfaceKit) with eight analog inputs on it. The InterfaceKit converts the analog inputs to digital and, through a USB port, outputs the data to a computer. A number of analog sensors can be plugged into the eight ports on the InterfaceKit, including motion detectors, robotic arms, and all varieties of sensors. Included in this repertoire are a temperature sensor and a light intensity sensor. We ordered the devices and went about preparing them for use (Fig. 1).
Figure 1: The Phidget’s Interface Kit When Set Up
We read into the Phidgets documentation to find out how to get the data into a useable format. We discovered that a .zip file full of example programs was available for download. Upon obtaining this file, we found the most basic of them, one that took the resistances provided by the Phidgets sensors and wrote them into a text box in a Visual Basic form. We then began to modify the code so that it would serve our specific needs.
We decided that we needed the values in text form, but we needed to have them taken at more spread out intervals than the original program provided. The original program took measurements and outputted them to the Visual Basic form as fast as it took them. This interval was too small for our purposes, so we decided to have it take data once every five minutes. We put a timer into the Visual Basic form and programmed its interval to take one measurement every five minutes (Fig. 2).
Private Sub Text2_Change()
Timer1.Interval = Val(Text2.Text)
Private Sub Timer1_Timer()
Display IFKit.SensorValue(1), IFKit.SensorValue(0)
Figure 2: Visual Basic Code Sample 1
We also programmed the data to be written not only into a text box on the existing Visual Basic form, but into a comma delimited Excel spreadsheet. This file type (.csv) allowed us to split the raw data into columns according to time and the two data strings. Combined with including commas between the variables in the code, this allowed us to easily create a spreadsheet that would permit us to view our data more effectively (Fig. 3).
Private Sub Display(Temp As Long, Lux As Long)
Dim Entry As String
Entry = Now() & "," & Temp & "," & Lux
Text1.Text = Text1.Text & vbCrLf & Entry
'open a file
Open "Test.csv" For Append As 1
Figure 3: Visual Basic Code Sample 2
Once the code was written, we decided we would take measurements for the week from April 10th to April 17th.
The next task we were faced with was that of actually collecting the data. We couldn't just leave the sensors out on the ground because we couldn't be sure that it wouldn't rain. We couldn't afford to run the risk of destroying the sensors and, as a result, our data. We decided that the best protection from the rain would be to put the sensors in a plastic bag. However, another problem presented itself at this point, because we couldn't completely close off the bag seeing as the sensors were connected to the Phidget InterfaceKit by cables. We decided to overcome this obstacle by covering the opening of the bag with clay (Fig. 4).
Figure 4: Sensors When Protected From Rain
To obtain the data, we hung the Phidget sensors outside a window in a plastic bag with clay to protect from rain. We took special care to leave almost no air in the bag so that it wouldn't heat up. We had two reasons for using the plastic bag as insulation: (a) the bag kept rain out so that the sensors wouldn't break, destroying the experiment, and (b) the bag retarded against the effects wind would have on temperature, so that a more definite correlation between light and temperature would present itself.
We went about acting on our original plans. We set the light sensor out a window, which was unavoidably under a deck, and connected all of the required cords to their respective locations. We started up the Visual Basic program and it began writing to the .csv file exactly as planned. We checked back on the program daily to make sure that it was still taking results. After five days, on April 14th, we decided to back up the data by temporarily stopping the program and copying the .csv file to another location. Then we started the program again. The next day, Friday April 15th, we came back to the test location and found the computer was off. We unplugged all of the cables and attempted to restart the computer. After a week of effort, we were successful in this endeavor and retrieved April 14th’s backed-up data from the computer. We suppose that the problem stemmed from a power surge.
Because of that difficulty, we only had five days of data collection instead of the seven days we had planned on. This produced a total of 6,540 results for both temperature and light intensity. In order to better analyze the data, we took the mean, maximum, and minimum of these values (Fig. 5).
Light Intensity Values
Figure 5: Data table for raw results.
We also found that there were no outlier errors in our data. That is to say all the values fell within reasonable range of the average. This showed us that the data did not need to be altered and was probably sound.
The sensors output units derived from the resistance that the sensor experiences when light or heat is cast on it.
When we looked at the light intensity measurements, we discovered a range that extended from approximately 0 to 1,000. When we looked at the average values of lux for a moonlight night and a sunny day, we discovered that, at night, the sensor should read around 0 (on a moonlight night, lux is about 1, but the sensor was under a deck), and at noon, the sensor should read around 10,000 (on a sunny day, the intensity is from 32,000 to 100,000, but it was under a deck). These numbers suggested to us a linear equation with a y-intercept of 0 and a slope of 10,000/1,000 or 10. The equation for this line is:
y = 10x (1)
When we reviewed the equation provided in the Phidgets documentation, it did in fact indicate that lux was equal to 10 times the sensor value, though we didn't understand it until we had discovered the relationship ourselves. The reason for this misunderstanding was the apparent inverse nature of the sensor's output to the light intensity itself, when in fact the sensor's output was inversely proportional to the resistance of the sensor, and, as such, directly proportional to the light intensity.
This left us to discover an equation for the temperature sensor, which was luckily much easier to acquire. Using the services of the Weather Channel Online, we found the temperature readings for the days we took our measurements, April 10th to April 14th. The minimum for that period was 32° Fahrenheit, and the maximum was 68° Fahrenheit. Our minimum and maximum sensor readings were 209 and 401. Again, assuming a linear relationship with a y value of 32 when x is 209 and a slope of (68-32)/(401-209). The equation for this line is:
y = (36/192)x – 7.188 (2)
where y is degrees Fahrenheit and x is the sensor value.
To convert to degrees Celsius, we applied the formula (5/9)(Fahrenheit - 32). This leaves us with the equation:
y’ = (5/9)(36/192)x – (5/9)(39.188) (3)
This, in simplified form, is approximately:
y’ = 0.104x – 21.771 (4)
We decided against comparing this equation to the equation provided in Phidgets documentation because the Phidgets organization doesn’t foresee the use of a bag around the sensor. We are fairly certain that the bag had some impact on the temperature as read by the sensor. Figuring an equation based upon both the readings through the bag and correct results provided by a trustworthy source (the Weather Channel) is guaranteed to be more accurate.
We started by making a graph of lux and Temperature, but since lux values range in the 1,000s and degrees Celsius peaked at 50, the graph was ineffective. As such, we divided the lux values by 500 so that the graph would be more intuitive (Fig. 6).
Note: The y-axis refers to degrees Celsius and lux values/500.
At first, we thought that our hypothesis was incorrect, because the correlation wasn’t immediately apparent. However, upon studying the graph more intensively, we found a correlation. We looked at the graph and saw some areas that spiked. We looked at the other line in the same place, and saw a spike (though it was often either much bigger or smaller). This excludes nighttime when no light could reach the light sensor.
We saw a number of trends that repeated during the four days of observation. First of all, the lux values always reached zero while the Temperature never did. This is predictable because a sensor under a deck at night will receive very little light while temperature will remain relatively constant around the whole ground area. We also noted the positive correlations between lux and Temperature that supported our hypothesis. The lux values, because they went to zero each night, climbed much more steeply initially, but were rather constant throughout the day. The Temperature values, however, stayed more constant overall, with some very distinct spikes in the afternoon. When we look at both April 13th and 14th, we see a distinct irregularity. There is a thin spike just before noon on both days, and a wider spike that reaches approximately the same height in the afternoon. We hypothesized that this apparent anomaly results from shadows covering the sensor at times just around noon and in the morning both days. Another apparent similarity is one between the 11th and 12th of April that is a much flatter distribution of light throughout the day, contrasting starkly with the irregularity of the 13th and 14th. We hypothesized that this was caused by increased cloud coverage on the 11th and 12th.
We found that our initial hypothesis was correct, because there is in fact a discernible and direct correlation between Light Intensity and Temperature. Each data spike on one line corresponds to a similar spike on the other line, showing a direct relationship.
There were, as noted, some problems with the carrying out of this experiment. If we were to redo this experiment, we would do two things differently: (a) we would more carefully monitor the state of the computer that was processing the data and protect said computer from anomalies such as power surges, and (b) we would take data for a longer period of time, in order to be more confident in the accuracy of our results.
Because of some of the correlations and relationships we discovered, we would propose a number of continuing experiments. First of all, we would like to see an experiment similar to ours that takes results for an entire year or multiple years, to see if the correlation changes seasonally. We would also try to discover more about the shadow patterns that are apparent on 13th and 14th of April by placing the sensors in a number of areas with varying shadow patterns and recording when the shadow is on the sensor or off it to discover if patterns such as those we observed are in fact related to shadows. Also, based upon the difference between the light intensity graphs on the 11th and 12th of April that we hypothesize are related to cloud coverage. This experiment would probably involve take a picture of the sky area above the light sensor and intervals each day over a period of about one month and seeing if patterns like those that we observed occur on cloudier days.
We also regret that we weren’t able to do more with the data we collected. We have such a rich supply of data that we think it’s a shame that we only analyzed it at as shallow a level as we did. This experiment has, however, sparked both of our interests in learning statistical analysis and how to apply it to data collections such as this one.