# How do you compensate for a varying DC offset when using a wheatstone bridge?

## Background

I have a sensitive magnetic sensor that is packaged as a wheatstone bridge with a 20k device resistance. I am using it to measure the rotation of a magnet. It is possible to calibrate out the offset voltage by applying a voltage to Vref of the instrumentation amplifier when the offset is constant (like with a with a strain gauge). However, the offset of the magnetic sensor can vary depending on the orientation in the earths magnetic field. Here is an example with two sensors.

Green & Yellow = Sensor 1

Pink & Blue = Sensor 2

Here are the same two devices rotated by 90 degrees. The DC offset changes from 20-40mV. Also note sensor 1 has a difference of 27mV between differential pairs and sensor two has a difference of 9mv.

Here is a screenshot of the magnet rotating which produces a ~50mV sine wave

## Problem

I have built a circuit using the INA321, but when the offset gets too large the opamp rails and produces clipped output. Even when the output is not clipped, the large DC offset change in the output makes it hard to count zero crossings which is my end goal.

## Question

How can I compensate for the offset variance due to device differences and the earths magnetic field?

Using a high pass filter is not an option because I need to be able to measure very slow frequency. My power budget is also very limited so this needs to be done without the use of a microcontroller.

• You might be surprised at how low power a microcontroller can be. Your opamps are using 2mW, you can operate many microcontrollers at >20x less power Aug 16, 2023 at 17:53
• Also, a "DC offset change" isn't really "DC" if it keeps changing. If you want to do this passively, anything you do is basically going to be some sort of high pass filter, just with a longer time-scale. When you say "very slow frequency", how slow exactly? Aug 16, 2023 at 18:08
• Have you tried making the existing offset section (shown as U1) variable?
– Nedd
Aug 16, 2023 at 19:56
• @BeB00 I will be duty cycling whatever op-amps I end up using to reduce power. The INA321 uses 40μA per channel and I should be able to reduce that depending on my duty cycle frequency. Regarding the changing DC offset, it only changes when the device is moved or from part to part. It will be stationary when operating, but I need to account for the case where a user moves it from time to time. Aug 16, 2023 at 23:10
• @Nedd Yes, the simulation showing the clipping is with a Vref of 100mv. I can't go lower than that. Aug 16, 2023 at 23:14