Pages: [1]   Go Down
Author Topic: Trying to figure out what is draining my battery  (Read 880 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Sr. Member
****
Karma: 4
Posts: 289
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I am trying to minimize battery drain after putting the microcontroller to sleep.  I am using this thread:

http://www.gammon.com.au/forum/?id=11497

which shows that after powering down the ADC and brown out detector, and then entering SLEEP_MODE_POWER_DOWN, the mega328 should draw about .355uA.  I am using this schematic:


Version5_Sch by jg1996business, on Flickr

but I don't have anything connected to the ISP6 header or the SD Card connector, and I don't have the GPS Module soldered in yet.  In addition, I dropped the 8MHZ resonator when I was trying to solder it in and it is lost so I burned the arduino bootloader for an 8MHZ internal oscillator breadboarded mega328.  The 3.3V buck/boost converter and the LiPo charging circuit are soldered up.  This is my test sketch:

Code:
#include <avr/sleep.h>

byte mode = 1;
volatile boolean switchPress = false;
volatile boolean lastSwitchPress = false;
unsigned long modePress;


void setup()
{
  //Serial.begin(115200);
  pinMode(6, OUTPUT);
  pinMode(9, OUTPUT);
  digitalWrite(2, HIGH);  //enable pull up
  attachInterrupt (0, buttonPress, LOW);
  sleepCPU();
}

//function to put everything to sleep
void sleepCPU()
{
 // disable ADC
  ADCSRA = 0;  
  
  set_sleep_mode (SLEEP_MODE_PWR_DOWN);  
  sleep_enable();

  // will be called when pin D2 goes low  
  attachInterrupt (0, buttonPress, LOW);
 
  // turn off brown-out enable in software
  MCUCR = _BV (BODS) | _BV (BODSE);
  MCUCR = _BV (BODS);
  sleep_cpu ();
}

void loop()
{
}


Doing the math for everything that should be working on the board, it would be .355uA for the mega328, 50uA for the 3.3V converter, and it looks like about 2 - 5uA for the charge controller.  In addition, with a battery voltage of 4.2V and VCC of 3.3V, I believe about 90uA((4.2 - 3.3)/10000) should be passing through resistor R8 and there is probably some current flowing through resistor R3 but I am not sure about that.  Regardless, the amount of battery drain should be around 140uA or so but when I plug everything into my multimeter it reads 4.6mA when running the above sketch.  Can anyone spot on my schematic or sketch where I may be draining the battery faster than expected?
« Last Edit: February 10, 2013, 01:57:21 pm by jerseyguy1996 » Logged

Arduino Uno;
Mega328

Offline Offline
Edison Member
*
Karma: 63
Posts: 2478
The last thing you did is where you should start looking.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

You could quickly find out by using a razor knife.
Cut a power trace, insert the ammeter across the cut, then solder the trace.
Logged

0
Offline Offline
Sr. Member
****
Karma: 4
Posts: 289
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

You could quickly find out by using a razor knife.
Cut a power trace, insert the ammeter across the cut, then solder the trace.

Darn.....I was hoping to not have to start cutting into stuff.  I bypassed the 3.3V converter and the battery charging circuit by just applying 5V to Vcc and I get a current draw in sleep mode of 170uA.  I can't believe the converter or charger are sucking up 4.4mA.  This is kind of disappointing to say the least.  The whole thought process was that with everything asleep, the battery drain would be negligible.  According to the datasheet for the converter, the quiescent current is less than 50uA and for the charger it should be less than 5uA.  What could I be missing here?
Logged

Arduino Uno;
Mega328

Offline Offline
Sr. Member
****
Karma: 9
Posts: 296
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
I can't believe the converter or charger are sucking up 4.4mA.  This is kind of disappointing to say the least.  The whole thought process was that with everything asleep, the battery drain would be negligible.

DC-DC converters suck power (albeit, very little), even when there's no load.

Quote
According to the datasheet for the converter, the quiescent current is less than 50uA and for the charger it should be less than 5uA.  What could I be missing here?
Maybe the 50uA is when the DC converter is not enabled?

I see an ENABLE pin on the converter hardwired in your schematic. Maybe you should connect this ENABLE pin to your microprocessor and enable/disable it when not needed.
Logged

United Kingdom
Offline Offline
Tesla Member
***
Karma: 223
Posts: 6593
Hofstadter's Law: It always takes longer than you expect, even when you take into account Hofstadter's Law.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

How do you calculate the current for the 3.3V converter as 50uA? I can't find that on the datasheet. You have the PS pin tied to +5v, so you're not even using its power save mode.

[EDIT: OK I found the 50uA figure on the datasheet. It's measured at 3.6V input, however it doesn't say whether it is measured with PS tied high or low.]
« Last Edit: February 10, 2013, 03:58:21 pm by dc42 » Logged

Formal verification of safety-critical software, software development, and electronic design and prototyping. See http://www.eschertech.com. Please do not ask for unpaid help via PM, use the forum.

Offline Offline
Sr. Member
****
Karma: 9
Posts: 296
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

To OP, see page 13 datasheet.

Device Enable
The device is put into operation when EN is set high. It is put into a shutdown mode when EN is set to GND. In
shutdown mode, the regulator stops switching, all internal control circuitry is switched off, and the load is
disconnected from the input. This also means that the output voltage can drop below the input voltage during
shutdown. During start-up of the converter, the duty cycle and the peak current are limited in order to avoid high
peak currents flowing from the input.
Logged

0
Offline Offline
Sr. Member
****
Karma: 4
Posts: 289
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Ahhhh.....I always manage to miss something.  Well not the end of the world.  I assume that I can't disable the converter without fouling the power supply to the mega328?  I guess I can just keep it plugged into a charger when not in use.
Logged

Arduino Uno;
Mega328

Pages: [1]   Go Up
Jump to: