Tricky Circuit

Resolution and quantization

Turn a voltage into a number

ADC means Analog to Digital Converter: it maps an input voltage to a number. Resolution in bits sets how many codes exist: 2^bits. Quantization groups a continuous range into steps. The reference voltage sets the top of that range. A bit is one binary digit, either 0 or 1.

Open interactive experiment

EXPERIMENT BENCH

Change the circuit settings, predict the readings, then check a challenge. These are learning models, with the assumptions explained in each lesson.

Sign in to save progress. Guest progress stays on this device.

Open laboratory in a full window

Why it works

Ideal ADC rounds downward and clips to its code limits. No noise, input loading, sampling delay or calibration error. The sensor slider represents 0–5 V.

Step = Vref/2^bits. Code = floor(Vin/step), limited to 0…2^bits − 1. floor means round down. A smaller step distinguishes smaller voltage changes. Vin is input voltage; Vref is reference voltage.

Difficulty
  1. Build · Build it

    Power on at 8 bits, a 5 V reference and 50% sensor level. Read code 128.

    Need a hint?

    8; 5 V; 50% → 128

  2. Explore · Change one thing

    Select 10 bits, a 5 V reference and 25% sensor level. Read code 256.

    Need a hint?

    10; 5 V; 25% → 256

  3. Solve it · Solve the challenge

    Select 12 bits, a 2.5 V reference and 80% sensor level. Observe saturation at code 4095.

    Need a hint?

    12; 2.5 V; 80% → 4095

Extra reading and circuit recipes

Turn a voltage into a number

A useful pattern

An 8-bit conversion has 256 codes, numbered 0 through 255.

Beyond this model

More bits give smaller ideal steps; real noise and errors can limit useful resolution.

A useful trap to avoid

Clipping a number does not protect a physical input from too much voltage. Check real input limits.

An ideal 8-bit ADC sees exactly its reference voltage. Its code is…

  1. 256
  2. 255
  3. 128
Read more

There are 256 codes but the first is zero, so the highest is 255.

Texas Instruments

Temu affiliate offers

Find your next electronics project

Explore these do-it-yourself project kits. Check the selected option, included parts and instructions on each offer.

Tricky Circuit may earn a commission if you buy through these Temu affiliate links. These are product ideas; they have not been bench-tested by Tricky Circuit and are not verified lesson parts lists.

Supplier photo of an assembled infinity mirror light cube illuminated on a dark background.

Supplier product photo

Build an infinity light cube

Listing specifies 5-volt direct current. Soldering required; battery and glue not included.

View kit on Temu

Supplier photo of a breadboard, jumper wires and assorted electronic components in a plastic storage case.

Supplier product photo

Try breadboard experiments

Breadboard, wires and assorted parts. Arduino controller board not included.

View kit on Temu

Supplier photo of an assembled blue surface-mount soldering practice board with a circular ring of small lights.

Supplier product photo

Solder a chasing-light board

Surface-mount soldering practice. Battery and battery holder not included.

View kit on Temu