Projects / Two knobs, how fine can you set?

Two knobs, how fine can you set?

Beginner1 hGuided buildReviewed

Build it step by step

0 of 8 done
  1. NANO

    Wire the two dividers

    Outer legs to 5V and GND, wipers to A0 and A1.

  2. NANO8.5 mASSD1306

    Wire the OLED

    SDA to A4, SCL to A5, power from 5V and GND.

  3. NANO8.5 mASSD1306

    Install the libraries

    Adafruit SSD1306 and Adafruit GFX.

  4. NANO

    Measure the 5V rail

    Put the value in VREF_MV.

  5. NANO

    Upload

    Both voltages show on the display.

  6. NANO

    Set the trimmer

    Turn until it shows OK.

  7. NANO

    Set the ten-turn pot

    Turn until it shows OK.

  8. NANO

    Compare

    Time and effort for each.

In short

How do you build a two knobs, how fine can you set??

Set the same voltage with a single-turn trimmer and a ten-turn pot and see which one is easier to set within a couple of millivolts. You need Multi-turn potentiometer 10 kΩ (3590S), Trimmer potentiometer 10 kΩ (3362 single turn), Arduino Nano, SSD1306 OLED Display, Jumper wires male to male (40 pcs, 20 cm) and Breadboard 830 Tie Points. It takes 8 steps and about 60 minutes.

Level
Beginner
Time
About 60 min
Parts
6

Parts list

Tick what you already own. It saves to My Garage, so “Build with what I have” knows.

Wiring

FromToWhy
Both pots, one outer leg eachNano 5VTop of each divider
Both pots, other outer leg eachNano GNDBottom of each divider
Single-turn trimmer wiper (middle)Nano A0Trimmer voltage
Ten-turn pot wiper (middle)Nano A1Multi-turn voltage
OLED VCC and GNDNano 5V and GNDPower
OLED SDANano A4I2C data
OLED SCLNano A5I2C clock

Code

A potentiometer sets a voltage, but how finely it can set it depends on how far you have to turn the shaft for the whole range. A single-turn trimmer sweeps its full range in less than one turn, around 270 degrees, so across 5 volts each degree changes the output by about 18 millivolts. A ten-turn pot covers the same 5 volts in 3600 degrees, so each degree changes the output by only about 1.4 millivolts, which is roughly thirteen times finer. This build shows that clearly. Both pots are wired as dividers across 5 volts and read by the Nano, and the sketch averages 128 readings to get below the noise of the converter, then shows both voltages on the display and marks one with OK when it is within 2 millivolts of 2500. Try to set each pot to the target and count how long it takes and how often you overshoot. The ten-turn pot usually lands in a few seconds, and the single-turn trimmer takes much more care. Measure the real 5 volt rail with a multimeter and put it into VREF_MV, since all the readings are relative to that supply. The Nano has a 10-bit converter, so one step is about 4.9 millivolts, and the averaging works because tiny noise moves readings between steps. For real precision work the accuracy of the reference matters more than the number of decimals on the display.

Runs on a virtual Arduino Nano in your browser, with sliders for the sensors. Happy with it? Verify and upload to your real board from the same page (Chrome or Edge on a computer).

#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>

Adafruit_SSD1306 oled(128, 64, &Wire, -1);
const float VREF_MV = 5000.0;               // measure your Nano 5V pin in mV and enter it here
const float TARGET_MV = 2500.0;
const float WINDOW_MV = 2.0;                // a "lock" is within plus or minus 2 mV

float readMv(int pin) {
  long sum = 0;
  for (int i = 0; i < 128; i++) sum += analogRead(pin);   // oversample to average out noise
  return (sum / 128.0) * VREF_MV / 1023.0;
}

void setup() {
  Serial.begin(9600);
  oled.begin(SSD1306_SWITCHCAPVCC, 0x3C);   // try 0x3D if the screen stays blank
  oled.setTextColor(SSD1306_WHITE);
}

void loop() {
  float t = readMv(A0);                     // single-turn trimmer
  float m = readMv(A1);                     // ten-turn pot
  bool lockT = fabs(t - TARGET_MV) <= WINDOW_MV;
  bool lockM = fabs(m - TARGET_MV) <= WINDOW_MV;

  oled.clearDisplay();
  oled.setTextSize(1);
  oled.setCursor(0, 0);  oled.print("Target 2500 mV +/- 2");
  oled.setTextSize(2);
  oled.setCursor(0, 16); oled.print("1T "); oled.print(t, 0);  oled.print(lockT ? " OK" : "");
  oled.setCursor(0, 40); oled.print("10T "); oled.print(m, 0); oled.print(lockM ? " OK" : "");
  oled.display();

  Serial.print("trimmer "); Serial.print(t, 1);
  Serial.print(" mV   multi-turn "); Serial.print(m, 1);
  Serial.println(" mV");
  delay(100);
}

What the serial monitor should show

Open the serial monitor at the baud rate in the code. This is what our simulator prints for a virtual Arduino Nano with its sensors at their default values. Your numbers will follow your real readings, but the format should match.

trimmer 2502.0 mV   multi-turn 2502.3 mV
trimmer 2502.3 mV   multi-turn 2502.7 mV
trimmer 2502.5 mV   multi-turn 2502.5 mV
trimmer 2502.6 mV   multi-turn 2502.6 mV
trimmer 2502.4 mV   multi-turn 2502.4 mV
trimmer 2502.4 mV   multi-turn 2502.3 mV

Test checklist

What you should see at each check. If a reading is far off, stop and use the troubleshooting list.

CheckExpected
Both pots at the middleAbout 2500 mV each
Trimmer turned a few degreesVoltage changes by tens of mV
Ten-turn pot turned a few degreesVoltage changes by a few mV
Reaching the OK windowEasier with the ten-turn pot
Reading noiseA few tenths of a mV after averaging

If it does not work

Screen blank

Try address 0x3D and check SDA and SCL.

Readings far from expected

Enter the real 5V rail in VREF_MV.

Reading jumps

Check the wiper pin, a loose breadboard contact causes jumps.

Cannot reach OK

The window may be too tight for your ADC, widen it to 3 mV.

Both read zero

Check the outer legs are on 5V and GND.

Still stuck? Find the fault step by step with your multimeter →

Ask Lark AI

Common questions

What parts do I need for the two knobs, how fine can you set??

Multi-turn potentiometer 10 kΩ (3590S), Trimmer potentiometer 10 kΩ (3362 single turn), Arduino Nano, SSD1306 OLED Display, Jumper wires male to male (40 pcs, 20 cm) and Breadboard 830 Tie Points.

How long does the two knobs, how fine can you set? take to build?

About 60 minutes for a beginner maker, in 8 steps.

How do I know the two knobs, how fine can you set? works?

Both pots at the middle: About 2500 mV each. Trimmer turned a few degrees: Voltage changes by tens of mV. Ten-turn pot turned a few degrees: Voltage changes by a few mV.

Screen blank: what should I check?

Try address 0x3D and check SDA and SCL.

Readings far from expected: what should I check?

Enter the real 5V rail in VREF_MV.

Reading jumps: what should I check?

Check the wiper pin, a loose breadboard contact causes jumps.

Cannot reach OK: what should I check?

The window may be too tight for your ADC, widen it to 3 mV.