Pull up resistors consume a lot of current

Hi,

I am using Arduino Uno.

I was under the impression that pins set as input with a pull-up resistor were drawing a neglegible amount of current.

However, it seems untrue from my test.

My circuit (including Arduino) draws around 30mA constantly.

However, once I just add these lines to my sketch and without changing anything on the hardware front, the consumption goes up to 80 mA:
pinMode(BTN_2_SIGNAL_SWITCH, INPUT_PULLUP);
pinMode(BTN_3_SIGNAL_SWITCH, INPUT_PULLUP);
pinMode(BTN_4_SIGNAL_SWITCH, INPUT_PULLUP);
pinMode(BTN_5_SIGNAL_SWITCH, INPUT_PULLUP);
pinMode(BTN_6_SIGNAL_SWITCH, INPUT_PULLUP);

I'm measuring current using a digital multimeter (actually two, to compare the readings).

I am really confused and worried that that will make batteries last much less.

Any comment or pointer would be great.

Thanks!

Show us a good schematic of your circuit.
Show us a good image of your ‘actual’ wiring.
Give links to components.

1 Like

Does you Arduino get REALLY, REALLY hot? IF not, then your test is wrong.
Paul

1 Like

The internal pullups in the ATmega328 processor of the Uno are 30K to 50K so draw less than 0.2mA each. Something else is causing the large current.

Post a full schematic.

How are you measuring current (show connections)?

1 Like

If you aren't pulling them down, shouldn't pullup resistors, internal or external, use almost no current?

a7

1 Like

Thank you all.

You made me realise that was something not right.

And, actually, I almost forgot that I've brought the ATMega328P out of the Arduino board.

So, after realising that, I have tested the circuit using the microcontroller on the Arduino board and currents are as you described.

I think the problem is that with the "offboad ATMega328P" I've left some of the pins "floating". I'll make sure they are all connected.

Thanks again.

The Uno is a very poor choice for battery powered projects. Many people use a Pro Mini with the voltage regulator and the power LED removed, which is basically a "bare bones" Arduino. Great tutorial on bare bones here.

2 Likes

+1. Required reading!

a7

Generally a bad and unprofitable idea.

If you want a "bare bones" device for an embedded project, use a cheap (Chinese!) Pro Mini as jremington pints out. You just need a USB interface module to program each one.

That will not account for 30 mA either. :roll_eyes:

1 Like

That was a very interesting read indeed, and helped me approach my problem in a better way.
Thanks!

I've found the issue: wrong connections - AVCC and AGND of the uC ended up not being connected to 5V and ground respectively.

Thanks a lot for your help. I think I've learned something to do debugging better next time: isolate the problem and share the schematics/pics if you need help.

This should be first with your question.

The pro mini is super cheap, I just got 10 @ $3 each. They are the way to go for this, but if you want to build it from chips, check out this tutorial on a tiny duino:
https://make.kosakalab.com/arduino/obaka/project-2/index_en.html
Thanks @GoForSmoke for showing it to me in the first place

1 Like

On ATMega328 there is no "AGND" - the Vcc and AVcc is separated (IIRC there is one diode drop between the two pins) both (all) GND pins are connected internally. While it is probably not the best idea to leave one of the GND pins unconnected (or even use internal wiring as a jumper) it shouldn't cause much problems.

1 Like

You are right - my mistake, there is no AGND, just another GND.

Which doesn’t have to be connected to anything.

1 Like

Although it is always advisable. :grin:

1 Like

No.
That way you can ruin the star ground wiring.

This stupid forum software automatically removed you quote because it said I had quoted all your message.
A) I didn’t I did not quote the emoji.
B) what is wrong with that.p anyway.

That just happened to me on another posting - it auto-edited me - though I did not notice it giving a purported "reason". I had to - and actually could - edit it back. As I have done on previous occasions.

Yes, it does some really strange and frequently annoying things, like this blue pop-up:

It really was not designed for a technical forum. :crazy_face:

Perhaps it is, but just somewhat poorly configured.


No, you connect the two together directly under the PCB.

The GND and VCC pins should have decoupling caps across them.

1 Like

Yes, indeed. Added as per component datasheet. Thanks for the reminder.