Serial Plotter not working

I have an arduino uno, and i'm using it to read an EMG, the serial montior is working just fine, but i cant have the graphic on the plotter

My code:

void setup() {
Serial.begin(9600);
}
void loop() {
float sensorValue = analogRead(A5);
float milivolt = (sensorValue / 1023) * 5;
Serial.print("Sensor Value: ");
Serial.println(sensorValue);
Serial.print("Voltage: ");
Serial.print(milivolt * 1000);
Serial.println(" mV");
delay(400);
}

image

how does this help? I already tried everything, but only in the plotter, the variable doesn't count

In your code, you're printing both text strings and numerical values, which can confuse the Serial Plotter. The Plotter is expecting just numerical values to plot.


now it plots like the i was the same value

i already used the plotter with text strings, and in the arduino tutorial they use it too

try using float milivolt = (sensorValue * 5.0) / 1023.0; instead.


same :frowning:

What if you try like this:

void loop() {
  float sensorValue = analogRead(A5);
  float milivolt = (sensorValue / 1023) * 5;
  Serial.print("Sensor:");Serial.print(sensorValue); 
  Serial.print(",");
  Serial.print("mV:");Serial.println(milivolt * 1000);
  delay(400);
}
2 Likes


thanks bro, finally

1 Like

It explains the rules, which in turns, explains why your program did not work.

1 Like

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