+ All Categories
Home > Documents > How to Run an Arduino for Years on a Battery - Open Home Automation

How to Run an Arduino for Years on a Battery - Open Home Automation

Date post: 11-Dec-2015
Category:
Upload: rismawan
View: 41 times
Download: 2 times
Share this document with a friend
Description:
tutorial dari internet untuk membuat sistem arduino low power, hemat baterai
17
How to Run an Arduino for Years on a Battery If you found this article after doing a search on Google, welcome! On this website you will find plenty of content around DIY home automation using open-source hardware. Enjoy the article! For most of the Arduino tutorials you will find on this website, power is usually not an issue as the Arduino is powered by the USB cable coming from the computer. However, sometimes you want to build systems that are going to be autonomous and powered by a battery. For example, you want to power the wireless motion detector [http://openhomeautomation.net/wireless- motion-sensor-arduino/] just by using a set of batteries. The first idea would be to connect directly an Arduino board like the Arduino Uno R3 to a battery. Easy, right ? Well, it would work, but your battery would be depleted in a matter of days because some components like voltage regulators are always sucking power. So we need August 7, 2013 / 60 Comments / in Arduino, Tutorials / by Marco Schwartz
Transcript
Page 1: How to Run an Arduino for Years on a Battery - Open Home Automation

How to Run an Arduino for Yearson a Battery

If you found this article after doing a search on Google,welcome! On this website you will find plenty ofcontent around DIY home automation using open-sourcehardware. Enjoy the article!

For most of the Arduino tutorials you will find on thiswebsite, power is usually not an issue as the Arduino ispowered by the USB cable coming from the computer.However, sometimes you want to build systems that aregoing to be autonomous and powered by a battery.

For example, you want to power the wireless motiondetector [http://openhomeautomation.net/wireless-motion-sensor-arduino/] just by using a set of batteries.The first idea would be to connect directly an Arduinoboard like the Arduino Uno R3 to a battery. Easy, right ?Well, it would work, but your battery would be depleted ina matter of days because some components like voltageregulators are always sucking power. So we need

August 7, 2013 / 60 Comments / in Arduino, Tutorials / by Marco Schwartz

Page 2: How to Run an Arduino for Years on a Battery - Open Home Automation

something better.

The first thing we need is to build our own Arduino systemwith just the minimal set of components. This will besimilar to a previous article[http://openhomeautomation.net/arduino-breadboard/] ,but with even less components. The second part is tooptimize the software so that the system only consumespower when it is actually doing something. And that’sexactly what we will see in this article.

Hardware & Software Requirements

You need several components to build you own Arduinosystem. The main piece of this project is of course themicrocontroller that will run your Arduino sketches, likethe Atmel ATmega328[http://target.georiot.com/Proxy.ashx?TSID=5093&GR_URL=http%3A%2F%2Fwww.amazon.com%2Fgp%2Fproduct%2FB007SH0D0A%2Fref%3Das_li_qf_sp_asin_il_tl%3Fie%3DUTF8%26camp%3D1789%26creative%3D9325%26creativeASIN%3DB007SH0D0A%26linkCode%3Das2%26tag%3Dnevjusfin-20] . You will need a chip with the Arduino bootloader.Buy your chip with it, it will make your life easier. In aprevious project I used a FTDI breakout board[http://target.georiot.com/Proxy.ashx?TSID=5093&GR_URL=http%3A%2F%2Fwww.amazon.com%2Fgp%2Fproduct%2FB0068QKQEA%2Fref%3Das_li_qf_sp_asin_il_tl%3Fie%3DUTF8%26camp%3D1789%26creative%3D9325%26creativeASIN%3DB0068QKQEA%26linkCode%3Das2%26tag%3Dnevjusfin-20] to program the Arduino chip directly on thebreadboard. But for this project I won’t have any externalpower running on the breadboard so I will just use anArduino Uno board to program the microcontroller.

To power the Arduino, you will need a battery. The best isto power the Arduino directly from the battery, so youdon’t have to use any voltage regulators that will sucksome power. I used a set of two AA batteries[http://target.georiot.com/Proxy.ashx?TSID=5093&GR_URL=http%3A%2F%2Fwww.amazon.com%2Fgp%2Fproduct%2FB0006SDBAM%2Fref%3Das_li_qf_sp_asin_il_tl%3Fie%3DUTF8%26camp%3D1789%26creative%3D9325%26creativeASIN%3DB0006SDBAM%26linkCode%3Das2%26tag%3Dnevjusfin-20] (1.5V each) with a battery holder[http://target.georiot.com/Proxy.ashx?TSID=5093&GR_URL=http%3A%2F%2Fwww.amazon.com%2Fgp%2Fproduct%2FB008SNZQ0A]

Page 3: How to Run an Arduino for Years on a Battery - Open Home Automation

thus powering the microcontroller with around 3V, whichis fine according to the ATmega328 documentation[http://www.atmel.com/devices/atmega328.aspx] .

You will also need several components around the chip.You will need one 10uF capacitor[http://target.georiot.com/Proxy.ashx?TSID=5093&GR_URL=http%3A%2F%2Fwww.amazon.com%2Fgp%2Fproduct%2FB0052GNODM%2Fref%3Das_li_qf_sp_asin_il_tl%3Fie%3DUTF8%26camp%3D1789%26creative%3D9325%26creativeASIN%3DB0052GNODM%26linkCode%3Das2%26tag%3Dnevjusfin-20] , two 22pF capacitors[http://target.georiot.com/Proxy.ashx?TSID=5093&GR_URL=http%3A%2F%2Fwww.amazon.com%2Fgp%2Fproduct%2FB0087ZBK4K%2Fref%3Das_li_qf_sp_asin_il_tl%3Fie%3DUTF8%26camp%3D1789%26creative%3D9325%26creativeASIN%3DB0087ZBK4K%26linkCode%3Das2%26tag%3Dnevjusfin-20] , one 10K Ohm resistor[http://target.georiot.com/Proxy.ashx?TSID=5093&GR_URL=http%3A%2F%2Fwww.amazon.com%2Fgp%2Fproduct%2FB00B5RJF1M%2Fref%3Das_li_qf_sp_asin_il_tl%3Fie%3DUTF8%26camp%3D1789%26creative%3D9325%26creativeASIN%3DB00B5RJF1M%26linkCode%3Das2%26tag%3Dnevjusfin-20] , one 220 Ohm resistor[http://target.georiot.com/Proxy.ashx?TSID=5093&GR_URL=http%3A%2F%2Fwww.amazon.com%2Fgp%2Fproduct%2FB00B5LNEF6%2Fref%3Das_li_qf_sp_asin_il_tl%3Fie%3DUTF8%26camp%3D1789%26creative%3D9325%26creativeASIN%3DB00B5LNEF6%26linkCode%3Das2%26tag%3Dnevjusfin-20] , one green LED [http://target.georiot.com/Proxy.ashx?TSID=5093&GR_URL=http%3A%2F%2Fwww.amazon.com%2Fgp%2Fproduct%2FB006G6TKQW%2Fref%3Das_li_qf_sp_asin_il_tl%3Fie%3DUTF8%26camp%3D1789%26creative%3D9325%26creativeASIN%3DB006G6TKQW%26linkCode%3Das2%26tag%3Dnevjusfin-20] , and one 16MHz crystal clock[http://target.georiot.com/Proxy.ashx?TSID=5093&GR_URL=http%3A%2F%2Fwww.amazon.com%2Fgp%2Fproduct%2FB005MN8FPW%2Fref%3Das_li_qf_sp_asin_il_tl%3Fie%3DUTF8%26camp%3D1789%26creative%3D9325%26creativeASIN%3DB005MN8FPW%26linkCode%3Das2%26tag%3Dnevjusfin-20] .

Finally, you will need a breadboard and some jumperwires [http://target.georiot.com/Proxy.ashx?TSID=5093&GR_URL=http%3A%2F%2Fwww.amazon.com%2Fgp%2Fproduct%2FB004RXKWDQ%2Fref%3Das_li_qf_sp_asin_il_tl%3Fie%3DUTF8%26camp%3D1789%26creative%3D9325%26creativeASIN%3DB004RXKWDQ%26linkCode%3Das2%26tag%3Dnevjusfin-20] .

This is the list of the components that were used in thisarticle:

Atmel ATmega328[http://target.georiot.com/Proxy.ashx?TSID=5093&GR_URL=http%3A%2F%2Fwww.amazon.com%2Fgp%2Fproduct%2FB007SH0D0A%2Fref%3Das_li_qf_sp_asin_il_tl%3Fie%3DUTF8%26camp%3D1789%26creative%3D9325%26creativeASIN%3DB007SH0D0A%26linkCode%3Das2%26tag%3Dnevjusfin-20]

10uF capacitor [http://target.georiot.com/Proxy.ashx?TSID=5093&GR_URL=http%3A%2F%2Fwww.amazon.com%2Fgp%2Fproduct%2FB0052GNODM%2Fref%3Das_li_qf_sp_asin_il_tl%3Fie%3DUTF8%26camp%3D1789%26creative%3D9325%26creativeASIN%3DB0052GNODM%26linkCode%3Das2%26tag%3Dnevjusfin-

Page 4: How to Run an Arduino for Years on a Battery - Open Home Automation

20]

Two 22pF capacitors[http://target.georiot.com/Proxy.ashx?TSID=5093&GR_URL=http%3A%2F%2Fwww.amazon.com%2Fgp%2Fproduct%2FB0087ZBK4K%2Fref%3Das_li_qf_sp_asin_il_tl%3Fie%3DUTF8%26camp%3D1789%26creative%3D9325%26creativeASIN%3DB0087ZBK4K%26linkCode%3Das2%26tag%3Dnevjusfin-20]

10K Ohm resistor[http://target.georiot.com/Proxy.ashx?TSID=5093&GR_URL=http%3A%2F%2Fwww.amazon.com%2Fgp%2Fproduct%2FB00B5RJF1M%2Fref%3Das_li_qf_sp_asin_il_tl%3Fie%3DUTF8%26camp%3D1789%26creative%3D9325%26creativeASIN%3DB00B5RJF1M%26linkCode%3Das2%26tag%3Dnevjusfin-20]

220 Ohm resistor[http://target.georiot.com/Proxy.ashx?TSID=5093&GR_URL=http%3A%2F%2Fwww.amazon.com%2Fgp%2Fproduct%2FB00B5LNEF6%2Fref%3Das_li_qf_sp_asin_il_tl%3Fie%3DUTF8%26camp%3D1789%26creative%3D9325%26creativeASIN%3DB00B5LNEF6%26linkCode%3Das2%26tag%3Dnevjusfin-20]

One green LED [http://target.georiot.com/Proxy.ashx?TSID=5093&GR_URL=http%3A%2F%2Fwww.amazon.com%2Fgp%2Fproduct%2FB006G6TKQW%2Fref%3Das_li_qf_sp_asin_il_tl%3Fie%3DUTF8%26camp%3D1789%26creative%3D9325%26creativeASIN%3DB006G6TKQW%26linkCode%3Das2%26tag%3Dnevjusfin-20]

16MHz crystal clock[http://target.georiot.com/Proxy.ashx?TSID=5093&GR_URL=http%3A%2F%2Fwww.amazon.com%2Fgp%2Fproduct%2FB005MN8FPW%2Fref%3Das_li_qf_sp_asin_il_tl%3Fie%3DUTF8%26camp%3D1789%26creative%3D9325%26creativeASIN%3DB005MN8FPW%26linkCode%3Das2%26tag%3Dnevjusfin-20]

Battery holder [http://target.georiot.com/Proxy.ashx?TSID=5093&GR_URL=http%3A%2F%2Fwww.amazon.com%2Fgp%2Fproduct%2FB008SNZQ0A]

2 AA batteries [http://target.georiot.com/Proxy.ashx?TSID=5093&GR_URL=http%3A%2F%2Fwww.amazon.com%2Fgp%2Fproduct%2FB0006SDBAM%2Fref%3Das_li_qf_sp_asin_il_tl%3Fie%3DUTF8%26camp%3D1789%26creative%3D9325%26creativeASIN%3DB0006SDBAM%26linkCode%3Das2%26tag%3Dnevjusfin-20]

Breadboard and some jumper wires[http://target.georiot.com/Proxy.ashx?TSID=5093&GR_URL=http%3A%2F%2Fwww.amazon.com%2Fgp%2Fproduct%2FB004RXKWDQ%2Fref%3Das_li_qf_sp_asin_il_tl%3Fie%3DUTF8%26camp%3D1789%26creative%3D9325%26creativeASIN%3DB004RXKWDQ%26linkCode%3Das2%26tag%3Dnevjusfin-20]

On the software side, you just need the usual ArduinoIDE. Note that in this tutorial, we will only cover a tiny partof the possibilities offered by the Arduino platform. If youwant to learn more about the basics of Arduino, Irecommend the excellent Up and Running with Arduino

Page 5: How to Run an Arduino for Years on a Battery - Open Home Automation

course [http://www.lynda.com/Arduino-tutorials/Up-Running-Arduino/162273-2.html?utm_medium=ldc-partner&utm_source=SSPRC&utm_content=524&utm_campaign=CD17065&bid=524&aid=CD17065].

Hardware Configuration

This project is a bit complex to build, so be sure to followthe instructions. This is how it should look like at the end:

First, put the microcontroller in the center of thebreadboard. You can then take care about the power:connect power lines on each side, connect the negativepower rail to the two GND pins of the microcontroller, andthe positive power rail to VCC, AVCC, and AREF. Also, addthe 10uF capacitor between two power rails. Finally, addthe battery to the system.

You also have to add the crystal between the X1 and X2pins, with 22pF capacitors going from each pin to theground. Also, you need to connect the RST pin to thepositive power rail using a 10K Ohm resistor. To see if thesystem is working, connect the green LED in series with a

[http://openhomeautomation.net/wp-content/uploads/2013/08/arduino_low_power.jpg]

Page 6: How to Run an Arduino for Years on a Battery - Open Home Automation

220 Ohm resistor to the digital pin 13 of the Arduinoboard, the other side going to the ground.

This is the complete schematics of the project:

Testing your Arduino system

It’s now time to test if the hardware part is working. What Idid in this project is to use the Arduino Uno board toprogram the chip, and then I just “transplanted” the chipon the breadboard. You can just use the default “blink”sketch to program the microcontroller. After this is done,just replace the chip on the breadboard, and plug yourbattery (my battery pack even has a nice on/off switch).The LED should just goes on and off every second asexpected.

Optimizing for Low-power

So now, we have an autonomous Arduino system. But itstill consuming way too much power. Indeed, even whenthe LED is off, the Arduino chip is still active and

[http://openhomeautomation.net/wp-content/uploads/2013/08/arduino_low_power_schem1.jpg]

Page 7: How to Run an Arduino for Years on a Battery - Open Home Automation

consumes power. But there are functions on themicrocontroller to put it to sleep during the time it isinactive, and re-activate the chip when we need to changethe state of an output or to perform some measurements.I tested many solutions to really reduce the power to thelowest value possible, and the best I found is the JeeLiblibrary [https://github.com/jcw/jeelib] . You can justdownload it [https://github.com/jcw/jeelib] and install it byplacing the folder in your Arduino/libraries/ folder.

This is the sketch I used:

You basically just have to include the JeeLib library with:

Then initialize the watchdog with:

01. #include <JeeLib.h> // Low power functions library

02. int led_pin = 13;

03. ISR(WDT_vect) Sleepy::watchdogEvent(); // Setup

the watchdog

04.

05. void setup()

06. pinMode(led_pin, OUTPUT);

07.

08.

09. void loop()

10.

11. // Turn the LED on and sleep for 5 seconds

12. digitalWrite(led_pin, HIGH);

13. Sleepy::loseSomeTime(5000);

14.

15. // Turn the LED off and sleep for 5 seconds

16. digitalWrite(led_pin, LOW);

17. Sleepy::loseSomeTime(5000);

18.

01. #include <JeeLib.h>

01. ISR(WDT_vect) Sleepy::watchdogEvent();

Page 8: How to Run an Arduino for Years on a Battery - Open Home Automation

Finally, you can put the Arduino to sleep for a given periodof time with:

Upload the sketch with the Arduino IDE and replace thechip on the breadboard. You should see your Arduinohaving the same behavior as before (with 5 secondsintervals). But the difference is that now when the LED isoff, the Arduino chip doesn’t use a lot of power. To finishthis article, I wanted to actually quantify the powerconsumption of the system we just built. You can do theexact same by placing a multimeter between one of thepower lines. For example, I connected the positive pin ofthe battery to one pin of my multimeter, and the other pinto the positive power rail of the breadboard. Here are theresults:

LED off, without the JeeLib library: 6.7 mA

LED on, without the JeeLib library: 8.8 mA

LED off, with the JeeLib library: 43 uA (!)

LED on, with the JeeLib library: 2.2mA

From these results, we can see that our breadboard-Arduino consumes 6.7 mA when doing nothing withoutcaring about putting it to sleep. For information, that willdrain your two batteries in about a month. Which isactually not so bad, but we can do better. With the sleepfunctions, this can be reduced to 43 uA, which is a 150ximprovement.

Let’s do some calculations to see how it will impact a realproject, for example a temperature sensor. It takes about500 ms to perform a measurement, at about 2.5 mA ofcurrent. Then, the systems sleeps for 10 seconds and theloop starts again. The “mean” is then 0.16 mA over a

01. Sleepy::loseSomeTime(5000);

Page 9: How to Run an Arduino for Years on a Battery - Open Home Automation

52 Comments Open Home Automation Login1

Share⤤ Sort by Best Recommend

Your email ...

Share this entry

complete loop. With batteries rated at 2500 mAh, it meansin theory the system will last … nearly 2 years withoutchanging the batteries! Of course, some other effects willactually modify this number, but it gives you an idea.

How to Go Further

Really, you can adapt this idea to every system where theactive time is small compared to the sleep time, and makeyour Arduino last for years without changing the battery!If you want to learn more about the topic, note that thereis a complete guide on how to build your own systemsfrom scratch in our Home Automation with Arduino[http://www.openhomeautomation.net/home-automation-arduino/] product.

Do you like what you are reading on this website?If yes, join over 2,000 people who receive exclusiveinformation about open-source home automation

& the IoT. You will also receive a PDF with my 5best tips on building home automation systems.

Simply enter your email below!

Subscribe

Page 10: How to Run an Arduino for Years on a Battery - Open Home Automation

Share⤤ Sort by Best

Join the discussion…

• Reply •

Paul • 2 years ago

This was a nice article and kudos for using the JeeLib libraries.JCW @ jeelabs.org has done an amazing job at simplifying theuse of the ATmega's low­power modes. I just wanted to point outone thing: while the ATmega will probably work ok at 3.0V using a16MHz clock, it is technically over clocking it. See this page for adiscussion about operating voltage ranges for the ATmega:http://jeelabs.org/2010/12/16/... As the 2xAA cells dischargedown to < 2.0V, you are really only supposed to run the chip atabout 4MHz. Using the internal oscillator (@ 8MHz or less) assuggested previously would be safer from a reliabilityperspective. The downside is that you could not use the Unoboard definition and would instead need to use/create a new oneto use the device properly in the Arduino IDE.

3

• Reply •

Guillaume Sartenaer • a month ago

hello great article!

i hace a simple ... what is the purpose of capacitor on battery?

• Reply •

Marco Schwartz • 12 days ago

Mod > Guillaume Sartenaer

Thanks! It's here to regulate the voltage so the Arduinogets a stable power supply.

• Reply •

Jacob Thomas • 3 months ago

Thanks for the Great tutorial!

Wanted to know your recommendations for a wireless radiomodule. I'm building a project to monitor a garden with varioussensors, temperature, moisture, humidity and I want to run thewhole thing on regular batteries.

• Reply •

Marco Schwartz • 2 months agoMod > Jacob Thomas

Thanks! Have a look at XBee modules they work greatwith Arduino.

Recommend

Share ›

Share ›

Share ›

Share ›

Share ›

Page 11: How to Run an Arduino for Years on a Battery - Open Home Automation

• Reply •

Guillermo • 3 months ago

Edit: problem solved, I feel really stupid now. I am using a longbreadboard and I had another IC which I forgot to disconnect :oDumb dumb dumb. I compiled it without errors too. Now it goesdown to 5uA!!!

Thank you for the article.I get a compilation error on lineISR(WDT_vect) Sleepy::watchdogEvent(); // Setup thewatchdog

error: expected unqualified­id before string constant

If I remove the line, the code works and it consumes to 10mAwhile running LoseSomeTime(). Even if lower than regular delayfunction (15mA), it is still very high. Could it be that line the causeof the problem?

• Reply •

Christian Lee • 4 months ago

Wow, awesome. Will this save power even if using the librarywith a standard Arduino Uno board? Thanks!

• Reply •

Marco Schwartz • 4 months agoMod > Christian Lee

It will save power, but don't expect to run an Arduino Unofor years with a single battery :)

• Reply •

Jean­Philippe Encausse • 5 months ago

Thanks for this article and explanation !

Where can we buy that kind of arduino board ?

I'd love to make an Arduino with a PIR (motion detector) and acamera taking very short shoot.

• Reply •

Marco Schwartz • 5 months ago

Mod > Jean­Philippe Encausse

Thanks! Well to find all the components used in the articlesimply follow the links to Amazon by clicking on them :)

Arun chandran • 6 months ago

Greetings

Share ›

Share ›

Share ›

Share ›

Share ›

Page 12: How to Run an Arduino for Years on a Battery - Open Home Automation

• Reply •

First of all thanks a lot for introducing me to jeelib. Its such a greatarticle , although im relatively new with arduino.My issue is that im trying to build a key finder using ble modulesand for this to happen im serially communicating with my blemodule using arduino at a baud of 9600 ,my ble doesnt seem torespond to the arduino at any other baud. it works without usingthe jeelib libraries. Now i wanted to take it to the next level byoptimizing the usage of Battery. but while using the jeelib libraryim not able to serially communicate wit the ble module. Is thereany way i can change the baud at the jeelib libraries so that i cansuccessfully reduce my battery usage and communicate with myble ?

RegardsArun

• Reply •

Marco Schwartz • 5 months agoMod > Arun chandran

Hi Arun! BLE + jeelib is not something I tried, but maybesomebody here will have a solution for you :)

• Reply •

Arun chandran • 5 months ago

> Marco Schwartz

Thanks for the reply Marc

Im using the jeelib library on arduino pro andrunning the serial monitor at 9600 Baud and withusing Jeelib library I'm seeing junk characters onmy serial monitor . BLE is just a peripheral which is connected to mycontroller .My concern is here is about why am I getting junkcharecters on my serial monitor.

Regards Arun

• Reply •

Wu Jietong • 5 months ago

> Arun chandran

Try a Serial.flush() then a delay(1)

Brad Sweet • 2 months ago

> Wu Jietong

I tried this right before the line where I see

Share ›

Share ›

Share ›

Share ›

Page 13: How to Run an Arduino for Years on a Battery - Open Home Automation

• Reply •

I tried this right before the line where I seethe bad character and it did not work. Isthere some place specific to put it?

Additionally it only happens when I havethe Sleepy::loseSomeTime(5000); in thecode.

I'm using a Micro Pro (8MHz, 3.3V)

• Reply •

Nic • 6 months ago

Hi there, I feel like I'm missing something here. I built the circuitas you stated and I am not seeing the LED blink. But when Iconnect the ATmega328 to a arduino uno board the LED blinksjust fine. When measuring the voltage on D13 (when the ATmegais on the breadboard) it is very low 50mV. But when I do thesame measurement on the arduino board I get a measurement of4.95V on D13. I realize the aduino board is being feed morevoltage and thats why D13 has a 4.95V but I would expect to seesomething similar on the breadboard (i.e. 2.95V on D13). I wouldappreciate any help thanks.

• Reply •

Marco Schwartz • 5 months agoMod > Nic

Hi Nic, I just checked the project again and it's workingfine. Probably a missing connection somewhere(especially check the power supply connections), or alack of a good power supply for the breadboard project.

• Reply •

ani • 7 months ago

hi there...you mentioned that with With the sleep functions, thiscan be reduced to 43 uA, which is a 150x improvement....can youtalk about the sleep functions, because i would like my batteriesto atleast last 5 months...thanks...and i have applied jeelib in mycode....i will be posting my code here...by tomorrow...do you mindchecking whether i have applied it correctly or not ..thanks...

• Reply •

Marco Schwartz • 7 months agoMod > ani

The sleep functions are exactly the one I used with theJeeLib library. Basically you extend the battery by havingvery little up times (for data acquisition for example) vsvery long sleep times.

1

Share ›

Share ›

Share ›

Share ›

Share ›

Page 14: How to Run an Arduino for Years on a Battery - Open Home Automation

• Reply •

littleguy • a year ago

Great article! Would this be suitable for building an LCDcountdown timer?

The resolution will be 1 second, so I'd have to pause at leastonce per second.

Is there a better way for my particular projects?

• Reply •

Marco Schwartz • a year ago> littleguy

That would definitely work!

• Reply •

Ben Hearsum • a year ago

I've tried out your example and it doesn't seem to work quite rightfor me. I'm using an Arduino Micro, so perhaps things aredifferent.

When I call Sleepy::loseSomeTime(5000); my device wakes upalmost immediately. Reading the code, it appears that theinterrupt handler is getting called very quickly, which of coursecalls watchdogEvent(), which causes loseSomeTime to bail outearly.

If I attach a multimeter to pin 13, I see it bouncing back and forthbetween HIGH and LOW very rapidly (a few times a second atleast).

Any help interpreting this would be greatly appreciated.

• Reply •

Marco Schwartz • a year ago> Ben Hearsum

That could definitely come from the Arduino Micro. I amnot maintaining or developing this library, and so far I onlytested with the Arduino Uno microcontroller(ATMega328p). I would suggest to contact the JeeLibguys to report your issue.

1

• Reply •

Heron • a year ago

That 10uf capacitor link goes to a 450v version on Amazon. Isthat correct?

Marco Schwartz • a year ago> Heron

Yes it is, it is just that the capacitor is rated up to 450V.

Share ›

Share ›

Share ›

Share ›

Share ›

Page 15: How to Run an Arduino for Years on a Battery - Open Home Automation

• Reply •

Yes it is, it is just that the capacitor is rated up to 450V.But of course you can use a capacitor rated for 50V orless only :)

• Reply •

Bruno • a year ago

Hi, Great Project!

I've a question for you, It's possible to add a power booster circuitin order to power this miniduino with only 1.5v ? I saw people thatis using a DC to DC converter to obtain more power from almostnothing as input.

If you've some information about that would be great!

Thanks!Best Regards!

• Reply •

Marco Schwartz • a year ago> Bruno

Hello Bruno, sure it is possible! Check:https://www.adafruit.com/produ...

• Reply •

riju16 • a year ago> Marco Schwartz

during sleep mode should the current flowingacross the input and output wires bezero..bascially i have used to loops one loop ihave shorted from pin 8 to analog pin A3..andanother one from pin 4 to A4..i have used adc..sobasically when both loops are intact..transmitterwill wake up and trasmit level 1 or whatverok..when when of the loops cut..tramistter willtrasmit loop 1 or loop cut..and then go back tosleep..

my question is that during sleep mode...shouldntthe current across the wires..be zero..and thenwhen it wakes up there will be a spurt of increaseof current..and then back to zero???

Micah • a year ago

I have the same setup except I am running from a 9V battery witha 5V regulator. I am showing about 56mA while the LED is on and37mA while it is off. This seems too high even though I'm running5v. Any remarks?

Share ›

Share ›

Share ›

Share ›

Page 16: How to Run an Arduino for Years on a Battery - Open Home Automation

• Reply •

5v. Any remarks?

Thanks,Micah

• Reply •

Marco Schwartz • a year ago> Micah

Hello Micah, I guess what you are seeing is theconsumption of the 5V regulator that always sucks power.I would recommend using a battery in the 3­5V range topower up the Arduino with intermediate components.

• Reply •

David • a year ago

A really nice writeup. Tried it out on a ATtiny85 project. Theresults ­ staggering.

Standby power draw before: 4.5mA. Standby power draw afterincluding JeeLib: 0.008mA. The device does a digitalRead everysecond while on "standby". I calculated the battery to last 35hours before and 27 months (!!!) after optimizing for power.

• Reply •

Marco Schwartz • a year ago> David

Hello David,

Thanks for your message, and congratulations for buildingup the project!

1

• Reply •

Camillo • a year ago

Hi, can I get the same results (2x1.5V batteries for 1 year) usingan Arduino Pro Micro at 3V from SparkFun?https://www.sparkfun.com/produ...Thank you!

• Reply •

Marco Schwartz • a year ago> Camillo

No, as there are devices like a voltage regulator andsome LEDs that will continuously suck some power fromthe battery. You can definitely use batteries with thisboard, but they won't last 1 year for sure.

Raaj • 2 years ago

The Atmega328p doc says that when operating at 3V, you shouldrun it at 10Mhz or below to prevent brown out and data corruption

Share ›

Share ›

Share ›

Share ›

Share ›

Share ›

Page 17: How to Run an Arduino for Years on a Battery - Open Home Automation

• Reply •

run it at 10Mhz or below to prevent brown out and data corruption

• Reply •

tes • 2 years ago

hi all, i'm trying to build a perimeter security system with pirsensor and arduino my questions are 1. can i use arduino uno programs to run in arduino mini 2. can i have the arduino board sleep but the sensor still active sothat when ever it detects motion the board will then go back toworkand 3) since im trying to build three devices with transmitter socan i use only one receiver for the three devices? thank you inadvance.

• Reply •

Marco Schwartz • 2 years ago> tes

Hello,

1. In most of the cases it will be no problem. Just keep inmind that the Arduino mini runs at 3.3V, so some sensorsmight no work with the mini (or differently)

2. For that you will need to use interrupt pins to wake upthe Arduino when something happens on the sensor.You'll find plenty of documentation about that on theArduino website.

3. That depends on the technology you are using. WithZigbee for example you will no problem doing that.

If you need additional help, don't hesitate to get in touchvia email!

lucid dream • 2 years ago

Hello, all is going well here and ofcourse every

Share ›

Share ›

Share ›

© 2014 Open Home Automation - Enfold Theme by Kriesi


Recommended