Removing DC Offset

Thread Starter

chrisw1990

Joined Oct 22, 2011
551
i will try to keep this brief..
i am using a hall sensor, analogue output, reacts to both north and south poles of the magnet, and therefore, in its "idle" state, the output voltage is 1.65V, i need to remove this, and amplify the voltage.
I.E.:
I am only using one pole of the magnet with the hall sensor, therefore, the voltage will always be between 1.65 - 3.3V (ish) what i want to do, is take that 1.65V signal, remove the dc bias, and amplify it so that the signal i get out is between 0 and 3.3V.
hope this makes sense
ask if it doesnt!
 

hgmjr

Joined Jan 28, 2005
9,027
Do you have a preliminary schematic yet? If so, post it so that we can comment on how it may be improved.

hgmjr
 

Thread Starter

chrisw1990

Joined Oct 22, 2011
551
hi, iv just tried the circuit from post 3 with my parameters, jpg attached, it doesnt increase the signal to 0-3.3, maybe iv done something wrong?
 

Attachments

SgtWookie

Joined Jul 17, 2007
22,230
Ahh, OK - you're using just a 3.3v supply, and the opamp you used is not a rail-to-rail opamp.

What voltages do you have available?
 

SgtWookie

Joined Jul 17, 2007
22,230
I'm afraid you're going to need a negative supply to get the output that you want.

You don't see it on the schematic, but internal to the opamp, the inverting input converts the -in to a negative voltage - but if you don't have a negative supply, you wind up with the saturation instead.

[eta]
gee, it just doesn't work very well with a 3.3v supply for some reason. If I change it to 5v and add a -2v supply, the waveforms clean right up.
 
Last edited:

Thread Starter

chrisw1990

Joined Oct 22, 2011
551
lol i know its a problem, been agonising over it all day! iv got that circuit (last posted image) that works, ish, converts it to 0-3.3, it just saturates at the top which is no good:(
it has to be 3.3V as it interfaces with my other project which is all at 3.3V
 

praondevou

Joined Jul 9, 2011
2,942
I did almost exactly the same thing a few weeks ago with the ACS758 which gives me on offset of 2.5V at the output at zero current. I found it easier to create a negative voltage (as Sgt said) from an LT1054 so I could get the output shifted to truly 0V. Even with a rail to rail opamp I would get a non-linearity error if the measured current is near zero at the output...

In case you don't want a neg voltage:
Does this output go to a uC? If so, why not shift the 1.65V down to 0.3V and amplify the signal to get at most 3V or something like this? You will be able to make the appropriate calulations in the uC and don't need to bother about non-linear opamp behaviour near rail voltages...
 
Last edited:

Thread Starter

chrisw1990

Joined Oct 22, 2011
551
i hear what your saying, the purpose for this is a linear position sensor, feeding into a uP system, i am trying to limit the power supplies on the system as it has 4 already. the sensors run externally, connecting to +3.3V and GND, with a third signal wire. just trying to get round this offset voltage.
iv been messing around in ltspice and i can almost get the device to work, but the top of the wave gets cut off if i want full voltage inflection its a ball breaker, tried to find a different sensor to do it with but most if not all do it this way.
 

Thread Starter

chrisw1990

Joined Oct 22, 2011
551
can someone just look at this? see if im not going barmy and that it has actually done it? it misses obvious bits like base resistor and theres a potential divider from something i was looking at but... its looking hopeful...
 

Attachments

praondevou

Joined Jul 9, 2011
2,942
You can also have a look at the Hall sensors from Micronas, I used the Hal815 lately in my company, but it's a programmable, also don't know it's supply voltage range. They have lot's of options too, with fixed output ranges...

The LT1366 output still doesn't go to rail voltages, it's several tens of mV avay from it, depending on your load. If you can live with that....
I can't really see an input curve on your diagram that has the desired corresponding output curve. but I'm on my phone, so I can't really check it :)
 
Last edited:

Thread Starter

chrisw1990

Joined Oct 22, 2011
551
not sure if you can see it, but the red sine wave is the input voltage i.e. from the hall sensor,
the blue is the output from the collector of the npn tranny,
the white sine wave is the output from the amplifier.
the key thing is, while its mV away from the rails, it doesnt saturate at all, and it (in theory) tracks the input voltage nicely too.
by the way, i am using sine wave signals here just to prove it tracks the input voltage accurately. in real life obviously its a dc output and dc signal.
 

praondevou

Joined Jul 9, 2011
2,942
the output will eventually saturate before rail voltage if u increase the amplification. As long as u stay inside the max output voltage specs of the opamp it will work.

Somebody may correct me if I'm wrong but I don't think you can get to truly supply voltage level (I mean zero voltage difference), if that's what you wanted. right you are not. that's what I meant in my other post: why not specify the sensor output for less voltage so the opamps output stays inside it's max output voltage swing?
With what you have on your graph the uC still has to account for the error, your amplification of the input signal is less than 2.
 

Thread Starter

chrisw1990

Joined Oct 22, 2011
551
yeh, the uP can account for the error, but now at least, theres a greater resolution of the signal.
can you confirm/verify something for me? the output of the transistor, shown in the blue, it doesnt quite make sense how it would be down to zero, as surely the input signal is 1.05V over the base conduction voltage? make sense?
 

Adjuster

Joined Dec 26, 2010
2,148
yeh, the uP can account for the error, but now at least, theres a greater resolution of the signal.
can you confirm/verify something for me? the output of the transistor, shown in the blue, it doesnt quite make sense how it would be down to zero, as surely the input signal is 1.05V over the base conduction voltage? make sense?
You are putting VOLTS across a transistor base-emitter! In real life, the poor little thing would have gone up in smoke. If you measure the base current it will probably be in the Amperes. What you are seeing is the collector voltage varying due to internal resistances in the transistor, not true amplifier action.

The fact that the collector waveform is a reasonable sine wave is also a good clue: an active common-emitter transistor transistor cannot handle base-emitter swings that big without clipping.
 

Thread Starter

chrisw1990

Joined Oct 22, 2011
551
i know, i said earlier when i posted it, its not perfect, misses things like a base resistor..
i just wasnt sure as obviously the dc offset of the input voltage would mean the transistor would always be on, so just concerned that the simulation hasn't noticed if you like, that its offset?
sounds stupid i know, but can you at least see what i mean?
 

Adjuster

Joined Dec 26, 2010
2,148
i know, i said earlier when i posted it, its not perfect, misses things like a base resistor..
i just wasnt sure as obviously the dc offset of the input voltage would mean the transistor would always be on, so just concerned that the simulation hasn't noticed if you like, that its offset?
sounds stupid i know, but can you at least see what i mean?
I should be in bed but busy tomorrow, er, later today, but I think it's best you see this.

The simulator has not "failed to notice" anything. It is responding in a predictable way to your input. The transistor is more than on, it's in flaming meltdown!

Depending on temperature and the exact model of transistor in question, the transistor will be about as turned on as it ever can be when a certain value of base -emitter voltage is reached. I would guess for a small transistor this might be about 0.8V. Higher base emitter voltages are only possible if the base current is excessive, causing internal voltage drops to arise in the transistor so that the collector voltage is dragged back up again. I'll try a little simulation on that.
 
Top