Interface and Application Programming

The assignment this week was to create a program that visualized an input device. For my input device a few weeks ago, I figured out how to use a new temperature sensor with the Arduino.  This week, I decided I wanted to create a desktop application to moniter and visualize the sensor's readings. 

I decdied to use processing, because of its resemblence to the Arduino IDE.  I wanted to use the sensor, coneected to the Arduino, connected to the computer, to show and graph the temperature.  I did lots of digging, and couldn't find a proccesing sketch that worked. I did however find a sketch that had a readout and graph that got some crazy readings, which changed every second or so, and every once in a while resembled an accurate reading. The sketch was called Arduino tiny temperature shield. This program interacts with the serial output that a properly programmed Arduino provides when connected to a temperature sensor.

The Arduino sketch that I was using printed out a bunch of data in the serial moniter, and I wanted to visuzlize only the temperature data in my program. This is how it looked before:

I realized that I had to modify the sketch that the Arduino was running to only print out the temperature to serial. I didnt need the rom, chip, or data number, and only needed a celcius reading.

The Arduino code that I had modified to print this data was pretty complex, but when I deleted all of the serial print commands, exept for the final ones that printed the celcius data, I was able to get it to only print the info that I needed:

from here, I opened up the processing sketch, and it was collecting and graphing the correct temperature data! You can see where I put the sensor into a glass of cold water.

 

 

 

 

 

Published on   April 21st, 2013