Serial Print, Serial Plot, different streams, different devices

I have the majority of my sketch done. Everything is working swell. I am serial.printing two sensor readings, time & date, and some text.
Now I would like to serial PLOT just the sensor readings, maybe to a second device, or over putty to a second screen on my pc.
Is that possible? Can you point me in the right direction?

Which Arduino are you using ?

Sorry for the delay. Preparing for a holiday.
Nano.

Use SoftwareSerial to implement a second serial interface in pins of your choice other than 0 and 1

Connect a TTL to USB converter to those pins, plug it into the PC and you have a second serial port on the PC that you can print to

If you open a second instance of the IDE using the second serial port you can open the Serial monitor in one instance and the Serial plotter in the other and print the same or different data to each of them.

Alternatively you can use a terminal emulator such as PuTTY or Coolterm as the serial terminal on the PC and the Serial monitor of the Arduino

"...different data to each of them..."
I don't understand how to serial.print text and data to one serial, and just data to the other serial, all in the same sketch. I would prefer to not have two sketches.

You don't need 2 sketches

Suppose that you have some data in a variable named d and some associated text in a variable named t and that you have set up a SoftwareSerial port named plotter connected to a second instance of the IDE. Then you could do this

Serial.println(t);  //text to Serial monitor
Serial.print(d);  //data to Serial monitor
plotter.println(d);  //data to plotter on second instance of IDE

If the plotter on the Arduino is to be used and the text and data sent to PuTTY via a SoftwareSerial port named putty then something like this

Serial.print(d);  //data to Serial plotter on the Arduino
putty.println(t);  //text to PuTTY on the PC
putty.println(d);  //data to PuTTY on the PC

OK. Let me just summarize my intention before I go down the SoftwareSerial rabbit hole.
I have two DS18B20 temp probes, on one pin using OneWire . I am showing (serial.print) in real time, the two temps, date and time, and some text on the serial monitor.
I also want to serialplot just the two temps. I'm not interested(at this point) in the x-axis units. It can be just the default units.
Is Software Serial the way to go?

  • You are using a Nano which only has 1 serial port
  • You want to output data over 2 separate serial ports
  • Therefore you need a second serial port which SoftwareSerial can provide

Note the need to use a serial to USB converter attached to the pins used by SoftwareSerial. You could use a second Arduino for this if you have one. See Arduino Project Hub

but something like this https://www.amazon.co.uk/UART-CP2102-Module-Serial-Converter/dp/B00AFRXKFU is neater

Can I open the serialmonitor and the serialplotter at the same time, within the same IDE sketch? No, correct?
Or must I open the IDE/sketch again and choose the native serialplotter? But I then need another usb input to the laptop/PC, and that's where the converter comes into play?
So, the power/usb cable from the Nano can only carry one serial stream. Thus SoftwareSerial.
Thank you for your time and feedback. This is just the final touch to the project so I want to make sure I can still see the finish line.

You cannot open the plotter and monitor at the same time in on instance of the IDE. As previously posted you need a second serial interface to the PC so that you have 2 distinct serial ports, one using the plotter and the other using a terminal emulator or the monitor of a second instance of the IDE. No sketch is required on the second instance

The converter is required to connect the second serial interface to the PC via USB

There are other alternatives such as using an OLED screen attached to a single Nano to display text whilst the Serial plotter of the same Nano is used as normal. One way or the other extra hardware is required