Atmega328 powered by 3.7v lipo

Hi,

I read an article in the playground that said I could run the Atmega8 off a 3.7v li-ion http://arduino.cc/playground/Learning/ArduinoSleepCode. Will this work with an Atmega328?

I would welcome a pointer in the right direction eg tutorial so I can learn about using 3.7v li-ion /lipo supplies with the Atmega.

Cheers

Connect your 3.7v battery to Ground (-) and +5V (+). The rated operating speed for the ATmega is (5.555 MHz/Volt) - 5 MHz (for voltages over 2.7) so a voltage of 3.7 would get you a speed of about 15.5 MHz. You could play it safe by running at 8MHz or overclock a bit by running at 16 MHz (the only two valid choices for Arduino).

I would not expect to get 3.3V from the 3.3V pin if you are running on 3.7V

Some board versions are actually intended to be run from a 3.7v LiPo, like the 3.3V Arduino Pro, for example.

I use a 8 MHz Promini from 3.7V LiPo in a remote control, runs fine, recharge it every 4-5 weeks.
Will eventually rebuild it into a standalone '328 design, drop the regulator which I’m bypassing.

Max1811 to recharge it from a 5V source.

Many Thanks Everyone,

that is a great help.

I'll have play with 3.7v and see if I can put it to sleep and wake it up by external stimulus eg clock.

I'm working on an idea for a low power data logger (temperature) for my garden and will need to use solar to top up the battery. I already have a solar charger for 3.7v lipo from some old outdoor Christmas lights.

I got an Arduino datalogging, running off a 12v battery, and was using a PIC16F84a (running on lowish power) to switch on the arduino via a relay. The arduino logs data for a few seconds every 10mins then is switched off - hence saving power. I know the PIC and relay seems like overkill but I had some anyway to play with.

But I now want a more elegant solution, that's why I thought of sleep, interupts (via clock) and solar/ lipo and low power. Should I use the promini I wonder? I don't have any but do have quite a few 328's. Is there an advantage (apart form small size) of using ProMini? I'll be happy if my datalogger is about the size of a brick, in fact I might disguise it as one :)

Cheers

Skip the promini & just build one up standalone. No regulator, no power LED, just tthe ATMega, 8 MHz xtal, two22pf caps, 100nF caps on the VCC/AVCC/Aref pins. What are you storing data to?

I've done some research into saving power here:

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

You should be able to get the Atmega328 running at 3.3V down to 5 uA of current whilst sleeping (most used by the watchdog timer).

That should last you for ages. I hardly think you need a second processor to turn the first one on.

Thanks for all the input,

Currently I'm using an SD card on a NuElectronics budget ($18) data shield (http://www.nuelectronics.com/estore/index.php?main_page=product_info&cPath=7&products_id=20&zenid=fc648049d871367a7da1cfc6d42f078a) which works fine with the Arduino Uno board. I'll need work out if it can work with lower voltages, or somehow boost 3.7 to 5v during logging.

Will I still need an external RTC to interupt the atmega from a deep sleep? I note that some RTC chips have programmable "pulses" so I could wake the atmega periodically, but only when data is to be collected. There is an RTC DS1302 on the datalogger shield, but it doesn't have such a feature.

Cheers

As I described on the above page, you can use the watchdog timer to wake you after 8 seconds. Of course that might be too soon, but a loop of 8 such pauses, and you have over a minute. After all, for datalogging it wouldn't need to be millisecond accuracy.

According to this:

http://en.wikipedia.org/wiki/Secure_Digital

The SD card itself works on 3.3V, I don't know the impact of putting 3.3V into the shield.

However I have seen projects described where you simply connect directly to an SD card (after all, they just use SPI). If you get a micro-SD card, and then one of those SD-card adapters, you solder wires onto the adapter, and then plug the SD card inside it.

Thanks Nick

I'm working on setting the fuses to minimise power use and use the WDT with sleeps and interupts etc.. as per your link http://www.gammon.com.au/forum/?id=11497. I'm using an STK500 compatible ISP and avr studio 4 to play with fuses (I had a problem with studio 5.0 recognising my Olimax stk500)

When the 328 is set to use the internal oscillator does the external Xtal-capacitor rig still use power, even though it is not used by the avr? If so maybe I should leave it out of my circuit. However it seems useful to have the option of using the external crystal sometimes, so I can maybe use USB or FTDI too.

Cheers

I doubt the external crystal would use an appreciable amount of power if not activated. On my test board, and during my tests, I was getting under one microamp consumption in various modes, and that was without detaching the crystal.

Hi…

Have a look at seeedstudios Stalker … an arduino made especially for datalogging…
http://www.seeedstudio.com/depot/seeeduino-stalker-v2-p-727.html?cPath=132_133

[quote author=Nick Gammon link=topic=86611.msg683199#msg683199 date=1328731103] I doubt the external crystal would use an appreciable amount of power if not activated. On my test board, and during my tests, I was getting under one microamp consumption in various modes, and that was without detaching the crystal. [/quote]

It can't make a difference to leave the caps/xtal in circuit when the oscillators switched off since at DC the caps and the crystal all look like open-circuits... Since the oscillator has an internal bias resistor then when it is switched off the oscillator input terminal won't be floating either. Also those folks at AVR thought of this (they wouldn't sell many chips if it couldn't be used standalone at micro-power levels!)

Thanks for the input,

Seeeduino Stalker v2

Thanks I'll have a look at that.

Yes I guessed the avr designers thought of the internal / external osc issue. Just wanted to check.

Cheers

Check this might help you http://ladyada.net/products/usbdcsolarlipo/index.html

Pravas: that solar charger is cool - thanks 8) for the tip

Hi Nick,

I’ve got the fuses on the 328 set to minimise Power consumption except I am using the 8MHz internal (I still have the external 8MHz as well for reasons mentioned earlier).

Voltage set at 3.7v and current during sleep is 5.1uA - yippee. I’m well chuffed, only 18.87uW in sleep mode as per your code sample

I am using a minimalist board Cisesco XINO http://proto-pic.co.uk/xino-basic-for-the-atmel-atmega-series-and-arduino/. NB I also dumped the power LED.

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

const byte LED = 13;

void flash ()
  {
  pinMode (LED, OUTPUT);
  for (byte i = 0; i < 10; i++)
    {
    digitalWrite (LED, HIGH);
    delay (50);
    digitalWrite (LED, LOW);
    delay (50);
    }
    
  pinMode (LED, INPUT);
    
  }  // end of flash
  
// watchdog interrupt
ISR (WDT_vect) 
{
   wdt_disable();  // disable watchdog
}  // end of WDT_vect
 
void setup () { }

void loop () 
{
 
  flash ();
  
  // disable ADC
  ADCSRA = 0;  

  // clear various "reset" flags
  MCUSR = 0;     
  // allow changes, disable reset
  WDTCSR = _BV (WDCE) | _BV (WDE);
  // set interrupt mode and an interval 
  WDTCSR = _BV (WDIE) | _BV (WDP3) | _BV (WDP0);    // set WDIE, and 8 seconds delay
  wdt_reset();  // pat the dog
  
  set_sleep_mode (SLEEP_MODE_PWR_DOWN);  
  sleep_enable();
 
  // turn off brown-out enable in software
  MCUCR = _BV (BODS) | _BV (BODSE);
  MCUCR = _BV (BODS); 
  sleep_cpu ();  
  
  // cancel sleep as a precaution
  sleep_disable();
  
  } // end of loop

I tried setting the internal Oscillator fuse to 128KHz but the sketches didn’t work.

But anyway I’m happy with <6uA when using the Internal 8MHz osc. [I wonder why the sketches don't work though?]

I am also getting 3.6v out of the output Pins, when set to high and the 328 is awake, so that should be enough to operate an SD card,

Cheers

PS

NuElectronics SD shield is working