Removing DC Offset

Thread Starter

Gareth_71

Joined Dec 1, 2017
15
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

BR-549

Joined Sep 22, 2013
4,928
Do you know what a voltage divider is?

Thread Starter

Gareth_71

Joined Dec 1, 2017
15
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.

BR-549

Joined Sep 22, 2013
4,928
Pardon me. You want to remove offset. What is your signal feeding after you remove offset?
Please show a circuit.

BR-549

Joined Sep 22, 2013
4,928
A diode can eliminate either the positive or negative side of the signal.

AlbertHall

Joined Jun 4, 2014
12,231
A diode can eliminate either the positive or negative side of the signal.
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.

Thread Starter

Gareth_71

Joined Dec 1, 2017
15
Hi Albert.

That is exactly what I am experiencing.

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

DickCappels

Joined Aug 21, 2008
9,855

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.

AnalogKid

Joined Aug 1, 2013
10,299
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

Thread Starter

Gareth_71

Joined Dec 1, 2017
15
Hi

Sorry the signal is always 0.5v

Source is a hall sensor and destination is whatever I want it to be.

BR-549

Joined Sep 22, 2013
4,928
Your destination will determine how "clean" or "exact" your signal needs to be.

DickCappels

Joined Aug 21, 2008
9,855
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?

crutschow

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

AnalogKid

Joined Aug 1, 2013
10,299
Sorry the signal is always 0.5v
Source is a hall sensor and destination is whatever I want it to be.
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

hobbyist

Joined Aug 10, 2008
892
I removed the circuit, so as to not bring confusion to the original thread requirements.

Last edited:

AnalogKid

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

ak

hobbyist

Joined Aug 10, 2008
892
I think the requirement is that the circuit work without adjustment while the DC offset varies between 11.5 V and 13 V.
In that case, my circuit (post #15) would not work for that then!

Circuit removed.

Last edited:
Thread Starter

Gareth_71

Joined Dec 1, 2017
15
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!

DickCappels

Joined Aug 21, 2008
9,855
If the signal is as you described the active clamp will work.

AnalogKid

Joined Aug 1, 2013
10,299
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.!
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

Similar threads