I want to get as low power use during sleep as possible with an Adafruit Trinket. Based on results presented on various places in the internet (blogs etc), I expect to be able to go down to 50 - 100 micro amps on the ATTiny85 of the Trinket. I am aware of the fact that using a board such as Trinket may add a bit of consumption, and I physically removed the power LED and the power regulator. I am feeding 5V directly on the 5V pin.
I am using the simplest sketch I can think about for low power, with nothing connected to any pin:
#include <avr/sleep.h> // library for sleep
#define adc_disable() (ADCSRA &= ~(1<<ADEN)) // disable ADC (before power-off)
void setup() {
// put your setup code here, to run once:
delay(10000);
// power_all_disable();
set_sleep_mode(SLEEP_MODE_PWR_DOWN);
adc_disable();
sleep_enable();
sleep_mode();
}
void loop() {
}
But I cannot get less than around 1.3 milli amps consumption during sleep. Do you know what may be the cause of using ~1mA instead of ~100 microA? Any idea how I can decrease this further?
Edit 1: it should be even much less than ~50 - 100 micro Amps: ATtiny85: Power consumption vs clock speed ; even though this the libraries are maybe primary intended for the ATMega328P, it looks like it should work also with ATTiny85 as well: http://www.technoblogy.com/show?KX0
Edit 2: I had an ATMega328P-based Adafruit Metro Mini lying around. I took away the ON LED, and then using exactly this sketch, feeding power directly on the 5V pin of the Metro Mini, leads to a power consumption of around 150 micro Amps during sleep, which is more like what I expect. Strange it is 10 times more with the ATtiny while it should have been less (?). Am I missing something or is it maybe just broken library on ATtiny? This is a bit ironic, as I went for the lesser ATtiny85 based board for saving current compared with the ATMega328P...
1 Answer 1
Please have a look at the schematics:
The USB connector uses a resistor (1500 Ohms) against the 5V net and a 3.6 Volt Z-Diode on it's (D-)-Pin. In addition to the current that is drawn by the microcontroller, this part of the circuit draws some extra current. (5[V] - 3.6[V])/1500[ohm] = 0.0009333... ~= 0.001 [A].
Even though I'm not completely sure without making some tests, that seams plausible to me.
EDIT (Answer to the OPs comment below.)
The schematics uses a normal diode symbol but has a 3.6 Volt label next to it. I assume that it should be a Zener diode with a reverse voltage drop of 3.6 Volts. If I'm right, the Diode is used to limit the 5 Volts to 3.6 Volts (for what reason ever). The Zener Diode effectively limits the Voltage over it to 3.6 Volts. The rest of the voltage of 5 Volts must be dropped over the resistor. i.e. 5V - 3.6V = 1.4V. This voltage drop tells us by Ohms Law that the current through the resistor is:
I = U / R
I[A] = 1.4[V] / 1500[Ohm] = (about) 1 mA.
This value is very reasonable for your observations and the current is drawn from the 5V connect, hence you can measure it, even if you would desolder the microcontroller.
-
Mmmh, it looks like this diode is going against the polarity provided by the +5V and is here only to protect the pin or something like this, right? It should not be able to draw current from the 5V I think (?).Zorglub29– Zorglub292020年07月26日 08:00:35 +00:00Commented Jul 26, 2020 at 8:00
-
@Zorglub29: I've edited the answer in reply.Peter Paul Kiefer– Peter Paul Kiefer2020年07月26日 09:15:56 +00:00Commented Jul 26, 2020 at 9:15
-
Many thanks for the explanation, you are definitely right :) Very strange that 1) the drawings are using the 'wrong' symbol 2) they use such a circuit on a 'low power' board. Will contact Adafruit. Why do you think they decided to use a set voltage on this pin?Zorglub29– Zorglub292020年07月26日 17:48:26 +00:00Commented Jul 26, 2020 at 17:48
-
1I guess they use the USB connetion to a 5V controller that has no native USB port. It is common to limit the Voltage on the D- and D+ pins of the USB connect to stay within the specifications. As far as I know does Adafuit recomment to use the newer M0 (ARM) Trinket. (Guess why! ;-) ) My favorit microcontrollers are the MSP430 / MSP432 series from Texas Instruments. That's real low Power. ;-) And the Energia IDE is nearly the same as the Arduino IDE. (Although I use an Eclipse based IDE, so I have not much experience). I heard the STM32 s (e.g Blue Pill) are also very low power devices.Peter Paul Kiefer– Peter Paul Kiefer2020年07月28日 12:25:32 +00:00Commented Jul 28, 2020 at 12:25
loop()
that could indicate that it's woken up (maybe turn on an LED or something).