4

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?

PeterJ
  • 17,131
  • 37
  • 56
  • 91
Kingsley
  • 143
  • 4
  • 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. – Madivad Jun 29 '14 at 09:05

1 Answers1

3

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

Gerben
  • 430
  • 2
  • 9
  • Any sort of capacitor ? –  Jun 25 '14 at 20:19
  • I'm not sure. I'd avoid polarized electrolytic caps. Just try some values, or do a google search. – Gerben Jun 26 '14 at 07:54
  • 3
    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*pi*R*C), so you can figure out how big the C needs to be for a given acceptable cutoff frequency. – Zuofu Jun 29 '14 at 14:09