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.
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.
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.
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.
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.
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.
Perhaps it is, but just somewhat poorly configured.
No, you connect the two together directly under the PCB.