0

I'm trying to figure out why my attiny85 (on a digistump developer board) draws around 3mA at 3V when setting up a pin as INPUT and connecting it straight to ground. The current is measured with a multimeter between said pin and ground (thus only the current sunk by that pin is measured). I would assume that without a pullup resistor it would consume a lot less but it seems, regardless if I configure the button as INPUT or INPUT_PULLUP the current is the same.

Sketch:

void setup() {
  pinMode(3, INPUT);
  //According to datasheet pin needs to be low to disable internal pullup
  digitalWrite(3, LOW);     
}

void loop() {
  digitalRead(3);
  delay(100);
}

I would like to design a circuit that can detect a normally closed switch being opened, but the idle power consumption is way to high at the moment. I was planing on using a very high external pullup but it seems I can't disable the internal one...

  • That seems odd, and not expected. The inputs on a CMOS device like an Arduino should be capacitive, and draw almost no current once they settle on their state. (It takes a small amount of current to drive the capacitor on the input to the high state, but then once it's charged, current flow should drop to the leakage current of the capacitor.) – Duncan C Dec 10 '19 at 18:22
  • Could you put the pin through a 10K resistor to ground when your switch is closed? That should be enough to pull the pin low, but greatly reduce the current flow. – Duncan C Dec 10 '19 at 18:22
  • You write that the "attiny85 draws around 3mA", so did you measure the current that is sunk by the pin or is it the current consumption of the entire chip? Does it change when you don't configure anything? Also, measuring current to detect the state of a switch seems way too complicate, you could probably read the voltage level at the switch directly. – Sim Son Dec 10 '19 at 18:57
  • 3 mA is a normal current draw for an ATtiny85 @ 3 V and 8 MHz. This has nothing to do with the input pin, it's just the current the AVR core needs to execute whatever instructions you ask it to execute. – Edgar Bonet Dec 10 '19 at 19:29
  • 1
    On your devboard PB3 is connected to +5V over two resistors (1.5 k + 66.5) Ohms. That's the reason for the high current. Not the PU Resistor. ;-) See the scematics s3.amazonaws.com/digistump-resources/files/… (5/1560 = 0.0032051) – Peter Paul Kiefer Dec 11 '19 at 16:30
2

The schematics of the digistump developer board shows that PB3 is connected to +5V over two resistors (1.5 k + 66.5) Ohms. That's the reason for the high current (5V / 1560 Ohm = 0.0032051 A). See the schematics https://s3.amazonaws.com/digistump-resources/files/97a1bb28_DigisparkSchematic.pdf

As you mentioned in a reply on my comment above, using PB2 shows the expected behavior of an AT85 IO pin.

| improve this answer | |
0

Input pin only needs 1uA to pull it high or low.

What else is hooked up?

The internal pullup, 30K to 50K, would only draw 0.1mA.

Turn it on and try it, measure the Vcc current with the pin open and then Gnd'ed.

| improve this answer | |
  • I came to the same conclusion that it should only draw 0.1mA with those 30-50k internal pullups. Also I probably wasn't precise saying the attiny draws 3mA - rather that pin sinks 3mA when measuring with a multimeter between the pin and ground. Now that I write this - I will have to check my multimeter, maybe it's measurement is simply off I haven't checked switching it to the µA setting! – schneida Dec 11 '19 at 13:09

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.