2

The Arduino IDE has a built in functionality that allows the user to plot a value (such as temperature) over time.

I would like to plot two variables with different ranges on the y-axis (pressure in the range of thousands and temperature which varies from 20°C to 40°C).

I could make it work to have both being plotted, but the range differences does not allow me to see small changes in one/both quantities. Is there a way to two, or more, Y axis each one with its own scale?

sa_leinad
3,2182 gold badges23 silver badges51 bronze badges
asked Jun 12, 2017 at 9:06

2 Answers 2

5

No. The Arduino Serial Plotter only supports one Y axis.

An alternative would be to capture the data into a file as CSV data and use some other software to plot it - you could import the data into Excel / LibreOffice, or (as I prefer for quick graphing) use something like GnuPlot (or whatever is similar for your chosen OS).

For instance, this is a GnuPlot configuration for plotting two independent axis datasets and the results:

set datafile separator ","
set terminal png enhanced size 1360,768
set output 'testCharge.png'
set ytics nomirror
set ylabel "Current (A)"
set y2label "Voltage (V)"
set y2tics nomirror
plot "testCharge.csv" using 3 smooth bezier title "Current" w l, \
 "testCharge.csv" using 4 title "Cutoff" w l dashtype 2, \
 "testCharge.csv" using 2 smooth bezier title "Voltage" w l axes x1y2

The data I use is formatted thus:

Phase,Voltage,Current,Cutoff
0,3.58,1.098,0.033
0,3.59,1.098,0.033
0,3.59,1.098,0.033
0,3.59,1.098,0.033
0,3.6,1.098,0.033
0,3.6,1.098,0.033
0,3.6,1.098,0.033
0,3.61,1.098,0.033
0,3.61,1.098,0.033
... etc ...

And the results:enter image description here

Incidentally, that's me charging a Li-Ion battery and monitoring the voltage and current.

answered Jun 12, 2017 at 9:33
1

The Serial Plotter from within the Arduino IDE is quite limited. Not to mention the lack of documentation on the Arduino website. So, no the Serial Plotter cannot do what you require.

However, there is a very good selection of serial data plotter programs over at this question: Serial data plotting programs

answered Jun 12, 2017 at 12:37
0

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.