Skip to content

OLED Sensor Dashboard

Show a live potentiometer reading, estimated voltage, and proportional bar on an OLED.

OLED Sensor Dashboard: the matching Arduino Uno circuit rendered in Circuitera’s simulator
Matching Circuitera simulator circuit. Real firmware capture; modeled components are idealized.

Wire it up

Disconnect power before changing connections. Follow terminal names rather than wire colors.

FromToWhy it matters
Potentiometer (pot1) · VCCUno · 5VPower connection
Potentiometer (pot1) · GNDUno · GND.2Ground reference
Potentiometer (pot1) · SIGUno · A0Match this terminal to the sketch
SSD1306 OLED (oled1) · VCCUno · 3.3VPower connection
SSD1306 OLED (oled1) · GNDUno · GND.1Ground reference
SSD1306 OLED (oled1) · SDAUno · A4Match this terminal to the sketch
SSD1306 OLED (oled1) · SCLUno · A5Match this terminal to the sketch

The complete sketch

oled-dashboard.ino
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
Adafruit_SSD1306 display(128, 64, &Wire, -1);
void startDisplay() {
  if (!display.begin(SSD1306_SWITCHCAPVCC, 0x3C)) while (true) {}
  display.clearDisplay(); display.setTextSize(1); display.setTextColor(SSD1306_WHITE);
}
void setup() { startDisplay(); }
void loop() {
  int sample = analogRead(A0);
  display.clearDisplay(); display.setCursor(0, 0);
  display.println("ANALOG DASHBOARD");
  display.print("ADC: "); display.println(sample);
  display.print("Volts: "); display.println(sample * 5.0 / 1023.0, 2);
  display.drawRect(0, 42, 128, 12, SSD1306_WHITE);
  display.fillRect(2, 44, map(sample, 0, 1023, 0, 124), 8, SSD1306_WHITE);
  display.display(); delay(100);
}

The launch buttons use this same code and a matching saved circuit.

Build it step by step

  1. Open a complete project

    Launch in Simulator creates a separate Uno sketch and its matching wired circuit. Existing sketches are preserved. Press Run to compile and execute.

  2. Explore the live circuit

    Turn the knob while running. The number and bar should follow the same analog sample.

  3. Try it on hardware

    Disconnect power while wiring. Match terminal names in the table, select the exact board, Verify, then connect and upload. Check component ratings and power requirements first.

Understand the sketch

A small dashboard

Each frame clears the old value, samples A0, draws the new text and bar, then transfers one complete buffer. The voltage estimate assumes a 5 V reference.

If something is different

Display stays unchanged

Keep display.display inside loop and the potentiometer SIG wire on A0.

Expected output and tested scope

The OLED value/bar changes when the potentiometer input changes.

Version 1 · Last source- and build-matched test: 2026-10-25. Actual shipped AVR-GCC WASM compilation and Uno AVR engine execution; no physical hardware test.

Supported tutorial target: Arduino Uno R3 / ATmega328P. Compile: PASS · Modeled execution: PASS. Other boards require a separate review of pins, voltage, libraries and the exact build profile.

Keep exploring.