Correcting AC Offset

Thread Starter

Jimmy7

Joined Feb 8, 2012
8
Hello All.

I wonder if anyone would mind helping me with a problem I have encountered.

I have used an Arduino to generate a DDS signal, everything on the Arduino side works brilliantly, however the output of the Arduino can only ever be between 0-5v (+ve). As I wish to use the signal for audio this is a bit of a problem for speakers etc.

The way I see it, I have two options, either use a voltage divider on the supply to fake a central ground. (ie make ground 2.5v).. And I'm also not sure this would be compatible with speakers either?

Or use some RC circuit to normalise the circuit. The problem I have with this, is that the signal could be anything between 30-6000hz making it hard not to cause filtering issues. I have also noticed a latency issue with RC techniques.


Any help would be greatly appreciated!
Thanks, James
 

studiot

Joined Nov 9, 2007
4,998
Outputting through 20 to 100 microfarads in series with a 1k resistor should remove your DC offset.

Note the offset is DC not AC.
 

to3metalcan

Joined Jul 20, 2014
260
Outputting through 20 to 100 microfarads in series with a 1k resistor should remove your DC offset.
Jimmy7, capacitive coupling automatically puts the signal at +/- 2.5V if the speaker's other terminal is at ground.

studiot, is the 1k resistor there because the output of the Arduino can't drive an 8-ohm load on its own? Because by my math, for 30hz straight into 8 ohms, you would need about 1000uF at the output. With the 1K, it seems like he'd be getting less than a milliwatt out of the speaker.
 

studiot

Joined Nov 9, 2007
4,998
A capacitive reactance of 100Ω at 30hz comes out at 17μF.

That is about 1/10 of 1k so most of the signal will appear across the 1k.

I don't know enough about the arduino to know what it's drive capacity is.

As you say, possible solutions (if there is greater drive capacity) would be to use a greate value capacitance.

Alternatively a higher impedance speaker, a booster amp or a transformer could be employed.
 

Thread Starter

Jimmy7

Joined Feb 8, 2012
8
Thanks for the replies everyone.

Currently, yes the speaker is effectively connected straight to the Arduino. However for this reason I brought a cheap 0.5w speaker, so I don't really care if it gets damaged (and it is an 8ohm speaker).

Currently I am just experimenting with audio signals as it's something I have no experience of. Amplifying/filtering that sort of thing.

Ideally, I want to reduce signal down to 'line' voltage range (which isn't a problem) and centered etc.


Thanks again!
 

to3metalcan

Joined Jul 20, 2014
260
Jimmy, I don't think the concern is about the speaker. If the port can't support the necessary power, it can eventually damage the Arduino.
 

studiot

Joined Nov 9, 2007
4,998
You can construct a very simple one transistor buffer that should do the trick.

Take the supply from the +5volts not from the input supply to your regulator.

If you use the 9 or 12 volt supply from before the regulator double the resistors to the nearest preferred values.
 

Attachments

Top