Go Down

Topic: What can I expect from my ATmega328 when the batteries run down? (Read 843 times) previous topic - next topic

BlueJakester

I have an ATmega328 with DS1307 clock and 4x7-segment display on a project board. It's powered by 3xAA batteries. I'm going to run it until the power is drained and wondered what behavior I might expect when power gets low?

Will the '328 simply shutdown, or maybe bad data, scrambled display, or something else?  I'm assuming no harm will come to the device.

Thanks,
Jake

James C4S

Assuming the brown-out fuse is set, when VCC sags below the brown-out threshold the ATmega will hold itself in RESET.

How the display or the RTC will act isn't probably as well defined.
Capacitor Expert By Day, Enginerd by night.  ||  Personal Blog: www.baldengineer.com  || Electronics Tutorials for Beginners:  www.addohms.com

BlueJakester

#2
Aug 18, 2012, 11:50 pm Last Edit: Aug 18, 2012, 11:52 pm by BlueJakester Reason: 1
Thanks James. I burned the "Duemilanove w/ ATmega328" bootloader onto a blank 328p myself, so if the brown-out fuse is on by default I should be OK. The RTC has the battery backup, so I'm probably OK there too. I don't really care if the display gets weird, that can be my indicator the batteries need replacing  XD

James C4S

I would think you need to verify the voltage at when the rtc switches to its battery and not just assume it'll work.
Capacitor Expert By Day, Enginerd by night.  ||  Personal Blog: www.baldengineer.com  || Electronics Tutorials for Beginners:  www.addohms.com

BlueJakester

Thanks. The RTC is a DS1307 and I found this in the datasheet:


BlueJakester

#5
Aug 19, 2012, 02:21 am Last Edit: Aug 19, 2012, 02:25 am by BlueJakester Reason: 1
UPDATE: The batteries ran down below a level that was acceptable. They lasted about 10 hours. Incorrect time digits were being intermittently displayed. So now I know.

I put in some fresh batteries and all was well. But for now I've hooked up a 5V wall-wart and am running fine. I don't think batteries are going to be a viable power option, unless it's for a quick demo when I don't have access to AC power.

CraigKC

I wanted to add that BOD is not as simple as "on" or "off" and has multiple levels that it can be set for.  In order to determine whether you're going to get rogue instruction execution you need to make sure your clock speed matches your BOD setting.  For example, you can set a BOD of 1.8V if you're running 2Mhz or less.  You'll want a BOD of 2.7V for 8Mhz and 4.3V for 16Mhz+.  Double-check those exact numbers with the datasheet.

If you choose a BOD setting too low for your given clock speed you'll indeed get incorrect/rogue execution of instructions at some point.  Is it possible you are using the default BOD of 2.7V and 16Mhz?  That would explain the instability.  If you can slow the clock down you can run reliably at lower voltages.  The best option considering the needs of your RTC seems to be BOD of 2.7V and 8Mhz.  Try that.

DuaneB

More or less on topic question -

I have two Arduino's running from batteries, one uses a crystal and the other a resonator - I assume that the clock of the cyrstal Arduino will not slow down with a falling battery voltage, how about the resonator ?

Duane B
Read this
http://rcarduino.blogspot.com/2012/04/servo-problems-with-arduino-part-1.html
then watch this
http://rcarduino.blogspot.com/2012/04/servo-problems-part-2-demonstration.html

Rcarduino.blogspot.com

Go Up