Go Down

Topic: Custom atmega32u4+RFM12b board: high current draw in sleep mode (Read 1 time) previous topic - next topic



I am trying go get a FOSS project going, namely a miniature, battery operated atmega32u4 node with a RFM12B module on it, called it 'Funky'.
I am very unexperienced, just recently started hobby level learning electronics, so please be forgiving.

Wiki page http://harizanov.com/wiki/wiki-home/funky-sensor-v2/



So my trouble is that I can't get decent sleep currents, the lowest I get is 3mA using this Arduino code:

Code: [Select]

#include <avr/power.h>
#include <avr/sleep.h>

#include <JeeLib.h> // https://github.com/jcw/jeelib
#include "pins_arduino.h"

ISR(WDT_vect) { Sleepy::watchdogEvent(); } // interrupt handler for JeeLabs Sleepy power saving

#define myNodeID 27      // RF12 node ID in the range 1-30
#define network 210      // RF12 Network group
#define freq RF12_868MHZ // Frequency of RFM12B module

#define LEDpin 1

void setup() {


  rf12_initialize(myNodeID,freq,network); // Initialize RFM12 with settings defined above
  // Adjust low battery voltage to 2.2V
  rf12_sleep(0);                          // Put the RFM12 to sleep
  //Leave timer 0 going for delay() function

   // Datasheet says that to power off the USB interface we have to do 'some' of:
   //       Detach USB interface
   //      Disable USB interface
   //      Disable PLL
   //      Disable USB pad regulator

   // Disable the USB interface
   USBCON &= ~(1 << USBE);
   // Disable the VBUS transition enable bit
   USBCON &= ~(1 << VBUSTE);
   // Disable the VUSB pad
   USBCON &= ~(1 << OTGPADE);
   // Freeze the USB clock
   USBCON &= ~(1 << FRZCLK);
   // Disable USB pad regulator
   UHWCON &= ~(1 << UVREGE);
   // Clear the IVBUS Transition Interrupt flag
   USBINT &= ~(1 << VBUSTI);
   // Physically detact USB (by disconnecting internal pull-ups on D+ and D-)
   UDCON |= (1 << DETACH);


  SMCR |=(1<<SM1);//Power down
  SMCR |=(1<<SE); //Enable sleep mode
  __asm__ __volatile__ ("sleep" "\n\t" :: );

// I expect uA readings here, but get 3mA...

void loop() {

Any tips are welcome, is it a hardware design issue, or software consideration?

[edit] I realize I didn't mention it, but I power the board from a 3.3V source directly at the VCC pin.
I don't have the  LTC3525 boost regulator circuitry poplated for this board build, jut the MCP1703. I tried completely unsoldering it after I programmed the board with the test sketch, but no improvement happened. I also experimented with fuses, disabling BOD, switching clock source from the external crystal to internal one.


OK I think I found the issue, I was powering the board from a quite noisy 3.3V source therefore mu multimer was going crazy. Powering from couple AA batteries gives me now 0.13mA, which is still high, but much better. I will see how I can get that even lower

Go Up