Is there anyway to save the values i'm obtaning in real time from the serial monitor?
Welcome to the forum
The answer to your questions is, of course, yes
How you do it depends on how much data that you want to save, how you want to access it after saving it and how long it is to be retained for. More details please
Some possible ways include saving to an SD card, saving to EEPROM on the board and saving to variables in the sketch
Your topic has been moved to the Project Guidance category of the forum
In Real time - no.
If I wanted that, I'd go with a real terminal emulation solution, putty or something similar.
Take a look at this thread:
About the size of the data, is around 1300 samples per second. It data from an acelerometer X,Y and Z axis. The thing is that I need to plot this values in real time for visualize the how the axis change in time while im moving the accelerometer. I've been doing this with serial plotter, but there was some cases where the serial plotter plots wrong the values from the axis.
So I want to save the values I'm getting at the serial monitor, for plotting it into other tool like excel or Matlab.
Just in case, I don't have the arduino code because I actually not coding the accelerometer with Arduino. It is embedded and coded in other development board. I was just using the serial monitor and serial plotter from arduino through serial communication.
So the easiest solution is to use another terminal emulator program which can log the data. I am sure that, say, Putty has a feature of logging.
And it is possible on Putty to plot the values from the log??
No, but other programs can read the log file and make a plot.
Putty does the logging to a file then you use something like Excel to graph it
Horses for courses
Ok I'll try it! Only for curiosity, what if I necessarily have to use the serial plotter from Arduino, and as I comment, I have issues in some cases. Like this:
That plot is wrong. And the values I'm getting at the serial monitor are right! But they are not the same ones that are being plotted.
Does anybody has any idea of what it could be?
Well, I presume you know what you're doing, but the textual lines on the left have three values, first is around 1000, the chart shows no flat line in that area; I assume that's because the image on the left is a snapshot from time A, but the one on the right is before or after that,but it's really hard to tell.
If you were to run this for 300 samples, then show us data and chart that are mismatched, I'd be more convinced. But, please, capture the actual serial monitor text and paste it into a message, along with the chart image of the same data. Then we can talk apples and apples.
Is that what I'm talking about...that is the issue I'm having. There are cases where the Serial Plotter is not ploting right the values. And yes! As you say my first value is around 1000 but in the serial plotter is not showed.
As you can see, the first value of 1000 is there in the serial plotter but the line or graph no. So that is the weird thing...
Just a guess. I've only played with Serial Plot a bit, not much use for it, but I have seen cases where it doesn't seem to synchronize with the datastream if there's any unusual first lines, or if it's open before download completes. Like a mixed text and numeric header that identifies initial conditions. I don't know, but I think what I'd do is start my Arduino, have it pause waiting for a character from Serial monitor, then start Serial Plot, then start the actual data stream by sending a character.
Ok I'll try to plot my data following the order you suggest. Thank you !
Finally I found which was the issue. The data I was sending to the serial had an incorrect format. It was sending the axis values like: 100, 230, 234,
So it was an extra comma that made the serial plotter get like it was 4 values instead of just the 3 values. Then, I started sending the values as 100, 230, 234 without the comma in the end.
The plotter works fine.
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.