Electronic – Summarising from a group of sensors

magnetoperational-amplifiersensorsummer

I have a group of sensors the nominally output 2.5V but if they come in contact with a magnet they'll increase slightly or decrease slightly based on the polarity (north/south pole).

These sensors have a decent range but they're pretty narrow in scope, so as a result I've aligned a number of them side by side.

My issue now is that I have 6 of them, and I don't want to spend 6 analogue in pins if I can help it. Ideally I'd like to build a circuit that ultimately reports the greatest difference from the nominal 2.5V between all 6 of the sensors.

For example, let's say we begin in a neutral environment — no magnets are present. All sensors will read 2.5V and none of them really "win" the output pin. However, as I bring a magnet closer to the line of sensors, the one closest will read let's say 2.9V, and it's neighbour will read 2.7V. Between these two the 2.9V will "win" the output pin because it has the greatest difference from the nominal 2.5V. So I'd like to see either 2.9V on the output pin of this circuit, or 0.4V (the difference). Doesn't really matter which since the rest can be handled by software.

I'm thinking a summer op-amp might be the right answer here but I was wondering if you guys have any other suggestions. Thanks!

EDIT: To clarify, I don't care which sensor "wins" I just want to know if ANY sensors change from 2.5V, what's the greatest change?

EDIT2: There's only one magnet being sensed here so if one sensor reads negative then they all will. No need to account for some being +0.4V while another is -0.4v.

Best Answer

Depending on how you want to process the data and the driving current you have available, you can use a simple non-linearity to provide you with a maximum voltage. All you need is an element that behaves non-linearly with respect to the voltage across it.

Assuming your sensor outputs are low impedance, the simplest version of this would be:

schematic

simulate this circuit – Schematic created using CircuitLab

Vmax will be approximately equal to the largest voltage in all the sensors minus a diode drop. Likewise Vmin will be approximately equal to the lowest voltage in all the sensors plus a diode drop.

As the voltage-current dependence of a diode is exponential Vmax and Vmin will be close to the average voltage when all the sensors are about the same, but will exponentially deviate from this. As there is roughly a factor of 3 in current every 30mV of deviation, if the outputs are more than ~100mV apart, the contribution of the lower/higher voltage outputs would be negligible.

You can think of the circuit as a multi-input voltage divider (average circuit) but the non-linear diodes take the place of the resistors. If all the voltages are close to being the same (and the diodes are perfectly matched) the output is simply the average of the inputs (minus a diode drop, of course). But, the further the average deviates from any specific input the diode will exponentially reduce (or increase) its current leading whichever diode has the largest voltage across it to provide the most current to the resistor. At about 100mV differential the effect of all other diodes on the output voltage will be less than 1/10th of the effect of the dominant input.

Note that this diode structure is what you get with most interface clamping diodes. So this could be implemented with one IC and a couple resistors.