Go Down

Topic: Preserve battery with Sleep ? (Read 8935 times) previous topic - next topic

Yeast

I am working with arduino pro mini 3.3V connecting with IR temperature sensors, openlog, a few RGB LEDs and a buzzer. I followed the example on  sleep function here http://www.arduino.cc/playground/Learning/ArduinoSleepCode and put arduino to sleep when it is inactive for 8 seconds while it will wake when a interrupt button is pressed.

I attached a Li-Po battery 110mAh to it and after a day it run out of battery.
I also found another example on battery saving at http://interface.khm.de/index.php/lab/experiments/sleep_watchdog_battery/
Will watchdog + sleep help to save more battery power ? I need to have it running without changing battery for at least 5 days.

nickgammon

Why wait 8 seconds? Anyway you need to measure the current consumption. It sounds like it is using a lot more than sleep current.

I did an example here:

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

That used sleep plus a watchdog. Whilst asleep it used 25 uA so that should last quite a few days on a 110 mAh battery.

You will need a LOW level interrupt to wake it, as other interrupts are not processed when asleep (RISING, FALLING, CHANGE).

You may need to minimize the use of LEDs and buzzers. Also, as illustrated on the page I linked to, you can turn off internal functions like the ADC converter, to save power while asleep.
Please post technical questions on the forum, not by personal message. Thanks!

More info: http://www.gammon.com.au/electronics

Yeast

How do I measure the current consumption ??

The program is actually consist of a few steps of task to be perform.
Which also include changing of location of measurement but the between task time shouldn't exceed 8 seconds, it could be minimize to 4 or 3 seconds but it wouldn't make much difference I guess.
I am currently used HIGH interrupt as when the button is press then wake up. "attachInterrupt(1, wakeUpNow, HIGH);"
It is intended to be used like once a day so the used of LED and buzzer is only use during the performance of task so I hope to keep it the way it is.
Is the sensors other component still consuming the power even when arduino sleep?



CrossRoads

Put your multimeter in mA mode.
Disconnect the battery + connection, connect it to red meter probe.
Connect black meter probe to Vcc pin on the promini.

So now the meter is in series between the battery+ and the arduino VCC. Turn it on. Should see  a  jump in current as the part wakes up and does the readings.
If it does the functions really fast you won't get a good reading - have them repeat  for a second or so in that case.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

pekkaa

#4
Oct 28, 2011, 06:34 am Last Edit: Oct 28, 2011, 09:38 am by pekkaa Reason: 1
Depending on how you designed it, the other parts of you circuit may (and probably will) draw current while the Arduino is sleeping. Post the shematic that we can check is it possible to minimize the power consumption.

nickgammon


I am currently used HIGH interrupt as when the button is press then wake up. "attachInterrupt(1, wakeUpNow, HIGH);"


That won't work. Only a LOW interrupt wakes the processor from sleep.

Besides which, there is no such thing as a HIGH interrupt:

http://arduino.cc/en/Reference/AttachInterrupt

Only LOW, CHANGE, RISING, FALLING.

Quote
Is the sensors other component still consuming the power even when arduino sleep?


Yes, which is why I said above:


Also, as illustrated on the page I linked to, you can turn off internal functions like the ADC converter, to save power while asleep.
Please post technical questions on the forum, not by personal message. Thanks!

More info: http://www.gammon.com.au/electronics

Yeast

#6
Oct 28, 2011, 08:38 am Last Edit: Oct 28, 2011, 09:04 am by Yeast Reason: 1
@Nick
Thanks Nick :)
I will try that out later on today.

@Pekkaa
I will get working on the schematic right away

Yeast

Please excuse my bad drawing skill.

pekkaa

Don't you have current limiting resistors in the front of the RGB leds? What what are the two boxes in the top right corner? I can't read the text above them.

nickgammon

Please post technical questions on the forum, not by personal message. Thanks!

More info: http://www.gammon.com.au/electronics

pekkaa

I  have newer used buzzers, but shouldn't you have a resistor in the front of it also?

Yeast

I am currently using the RGB from the lilypad series (http://www.sparkfun.com/products/8467).
The soft button made up of two layers of conductive fabric separated by a layer of sponge.
One side is connected to ground and input. The another is connected to VCC.
How can I make one that produce LOW when it is press to be replace with this one ??
Are the resistors necessary ??? Will it help in reducing power consumption or does it provide more stability ?

pekkaa

#12
Oct 28, 2011, 05:46 pm Last Edit: Oct 28, 2011, 05:54 pm by pekkaa Reason: 1
You absolutely need to add the resistors. Check the shematic from the page you linked. It shows how to wire the resistors. Without the resistors the leds draw to much current. It may damage both the Arduino and the leds. And yes, the resistors will reduce the power consumption.

Check also the buzzer's specs. It may need a resistor as well. Btw, do you know how much current the openlog in your diagram draws while idling?

pekkaa

#13
Oct 28, 2011, 06:16 pm Last Edit: Oct 28, 2011, 06:24 pm by pekkaa Reason: 1
Quote
How can I make one that produce LOW when it is press to be replace with this one ??


Wire the other end of the button into the GND pin.  Remove the pull down resistor R from your diagram and enable the Arduino's internal pull up, http://www.arduino.cc/en/Tutorial/DigitalPins. Or if you want use an external pull up, connect it into the Arduino's Vcc pin.

And the most important thing: What is the battery's voltage? Is it 3.3V? If it is higher than that, you need to connect it into the RAW pin instead of Vcc.

Btw, the schematic on the Sparkfun's page is for 5V. You need the calculate resistor values for 3.3V yourself.

Yeast

#14
Oct 28, 2011, 06:41 pm Last Edit: Oct 28, 2011, 06:48 pm by Yeast Reason: 1
Quote
What is the battery's voltage?

It is 3.7V and I totally forget about the RAW pin - -"
And I have no idea how much openlog (http://www.sparkfun.com/products/9530) consume while idling.

Next question will be do I need a watchdog or just sleep function is enough?

Go Up