A binary weighted resistor DAC converts digital logic into an analog voltage using a summing op-amp and resistors scaled by powers of two (R, 2R, 4R, 8R). For a reliable 4-bit build, you must use 1% tolerance metal film resistors or a precision bussed SIP network with a ≤50 ppm/°C tempco. Standard 5% carbon film parts will cause missing codes and non-monotonic output due to value spread and thermal drift.

While R-2R ladders dominate high-resolution commercial chips, the true binary weighted architecture (using distinct R, 2R, 4R, 8R values) remains a staple for low-bit-count (3 to 4 bit) custom microcontroller projects, audio CV generation, and programmable gain amplifiers. The catch is that the passive components carry the entire burden of accuracy. Here is how to select, decode, and debug the resistors that make or break your DAC.

The Passives Inside a Binary Weighted Resistor DAC

In a 4-bit binary weighted DAC, the feedback resistor (Rf) and the input resistors dictate the analog output. If your MSB (Most Significant Bit) resistor is R, the next is 2R, then 4R, and the LSB is 8R. The current contributed by each GPIO pin is inversely proportional to its resistor value. Because the resistor values span a wide range (a 1:8 ratio for 4 bits, or 1:128 for 8 bits), the absolute tolerance and temperature coefficient (tempco) of the higher-value resistors become critical.

You can build this network using discrete axial resistors or a Single Inline Package (SIP) resistor network. Here is how the physical constructions compare on the bench:

Construction Type Typical Tolerance Tempco (ppm/°C) Typical Use Case
Carbon Film (Discrete) ±5% ±200 to -500 Current limiting, pull-ups (Avoid for DACs)
Metal Film (Discrete) ±1% to ±0.1% ±15 to ±50 Prototyping, low-bit custom DACs, precision biasing
Thick Film SIP Network ±2% (Absolute), ±0.1% (Ratio) ±100 (Absolute), ±50 (Tracking) Production bussed summing nodes, space-constrained boards
Thin Film SIP Network ±0.1% ±10 to ±25 High-precision instrumentation, audio DACs
Warning: When using discrete resistors, their individual temperature coefficients are uncorrelated. If the MSB resistor heats up and drifts +50 ppm while the LSB drifts -50 ppm, your DAC linearity collapses. SIP networks share a single substrate, meaning their ratio tracking tempco is vastly superior to their absolute tempco.

Decoding Resistor Markings and Network Pinouts

When you pull a resistor network from a bin or order SMD arrays, the markings dictate whether you have the right topology. A binary weighted DAC requires independent resistors that tie into a single summing node. This means you need an isolated network (where you jumper one side of all resistors together) or a bussed network (which has a built-in common pin).

Reading Discrete Axial Markings

For a 5-band metal film resistor (e.g., 80.6kΩ 1%):

  • Bands 1-3 (Digits): Grey (8), Black (0), Blue (6) = 806
  • Band 4 (Multiplier): Red (x100) = 80,600 Ω
  • Band 5 (Tolerance): Brown = ±1%

Reading SIP Bussed Network Codes

SIP networks use an alphanumeric code printed on the epoxy coating. A common Bourns part might read 4609X-1-103LF. Here is how to parse it:

  • 46: Series/package type (conformal coated SIP).
  • 09: Total number of pins (1 common + 8 resistors).
  • X: Circuit type. 'X' means bussed (all resistors share pin 1). 'Y' or no letter usually means isolated.
  • 103: The resistance code. '10' is the base number, '3' is the multiplier (number of zeros). 10 + 000 = 10,000 Ω (10kΩ).
  • LF: Lead-free (RoHS compliant).

For a binary weighted DAC, a standard bussed network with identical resistors (like 10k) won't work out of the box unless you are building an R-2R ladder. For a true binary weighted DAC, you either buy custom tapered networks, use discrete 1% metal film resistors, or use an isolated SIP network and manually wire the common summing node.

Selecting and Substituting the Right Passives

Which type should you use for the job? If you are building a 3-bit or 4-bit DAC for an ESP32 generating slow control voltages (like a programmable power supply feedback loop), 1% discrete metal film resistors are the most cost-effective and flexible choice. If you are designing a custom PCB for an 8-bit audio application, you must switch to an R-2R architecture using a thin-film matched network, as sourcing 8 discrete binary-weighted values (R to 128R) with matched tracking is nearly impossible off-the-shelf.

How to Substitute Safely

Suppose your design calls for an 80kΩ MSB resistor, but your lab kit only has standard E24 values (like 82kΩ) or you are out of 80k entirely. Never substitute a 5% 82kΩ part and 'hope the software calibration fixes it'—the hardware non-linearity will cause missing codes.

Safe Substitution Rules:

  1. Series Stacking: Use two 40kΩ 1% metal film resistors in series. This actually improves thermal dissipation and halves the random noise contribution of the resistor.
  2. Parallel Matching: Put a 100kΩ and a 400kΩ 1% resistor in parallel. The math: (100 * 400) / (100 + 400) = 80kΩ exactly.
  3. Trimming (Last Resort): If you must use a slightly off-value discrete resistor, place a 10kΩ multi-turn cermet trimpot in series with a lower-value base resistor. Measure the total resistance with a 4.5-digit multimeter before soldering the op-amp.

Bench Scenario: The 4-Bit ESP32 Waveform Generator Failure

To understand why passives matter, let's look at a real-world bench failure involving an ESP32 and a custom DAC.

The Setup: A maker needed a 4-bit DAC to generate a 16-step staircase waveform for testing an analog comparator. They wired four ESP32 GPIO pins (3.3V logic) through four discrete resistors: 10kΩ (LSB), 20kΩ, 40kΩ, and 80kΩ (MSB). The resistors tied into the inverting input of an MCP6001 rail-to-rail op-amp configured as a summing amplifier with a 10kΩ feedback resistor.

The Numbers: With a 3.3V logic high, the theoretical output step size should be exactly 220mV per step (3.3V / 15 total steps). The transition from binary 0111 (7) to 1000 (8) is the 'major carry' transition, where the MSB turns on and all lower bits turn off simultaneously.

The Outcome: On the oscilloscope, the staircase looked mostly fine, but at the major carry transition, the voltage actually dropped by 40mV before rising. The DAC was non-monotonic. Furthermore, steps 2 and 3 were indistinguishable (missing codes).

What Went Wrong: The maker had grabbed standard 5% carbon film resistors from a bulk bin. The 80kΩ MSB resistor measured 76.2kΩ on the multimeter (well within the 5% tolerance band of 76k-84k). Because the MSB resistor was too low, it sourced too much current. When the 1000 state triggered, the oversized MSB current overwhelmed the summing node, causing the output to overshoot the previous 0111 state erratically, while the 10kΩ LSB resistor (measuring 10.4kΩ) couldn't provide fine enough resolution to separate the lower steps. Swapping to a matched set of 1% metal film resistors instantly cured the non-monotonic glitch.

Failure Modes and Visual Symptoms on the Bench

When your binary weighted DAC misbehaves, the physical passives and the summing op-amp will often give visual or measurable clues. Here is a diagnostic matrix for common bench failures:

Symptom on Scope/Meter Probable Physical Cause Visual / Bench Inspection
Output pinned to VCC or GND Op-amp damaged by ESD or GPIO overvoltage No visual damage. Measure pin 2 (inverting) to pin 3 (non-inverting); if >10mV offset with no input, the silicon is fried.
Output drifts upward over 30 seconds Thermal drift in feedback or MSB resistor Touch the resistor body. If it's hot, you are exceeding the 1/4W power rating. Check for darkened epoxy or a burnt smell.
Noisy, fuzzy analog output Carbon composition resistors or cold solder joints Inspect solder joints under 10x loupe. A cold joint looks dull and crystalline instead of shiny and concave. Carbon comp resistors exhibit inherent 'current noise'.
Missing codes at lower steps only GPIO pin drive strength limits / wiring resistance Breadboard contact resistance (often 0.5Ω to 2Ω) adds to low-value LSB resistors. Move to soldered perfboard or use higher base impedance (e.g., 100k base).

For deeper theoretical background on DAC architectures and why binary weighted designs struggle with high bit-counts compared to R-2R or Delta-Sigma topologies, the Analog Devices Data Converter DAC Architectures guide provides excellent silicon-level context. Additionally, the All About Circuits digital textbook chapter on DACs offers great schematic breakdowns for breadboarding these exact networks.

Building a binary weighted resistor DAC is an exercise in passive component discipline. The microcontroller simply provides the logic; the resistors define the reality. Stick to 1% metal film or matched networks, respect the power ratings, and your analog output will be as clean as your digital logic.