Removing DC offset

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

  1. Rajinder

    Rajinder

    Joined:
    Jan 30, 2016
    Messages:
    313
    Likes Received:
    6
    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
     
    Rajinder, Mar 12, 2018
    #1
    1. Advertisements

  2. Rajinder

    AnalogKid

    Joined:
    Jun 10, 2015
    Messages:
    2,196
    Likes Received:
    619
    Location:
    Ohio - GMT-5
    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
     
    AnalogKid, Mar 12, 2018
    #2
    1. Advertisements

  3. Rajinder

    Rajinder

    Joined:
    Jan 30, 2016
    Messages:
    313
    Likes Received:
    6
    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
     
    Rajinder, Mar 12, 2018
    #3
  4. Rajinder

    AnalogKid

    Joined:
    Jun 10, 2015
    Messages:
    2,196
    Likes Received:
    619
    Location:
    Ohio - GMT-5
    Nowhere do you say what the peak-to-peak amplitude of the attenuated pulse is (sitting on the 2 V pedestal).

    ak
     
    AnalogKid, Mar 13, 2018
    #4
  5. Rajinder

    Rajinder

    Joined:
    Jan 30, 2016
    Messages:
    313
    Likes Received:
    6
    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.
     
    Rajinder, Mar 13, 2018
    #5
  6. Rajinder

    WHONOES

    Joined:
    May 20, 2017
    Messages:
    554
    Likes Received:
    104
    Location:
    Oxfordshire
    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?
     
    WHONOES, Mar 13, 2018
    #6
  7. Rajinder

    hevans1944 Hop - AC8NS

    Joined:
    Jun 21, 2012
    Messages:
    3,821
    Likes Received:
    1,838
    Location:
    Venice, Florida, USA
    Where is the two volt offset coming from?
     
    hevans1944, Mar 13, 2018
    #7
  8. Rajinder

    Rajinder

    Joined:
    Jan 30, 2016
    Messages:
    313
    Likes Received:
    6
    I thought tbe offset was due to my voltage divider. Not sure though.
     
    Rajinder, Mar 13, 2018
    #8
  9. Rajinder

    WHONOES

    Joined:
    May 20, 2017
    Messages:
    554
    Likes Received:
    104
    Location:
    Oxfordshire
    Can't see why a divider would introduce an offset unless the tail is not at ground.
     
    WHONOES, Mar 13, 2018
    #9
  10. Rajinder

    hevans1944 Hop - AC8NS

    Joined:
    Jun 21, 2012
    Messages:
    3,821
    Likes Received:
    1,838
    Location:
    Venice, Florida, USA
    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.
     
    hevans1944, Mar 13, 2018
    #10
    1. Advertisements

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.