Sleep Mode & batteries


I figured this was the best place to post this question.

I am developing a project at the minute which will require the prototype to be in use for about a month straight, without anyone touching it again. I was initally thinking of sending the data received by the prototype over a wifi connection, but now I am thinking it may be better to store it on an SD card. But this presents its own problems. Mainly powering the Uno board and a datalogging shield for that period of time (obviously).

So, I was thinking of putting it into sleep mode. However, the Arduino website seesm to say that sleep mode is not ideal.

If I was to put the prototype into sleep, what sort of issues could come up? Or, should I stay away from the sleep mode altogether?

As far as power goes, I was looking at the 6 x AAs battery pack, but if anyone has any other suggestions, I would be glad to hear them, I am still not 100% how long this would last considering the amount of time the prototype could be used is random.

Thanks in advance.


You should be able to save a good deal of power by NOT supplying 9V to the regulator (the Vin pin) but rather supply 4.5V directly to the processor (the 5V pin). The regulator is going to throw away quite a bit of power to regulate the voltage.

If you run the processor at lower speed (8 MHz) you can run on 3V and save even more power. This would also eliminate some of the level shifting normally needed for the 3.3V SD card.

You probably don't need the USB chip to be on for a month so you might want to try one of the small bare-bones boards.

If you need a clock, use an external RTC. The Arduino clock isn't going to be very accurate after a month.

Use a timer to wake up when it's time to log data. Sleep otherwise.


Thanks for the reply!

I am going to use the Openlog data logger from Sparkfun, with the Pro Mini.

Yea, I figured using sleep mode was the best way to go, I just wanted to make sure there was no hidden issues with this! :)

As for the other thibgs you mentioned, thanks! I will need to look into how I do all that ;)



I think one caveat when sleeping is that if you use a very deep sleep the millisecond timer stops during sleep and if you use a shallow sleep the system wakes up 1000 times a second to service the millisecond timer. Shallow sleep wouldn't be very energy efficient and with deep sleep you can't easily measure the passage of time.

How often are you going to be doing your logging?

Well, there is likely to be large chunks of the night when I would want it to sleep.


Sorry to bring this post back from the dead, but I figured it was better than writing a new post along the same lines.

So, my question: If I put my system into sleep after a period of inactivity ...say, a few minutes, can I wake it up it there is activity on the analogRead. I am just wondering, because I would like my system to wake up when force is detected on an FSR.

And if they can be done, how would you go about it? I have never used speed mode, and I don't know how to come out of it.

Much thanks in advance.


You can't sleep and perform an analogRead. What sort of latency can you accept? You could use one of the watchdog timers to wake up, say, every half second, look at the input and go back to sleep if nothing is going on.

Latency in what respect? How long after waking would a reading be taken?

Right, so I can't use the analogRead to wake up, so then timers is the only way? I would ideally like to put my system into sleep for long periods of time. I mean, generally through the night time, there would be no readings been taken (only on rare occassions). So, if at all possible, I would rather not wake up very half second with the WDT (or any other time for that matter haha).

But maybe this just cannot be done. Maybe waking up that often is the only way.

Even if it woke up that often, it is still saving a lot of power while it sleeps, isn't it?


o.fithcheallaigh: Latency in what respect?

How long can you safely ignore the FSR between checks. If the "events" you want to look for generally last 1 second then if you wake up every 1/2 second you won't miss one. If your events are 1/4 second long you will miss about half of ten if you only check very 1/2 second.

Can you add circuitry to cause an external interrupt when you want the Arduino to wake up?

Hmmm well, 1/2 a second would be too close for comfort I think. So, in that case I guess I will have to set up a counter to overflow every, say, 200ms and look for activity, clear the flag and then reset?


johnwasser: Can you add circuitry to cause an external interrupt when you want the Arduino to wake up?

Oh, sorry, probably not. Room is limited. But could be something I could look into for later versions!


The watchdog can be set to wake the processor at intervals of (approximately) 16ms, 32ms, 64ms, 128ms, 250ms, 500ms, 1s, 2s, 4s, 8s.

Ok cool! That's probably the best way to go then.

Thanks for everyones help :grin: