Voltage drop of Arduino's power regulator

Hey,

I need some help with a problem with a setup including a Mega2560. Lighting some LEDs causes the arduino's power output to drop from 4,9V (LEDs off) to 4,84V (16 LEDs on). The LEDs have a series resistor of 1k each (=5mA / LED)

This totally renders the analog inputs (10k-Potis as voltage dividers) useless since their values change dramatically if more LEDs light up. The user interface depends on exact poti values, so I scaled the 10bit values down to 8bit but still, the values change by 1 or 2 points. This is the cause of the positive reference voltage drop.

The arduino is powered by the USB cable, but I also tried to power the arduino with an external 7,5V 500mA power supply which outputs constant 7,56V in both situations (LEDs off / on). It draws 130mA with all LEDs off and 170mA with 16 LEDs on. So I assume it's the arduino's supply which causes the drop.

What options do I have?

You say the LEDs are connected via a 1k but that's kind of useless. How many LED's and what's the current?

Certainly at when powering the Arduino with high voltages (for example 12V) you can't draw that much current from an Arduino

Thanks for your reply. I did some tests:

Voltage drops with different external power supply:

| *Supply * | *Voltage LEDs off * | *Voltage LEDs on * | | - | - | - | | 12 | 4,91 | 4,86 | | 7,5 | 4,9 | 4,85 | | 6 | 4,06 | 4,0 | | 5 | 3,13 | 3,08 |

So I guess 7,5V is the best value for the external supply.

By the way, the LED's are not directly connected to arduino pins but to shift registers/port extenders. But those get their power from the arduino board's 5V/GND pins. The 5V pin needs to deliver ~80mA which should be okay? Can I decouple that and use another power regulator for the external hardware (LEDs and Potis)?

Are you sure the LED's only take 80mA? What else is connected to the Arduino? Do you have a schematic? And what's the voltage when only the Arduino is connected to the 12V supply (so disconnect everything)?

4 questions, 4 answers ;)

It's not unusual to see a small delta in a voltage regulator's output voltage related to current draw (although part of what you are seeing might be due to path-loss, too, depending upon where you are measuring).

If it's too much for you, you might consider using a separate regulator to power the LEDs.

Also -- if the Arduino is sinking the LED current, there might also be a small delta in voltage at internal ADC's ground reference due to a shift in the Arduino's reference "ground" voltage.

This latter is probably very small, but I'll give you an example of where it was a problem for me.

I was working on a PIC design that was part of a frequency-lock feedback loop. That is, the PIC was measuring the frequency delta between a voltage-controlled oscillator and a reference frequency, generating a PWM signal that, after being heavily filtered in the analog domain, drove the voltage-control input of the oscillator.

While debugging, I noticed that the oscillator's frequency would consistently drift in one direction, then reverse and move in the opposite direction. It would repeat this pattern at about a 1 Hz rate.

Coincidentally, one of the PIC's outputs was tied to the cathode of a small "heartbeat" LED that blinked at a 1 Hz rate (the LED's anode was tied to 3.3V through a resistor), so the PIC output was sinking a small amount of current (5 mA?) every 500 msec.

The drift exactly corresponded with this LED's heartbeat.

I removed the LED and the drift stopped.

My hypothesis was that the small delta in ground current introduced into the PIC's internal ground, ground lead, and finally the connection to the board's ground plane when the PIC was sinking LED current created a voltage delta that changed the PWM voltage (which was also referenced to that same PIC ground), as seen by the VCO, just enough to shift the VCO's frequency.

Anyway -- the point of the story is: if you want to make very accurate ADC measurements, be aware of all possible sources that might corrupt your readings.

...and one more thought:

If you have a spare analog input, you could try connecting a stable voltage reference to that pin.

Then, whenever you need to measure your ADC, first read your reference, determine if its ADC reading has shifted (meaning that Arduino's VCC has shifted), and calculate a scale-factor related to this offset.

Then, when you read the ADC for your "real" reading, scale it by the scale-factor you just calculated.

The supply voltage and the ground for the pots should come from the Arduino. Then if the voltage changes, for whatever reason, the Arduino will measure the same ratio and the output from analogRead() won't change.

You only get problems like the original description when there is an independent 5V source for the pots or a ground problem like JC described. (The chips actually have an analog ground pin, for exactly this purpose.)

The pots absolutely should be on the same supply as the Arduino.

The LEDs can be on a different one, but as Morgan pointed out, even if they are pulling down the supply, it shouldn’t matter.

Finally, it is worth noting that the Arduino Uno specs do recommend a 7.5~12v power supply when using the internal regulator, and if you look at your table, those work. If the Arduino came with a better regulator, it could have worked at 6v - but alas, it did not.

I found the following:

If you have a power source that delivers 6V or less you could connect that directly to the 5V pin of the arduino via a 1N400x diode. The diode has a voltage drop of .7V and the atmega can be safely driven with up to 5.5V

Source

Is this really okay? This seems like a simple solution (since my external power seems more stable than the arduino regulator). Also, my project is already soldered and it's a big mess of wires...

SOLVED.

Hell yeah. I connected the 5V and GND to an external 5V regulator and it works absolutely perfect. No voltage drops and the potis work over the full range. The arduino regulator just sucks :-) (okay, its way smaller and maybe not indended to drive that much load).

Is there any trick how to upload the binary while using the external supply? Am I right that plugging the USB cable in is not a good idea now?

EDIT: I felt lucky so I plugged the USB in with an external supply - works :-) But then, it uses the shitty voltage regulator. But it's hot pluggable, so it's ok. Arduino rocks!

Thank you guys for your thoughts!

But then, it uses the shitty voltage regulator.

NOTHING in the real world is perfect... i.e. There are resistors with 20% tolerance (rare), resistors with 5% tolerance (very common), 1% resistors, 0.1% resistors, and I think I've seen 0.01% resistors. But, you can't buy a resistor that's guaranteed to be exactly 1K (or any other exact value).

It's up to you, the designer/engineer to make sure your tolerances are tight enough for your application. If I tell you I need 10 feet of rope, you can ask me if 9 1/2 feet is long enough, or if 12 feet is OK, because you're never going to find a rope that's exactly 10 feet long. More likely, I'll say I need a rope at least 10 feet long.

The [u]datasheet[/u] for the NCP1117 regulator (used on the Uno) says the voltage should will be between 4.95 and 5.05V under certain specific conditions, with additional worst-case line regulation-variation of 6mV, plus up to 25mV of load regulation-variation.

In any case, it's PERFECTLY ADEQUATE for the Arduino or anything digital, as long as you operate the regulator within it's limits.

The user interface depends on exact poti values

That's generally a bad design. Typically, you should be looking for a minimum, a maximum, or a range of values.

so I scaled the 10bit values down to 8bit but still, the values change by 1 or 2 points.

Reducing the resolution does NOT increase accuracy. It's usually best to keep the accuracy/resolution you have and then look for a range of values. In some applications you can filter/average the readings to improve accuracy.

...And if you're doing what I think you're doing... you're not the 1st person to do it and I won't say it's always wrong... but I hate the idea of using analog when you really-really want digital. :confused:

Don't make it depend on exact values from the pots. There's always a bit of jitter in ADC values (putting a 0.01~0.1uf cap from the ADC pin to ground helps), and it's not even an evil thing if it's only 1-2 LSB (you need that for improving accuracy by oversampling and decimation - see the appropriate app note)

You need to allow a range of readings from the pot, or use rotary encoders instead of pots - unless your project is a game to challenge people to precisely adjust a knob within a time limit ;-)

DVDdoug:
…And if you’re doing what I think you’re doing… you’re not the 1st person to do it and I won’t say it’s always wrong… but I hate the idea of using analog when you really-really want digital. :confused:

You both are right. Rotary encoders would have been the right choice for parameter knobs. But since my loop() cycle time is ~3ms, polling 16 rotary encoders would not have been possible (the ones I have here need at least 1ms polling time).

In the next prototype I use an additional atTiny for polling stuff like that. But since it is my first arduino project that would have gone too far :slight_smile:

I didn't notice anywhere in the commentary above the possibility of using the ARef pin, and declaring

analogReference(EXTERNAL) in your setup code.

I've dealt with varying power supplies, from about 5 v. to 4.75 v., and this much change seems to be tolerated by the Arduinos. But if you want a reliable voltage reference in these circumstances, use a zener diode, at, say a little over 4 v. for a voltage reference(in series with say a 10K resistor), and hook that to AREf. Varying supply voltage will still have a small effect, but it will be much more stable. There are specific highly stable voltage reference chips out there also which can hold a very close reference voltage.

Try running the pots and Aref from the 3.3volt supply. See the AnalogReference page for important details.

https://www.arduino.cc/en/Reference/AnalogReference

If the 3.3volt supply isn't used for anything else it should be more stable than the 5volt rail. Leo..

jrdoner:
But if you want a reliable voltage reference in these circumstances, use a zener diode, at, say a little over 4 v. for a voltage reference(in series with say a 10K resistor), and hook that to AREf. Varying supply voltage will still have a small effect, but it will be much more stable. There are specific highly stable voltage reference chips out there also which can hold a very close reference voltage.

Is this schematic correct if I use a 4067? If I use this approach, do you think the Potis need smaller R-values?

The current into Aref alone drops the voltage across the zener below 4volt. https://www.arduino.cc/en/Reference/AnalogReference "...there is an internal 32K resistor on the AREF pin." I guess 16 10k pots are used. That's 625ohm. Plus the IC. Not a task for a simple 4volt zener. Read post#14 again. Why the 4067. A Mega has 16 analogue inputs. Give us the whole story, including diagram and code. Leo..