@Skyentist
Cool project! You might consider getting a WIFI shield / radio (or even looking into a Raspberry Pi) so your temperature sensors could talk to the device directly instead of via the PC. Although to directly control the device you’d still need a UI… perhaps a simple android app? Anyhow, necessity ain’t just the mother of invention - laziness is a wonderful muse. Nice work 
My latest arduino project is a display latency tester to determine the lag time between when software pushes data to the screen (single-buffered) and when the pixels actually flip color. FPS gamers often use this metric when buying new screens, as delays above 15ms can be ‘felt’ by most people. Anyhow, I just bought a new laptop and have ordered a replacement screen for it for this very reason, and while I wait for its arrival decided to build something that could quantitatively test the difference between the two screens.
The implementation is a little less straightforward than one might imagine. Detecting when the screen flips from dark to light is easy (I’m simply drawing a quad to the screen using OpenGL in direct mode, and flip it from black to white a couple times per second) - using an arduino and a TAOS TSL252R-LF phototransistor on one of the analog pins I can detect when the value increases above a threshold value, and I know the clock value on the arduino when that happens.
The problem is, the time it takes for the arduino to communicate to the PC (over serial/usb) that it’s received a ‘flash’ is ~15 milliseconds, which varies fairly widely (+/- 6ms) from message to message. So direct recording of the timestamp is not an option.
The solution was heavily inspired by these guys: http://lagtest.org/lagtestino/. In fact, I’m using bits of their arduino firmware almost line-for-line. But their PC-side software is written in python and built for linux, using several linux-only dependencies, so I decided to do a total re-write in Java after coming to understand their process,
Basically, the PC repeatedly sends the arduino a request for it’s clock value, and the arduino responds. Once the PC receives a response, it assumes that the back-and-forth serial transmission was symmetric, so divides the round-trip delay time (from when the clock request was sent to when the response was received, in System.nanoTime()) by two, and assumes that that’s the time the arduino actually received the request. So each of these back-and-forths give you a single data point - a correlation between the PC’s nanoTime, and the arduino’s internal clock.
After collecting 50 of these samples, I perform a linear regression against the dataset which yields a direct relationship between the arduino clock time and the PC’s system time, allowing you to convert any arduino clock time into a PC nanoTime. With this information, when the PC receives a message from the arduino saying that it received a flash ( which includes the arduino’s clock time when ithappened), I can convert that arduino time to the PC’s time, and compare that to the known PC time for when it produced the last flash. A simple subtraction and voila, display latency measured. Apparently this technique, after sufficient sampling, can produce microsecond-accurate results (and I continuously update the linear regression, so everything becomes more accurate as time goes on).
Anyhow, got it finished up last night, and it’s actually working quite well! There is some drift measured that I’m trying to track down, but I think that has more to do with Windows 7’s DWM (aero theme) messing with the frame updates than an error in the implementation. As a point of reference, my flat panel 23" acer monitor has a response time of about 22 ms. My M17xr3 alienware display has a latency of 45 ms! (thin laptop screens are typically much more laggy, so it’s important to do your research when buying a gaming laptop!) The screen on my new laptop has a latency of about 45ms as well (according to spec sheets), which I’ll be replacing for a screen rated at 16ms. I look forward to confirming these numbers myself!
^ Also, I have no idea if that will be enjoyable to read.
Good luck