Plotter not Plotting

I'm developing a simple code to soften a Temperature input with an EMA filter.

The problem I have, is that the serial motinor is displaying everything as it should, but the plotter is not. I tried reseting the program but it doesn't work.
I'm using an Arduino (Elegoo) Uno.
IDE 2.0.4

double LecturaTa;
double Ta;

double EMA;
double EMA1;

void setup() {
  
  Serial.begin(9600);

  pinMode(A0, INPUT);

}

void loop() {
  

  
  LecturaTa = analogRead(A0);
  Ta = (4675.0/(log(-(50000.0*LecturaTa)/(0.00797165*LecturaTa-8.154998))))-273.15;

  Serial.print("La Temperatura es:   ");
  Serial.print(Ta);
  Serial.print(" ºC");

  Serial.print("      La Media Movil Exponencial (EMA) de 0'06 es:    ");
  EMA = 0.06*(Ta)+(1-0.06)*EMA1;
  Serial.print(EMA);
  Serial.println("ºC");
  EMA1 = EMA;

}


Your topic was MOVED to its current forum category which is more appropriate than the original as it has nothing to do with Installation and Troubleshooting of the IDE

Which Arduino board and version of the IDE are you using ?

Sorry for the incorrect topic choosing.

I'm using an Arduino (Elegoo) Uno.
IDE 2.0.4

I must say that I have used the same arduino with the 2.0.0 Beta IDE some years ago and it worked fine.

Your code works here using 2.0.4 on a Nano

1 Like

Thanks for trying it out.
The code works, I just need help figuring out why my plotter is not plotting this values

Sorry, I should have been more specific. Your code works with the Serial plotter on 1.8.19

I have not tried in on 2.0.4

EDIT : Now tried using 2.0.4 and it works if you use

    Serial.println("      La Media Movil Exponencial (EMA) de 0'06 es:    ");

See https://docs.arduino.cc/software/ide-v2/tutorials/ide-v2-serial-plotter

You are formatting the data for a human to read. You need to use the machine readable format consumed by Serial Plotter:

<label>:<value>,<label>:<value>\n
Tempertura:23.21,EMA:23.22
Tempertura:23.21,EMA:23.22

<label> must not contain any spaces.

1 Like

This is a valid solution (maybe the only one) for the problem I had.

I tried different options and it looks like the plotter only understands the text before ":" and the variable right after it.

I don't know how UKHeliBob manages to get it plotted with the original code, I would like to know because it was (as you said) a more human way of expressing it.

Thank you a lot

PS: It's still sketchy, I still have trouble getting the plotter to understand I want to plot all variables, but I managed to do it. (I used fixed values to mantain the graph stable between values and not autoadjust.

I could not remember the correct format for the data to be plotted so was experimenting. All I did was to change

  Serial.print("      La Media Movil Exponencial (EMA) de 0'06 es:    ");

to

  Serial.println("      La Media Movil Exponencial (EMA) de 0'06 es:    ");

and got output on the plotter. I did not check that the output was reasonable, just that it was there and that the plot varied when changing the analogue input

1 Like

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.