This project is a Processing-based serial terminal and graphing program for the analysis and recording of data from serial devices, such as Arduinos. This program is designed as a replacement for the serial monitor contained within the Arduino IDE. The program contains easy-to-use tools to record data received from serial devices, and to plot numerical data on up to 4 separate graphs in real-time. This makes it useful for quickly analysing sensor data from a micro-controller.
This is still a work in progress; please let me know if you come across any issues or bugs which need to be fixed!
A full description and set of instructions can be found on my website: https://wired.chillibasket.com/processing-grapher/
Live graph tab, illustrating how real-time data can be plotted on multiple graphs
- Easy UI scale and colour theme changing
- Serial terminal monitor
- Connect to any serial port at any baud rate
- Send and receive serial communication
- Record the communication as a text file
- Change the colour of lines containing specific tags
- Live Graphing
- Plot real-time data obtained from serial device on a graph
- Can display data on up to 4 separate graphs
- Supports comma delimited numbers only (example: 12,24,-15.4)
- Apply different colours and names to each input
- Record the real-time data as a comma delimited file
- File Graphing
- Opens comma delimited files for analysis
- Apply different colours and names to each input
- Supports zooming into sections of the waveforms
- Add vertical markers/labels to the data
- Apply filters to remove noise and transform the data
- Download and install the Processing IDE version 3.5.4 from https://processing.org/. Note that the newest version 4.0 is not yet supported.
- Clone or download all files in this repository.
- Open the main program file
ProcessingGrapher.pde
in the Processing editor. All the other files should automatically open in separate tabs in the Processing IDE. - Press the
Run
button in the top-left of the Processing editor to start the program.
To use the program on Linux, there are two additional steps that need to be taken:
- Change the renderer on line 217 to
final String activeRenderer = JAVA2D
. Unfortunately the renderer used on the other platforms (JavaFX) currently has some compatibility issues on Linux. - If the error message
Permission Denied
appears when trying to connect to a serial port, this means that your current user account doesn't have the permissions set up to access the serial ports. To solve you can either run the program usingsudo
, or you can set up your user so that it has access to the ports using these two commands (replace<user>
with the account username):sudo usermod -a -G dialout <user>
sudo usermod -a -G tty <user>
- Reboot the computer to apply the changes.
It is possible to create a stand-alone version of the program, which does not require the Processing IDE to run.
- Open the code in the Processing IDE, as described in the previous steps.
- In the top bar, click on
File > Export Application...
- In the Export Options window that pops up, select the platform you want to export for and make sure that the Embed Java option is ticked. Finally, click Export.
- This will create an application folder which will include either an
*.exe
file (Windows), shell script (Linux) or*.app
launch file (OS X) which you can use to run the program.
- To connect to an Arduino:
- Ensure Arduino is plugged into your computer
- Go to the "Serial" tab of the program
- In the right-hand sidebar, press on
Port: None
button - A list of all available ports should appear. Click on the port you want to connect to
- Press on the
Baud: 9600
button and select the baud rate of the serial connection - Finally, click on the
Connect
button to initiate the connection with the Arduino
- To plot real-time data received from the Arduino:
- Make sure that the data consists of numbers being separated by a comma
- For example the message
12,25,16
could be sent using Arduino code:Serial.print(dataPoint1); Serial.print(","); Serial.print(dataPoint2); Serial.print(","); Serial.println(dataPoint3);
- Go to the "Live Graph" tab of the program. The data should automatically be plotted on the graph.
- To plot different signals on separate graphs, click on the number of graphs (1 to 4) in the "Split" section of the right-hand sidebar.
- You can then press the up or down buttons on each signal in the sidebar to move it to a different graph.
- To change options (such as graph type, x-axis and y-axis scaling) for a specific graph, click on the graph you want to edit. The options for that graph are then shown in the sidebar.
A full set of instructions and documentation can be found on my website at: https://wired.chillibasket.com/processing-grapher/
Serial monitor tab, showing the communication with an Arduino
File graph tab, showing how information from a CSV file can be plotted on a graph
- (15th December 2021) Version 1.3.4
- (26th September 2021) Version 1.3.2
- (8th August 2021) Version 1.3.1
- (#22) Text can now be pasted into the serial console message box; this makes it a lot easier to send recorded messages without having to type them all out again.
- (#23) Improved the functionality of all scroll bars so that they can now be clicked on using the mouse and dragged up and down.
- (#24) Automatically detect the frequency of incoming serial data so that the x-axis of the real-time graph can be scaled properly without any user input.
- (#7) The serial monitor can now differentiate between normal messages and messages which can be plotted on the realtime-graph. A new button has been added in the sidebar menu so that these "Graph Data" messages can be hidden, making it easier to see other messages.
- (31st July 2021) Version 1.3.0 [Release]
- (#20) Added option to change the colour of keyword tags on the "Serial" tab and signals on the "File Graph" tab. Simply click on the colour on the sidebar menu and select a new one using the colour picker.
- Minor UI improvements on "File Graph" tab to highlight zoom options. The escape key can now be used to cancel an active zoom operation.
- (#21) Added pop-up button which allows you to scroll back down to the newest entry in the "Serial" tab after scrolling up.
- (9th May 2021) Version 1.2.4
- (1st April 2021) Version 1.2.3
- Fixed export bug when trying to save CSV data to a file.
- (6th March 2021) Version 1.2.2
- Fixed bug where the first and last data-point on the Live Graph were not being displayed.
- Improved mouse-wheel scrolling speed to better match the content.
- (1st March 2021) Version 1.2.1 [Release]
- (#16) When adding labels to the graph in the "File Graph" tab, they are now stored as a new signal.
- Changes to the chart in the "File Graph" tab can now be saved to a new file.
- Added option to apply filters to the signals in the "File Graph" tab.
- (#13) Advanced serial port settings can now be modified in the "Settings" menu.
- (9th February 2021) Version 1.2.0
- (#15) Updated to use the JavaFX (FX2D) renderer, which significantly reduces the processor usage of the program.
- Implemented native JavaFX pop-up dialogues while maintaining backwards compatibility with the default renderer.
- (29th November 2020) Version 1.1.1
- Added button on "Live Graph" tab to toggle automatic y-axis scaling on/off.
- Added a "Hidden" section on the "Live Graph" tab so that unwanted signals can be hidden from the real-time graphs.
- Added a "Settings" sidebar menu to make changing program preferences easier.
- Added two additional program colour schemes.
- (7th September 2020) Version 1.1.0 [Release]
- Updated all version number to differentiate between minor updates and larger releases.
- Improved the way in which the axis labels are displayed on the graphs.
- Constrain strings which are too long so they appear correctly in the right-hand menu.
- (23rd August 2020) Version 1.0.8
- Added a file recording error recovery function, which deals with all possible error scenarios.
- Optimised the Serial monitor text rendering to improve the frame rate.
- Added menu button to turn off the automatic scrolling of the serial monitor.
- Improved the menu UI to make it clearer when a button is disabled.
- Menu clicks are now handled in a separate thread, meaning pop-ups etc. are no longer blocking.
- Added a new thread which updates the COM port list at regular intervals.
- Overhauled the "Graph" drawing class to make it more robust to displaying a variety of data.
- (6th August 2020) Version 1.0.7
- Revamped file saving process so that new entries are written to the output file the moment they are received.
- When recording data for a long time, the entries are now automatically split into multiple files of maximum 100,000 rows.
- Updated live graphs to show a continuous running data stream, rather than drawing the data from left to right.
- (3rd August 2020) Version 1.0.6
- Added "Getting Started" boxes to help new users.
- Updated error-handling of the CSV file saving process.
- Added variable which can be used to change the serial comms line-ending character.
- File open/save path strings are now properly cleaned to prevent backslash "" errors.
- (20th July 2020) Version 1.0.5
- Streamlined the Serial devices connection process by adding COM port and Baud rate options into sub menus on the right-hand sidebar (instead of blocking pop-ups).
- Removed the duplicate serial connection code from the "Live Graph" tab, so that future improvements to the serial connection process will be easier.
- Added loading screen on start-up.
- CTRL+ and CTRL- keyboard combinations can be used to increase and decrease the UI scaling factor.
- (19th July 2020) Version 1.0.4
- Added scrolling support to the right-hand menu bar using the mouse scroll wheel or up/down arrow keys. This solves the issue where menu items could be hidden when the window size is too small.
- Finished updating all code function commenting to a more consistent Doxygen-style format.
- (18th July 2020) Version 1.0.3
- Added usage instructions which appear in the serial monitor on start-up
- Added the "Inconsolata" font which is used in the serial monitor
- Fixed issue where serial messages which are longer than the window width would not appear. Now the visible portion of the text is shown, and a double arrow ">>" icon is used to show that some text is hidden. However, there is not any way to see that text yet, other than resizing the entire window.
- Added support for "Page Up" and "Page Down" keys to quickly scroll through text in the serial monitor.
- (17th July 2020) Version 1.0.2
- Fixed live graph bug which plotted erroneous data when graph y-axis was resized.
- Added code which reset the live graph signal list when serial device is disconnected.
- (19th April 2020) Version 1.0.1
- Added ability to display live serial data on up to four separate graphs.
- Graphs now support the display of linecharts, dotcharts and barcharts.
- Updated zooming options on the "Live Graph" and "File Graph" tabs.
- Fixed some of the bugs in displaying the live graph data.
- Changed method used to plot live serial data, so that the maximum frequency which can be displayed is no longer limited by th frame rate (60Hz).