logobosstone

Menu

  • Home

Scilab Read Serial Port

0911

How to read and write matrix data with external files in Scilab Scilab allows the user to read matrix data from external text files. This feature is useful when, for example, we want to import some numerical table data from an external source (e.g. LibreOffice Calc).

  • Serial Port Arduino
  • Serial Port Cable
Active2 months ago

I need to plot serial data from Arduino.

I require support for:

  1. Various data formats (e.g. signed, unsigned, 8 bits, 16 bits);
  2. Plots several data on the same axes;
  3. Exports / Imports file data.

As plotting serial data from Arduino is a common need, my question is:What programs/utilities are available for plotting serial data from Arduino that meet the needs above?

What are the advantages / disadvantages of the method you have suggested?

dda
1,51111 gold badge88 silver badges1616 bronze badges
akellyirlakellyirl
1,61111 gold badge1010 silver badges1919 bronze badges

19 Answers

There are some good applications for visualizing the serial data, including:

  • MegunoLink ($29.95; Lite free) - plotting, logging, programming, reporting and more.

  • MakerPlot ($39) - digital & analog plotting, monitoring, custom interfaces and more.

  • ArduinoPlot (free) - simple plotting.

  • arduino-plotter (free) - easy, light-weight plotting with support for all primitive types

  • Bridge Control Panel (free) - logging, plotting, and more.

  • RealtimePlotter (free) - 6 channels data plotting.

  • Real Time Serial Data Plotter (free) - CSV data plotting, logging and more.

  • SimPlot (free) - 4 channel plotting.

  • Arduino Serial Plotter (free) - built in Arduino Editor under Tools > Serial Plotter.

(This is a community wiki, you can expand the list.)


Advantages: It's very flexible, scriptable, and freely available.

Disadvantages: A bit complex to learn (but I figured out how to get started in a few minutes, and quite functional in an hour or two), runs in a terminal window (if you consider that a disadvantage).

Something I found very useful was to script it to reload my terminal program's logfile periodically so i got a dynamic graph as my experiment progressed.


Edit: Here is the GnuPlot script that plots it:

Ps/2 portJRobertJRobert
11.1k22 gold badges1414 silver badges4141 bronze badges

I use Matplotlib for any plotting I need to do.

It's not arduino specific in any way, but it is a very excellent Python plotting toolkit.

I've built a number of applications that plot data from a variety of microcontrollers in real-time to a graph, but that was really more of a two-step process: 1. Get data from device into computer, 2. plot realtime data.

Really, I think you should break your question into two parts:

  • How do you get data from an Arduino/Any serial device into a computer easily.
  • What is a good plotting library that is easy to use.
Connor WolfConnor Wolf

SerialPlot (free). It does everything you require and much more.

Other features:

  • Zoom in on data
  • Click on datapoints to see values
  • Send commands back to Arduino
  • Adjust total number of points plotted
  • Ability to show each channel in its own autoscaled plot
  • Interprets binary, ASCII and custom packets
  • Demo mode lets you play with features
NateNate

Responding to my own question here.. I use Bridge Control Panel as mentioned.

Advantages: Lots of Features.

Disadvantages: Tricky to setup and very poor syntax/error reporting.

To use:You need to write the Arduino Data over the Serial Port one byte at a time. For an int data type that would look as follows:

In Bridge the command to Read Data is:

RX8 is the read command[h=43] means the next valid byte is 'C' in ASCIIthen the High Byte of Key1then the Low Byte of Key1

It looks like this in Bridge:

akellyirlakellyirl
1,61111 gold badge1010 silver badges1919 bronze badges

You can try serialchart. It's pretty strait forward program. It does exactly what you asked. The only disadvantage is that it requires data in CSV format (does not meet first point).

Screenshot from project page:

ah01ah01

You might be interested in TelemetrySee on Github . It is a communication protocol, highly simple to use, with a clean interface, that enables bidirectionnal communication with Arduino/Mbed devices.

If you don't want to read this long post, see A walkthrough of all the awesome features in it

The power of this library comes from the desktop command line interface (that requires no programming skills in python).

It is able to open high-performance plots (much higher that what can be done with matplotlib) just by typing a command.

The protocol supports complexes data structures. For now arrays and sparse arrays can be send from the embedded board.

The plots opened from the command line interface understand the type of data, and for arrays, rather than plotting each sample versus time, sample will be plotted against its own index.

In a near future, it is planned to add support for spatial coordinates (xyz data), that will allow you to plot immediately spatial data. Once, again the plots will figure everything out, plot your data in 2D or 3D space and you can focus on developping your app.

I believe those features are simply unique for such a project.

Pytelemetry CLI

Once installed with pip, the command line can be started with

Then you can connect, ls(list) received topics, print data received on a topic, pub(publish) on a topic, or open a plot on a topic to display received data in real-time

PS : I am the author.

I developed it because I could not find a solution that would allow me to:

  • write quickly PC scripts to control an Arduino
  • debug quickly
  • plot complex data (not just a time varying value)

all of the above without using proprietary solutions or bloated GUIs.

Using this library, the time to setup a communication between Arduino and PC went from usually half a day to 5 minutes.

OverdrivrOverdrivr

Nobody had mentioned Processing which is super versatile. You can do a lot more than just plotting but if that's all you want to do you can use the gwoptics library; hook up Arduino and Processing as directed here.

Avamander
60022 gold badges99 silver badges3434 bronze badges
Sebastian ZekiSebastian Zeki

I made an equivalent tool in python that print real time data from ADXL345 accelerometer.https://github.com/mba7/SerialPort-RealTime-Data-Plotter

may be it will be helpful for someone

Serial Port Arduino

Just choose the serial com and speed and sent a serial data on the following format:

  • 3 inputs, every input is a 2 bytes (Two's complement )
  • 6 bytes seperated by a space
  • the packet is a string terminated by 'n'

Could be easily adapted to change this format

mba7mba7

You can use MATLAB Student Edition, this can save your time for further analysis, too.You can just open the COM port in MATLAB and plot the received signal and/or save the signal in the workspace or whatever. MATLAB makes everything easy!

AHKhAHKh

CSV format is most versatile for any data (signed/unsigned, various size and precision).

Cross-platform (written in Java/Scala) tool Scsvlog can receive/parse CSV strings from serial port / socket, show values and draw charts (up to 8).

Greenonline
2,31166 gold badges2121 silver badges4141 bronze badges
ed82484954ed82484954

You can try out the software I developed for that propose. It's aimed to be easy to use. See SerialGraphicator - Open Source Free Serial Port Client capable of graph values that are received in JSON format.

Greenonline
2,31166 gold badges2121 silver badges4141 bronze badges
newtonisnewtonis

While I haven't used it myself, 'rqt_plot' running on the PC seems to be a popular way to plot data on a PC that comes over a serial port from an Arduino running a sketch that includes the rosserial_arduino library or the ros_arduino_bridge library.

  • '7/24: Now that I have the Arduino set up using Kessel, I can visualize the data better using ROS tools'
  • etc.
David CaryDavid Cary

I know this is a very old question, but I recently created a mac application that solves this problem very well. You can find more information about it on www.bloonapp.com. There are some demo videos on the website that you can check out.

JazaweJazawe

I know you were probably after more advanced GUI output, but I managed to replicate a task that one would normally do with an oscilloscope:

Serial Port Cable

using the serial plotter in the Arduino IDE and an ADC module you can get for $3 on eBay. I admit it's a bit crude, but it might be worth playing with the tool for a while, before you invest in Python/Matlab/ect level solutions. It was exceedingly easy to use. It would not take much to add SD card recording to the process.

See: https://edwardmallon.wordpress.com/2016/08/15/using-the-arduino-uno-as-a-basic-data-acquisition-system/

Ed MallonEd Mallon

Advantages:

  1. Easy to use
  2. Intuitive and flexible UI
  3. Open Source and free
  4. Different types of Graphs
  5. Very fast graph update rate

Disadvantages:

  1. Stopped development
  2. Binary data format is not complete yet.
  3. Primitive graph controls like zoom, screenshot and ...
Ali80Ali80

SVisual Monitoring and recording of signals for Arduino and not only.

АлександрАлександр

Serial Plotter is a simple program that I've made with Electron that receives data in the following format:data1,data2,timestamp; and converts it into a realtime chart.

user2298995user2298995
Serial

Almost useful. It needs:

  1. logging serial data to a file OR
  2. graphing from a file and updating every xxx milliseconds.

Live Graph is a better option and I use it in conjunction with Tera Term which gets the data via the USB/serial link (and saves it to a log file which then Live Graph polls).

Live Graph is slightly buggy when caching data and I haven't found a way to set a moving window to display results. Also, showing multiple graphs requires manual scaling, but in spite of all this, it's still very useful. It's written in java so you'll need the JRE. I prefer this over having to install python like some of the other graphing programs do. another downside is that it opens 4 different windows, which is a pain when I want to flip between it and Tera Term.

I've yet to find software that's

  1. An executable (.EXE) so it has no external reliance
  2. Includes a terminal emulator or serial data logger
  3. Logs serial data
  4. Graphs multiple items from a CSV
  5. Allows for CSV AND tab-delimited data (which is way easier to read as it scrolls along while simultaneously monitoring the graph.
  6. Allows setting of different scales for each overlaid graph without having to scale everything to [0..1] or setting a multiplier, i.e. allowing setting an [y0..y1] range for each item graphed.
sa_leinad
2,32111 gold badge1414 silver badges3939 bronze badges
maheshmahesh

Not the answer you're looking for? Browse other questions tagged serial or ask your own question.

1. Create circuit with TMP36 sensor (google for examples)

2. Connect arduino to computer via USB port (it is for data exchange and power). In Ubuntu 14 you should allow this device. Open terminal and run
sudo chmod a+rw /dev/ttyACM0
note 'ttyACM0' is optional. You may need to change this line.
In arduino software check for: Tools>Port
3. Install and run arduino software. Create new sketch (google for details):

int outputpin= 0;
void setup()
{
Serial.begin(9600);
}
//main loop
void loop()
{
int rawvoltage= analogRead(outputpin);
float volts= (rawvoltage/1024.0) * 5;
float celsius= (volts-0.5)*100;
Serial.println(celsius);
delay(1000);
}

Go to Sketch > Upload.
Go Tools > Serial Monitor to see output (Temperature, degrees C, each 1 sec)

4. SciLab > Applications > Module Manager - ATOMS > Real Time > Serial Communication Toolbox for Scilab
Install it and re-run scilab
5. Type Scinotes or go to Applications > SciNotes
Create code like (read help for details and commands):
n=300 // plot 300 data points from serial port '/dev/ttyACM0'
h=openserial('/dev/ttyACM0','9600,n,8,1')
i=1;
while i<=n
data(i) = strtod(readserial(h)); // char to number
plot(i,data(i),'b-o'); // real time plot
drawnow(); // show data
i=i+1;
end

And run it (arduino monitor should be closed).
You will see output in real time. Scilab is getting string output (temperature) and transfer it to the numbers.
SciLab/Xcos also has special tool for Arduino. You may google videos on youtube for that.
https://youtu.be/HZ88d_n7Q5M
This entry was posted on 11.09.2019.

Post navigation

Djordje Balasevic Svi Albumi Download
Matlab 2012 Trial Free Download

New Posts

  • Zapf Chancery Medium Italic Bt Free Download
  • Kinnari Serial Mani
  • Veeam License Keygen
  • Corel Draw X7 Serial Number Free Download
  • Dell 2520 Network Drivers
  • Java Turbo C Download Free
  • Free Video Editing Software No Watermark Download
  • Yeh Junoon Mera Shootout At Wadala Video Song Download
  • Serial Number Kaspersky Mobile Security 9
logobosstone