Connect with us

Removing DC offset

Discussion in 'Electronics Homework Help' started by Rajinder, Mar 12, 2018.

  1. Rajinder

    Rajinder

    330
    6
    Jan 30, 2016
    Hi
    I have a 9V pulse at 4KHz.
    This is slighty negative going to about 200mV.
    I need this fed into a PIC to detect edges.
    I used a diode to remove the negative oart of the signal. Then fed into a potential divider to divide by a factor of 3.
    However the output is a square wave sitting on a dc offset of 2V. How can i remive the dc offset please? Any ideas would be appreciated. Please see my sketch to explain the problem.
    Thanks in advance. 20180312_195304.jpg
     
  2. AnalogKid

    AnalogKid

    2,214
    624
    Jun 10, 2015
    The -200 mV level could be a scope misalignment. Even if not, it is not a large enough undershoot to cause problems with a PIC input. So I don't think you need the series diode.

    A text description doesn't convey enough information. Please post a schematic showing the signal source, attenuator, PIC (with pin numbers), and any other components. Pay particular attention to all power and ground connections.

    ak
     
  3. Rajinder

    Rajinder

    330
    6
    Jan 30, 2016
    Hi
    Ok thanks for the reply.
    The diode can be removed. This 9V pulse still needs to be reduced to a level so it doesn't damage the PIC A/D (AN10) line.
    It will be used to detect the edges of the signal. However the voltage divider has the square wave sitting on a 2V signal. This makes edge detection awkward.
    So can I remove the DC offset easily?
    Or can I do something with the 9V pulse to just detect the edges but have it at a level suitable for the PIC input.
    Best regards
    Raj
     
  4. AnalogKid

    AnalogKid

    2,214
    624
    Jun 10, 2015
    Nowhere do you say what the peak-to-peak amplitude of the attenuated pulse is (sitting on the 2 V pedestal).

    ak
     
  5. Rajinder

    Rajinder

    330
    6
    Jan 30, 2016
    Sorry the pk to pk amplitude of the square wave is around 0.9V
    I was thinking ti remove the voltage divider and have a RC high pass filter ie a differentiator circuit.
    Having the value of RC less than Time of pulses.
    Does that seem plausible?
    Thanks.
     
  6. WHONOES

    WHONOES

    564
    111
    May 20, 2017
    You could fairly easily offset the "offset" using an opamp.
    Can you give us a picture of a scope trace showing the signal and give it a ground reference using another scope trace if necessary?
     
  7. hevans1944

    hevans1944 Hop - AC8NS

    3,909
    1,867
    Jun 21, 2012
    Where is the two volt offset coming from?
     
  8. Rajinder

    Rajinder

    330
    6
    Jan 30, 2016
    I thought tbe offset was due to my voltage divider. Not sure though.
     
  9. WHONOES

    WHONOES

    564
    111
    May 20, 2017
    Can't see why a divider would introduce an offset unless the tail is not at ground.
     
  10. hevans1944

    hevans1944 Hop - AC8NS

    3,909
    1,867
    Jun 21, 2012
    With the "ground" lead of your oscilloscope connected to the bottom of the 10 kΩ resistor in your voltage divider, connect the oscilloscope probe tip to the cathode of the diode that is connected to the top of the 20 kΩ resistor in your voltage divider. You should see a square wave with a peak voltage of nine volts minus one diode forward-voltage drop, or about 8.3 V peak, assuming 0.7 V is dropped across the diode, which is typical for silicon diodes. The minimum value of the square wave should be 0 V, since the diode will block the minuscule 0.2 V negative swing you observe on the anode of the diode.

    Now move the oscilloscope probe to the junction of the 10 kΩ and 20 kΩ resistors. You should see one third the peak-to-peak amplitude observed on the diode cathode, or about 2.8 V peak-to-peak and no DC offset. IF you do see a DC offset, there is something wrong with the "ground" connection of the 10 kΩ resistor. Find and remedy this problem before attempting to proceed.
     
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.