Short battery life despite low-power software -- any ideas why?


  • Newbie
  • *
    • Posts: 1
    • View Profile
I'm producing a datalogger that needs to stay alive for at least a month between battery swaps (hardware and software detailed below). My multimeter (connected at the battery) tells me that I'm draining <1 mA on average while the logger is in Power Down sleep mode, and it spends the vast majority of time asleep. When the logger is writing to SD (once a minute), usage shoots up to ~20 mA for maybe <50 ms.

The problem is that no matter what battery setup I use, the logger only stays alive for less than 3 days. I've tried 2x AAs, a 1200mAh Duracell USB power bank, as well as several quadcopter Li-ion batteries. My most recent test was with a 3.7V 860mAh Li-ion battery, and it lasted almost 3 days (71.79 hours, really). That's basically 12 mA drain to get that sort of battery life, which is way beyond what the multimeter is indicating to me.

Does anyone have any ideas as to why this is happening?

This is an on-going problem I've been having, so here's some troubleshooting that I'm working on:

  • I've ordered a processor board without a battery option (gets rid of the battery charging indicator LED).
  • I'm now testing the TinyDuino stack without external circuitry, just the processor + SD + RTC + protoshield connecting to a Li-ion battery, and the logger printing fake data to the SD card. I previously had an indicator LED and a DHT11 powered from a digital pin and VCC respectively, but the presence of those didn't change my <1 mA sleep reading.
  • I haven't tested constant power from a wall plug, which would tell me whether the board just refuses to continue working after 3 days.

Here's the hardware setup:

  • TinyDuino processor module with Li-ion battery option
  • TinyDuino MicroSD module
  • MicroSD card from Tiny Circuits
  • TinyDuino RTC module
  • Proto module with terminal blocks
  • 3.7V 680 mAh Li-ion battery (connected to Vin with jumper wires since the connection jack doesn't fit the TinyDuino)

Testing gets done at 19–25 °C, 32–58% relative humidity.

Here's some pseudo-code representing the logger's function:

Code: [Select]
Setup {
    minuteValueFromLastWakeup = RTC.getMinutes

Loop {
    Go to sleep for 8s. (Rocket Scream's Low Power Library, 'Power Down' mode, ADC and BOD off.)
    if (RTC.getMinutes != minuteValueFromLastWakeup) {
        if (batteryVoltage >= 2800 mV) {
            Open logfile.csv on microSD card.
            Write <100 bytes to the card.
            Close the file.
        minuteValueFromLastWakeup = RTC.getMinutes
    } else {
        Do nothing.
« Last Edit: June 16, 2015, 07:44:46 AM by ParticleViolin »

Ben Rose

  • Administrator
  • Hero Member
  • *****
    • Posts: 392
    • View Profile
Looks like you have your bases covered. Are you able to post your actual code and libraries used? 72 hours makes me want to think of a millis()/micros() rollover, but it doesn't correspond to either- maybe some of the related math?


  • Full Member
  • ***
    • Posts: 44
    • View Profile
Not having much of an idea what is going on, but maybe it would help you to log data to the eeprom first and flush it to flash only every nth log entry... though a tenfold increase of runtime is probably difficult.


SMF spam blocked by CleanTalk