Light and Tempurature Logging: A Lovely Visualization of Not Much

Data Visualization

The recurring theme of this class seems to be that I spend about 3-4 times as long on a given project as I expect I’ll have to put in. My initial idea for this project was to strap my thermo sensor and a light sensor to my bedroom window to track how the sunlight and temperature correlated. I wanted to learn how to hook up multiple sensors to my XBee and trasmit both pieces of data on a regular interval. It seemed like it wouldn’t be so hard to adapt the code from the book to create this project, but in the end, I couldn’t get any reliable data. It may have been how I set up my XBee in CoolTerm, or just that my Processing code was handling the API data packets from the sensor incorrectly, but as I went along, the more I tried, the further I seemed to get. Not only that, but I was going to be leaving home for a few days, and I needed to hook up my sensor to a stable power supply, so I was going to be plugging it into my computer anyway, so after many many hours of trying, I moved my whole operation to the Arduino.

Data Logging

Working with a combination of circuits from the book and a variation that Chris sent me a couple weeks ago, I managed to get my thermometer to return values that were pretty close to the thermometer we have in our house. And with quite a bit of luck, I got my light sensor to return values that came close to the top and bottom of the 10-bit analog range, at the lightest and darkest times of the day. So, before I left for a few days, I set up my sensor and let it go.

Unfortunately, it seems that my thermo sensor fluctuated between two values the whole time, regardless of the fact that I know there were much larger swings of temperature in the window sill where I installed my sensors. Nevertheless, my setup managed to consistently record data, and you can see what I collected here:

http://thomhines.com/projects/wireless_sensor/data.php (Click on one of the hour labels to see that hour in more detail)

The data was stored in a text file on my server, and because HTML is built specifically to organize and display information, I decided to try to make a dynamic visual display using only web technologies. The HTML is built via PHP to load and print out the data. The bar graphs and colorings are all done via CSS and javascript. You can check out all the various pieces of code here:

Arduino
Processing
HTML/PHP
JavaScript/jQuery