power step up for Arduino pro mini on 2x AA cells

Okay now when I am turning off the IR LEDs and receivers before sleep (and if the status LED is not on) I get around 250uA power usage.

According to this: https://andreasrohner.at/posts/Electronics/How-to-modify-an-Arduino-Pro-Mini-clone-for-low-power-consumption/ I can save a little bit more removing the on-board LED. And a liiittle bit not using RAW, and a liiitle bit removing the onboard regulator. But removing the regulator doesn't seem like it has enough of an effect that I will do it.

I removed the onboard LED now, and I get 80uA during sleep. I wish it was possible to buy the pro mini without the onboard LED if I wanted to make more of these for friends or family.

This is the sketch I use to test sleep current on the Pro Mini. It goes into power-down sleep with everything turned off, including the WDT. With the regulator and LED removed, I get something under 1uA on a genuine 328P, and about 140uA on a counterfeit. I haven't tried it with the WDT enabled.

#include <avr/sleep.h>
#include <avr/wdt.h>
int i;

void setup(){

  for (i = 0; i < 20; i++) {          // all pins to one rail or the other
    pinMode(i,OUTPUT);
    digitalWrite(i,LOW);
  }
  ADCSRA = 0;                         // disable ADC for power saving
  wdt_disable();                      // disable WDT for power saving
  set_sleep_mode (SLEEP_MODE_PWR_DOWN); // Deep sleep
  sleep_enable();
  sleep_bod_disable();                // disable brownout detector during sleep
  sleep_cpu();                        // now go to sleep

}

void loop(){
}

If I comment out the WDT disable, there's no change in current. I think that's because the bootloader, or mystery code added by the IDE, turns off the WDT by default.

Also note that the command to disable BOD during sleep has to be done immediately before sleep_cpu() to be effective.

On my 3.3V 8MHz Pro Mini, with what I believe is a genuine 328P, and with only the LED removed (3.3V regulator left in place), I get the following sleep currents, which are somewhat surprising:

5V applied to Vcc - 50uA
5V applied to RAW - 45uA
3.3V applied to Vcc - 70uA

I don't understand why backflow through the regulator is higher with 3.3V applied to Vcc than with 5V applied there. That makes no sense.

An identical Pro Mini with the regulator also removed gives me under 1uA with either 3.3V or 5V applied to Vcc. So the regulator being present makes a big difference.

However, remember that this is sleep current. I haven't tested current draw in normal active mode. That might produce significantly different results. I probably should do that test at some point.

With respect to the LED, it may be easier to remove its resistor instead.

When the ATmega is active, expect ~8 mA of current. At that point the regulator is totally insignificant.

250 uA probably means you did not switch off the ADC before going to sleep. That's about how much that peripheral uses.

ShermanP:
This is the sketch I use to test sleep current on the Pro Mini. It goes into power-down sleep with everything turned off, including the WDT. With the regulator and LED removed, I get something under 1uA on a genuine 328P, and about 140uA on a counterfeit. I haven't tried it with the WDT enabled.

#include <avr/sleep.h>

#include <avr/wdt.h>
int i;

void setup(){

for (i = 0; i < 20; i++) {          // all pins to one rail or the other
   pinMode(i,OUTPUT);
   digitalWrite(i,LOW);
 }
 ADCSRA = 0;                         // disable ADC for power saving
 wdt_disable();                      // disable WDT for power saving
 set_sleep_mode (SLEEP_MODE_PWR_DOWN); // Deep sleep
 sleep_enable();
 sleep_bod_disable();                // disable brownout detector during sleep
 sleep_cpu();                        // now go to sleep

}

void loop(){
}




If I comment out the WDT disable, there's no change in current. I think that's because the bootloader, or mystery code added by the IDE, turns off the WDT by default.

Also note that the command to disable BOD during sleep has to be done immediately before sleep_cpu() to be effective.

On my 3.3V 8MHz Pro Mini, with what I believe is a genuine 328P, and with only the LED removed (3.3V regulator left in place), I get the following sleep currents, which are somewhat surprising:

5V applied to Vcc - 50uA
5V applied to RAW - 45uA
3.3V applied to Vcc - 70uA

I don't understand why backflow through the regulator is higher with 3.3V applied to Vcc than with 5V applied there. That makes no sense.

An identical Pro Mini with the regulator also removed gives me under 1uA with either 3.3V or 5V applied to Vcc. So the regulator being present makes a big difference.

However, remember that this is sleep current. I haven't tested current draw in normal active mode. That might produce significantly different results. I probably should do that test at some point.

With respect to the LED, it may be easier to remove its resistor instead.

Good tip about the resistor : )
Wow 1uA is really low. Interestingly enough when I just moved from RAW to VCC pin, the power usage during sleep increased from around 80 to 250uA. I might be okay with 80uA during sleep for now, as I guess the programmer FDI interface uses the RAW ping and thus the regulator.

wvmarle:
When the ATmega is active, expect ~8 mA of current. At that point the regulator is totally insignificant.

250 uA probably means you did not switch off the ADC before going to sleep. That's about how much that peripheral uses.

I used this code

#include <LowPower.h>
LowPower.powerDown(SLEEP_8S, ADC_OFF, BOD_OFF);

I think that this does away with the ADC as well.

ShermanP:
Nothing fancy. Opening the door turns on the power, but then the D1 Mini maintains it until it's finished, then turns it off (after the door has been closed). If the door is left open, it sends another notice to that effect, then goes to sleep.

All noted, but it is much easier using CH_PD on the ESP-01 as you need only a diode, a pull-up and no other components! The CH_PD does it all for you. :grinning:

jontaa:
Good tip about the resistor : )
Wow 1uA is really low. Interestingly enough when I just moved from RAW to VCC pin, the power usage during sleep increased from around 80 to 250uA. I might be okay with 80uA during sleep for now, as I guess the programmer FDI interface uses the RAW ping and thus the regulator.

What voltage are you applying to Vcc/RAW that gives you 250/80uA?

Anyway, you might try my code and see if anything is different.

1uA is what the datasheet says you should get if you aren't using the WDT. That's for just the 328P, not the regulator.

Paul__B:
All noted, but it is much easier using CH_PD on the ESP-01 as you need only a diode, a pull-up and no other components! The CH_PD does it all for you. :grinning:

Do you have a link for that circuit?

With the ESP-01, I believe I would need to add a regulator to convert my battery output to 3.3V, and then I would have to get one with an enable pin.

ShermanP:
What voltage are you applying to Vcc/RAW that gives you 250/80uA?

Anyway, you might try my code and see if anything is different.

1uA is what the datasheet says you should get if you aren't using the WDT. That's for just the 328P, not the regulator.

I was powering it from a 3,7V lipo battery when measuring that.

ShermanP:
Do you have a link for that circuit?

Too far back. I think I will have to re-draw it! :astonished:

ShermanP:
With the ESP-01, I believe I would need to add a regulator to convert my battery output to 3.3V,

The topic of this thread says "2x AA cells". That happens to be a perfect direct supply for an ESP8266. Alkaline of course.

ShermanP:
and then I would have to get one with an enable pin.

Do you not know what an ESP-01 is?

Well the 250uA on Vcc seems quite high. But you could be applying as much as 4.2V if the battery is fully charged, whereas that 4.2V will be regulated down to 3.3V if you apply it to Raw. That might account for some of the diffferece since the processor will consume more current at 4.2V than it does at 3.3V. But it still seems like too big a difference. The problem is that we have no idea about what the regulator sinks when you apply power to its output. That could vary considerably among regulator designs.

ShermanP:
Well the 250uA on Vcc seems quite high. But you could be applying as much as 4.2V if the battery is fully charged, whereas that 4.2V will be regulated down to 3.3V if you apply it to Raw. That might account for some of the diffferece since the processor will consume more current at 4.2V than it does at 3.3V. But it still seems like too big a difference. The problem is that we have no idea about what the regulator sinks when you apply power to its output. That could vary considerably among regulator designs.

I mean, it did go down to 80uA when I removed the onboard LED as I wrote, this last 80uA might be the regulator.

Paul__B:

With the ESP-01, I believe I would need to add a regulator to convert my battery output to 3.3V,

The topic of this thread says "2x AA cells". That happens to be a perfect direct supply for an ESP8266. Alkaline of course.

Well, you asked about how I switched power on my mailbox notifier, and I responded to that. Mine used higher battery voltage than two AAs, so it needed a regulator somewhere. The D1 Mini has a regulator built in.

and then I would have to get one with an enable pin.

Do you not know what an ESP-01 is?

I thought I did. It's a minimalist ESP8266 board which needs about 3.3V as a power input. It brings out the power down pin, which the D1 Mini does not. I'm not sure what led you to ask the question, but my point was that with higher battery voltage I would need a regulator if I used the ESP-01, and I would need a regulator that can be shut down in the same way the ESP-01 can be shut down so it wouldn't be sinking current during the 23.99 hours a day when nothing is going on.

ShermanP:
I'm not sure what led you to ask the question, but my point was that with higher battery voltage I would need a regulator if I used the ESP-01,

And indeed that was my point. If you use the ESP01 which does not include a regulator, albeit an inconvenience if you are using a higher voltage, you simply do not wastefully use a higher battery voltage and regulator - 3 V is just fine!

I will cook up that circuit for you - it is extremely practical, a greatly improved version of this project. :grinning:

ShermanP:
Do you have a link for that circuit?

OK, rather than trying to draw it again as I found EasyADA too kludgy and gave up, I have located this article which outlines the concept fairly concisely, noting that the ESP-01S is not quite as conservative on power as the ESP-01 original and would require the absurdly low value resistors shown here.

Note that "Tx" and "Rx" are actually general purpose pins and available to use to power LEDs or control other devices as in The Button concept.

Thanks very much for the circuit. It looks pretty slick.

I really don't like those resistor values.

Apparently the ESP-01S has pull-up resistors on the CH_PD and reset that the ESP-01 does not so you actually have to pull down CH_PD to shut it down and that pull-up resistor will then waste some current.

I do not know what value those resistors are - I will clearly have to do some tests. The actual circuit of the ESP-01 and ESP-01S appears to be completely undocumented (notwithstanding how few components are actually in the module). :roll_eyes:

Going back to low power usage. I realized that the methods of dimming the LED up and down, or blinking it at 60hz requires that the Arduino is not in sleep, as opposed to a normal blink.
I wonder if the power saved by doing this is more than what is lost when it's awake. I will need to test this.

Otherwise I will sleep for 4 seconds with the LED off, wake up and set the LED to on, and go back to sleep for 1 second, then wake up and repeat it.

Paul__B:
I really don't like those resistor values.

Apparently the ESP-01S has pull-up resistors on the CH_PD and reset that the ESP-01 does not so you actually have to pull down CH_PD to shut it down and that pull-up resistor will then waste some current.

I do not know what value those resistors are - I will clearly have to do some tests. The actual circuit of the ESP-01 and ESP-01S appears to be completely undocumented (notwithstanding how few components are actually in the module). :roll_eyes:

Oh I think you would have to remove the pullups from the "s" parts. The article you referred to suggested as much. Then the only resistor current you would have is when the power is on. And I would think you could get away with much higher values than 1K and 10K.

Actually, if you are just using the button, I don't think you would need the GPIO2 resistor or the diode. They would only be needed if a sensor is used for the wakeup, which could go back low, which the button can't do.