Pages: [1]   Go Down
Author Topic: What can I expect from my ATmega328 when the batteries run down?  (Read 799 times)
0 Members and 1 Guest are viewing this topic.
Colorado
Offline Offline
Full Member
***
Karma: 1
Posts: 170
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Fort Lauderdale, FL
Offline Offline
Faraday Member
**
Karma: 71
Posts: 6144
Baldengineer
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Capacitor Expert By Day, Enginerd by night.  ||  Personal Blog: www.baldengineer.com  || Electronics Tutorials for Beginners:  www.addohms.c

Colorado
Offline Offline
Full Member
***
Karma: 1
Posts: 170
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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  smiley-lol
« Last Edit: August 18, 2012, 04:52:11 pm by BlueJakester » Logged

Fort Lauderdale, FL
Offline Offline
Faraday Member
**
Karma: 71
Posts: 6144
Baldengineer
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I would think you need to verify the voltage at when the rtc switches to its battery and not just assume it'll work.
Logged

Capacitor Expert By Day, Enginerd by night.  ||  Personal Blog: www.baldengineer.com  || Electronics Tutorials for Beginners:  www.addohms.c

Colorado
Offline Offline
Full Member
***
Karma: 1
Posts: 170
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Logged

Colorado
Offline Offline
Full Member
***
Karma: 1
Posts: 170
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
« Last Edit: August 18, 2012, 07:25:39 pm by BlueJakester » Logged

0
Offline Offline
Jr. Member
**
Karma: 0
Posts: 84
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Dubai, UAE
Offline Offline
Edison Member
*
Karma: 22
Posts: 1675
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged


Pages: [1]   Go Up
Jump to: