3
\$\begingroup\$

For a circuit that I am designing I am going to measure DC current through a hall effect IC. The output voltage of this IC is small so I would like to amplify this with an OpAmp of some sort with a 3.3V power supply. However I think that OpAmps can be prone to an offset DC voltage and I also want to measure close to zero.

So what could do is add a negative supply of -5V to the Opamp instead of 0V. If I feed the output to an analog input of a microcontroller such as the STM32 Nucleo-32 or Arduino Nano, the voltage could theoretically be below zero.

Is it a problem to have a negative voltage on the analog input pin of such a microcontroller?

Or are there any other suggestions on how to do a precision amplification of the signal?

Thank you in advance :)

\$\endgroup\$
2
  • 1
    \$\begingroup\$ However I think that OpAmps can be prone to an offset DC voltage. Hm, citation needed. You don't use an opamp alone, but in an opamp configuration. For offset-critical measurements, there's classic configurations (instrumentation amplifier). \$\endgroup\$ Jun 11, 2021 at 10:13
  • 2
    \$\begingroup\$ and I also want to measure close to zero Ah, there's rail-to-rail input capable Opamps! you can simply buy one that does what you want, so hop over to the website of one of the larger opamp manufacturers (say, ti.com ), and look for these; their datasheets and application notes will probably also have exactly the measurement circuitry you need to work with a single supply. \$\endgroup\$ Jun 11, 2021 at 10:15

3 Answers 3

6
\$\begingroup\$

Is it a problem to have a negative voltage on the analog input pin of such a microcontroller?

Yes it can be and should be avoided.

Anyways, you will have poor precision if you directly read the voltage with your MCU's ADC, if it's very low. You need to amplify the signal.

This can easily be achieved with instrumentation op-amp, some of these can amplify voltages even at 0V and works by differential input. You want a single rail, rail-to-rail input and output and amplify the signal that at the highest output of your chip you are slightly below the VRef of your MCU.

AD8226 could be a good candidate:

Input voltage goes below ground

Output offset of 600uV should be tolerable for your application.

\$\endgroup\$
1
  • \$\begingroup\$ Thank you! you are right the offset is minimal for AD8226 I checked the datasheet. I do not need an extreme precision so this may work out fine \$\endgroup\$ Jun 11, 2021 at 12:08
5
\$\begingroup\$

I've had a similar problem recently so...

First, look at the "absolute maximum ratings" in your micro's datasheet. It will show the voltage range that a pin must not exceed. In my case the signal comes from an instrumentation amp powered from +/-15V so it can definitely go negative and zap the micro. So I added a series resistor and schottky diodes, along with a shunt to protect from positive overvoltage. This keeps the voltage on the pins in the safe zone.

In your case, there are much simpler solutions.

If the Hall sensor is bidirectional, then the simplest will probably be to offset it to something like AREF/2 (AREF being the ADC analog reference voltage) so the micro can acquire both polarities of the signal. If it is not bidirectional, it's fine to keep the reference at 0V.

Then you need a rail to rail opamp.

If all the analog chain is powered from a voltage that is lower than the maximum rating for your analog input pin, then you don't need any extra protection, which is convenient.

Make sure you check the opamp's output really goes down to 0V, not "almost 0V". This is important for offset calibration. You can use a low offset opamp, but you can also calibrate out the offset if the current you're measuring can be switched on and off, for example if it uses PWM. In this case you can synchronize the ADC and sample when the current is zero, which gives the offset. Then sample when the current is on, and substract.

In this case you may need to add a small positive DC offset, with a bunch of resistors. This is because, if your opamp has a negative input offset, then when the input is zero, its output will be clipped to 0V, and it will stay at 0V until the input signal is larger than the opamp's offset. So the offset calibration will be wrong, and you lose some range close to zero. If you add a bit of positive offset so "zero" is actually a few percent of your ADC range above zero, then this problem is solved.

\$\endgroup\$
1
  • \$\begingroup\$ It is not bi-directional. very useful information btw! thank you. \$\endgroup\$ Jun 11, 2021 at 11:58
2
\$\begingroup\$

Choose an OPA rail to rail for such applications.

Some OPA can also be operational when the voltage is a very "little" negative.

Some converters ADC can also measure a negative voltage, even if there are fed with only a positive voltage supply.

To realize a voltage amplifier for very low input voltage, you need low drift Instrumentation Amplifier ... like AD622. Gain (1 to 1000) set with one resistor only ( need a negative voltage).

The negative voltage can be generated by a little circuit added to one output port of the microcontroller and driven as PWM output (use 2 capacitors and 2 diodes for a voltage "doubler" but negative output)

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.