Circuit for raising audio signal to 1/2 Vcc - Page 1
Forum section: electronics / beginners

author: soFPG
author_rank: Frequent Contributor
timestamp: May 22, 2021, 08:53:34 pm
content: Does somebody mind explaining to me a circuit which raises an audio signal to 0.5Vcc such that it can be samples with an ADC of a µC (e.g. no negative voltage) with optimal dynamic range?Furthermore, how can I design a circuit which drops the output of a DAC back to audio level (e.g. AC with negative voltages)?

author: ledtester
author_rank: Super Contributor
timestamp: May 22, 2021, 09:29:54 pm
content: A capacitor to block DC and a bias to the new DC-level is all that is needed.For instance, in this example:https://www.eevblog.com/forum/beginners/measuring-audio-input-on-microcontroller-adc/msg478577/#msg478577the resistive divider sets the new DC-level to 1/2 Vcc. The diodes are there to protect the ADC input.QuoteOn page 16 in this datasheethttps://www.ti.com/lit/ds/symlink/tpa6211a1.pdfshows the typical situation:The capacitor C_C removes the current DC-offset and R_L sets the new bias to 0V. R_L could be a speaker, for instance.That section in the datasheet also talks about how to select the right capacitor value for your application.

author: David Hess
author_rank: Super Contributor
timestamp: May 23, 2021, 04:37:12 am
content: There are other solutions for special requirements, but a capacitor and resistor, or resistor divider to produce Vcc/2, like ledtester suggests, is usually the way to go, especially in audio applications.

author: soFPG
author_rank: Frequent Contributor
timestamp: May 23, 2021, 11:09:03 am
content: QuoteBut I can't connect a speaker to GND - can I?I guess GND should be replaced with a negative voltage?

author: SilverSolder
author_rank: Super Contributor
timestamp: May 23, 2021, 11:20:30 am
content: Quote from: soFPG on May 23, 2021, 11:09:03 amYes, you connect one side of the speaker to Gnd. The capacitor essentially subtracts the DC voltage out of the signal, so all the speaker "sees" is an AC signal (swinging around zero volts) on one of its terminals, and ground on its other one - which then causes an AC current to flow through it, which is just what you want!

author: soFPG
author_rank: Frequent Contributor
timestamp: May 23, 2021, 02:08:21 pm
content: For whatever reason I thought I have to have a negative voltage on the pin which would have been GND

author: SilverSolder
author_rank: Super Contributor
timestamp: May 23, 2021, 11:50:36 pm
content: Quote from: soFPG on May 23, 2021, 02:08:21 pmThat's one of the differences between AC and DC electricity. With DC, your thinking is correct, the current flows from plus to minus. With an AC voltage driving a speaker, it is better to think of it as the current flowing from "hot" (the output of the amp) to "neutral" (ground). Half of the sine wave is positive, the other half is negative with respect to ground - the actual current flows back and forth to neutral (ground).

author: soFPG
author_rank: Frequent Contributor
timestamp: May 30, 2021, 08:18:38 am
content: Thank you!I have another question: How can I make sure, that my amplifier circuit doesn't fry the audio source (e.g. my smartphone or an MP3-player) by drawing too much current or doing whatever?Is there some kind of standard protection circuit?A diode for reverse-current protection obviously wouldn't work (I guess?)

author: tooki
author_rank: Super Contributor
timestamp: May 30, 2021, 09:46:48 am
content: Use an op-amp buffer. Then the source only sees the very high impedance of the op-amp.

author: soFPG
author_rank: Frequent Contributor
timestamp: May 30, 2021, 11:50:08 am
content: Sorry that I have to ask this again but wouldn't an op-amp with its VIN- pin connected to GND remove all negative voltage levels from the audio? If so - does this mean I have to have a negative supply voltage for the buffer?Also - is the OPA required to have any special features? I guess THD shouldn't be too high?

author: SilverSolder
author_rank: Super Contributor
timestamp: May 30, 2021, 03:07:57 pm
content: Quote from: soFPG on May 30, 2021, 08:18:38 amUsually, the source resistance of an audio output (i.e. not speaker output obviously) is high enough that they can withstand a direct short pretty much forever. They are also usually AC coupled through a capacitor, so fairly immune to DC voltages.Your mileage and equipment may vary!

author: soFPG
author_rank: Frequent Contributor
timestamp: June 03, 2021, 07:34:17 pm
content: Can someone explain to me what the difference is if I connect my audio signal to IN+ or IN- of this audio amplifier?Weirdly enough, the schematic of my DAC uses the "plus" input of the amplifier:Does this even matter if I use single-ended output with DC coupling capacitor?

author: SilverSolder
author_rank: Super Contributor
timestamp: June 03, 2021, 07:37:47 pm
content: Google the following two phrases, and a lot of things will fall in place for you:Inverting Op Amp Circuit TutorialNon-Inverting Op Amp Circuit Tutorial

author: soFPG
author_rank: Frequent Contributor
timestamp: June 03, 2021, 07:48:18 pm
content: So does this mean Vo1 is the inverted input signal and Vo2 is the double-inverted (or back to normal)?

author: SilverSolder
author_rank: Super Contributor
timestamp: June 03, 2021, 08:32:54 pm
content: Quote from: soFPG on June 03, 2021, 07:48:18 pmYes - the circuit is an example of a Bridged amplifier, where two signals drive the speaker terminals in opposite phase. (So when Vo1 goes positive, Vo2 goes negative)The reason for doing that, is that it allows you to use the entire supply voltage (say, 12V battery in a car) to create a sine wave at the speaker (the speaker "sees" a signal that goes from +12V to -12V across its terminals).If you didn't have a bridged amplifier, the speaker would have ground on one terminal, and the other would "see" 0V to +12V (the sine wave would swing around 6V), so you could only get half the battery voltage to drive the speaker. Makes sense?

author: soFPG
author_rank: Frequent Contributor
timestamp: June 04, 2021, 06:32:07 am
content: Okay thank you. I almost would have connected Vo2 to GND because I thought I would need negative supply voltage to get the differential output.Nevertheless I am still confused by the schematic of the DAC.So I guess instead of connecting the DAC output to +IN as shown in the 2nd image I connect it to -IN?

author: gcewing
author_rank: Regular Contributor
timestamp: June 04, 2021, 07:27:45 am
content: The DAC circuit is using the op amp as a unity-gain non-inverting amplifier, also known as a voltage follower. This configuration is very commonly used as a buffer, because it doesn't need any extra components and has a very high input impedance.The two op-amps in the audio amplifier are configured as inverting amplifiers. The second stage needs to be inverting to give the opposite-phase outputs, but the first one could have been either inverting or non-inverting. For whatever reason, the designer chose to make it inverting.For audio, it hardly matters if the signal gets inverted somewhere along the way, so don't worry about it -- just connect the output of the DAC to the point marked Audio Input.

author: soFPG
author_rank: Frequent Contributor
timestamp: June 06, 2021, 04:16:56 pm
content: Thank you!QuoteI guess we want high impedance to reduce current flow to a minimum?