Correcting AC Offset

Discussion in 'General Electronics Chat' started by Jimmy7, Aug 5, 2014.

  1. Jimmy7

    Thread Starter New Member

    Feb 8, 2012
    8
    0
    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
     
  2. Jimmy7

    Thread Starter New Member

    Feb 8, 2012
    8
    0
    Sorry, to help illustrate my problem I have attached a picture.

    [​IMG]
     
  3. studiot

    AAC Fanatic!

    Nov 9, 2007
    5,005
    513
    Outputting through 20 to 100 microfarads in series with a 1k resistor should remove your DC offset.

    Note the offset is DC not AC.
     
  4. to3metalcan

    Member

    Jul 20, 2014
    228
    23
    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.
     
  5. studiot

    AAC Fanatic!

    Nov 9, 2007
    5,005
    513
    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.
     
  6. MikeML

    AAC Fanatic!

    Oct 2, 2009
    5,450
    1,066
    You aren't trying to drive a 4Ω or 8Ω speaker directly out of an Arduino port pin, are you????
     
    to3metalcan likes this.
  7. to3metalcan

    Member

    Jul 20, 2014
    228
    23
    Who, us??? :rolleyes:
     
  8. Jimmy7

    Thread Starter New Member

    Feb 8, 2012
    8
    0
    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!
     
  9. to3metalcan

    Member

    Jul 20, 2014
    228
    23
    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.
     
  10. Jimmy7

    Thread Starter New Member

    Feb 8, 2012
    8
    0
    Thanks for the tip. I suppose the damage is already done. We will see I suppose.
     
  11. studiot

    AAC Fanatic!

    Nov 9, 2007
    5,005
    513
    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.
     
Loading...