Skip to content

ESP32 DAC Output Not Producing Analog Voltage

DodaTech Updated 2026-06-26 1 min read

In this tutorial, you'll learn about ESP32 DAC Output Not Producing Analog Voltage. We cover key concepts, practical examples, and best practices.

The Problem

ESP32 DAC pin produces 0V or constant voltage instead of variable analog output.

Quick Fix

Wrong

dacWrite(25, 128);  // GPIO 25: expected 1.65V output
Pin 25 outputs 0V or stays at 3.3V regardless of dacWrite value.
dacWrite(25, 128);  // 8-bit value: 128 = 50% of 3.3V = 1.65V
int val = analogReadMilliVolts(34);  // Verify with ADC
Serial.printf("DAC output: %dmV\n", val);
DAC output: 1650mV
(Measured 1.65V on GPIO 25 with 128 value)

Prevention

DAC is available only on GPIO 25 and 26. Use dacWrite(value) with 0-255 range. Output voltage = value * 3.3 / 255. Do not use DAC pins for other purposes. Disable ADC on the same pin if active.

DodaTech engineers apply these same patterns across Doda Browser, DodaZIP, and Durga Antivirus Pro for production IoT reliability.

FAQ

### Which GPIOs support DAC on ESP32?

Only GPIO 25 (DAC1) and GPIO 26 (DAC2). Other pins do not support analog output.

What is the DAC resolution?

ESP32 DAC is 8-bit (0-255 levels). Output voltage range is 0V to 3.3V. Resolution is about 13 mV per step.

Can I use DAC and ADC simultaneously?

Yes, but DAC output on GPIO 25 conflicts with ADC2 channel 8. Disable ADC2 when using DAC on GPIO 25.

Built by the developers of DodaTech

Doda Browser, DodaZIP & Durga Antivirus Pro