29. ADC Serial plotter

Monitoring analog signals in real time is a core requirement in embedded system diagnostics. This task involves capturing analog voltage data using an onboard ADC and transmitting it over UART to visualize it through a serial plotter tool such as Arduino IDE Serial Plotter or similar PC-based software.

Key Concepts

  1. Analog-to-Digital Conversion (ADC)
    • ADCs convert continuous analog signals (e.g., voltage from a sensor) into discrete digital values.
  2. UART Communication
    • UART (Universal Asynchronous Receiver/Transmitter) is used for serial communication between the microcontroller and a PC.
    • Data is transmitted asynchronously at a predefined baud rate (e.g., 115200 bps).
  3. Serial Plotter
    • A tool (like the one in Arduino IDE) that visualizes incoming serial data in real-time.

General Approach

  1. Configure the ADC to read an analog input.
  2. Set up UART for serial communication.
  3. Continuously read ADC values and transmit them over UART.
  4. Visualize the data using a serial plotter.

Using Arduino IDE’s serial plotter

Arduino IDE has a serial plotter tool. We can open it by clicking below 

Arduino-UNO-serial-plotter

To plot data on the serial plotter, we need to simply send data to the Serial monitor with a new line (Serial.println()), where the new line separates the values.

Serial-plotter

The serial plotter is one of the very useful features provided by the Arduino IDE. It is very easy to understand any data visually, rather than a list of numbers.

The multiple values can also be plotted simultaneously, using the “\t” tab. If we send 2 values with a tab separating them, both values will be plotted on the Serial plotter simultaneously.

Limitations 

  • There is no option for vertical and horizontal scrolling, which limits viewing the waveform over a time range. 

So, by considering the above points, we can implement the task.

Below are the solutions to the given task using different microcontrollers

  1. STM32
  2. ESP32
  3. Arduino UNO

Submit Your Solution

Note: Once submitted, your solution goes public, helping others learn from your approach!