I'm building a portable measurement device, that internally uses a CMOS sensor hooked up to an ADC converter. It's normally powered from battery, but I also allow it to run when hooked up to USB port (for both charging and debug data output). This is realized by MCP73871 chip that does power path control.

The device itself needs a bunch of different voltages, so the voltage from the above chip is first boosted to ~7.7V with a boost regulator (MCP1665) and then dropped to 5.0V by an LDO (LM1117). These five volts drive the sensor itself and the ADC converter plus a bunch of op-amps for buffering the analog signal etc.

The problem is that the voltage coming out of the 5V LDO is actually slightly different when powered from battery vs USB.

The voltage coming of the switching regulator does change slightly depending on the source and that's something that I get - it's a switching regulator, the line regulation guarantees certain precision of the feedback voltage, which can result in slightly different output from the regulator - since the switch has different on/off periods etc. The difference I'm seeing here is 7.722V (RMS 2mV) when on battery vs 7.737V (RMS 26mV) when on USB.

There's a bit of unevenness in that signal, but it goes into that LDO, which smooths it nicely out, however when on battery, that LDO generates 5.024V (RMS 1mV) and 5.005v (RMS 1mV) when hooked up to USB. It's still totally within the tolerances, but doesn't really match the "line regulation" characteristics from the datasheet of LM1117.

While that difference is small, less than half percent, it actually gets propagated to the sensor, which boosts it up a bit (because of the gain settings on the sensor) and in the end I'm seeing 1% of a difference in the measurement. It's not a disaster, I can correct for it in the software, but is there anything that could be done about it in the design itself? What's causing this difference? Is there any point in using a different voltage regulator to drop the voltage to 5V? Maybe some high precision one or with a different architecture (like the LT3080 with the constant current reference)?

  • \$\begingroup\$ Possibility: look at voltage between ground points. USB source has both supply rail and ground return drops. The latter is not accounted for by the ADCZ if you do not take exceptional care with single common point starred ground routing. \$\endgroup\$
    – Russell McMahon
    Dec 15, 2020 at 23:38
  • \$\begingroup\$ perhaps it's noise/ripple coming from the SMPS, hitting/missing a resonant frequency matching capacitance into the LDO. Try adding more/faster capacitance to the LDO input to reduce noise. \$\endgroup\$
    – dandavis
    Dec 15, 2020 at 23:43

1 Answer 1


If your sensor output is ratiometric, then you should be using a ratiometric ADC to measure it (i.e. using the same power rails as a voltage reference for your ADC).

If your sensor is not ratiometric, then you should be using a fixed voltage reference for the reference of your ADC.

In your case, it sounds like you are using a ratiometric sensor with a fixed voltage reference for your ADC.

If your sensor is supposed to not be ratiometric but is significantly influenced by power supply fluctations nonetheless, then you should be able to use the same fixed reference ADC to also sample the voltage supply simultaneously with the sensor to know how much correction to apply.

  • \$\begingroup\$ The sensor is not ratiometric - it's a light sensor, measures just absolute light intensity. It is powered from these 5V and it needs around 20-30mA, but the ADC has a dedicated, high precision voltage reference (the sensor ouputs in the range from 0.3V to ~3.0V, I use the reference to provide bounds to the conversion) - that voltage reference is stable, but the output of the sensor itself is tiny bit different. \$\endgroup\$
    – miciwan
    Dec 15, 2020 at 21:07
  • \$\begingroup\$ @miciwan What?? \$\endgroup\$
    – DKNguyen
    Dec 15, 2020 at 21:07
  • \$\begingroup\$ Ratiometric doesn't mean a relative measurement of light intensity, but an output voltage relative to the supply or reference voltage. Does a 1% higher supply voltage on the sensor cause a 1% higher output voltage? If so, you should use that same supply voltage as your ADC reference (or a scaled down version of it if needed). \$\endgroup\$
    – Justin
    Dec 15, 2020 at 21:45
  • \$\begingroup\$ Ok, got it. The sensor datasheet doesn't really say anything about that, so my guess is that it is not ratiometric. It's basically a CMOS sensor, like one used in cameras - are these ratiometric? It's just powered by 5V, it has a binary gain setting switching between high and low gain and that's it. \$\endgroup\$
    – miciwan
    Dec 15, 2020 at 22:02
  • \$\begingroup\$ If it's ratiometric you would expect the output to scale with supply voltage and so you use an ratiometric ADC which uses the supply voltage as its voltage reference so that the variation is cancelled out. If it's not ratiometric then the output shouldn't vary with supply voltage and you use an ADC with a fixed voltage reference. \$\endgroup\$
    – DKNguyen
    Dec 15, 2020 at 22:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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