I followed a tutorial on 8-bic DACs using an R-2R resistor ladder. I am outputting a sine-wave using data from 0 to 255 on pins 0-7. This goes through the pins into the R-2R DAC producing an analogue signal.

Now I would like to convert this signal into something that can be used by a piezo speaker. I understand (perhaps incorrectly) that the speaker cannot play this signal because it needs an AC signal, whereas the DAC output is 0 to +5V.

I've read that now I need to "bias" the DAC to electrically subtract 2.5v from the output to make it -2.5 to +2.5 volts. This signal should then be able to be fed into the speaker. Is this correct? How do I bias this signal, with a capacitor in series?

  • \$\begingroup\$ Not detracting from Gerben's answer below, but if you were to ask this question in SE EE instead, you might get a more definitive resister / capacitor combination or even a different answer. \$\endgroup\$
    – Madivad
    Jun 29, 2014 at 9:05

1 Answer 1


You need to AC-Couple the signal. Just put a capacitor in series.

  • \$\begingroup\$ Any sort of capacitor ? \$\endgroup\$
    – Kingsley
    Jun 25, 2014 at 20:19
  • \$\begingroup\$ I'm not sure. I'd avoid polarized electrolytic caps. Just try some values, or do a google search. \$\endgroup\$
    – Gerben
    Jun 26, 2014 at 7:54
  • 3
    \$\begingroup\$ It depends on how low of a frequency you want to be able to reproduce, note that the circuit above is a high-pass filter, so low frequencies will be attenuated (which is what you want - you are trying to attenuate DC and bring the zero signal level up to the half-way point). The R part depends on what values you use for your R2R ladder, since by design the R2R ladder has an output impedance of just R Ohms. The cutoff is 1/(2*piRC), so you can figure out how big the C needs to be for a given acceptable cutoff frequency. \$\endgroup\$
    – Zuofu
    Jun 29, 2014 at 14:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.