ATMEGA Mic5225 and TB6612 Quiscent Current

Hey, I am trying to lower current draw for battery purposes. I've attached my code and a schematic I drew up showing how everything is wired. Everything works as expected. Motors turn a valve that open and close and then the Arduino sleeps. The mic5225 is supposed to be capable of a 29uA quiescent current, but during sleep my current draw is around 1.5mA. Does anybody notice any problems with my schematic or code that would be a problem?

int openValve = 7;  // 
int closeValve = 8;

void setup() {

  pinMode(openValve, OUTPUT);
  pinMode(closeValve, OUTPUT);

  //SETUP WATCHDOG TIMER
  WDTCSR = (24);//change enable and WDE - also resets
  WDTCSR = (33);//prescalers only - get rid of the WDE and WDCE bit
  WDTCSR |= (1<<6);//enable interrupt mode

  //Disable ADC - don't forget to flip back after waking up if using ADC in your application ADCSRA |= (1 << 7);
  ADCSRA &= ~(1 << 7);
  
  //ENABLE SLEEP - this enables the sleep mode
  SMCR |= (1 << 2); //power down mode
  SMCR |= 1;//enable sleep
}

void loop() {

  digitalWrite(openValve,HIGH);// open the valve
  delay(6000); // wait for valve to open
  digitalWrite(openValve,LOW); // valve is open.  Stop sending signal. 
  digitalWrite(closeValve,HIGH);// close the valve
  delay(6000);// wait for valve to close
  digitalWrite(closeValve,LOW);// valve is closed.  Stop sending signal. 

  
  MCUCR |= (3 << 5); //set both BODS and BODSE at the same time
  MCUCR = (MCUCR & ~(1 << 5)) | (1 << 6); //then set the BODS bit and clear the BODSE bit at the same time
  __asm__  __volatile__("sleep");//in line assembler to go to sleep
  
}

ISR(WDT_vect){
}

Did you measure the current of each of the components seperatly, to work out which one is using the current ?

srnet:
Did you measure the current of each of the components seperatly, to work out which one is using the current ?

Yes. My mistake for not posting. From the Mic5225 to the VCC of the TB6612 is 1.5mA during standby of the motor. So this is where that current is being used. Not sure how to lower this unless I use a relay or transistor to cut the logic supply to the TB6612 during sleep modes.
There is also 26 microamps from Mic5225 to the PWMA pin, but I think that all makes sense as the normal Quiescent current from the regulator.

So I connected a digital pin from the arduino to the VCC of the TB6612, assigned the pin as an output and drove it high at the start of the loop and low before going back to sleep. This puts the current back down to 26 uA during sleep.

Will driving the TB6612 from the output pin of the atmega and constantly driving it on and off cause any issues?

Is there a more elegant solution to this?

I've also tried driving the standby pin low before entering sleep but there is still around 550 uA measured across VCC to the TB6612 during sleep. The Datasheet claims 1uA while the standby is low.

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.