Removing DC Offset

Discussion in 'Analog & Mixed-Signal Design' started by Gareth_71, Dec 1, 2017.

  1. Gareth_71

    Thread Starter New Member

    Dec 1, 2017
    15
    2
    Hi All

    I am new here, so be gentle :)

    I am currently struggling with what should be a simple analog problem:

    Need to convert a square wave signal to a 0v based square wave.
    I.E. The signal has an amplitude of 0.5v, but a varying offset from about 11.5v to about 13v.
    How do I reject the offset?

    I have tried to use a DC block with a cap but end up getting a negative voltage component which is not desirable (the entire circuit is single supply).

    Also tried many other solutions to no avail, including using a high voltage instrumentation amp (INA126).
    As you may be able to tell, my skills are digital, not analog!

    Gareth
     
  2. BR-549

    Distinguished Member

    Sep 22, 2013
    3,761
    959
    Do you know what a voltage divider is?
     
  3. Gareth_71

    Thread Starter New Member

    Dec 1, 2017
    15
    2
    Yes I do! and it works, the trouble is that it also divides the signal and with the varying offset it makes it very difficult to work with.
     
  4. BR-549

    Distinguished Member

    Sep 22, 2013
    3,761
    959
    Pardon me. You want to remove offset. What is your signal feeding after you remove offset?
    Please show a circuit.
     
  5. BR-549

    Distinguished Member

    Sep 22, 2013
    3,761
    959
    A diode can eliminate either the positive or negative side of the signal.
     
  6. AlbertHall

    AAC Fanatic!

    Jun 4, 2014
    5,767
    1,359
    It can but not completely. Even with a schottky diode there will still be a couple of hundred millivolts beyond 0V in whichever direction is undesirable.

    I can't think of a simple way. A possible way would be a buffer amp, a precision rectifier, and an integrator feeding the reference voltage of the buffer amp.
     
  7. Gareth_71

    Thread Starter New Member

    Dec 1, 2017
    15
    2
    Hi Albert.

    That is exactly what I am experiencing.

    The signal is feeding my circuit which can be a voltage follower etc.
     
  8. DickCappels

    Moderator

    Aug 21, 2008
    4,683
    1,383
    upload_2017-12-2_2-55-16.png

    You can use this circuit, but reverse the poliarity the diode and voltage source. Make the voltage source equal to one diode drop, and that's best done with a biased diode.

    You can get even better performance if you replace the diode with an NPN transistor (2N3904, for example) with the emitter grounded and the collector connected to the capacitor. Turn on the transistor on the negative-going edge of the pulse to clamp the negative portion to ground.
     
    Gareth_71 likes this.
  9. AnalogKid

    AAC Fanatic!

    Aug 1, 2013
    6,849
    1,959
    How stable is the 0.5 V signal's peak-to-peak amplitude? If the offset varies from 11.5 V to 13 V, but the signal is a rock-solid 0.5 Vpp, that is something to work with.

    Another option is to AC couple the signal into a comparator to regenerate it with a 0 V negative peak value. You will lose any amplitude variations in the original signal, but keep the frequency / pulse widths (duty cycle).

    8 posts and still no information about the source of the input signal or the destination and use of the shifted signal.

    ak
     
  10. Gareth_71

    Thread Starter New Member

    Dec 1, 2017
    15
    2
    Hi

    Sorry the signal is always 0.5v

    Source is a hall sensor and destination is whatever I want it to be.
     
  11. BR-549

    Distinguished Member

    Sep 22, 2013
    3,761
    959
    Your destination will determine how "clean" or "exact" your signal needs to be.
     
  12. DickCappels

    Moderator

    Aug 21, 2008
    4,683
    1,383
    Do you care very much about the amplitude or only the timing. If only the timing it can be as simple as one transistor.
    Do you care about the width or only when the pulse occurs?
     
  13. crutschow

    Expert

    Mar 14, 2008
    18,816
    5,251
    Here's a single-supply op amp, Av=+1 circuit that can provide an arbitrary positive DC offset to a DC coupled signal.

    upload_2017-12-1_13-52-55.png
     
  14. AnalogKid

    AAC Fanatic!

    Aug 1, 2013
    6,849
    1,959
    1/2 of an LM393 will translate your signal to a ground-based square wave of any amplitude from 1 V to 36 V. The low output voltage is spec'd at 0.25 V typ, but I've seen outputs down to 0.1 V.

    ak
     
    Gareth_71 likes this.
  15. hobbyist

    Distinguished Member

    Aug 10, 2008
    884
    85
    I removed the circuit, so as to not bring confusion to the original thread requirements.
     
    Last edited: Dec 3, 2017
  16. AnalogKid

    AAC Fanatic!

    Aug 1, 2013
    6,849
    1,959
    I think the requirement is that the circuit work without adjustment while the DC offset varies between 11.5 V and 13 V.

    ak
     
  17. hobbyist

    Distinguished Member

    Aug 10, 2008
    884
    85
    In that case, my circuit (post #15) would not work for that then!

    Circuit removed.
     
    Last edited: Dec 3, 2017
  18. Gareth_71

    Thread Starter New Member

    Dec 1, 2017
    15
    2
    Hi All

    First of all, let me apologise for the short, late and non-detailed replies - I have been rather busy to say the least and just popped quick replies when I could.

    Second, thank you all so much for your replies - it has been very helpful.

    Onto the circuit:

    I am tasked with reading a signal from a sensor to a machine. The sensor is already hooked up to the machine so I do not know what the circuits look like, nor will I be able to find out. All I do know is that I have two wires: one at 0v and the other (the signal) is as described.

    The output I am looking for is simply to record frequency with a micro.

    I have tried using a voltage follower to give me isolation from the signal and then driving:
    1. A zener based circuit but I cannot rely on a fixed voltage as the 'carrier' voltage varies a lot over time.
    2. Voltage divider into a comparator (in the micro) which works, but I end up dividing a 0.5v signal by 3 and the resultant voltage is susceptible to noise and the issue of the moving 'carrier' is still there although it can be tracked by an ADC and the comparator adjusted accordingly in real time. - not elegant and prone to failure.
    3. Differential Amplifier: This kind of works however my analog / OpAmp knowledge is very limited and I am sure that leaving the +and - of the OpAmp connected directly to the signal is not acceptable. The output is not great either.
    4. Using a DC block capacitor, again this works but the signal is offset to zero so now I have a positive and equally negative signal and in a single rail positive system I do not think that this is okay. I have tried using a diode etc however I think the signal is too small because all of the negative component is not removed.

    So now I will try some of the ideas above and the LM393 (on order). In what configuration should I use the 393?

    Thank you all again!
     
  19. DickCappels

    Moderator

    Aug 21, 2008
    4,683
    1,383
    If the signal is as you described the active clamp will work.
     
  20. AnalogKid

    AAC Fanatic!

    Aug 1, 2013
    6,849
    1,959
    I agree about the diode. If the square wave were 1 V tall, this would be a bit easier.

    I think #4 is the way to go. The LM393 front end, powered by a single positive voltage (5 V to 36 V) is designed specifically for this type of signal. It will end up acting as a diode with 0 V offset. I'll try to whip up a schematic later.

    ak
     
    Gareth_71 likes this.
Loading...