Using KST for graphing
In the last year of my physics degree I did some work for the physics department developing a sun tracking sensor for a balloon based telescope. I got to use a great piece of free and open source graphing software called KST. Its a program designed specificely for plotting large amounts of scientific data. From the KST website:
"Kst is the fastest real-time large-dataset viewing and plotting tool available and has basic data analysis functionality. Kst contains many powerful built-in features and is expandable with plugins and extensions. Extensive help is available, both from within kst and on the web. Kst is a KDE application and is freely available for anyone to download and use."
Its a great program to use to plot energy monitor data. Here's an example of data being plotted from the non-invasive current trasformer method:
How to install on Ubuntu
In a terminal window type: $ sudo apt-get install kst
If you're a windows user, KST can be downloaded here.
How to start graphing
- First, you will need ArduinoComm which is detailed here.
- Run the program with $ java Program >tmp.dat. The addition of >tmp.dat at the end of the run command line writes the java program output to a file for storage.
- Run KST by typing $ kst
- Once KST is open, click the magic wand button: the data wizard.
- Find your tmp.dat file and click next
- Move all available data Fields to the selected data field box by clicking the right arrow.
- Click on the 'Next' button, and again, then click 'Finish'
- You should see several graphs as in the picture above and they should be updating in real time.
- To get KST to calculate and display useful stats like Standard Deviation, Mean, etc. click on the text label then select from the 'insert scalar in label' drop down box
Update Aug 2013:
Getting up and running with KST in with Ubuntu 13.04
Install KST through Ubuntu Software Centre or in terminal by running the following. I used KST V2.0.3
$ sudo apt-get install kst
Install the Java JDK. This was already installed for me, not sure if it's installed as standard.
$ sudo apt-get install openjdk-7-jdk
Download arduinocomm from http://openenergymonitor.org/emon/arduinocomm
Extract and open window in terminal and compile with
$ javac *.java
Download RXTX Linux binary from: (I used 2.1-7r2)
copy librxtxParallel.so, librxtxSerial.so to and RXTXcomm.jar to java folder. Mine was:
$ sudo cp librxtxParallel.so /usr/lib/jvm/java-7-openjdk-i386/jre/lib/ext
$ sudo cp librxtxSerial.so /usr/lib/jvm/java-7-openjdk-i386/jre/lib/ext
$ sudo cp RXTXcomm.jar /usr/lib/jvm/java-7-openjdk-i386/jre/lib/ext
Edit Program.java in a text editor to set the serial port and speed (e.g. myArduino.start("/dev/ttyUSB0",9600);)
To run Arduinocomm type:
$ sudo java Program
You should see serial data in the terminal window. To log to tmp.dat, run:
$ sudo java Program >tmp.dat