Fork me on GitHub

Project Notes

#090 PlotNValues

Sample up to 6 analog inputs and stream the data to serial in ASCII format - for plotting with Processing for example.

The Build


This is a generic program for sampling up to 6 analog values on a fixed time base, and streaming the data to the serial port in ASCII, comma-separated format.

PlotNValues (a simple Processing sketch) can be used to read the data from the serial port and plot the values over time, with some coloration effects thrown in for good measure.

In other words, we’re using Arduino and Processing as a basic oscilloscope or waveform plotter. And it kind of works, as long as the sampling frequency is kept relatively low (10ms/100Hz by default).

The number of traces is fixed with the TRACE_COUNT defined in the sketch. The values are read from analog pins A0,A1,..A5 respectively.

Here’s an example 2-input trace:

processing trace

Here’s an example 6-input trace:

processing trace


The Breadboard

The Schematic

The Build

Credits and References

Project Source on GitHub Project Gallery Return to the LEAP Catalog

This page is a web-friendly rendering of my project notes shared in the LEAP GitHub repository.

LEAP is just my personal collection of projects. Two main themes have emerged in recent years, sometimes combined:

  • electronics - usually involving an Arduino or other microprocessor in one way or another. Some are full-blown projects, while many are trivial breadboard experiments, intended to learn and explore something interesting
  • scale modelling - I caught the bug after deciding to build a Harrier during covid to demonstrate an electronic jet engine simulation. Let the fun begin..
To be honest, I haven't quite figured out if these two interests belong in the same GitHub repo or not. But for now - they are all here!

Projects are often inspired by things found wild on the net, or ideas from the many great electronics and scale modelling podcasts and YouTube channels. Feel free to borrow liberally, and if you spot any issues do let me know (or send a PR!). See the individual projects for credits where due.