Visualize Data From Sensors Using Arduino + Coolterm

by gabriellalevine in Circuits > Sensors

52524 Views, 76 Favorites, 0 Comments

Visualize Data From Sensors Using Arduino + Coolterm

Screen Shot 2012-07-12 at 3.12.35 PM.png
Screen Shot 2012-07-12 at 11.58.57 PM.png
2012-07-12 15.24.20.jpg
2012-07-12 15.20.47.jpg
2012-07-12 19.29.24.png
Once you're getting some values from sensors, for example using Arduino, (see my previous instructable), sometimes it's nice to see the sensor data in a graph. 

Here's how in only a few steps!

I made this particular Instructables using a sonar sensor (XL Max Sonar EZ/AE) but you can do it with any data values that are separated in arduino by a carriage return and a line break: 
To put it simply, the incoming sensor data should look like this in the Arduino Serial Monitor: 

23
23
24
24
25
22
26

Separated by a newLine.

I made it at TechShop. !
www.techshop.ws









Get CoolTerm

Screen Shot 2012-07-12 at 3.11.14 PM.png
CoolTerm is a serial port terminal application. 

Download it at : http://www.macupdate.com/app/mac/31352/coolterm.

Open CoolTerm.

CoolTerm and the Arduino Code

Screen Shot 2012-07-13 at 7.11.49 AM.png
Screen Shot 2012-07-13 at 7.08.16 AM.png
I'm using a code similar to the AnalogInOutSerial example in the Arduino Examples, to read the incoming serial data from one sensor. See the image for code that would work (you might have to modify the map() function). At the moment, any sensor will work that inputs analog voltages, or any incoming values that are separated by a newline.

Serial.println(potValue); //print the sensor value to the debugger panel

Any code for one sensor would work, for instance the attached circuit and code would work for a photocell to measure light levels.

Instead of the photocell I'm using the Max Sonar Sensor to measure proximity.


Connecting to the Serial Port in CoolTerm

Screen Shot 2012-07-13 at 7.34.46 AM.png
Screen Shot 2012-07-13 at 7.16.10 AM.png
With your arduino programmed and connected via USB and CoolTerm opened up, click OPTIONS. 
Make sure the Baud Rate is set to 9600 (because remember in Arduino, we set it to 9600 using Serial.begin(9600);

NOTE: You cannot have two Serial ports open at the same time, so you cannot view the arduino serial monitor while you are using CoolTerm. 

Start Recording & Saving

Screen Shot 2012-07-13 at 7.39.08 AM.png
Screen Shot 2012-07-13 at 7.40.52 AM.png
Now Click connect (see image). 
You should see data scrolling through in the serial monitor. 

Begin to record the data: 
Click Connection --> Capture to Text File --> Start

You can specify where to save the text file.

Graph the Data

Screen Shot 2012-07-13 at 7.47.11 AM.png
Screen Shot 2012-07-13 at 7.44.50 AM.png
Screen Shot 2012-07-13 at 8.11.08 AM.png
Screen Shot 2012-07-13 at 8.11.48 AM.png
Open the file with Microsoft Excel.

Your sensor data should look something like the image - a long columns of numbers.

See the images for the following: 

Click on "Chart".
Then click "Line".
and click on "Line" again. 
 (see the images)

And You Should Get Something Like This

Screen Shot 2012-07-12 at 3.12.35 PM.png
this rise and fall of the line is from me moving my hand towards and away from the sensor

Now you can work in excel to label the axes as you like. 

Now you can visualize the data using coolTerm and excel!

Coming soon - how to visualize the data real time with Processing.