• Stars
    star
    270
  • Rank 152,189 (Top 3 %)
  • Language Processing
  • License
    MIT License
  • Created almost 11 years ago
  • Updated over 3 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Plots live data from a serial port. Multiplatform and written in Processing.

RealtimePlotter

Debugging sensors on a microprocessor can be a hassle and the most used approach is to output the sensor values to a serial monitor. I made a realtime plotting tool which is a better and more visual way of doing the same thing.

Realtime plotter

I created this software to debug an Arduino Due on my self-balancing robot. To tune the controls of the robot I needed fast feedback to know if I was making progress or not. The video below demonstrates typical use of the realtime plotter:

Video

Realtime plotter video

  • Real-time plotter of your data while it is still being processed by your application
  • Plots live data from serial port. Microprocessor choice does not matter as long as it can send serial data to your computer.
  • 6 channels of data (and this can be increased if necessary)
  • Live bar charts
  • Live line graphs
  • You just send the data you want to debug with a space as delimiter like this "value1 value2 value3 value4 value5 value6". Floats or integers does not matter.
  • Open source
  • Robust. It will not crash because of corrupt data stream or similar.
  • Multi platform Java. Tested on OSX and Windows 8 (and should work on Linux as well).

More info and other projects at http://sebastiannilsson.com/en/projekt/realtime-plotter/realtime-data-plotter/

How to install and use

Since I have an Arduino I will use it as example but any micro processor can be used.

  1. Get ProcessingIDE to run the code. It is a neat and useful IDE for doing graphical stuff.

  2. Connect the Arduino to the usb or serial port of your computer.

  3. Upload the example code (RealtimePlotterArduinoCode) to the Arduino

  4. Check serial monitor (at 115200) and check that it outputs data in the format "value1 value2 value3 value4 value5 value6\r". Always end with a line break. Another way to do formatting is with the printf function like so: printf("%u %u %u %u %u %u\r", data1, data2,...);

  5. Close the serial monitor (since only one resource can use the serial port at the same time).

  6. Open the Processing sketch (Either BasicRealtimePlotter/BasicRealtimePlotter.pde or RealtimePlotterWithControlPanel/RealtimePlotterWithControlPanel.pde)

  7. In the Processing IDE, go to Sketch->Import Library. Search for ControlP5 from Andreas Schlegel and Install it. (I used version 2.2.6). You can also manually download controlP5 gui library and unzip it into your Processing libraries folder

  8. Edit the sketch file so that the serial port name to correspond to the actual port ("COM3", "COM5", "/dev/tty.usbmodem1411" or whatever you have). (If you want to test the code without a serial port just set boolean mockupSerial = true;)

  9. Run the sketch

Advanced use

The realtime plotter can be expanded to also send commands to the microprocessor. The usual approach when programming microprocessors is to set some parameters in the beginning of the code, upload them to the processor, see the result, change the parameters again, upload, and so on until satisfactory performance is achieved. This iterative process takes a lot of time and a better approach is to send updated parameters to the microprocessor from your computer via serial data. For example I needed to tune some parameters on my robot and created a command panel that runs in parallell with the realtime plotter. For each change in parameters I immediately am able to see the result on the plotting screen. Example code of this is located in /RealtimePlotterWithControlPanel.

RealtimePlotterProcessingWithControlPanel

Notes

I decided to send and receive the data as ascii characters instead of binaries. The greatest disadvantage is performance. The greatest advantage is ease of use.

In some sense the realtime data plotter can also be used as a very slow and limited digital oscilloscope. I would not recommend using it for any high frequency applications though.

Processing 2/3 compatability

  • For Processing 3 compatability, use the most recent code.
  • For Processing 2 compatability, use the code from the Processing-2 branch or download the older release.

Some comments about earlier approaches and the used libraries

I have tried many different ways of doing this. My first approach was Matlab but I had problems with it locking the serial port. It was a hassle to get it working and getting everything configured takes to much time. My second approach was Python and graphing libraries but this was still not very satisfactory. The Processing language together with a graph library and ControlP5 made the whole thing much easier.

Support me creating open source software:

Flattr this git repo

Buy Me a Coffee at ko-fi.com

More Repositories

1

LaTeX-template-for-Word

86
star
2

DueFlashStorage

DueFlashStorage saves non-volatile data for Arduino Due. The library is made to be similar to the EEPROM library.
C++
71
star
3

Moving-Avarage-Filter--Arduino-Library-

A moving average, also called rolling average, rolling mean or running average, is a type of finite impulse response filter (FIR) used to analyze a set of datum points by creating a series of averages of different subsets of the full data set.
C++
55
star
4

FIR-filter-Arduino-Library

FIR filter Arduino Library
C++
42
star
5

Selfbalancing-robot

Selfbalancing robot in Arduino. Implemented with PID controllers, FIR filters, complementary filter.
C++
31
star
6

Sketchy-Truck

A 2D car game in Andengine.
Java
28
star
7

Selfbalancing-robot-v2

Selfbalancing robot with Arduino Due. Work in progress. Check out v1 at https://github.com/sebnil/Selfbalancing-robot
C++
11
star
8

XamarinCustomViewExample

An example on how to make a custom UIView for iOS in Xamarin using .xib files
C#
6
star
9

Realtime-Serial-Port-plotter-in-Python-using-Bokeh

Just an experiment with creating a realtime plotter in Python
Arduino
5
star
10

Vasttrafik-Next-Trip

Showing next trips from Västtrafik. Implemented in PHP and uses the Västtrafik API. More info on http://sebastiannilsson.com/blogg/hittade-ett-anvandningsomrade-raspberry-pi/
PHP
5
star
11

Office-Hours

Get summary of logon and logoff times via Windows Events log
Python
4
star
12

hello_wxpython_tutorial

Getting started with wxPython tutorial
Python
4
star
13

Stormworks-Lua-Scripts

Lua scripts for the Stormworks game to improve boats
Lua
3
star
14

gopro_joiner

Script to combine, rename and compress gopro videos
Python
3
star
15

will-it-rain

Use SparkCore to light up a LED if you should bring an umbrella today
C++
3
star
16

FIR_v2

Arduino library for FIR filter implementation
C++
2
star
17

Bananpiren

A game in Unity3D.
C#
2
star
18

rikedom

Algorithmic trading library in Python
HTML
1
star
19

internet-uptime

Small script to check if my internet provider is providing me with internet.
Python
1
star
20

real_estate_finder

Location, location, location! This python script crawls realestate.com.au, checks the estimated time to and from work during rush hour and outputs an excel sheet with a list of properties.
Python
1
star
21

pyglet-asteroids

Asteroids clone in Python using Pyglet (opengl)
Python
1
star
22

jenkinsfile_example_python_in_docker

Example script to unit test a Python project in Docker.
Python
1
star
23

Python-ODE-Forward-Euler

Just some experiments with a custom ODE solver using Forward-Euler. Fast enough to be used in some realtime simulation applications.
Jupyter Notebook
1
star
24

L29x

Arduino library for motor driver L29x
C++
1
star
25

Pengar

Calculate your personal financial worth with an ipython script
Jupyter Notebook
1
star