Ground Embedded KO Subscribe

Notes / Electronic Circuits

ADC and DAC circuits: analog to numbers, numbers to analog

Resolution, reference voltage, sampling time, input RC filter. The circuit-side causes to check when an ADC value is not what you expect.

GROUND EMBEDDED · NOTEElectronic Circuits 11ADC and DAC circuitsVCC 3.3V10kΩButtonMCUGPIOHIGH when released

Resolution and reference voltage

A 12-bit ADC divides the reference voltage into 4096 steps. With a 3.3 V reference, one step (1 LSB) is about 0.8 mV.

voltage = ADC value / 4095 × Vref

If the reference is 3.25 V and not 3.30 V, every measurement is off by 1.5%. Precise measurement uses a separate voltage reference IC.

Sampling time and source impedance

Inside the ADC is a small sampling capacitor that charges to the input voltage during the set sampling time. If the resistance on the input side is high, it does not charge fully and the value comes out low.

  • Lengthen the sampling time, or
  • add a capacitor (a few nF to 100 nF) at the input as a charge reservoir, or
  • drive it with an op-amp buffer.
3D labRun what you have read so far→

Input RC filter

Sensor outputResistor RCapacitor CADC input pin
In front of the ADC input. The resistor and capacitor cut fast noise and supply the charge at the sampling instant.

A resistor and capacitor filter high-frequency noise, and the capacitor also supplies charge at the sampling instant. Set the cut-off above the signal you want to measure and below half the sampling frequency.

DAC

Turns a number into a voltage. Without a built-in DAC, PWM with an RC low-pass filter is sometimes used as a simple DAC. Choose the RC values by weighing output ripple against response speed.

3D LABADC Sampling and Resolution SimulationRun what this note explains and watch it respond.Open the lab →FREE PDFGet the 3 free ebooksIf you want to keep reading this topic as one book: BLDC motor control, serial communication and sensors at book length. PDFs are in Korean.Get them free →