Date Created: 2009-05-21 13:13:35 -0500 (Thu, 21 May 2009) onebeartoe.com - Development Tools Date Created: 2012-01-20 06:59:38 -0600 (Fri, 20 Jan 2012)
Date Created: 2010-06-20 14:05:39 -0500 (Sun, 20 Jun 2010)

Serial Plotter by onebeartoe.com

Overview

 Serial Plotter, by onebeartoe.com, is a cross platform data visualization tool. It uses JavaFX APIs to graph real-time data. This guide uses an Arduino Uno to generate the serial data used as input into the serial plotter application.

Video Demonstration

Background

This project started out as a heart beat display for a Halloween 2015 costume.

To aid with testing, that project used the Arduino IDE serial plotter to visualize heart rate sensor data.

Soon after getting the Arduino serial plotter going, I realized it would be nice to plot more than one input variable from the serial port.

So I created this app, written JavaFX, to graph multiple inputs from an Arduino serial connection to the PC.


Hardware

  • linear potentiometer - COM-11620

    Hookup:
    • The pin labled 1 goes to arduino 5V.
    • The pin labeled 3 goes to ground.
    • The pin labeled 2 goes to Arduino analog pin 5.

  • heart rate sensor

    The purple wire goes to the Arduino analog pin.
  • photo cell

    See the Fritzing diagram below for hookup/wiring information.

Assembly

Here is the assembly for the Arduino:



The last assembly step is to connect the Arduino to the PC/laptop, via the USB cable.


Software Prerequisites

This application has a runtime dependency on RXTX.

Before continuing with this project, follow this guide to installing RXTX for Java and note where the RXTX binary is located on the filesystem.


Arduino Sketch

See the resources section below for a link to the Arudino source code. Upload the sketch to the Arduino with the Arduino IDE.


Java Application

This application is distributed as an executable JAR file.

Download the executable JAR for this application: serial-plotter-1.0-SNAPSHOT.jar

To start the application, use this command:

$ java -Djava.library.path="c:\opt\rxtx" -jar serial-plotter-0.0.1-SNAPSHOT.jar
            


Usage

With the sensors connected to the Arduino, and the Arduino connected to the PC, run the Java application. Be sure to specify the correct serial port (COM port on Windows or path on Linux) as a command line argument.

Once the Java application is running, you should see values start to scroll across the GUI. Move the knob on the linear pot, change the amount of light falling on light sensor, or connect the heart rate sensor to see the serial potter update the graph values.


Going Further

Some enhancements to this projects include:

  • creating a version that runs on mobile devices.


Resources & Acknowledgments

Source Code

The source code for this project is on Github.

onebeartoe serial plotter source code

Photocell Hookup

Ladyada provided this lovely photocell hookup guide.

Inspiration

Partial inspiration came from a Raspberry Pi project that plots Arduino data coming over a serial connection.


Date Created: 2016-09-08 08:16:00 -0500 (Thu, 08 Sep 2016)

© 2004 onebeartoe.com