Qgelm

How to Run an Arduino for Years on a Battery

Originalartikel

Backup

<html> <p><em>If you found this article after doing a search on Google, welcome! On this website you will find plenty of content&#160;around DIY home automation using open-source hardware. Enjoy&#160;the article!</em></p><p>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.</p> <p>For example, you want to power the <a href=„http://openhomeautomation.net/wireless-motion-sensor-arduino/“>wireless motion detector</a> 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 something better.</p> <p>The first thing we need is to build our own Arduino system with just the minimal set of components. This will be similar to a <a href=„http://openhomeautomation.net/arduino-breadboard/“>previous article</a>, but with even less components. The second part is to optimize the software so that the system only consumes power when it is actually doing something. And that&#8217;s exactly what we will see in this article.</p> <h3>Hardware &amp; Software&#160;Requirements</h3> <p>You need several components to build you own Arduino system. The main piece of this project is of course the microcontroller that will run your Arduino sketches, like the&#160;<a href=„https://www.amazon.de/gp/search?linkCode=xm2&amp;SubscriptionId=AKIAJ6I5BZH2QF5SA2AQ&amp;keywords=3-pack%20NEW%20Atmega328p-pu%20Chip%20w%2F%20Arduino%20UNO%20Bootloader%20%20DIP%20IC%20Socket%20Bundle&amp;tag=openhomeautomation-20&amp;creative=12738&amp;url=search-alias%3Daws-amazon-aps&amp;camp=2025?tag=openhomeauto-21“ class=„affiliate-click“ onclick=„fbq('track', 'InitiateCheckout'); trackOutboundLink('https://www.amazon.de/gp/search?linkCode=xm2&amp;SubscriptionId=AKIAJ6I5BZH2QF5SA2AQ&amp;keywords=3-pack%20NEW%20Atmega328p-pu%20Chip%20w%2F%20Arduino%20UNO%20Bootloader%20%20DIP%20IC%20Socket%20Bundle&amp;tag=openhomeautomation-20&amp;creative=12738&amp;url=search-alias%3Daws-amazon-aps&amp;camp=2025?tag=openhomeauto-21'); return false;“>Atmel&#160;ATmega328</a>. You will need a chip with the Arduino bootloader. Buy your chip with it, it will make your life easier.</p> <p><a href=„https://openhomeautomation.net/cdn/storage/Images/NJcdNyXgWzb8SG6SC/original/NJcdNyXgWzb8SG6SC.jpg“><img class=„aligncenter wp-image-3161 size-large“ src=„https://openhomeautomation.net/cdn/storage/Images/NJcdNyXgWzb8SG6SC/original/NJcdNyXgWzb8SG6SC.jpg“ alt=„chip“ width=„1030“ height=„579“ sizes=„(max-width: 1030px) 100vw, 1030px“/></a></p> <p>In a previous project I used a&#160;<a href=„https://www.amazon.de/gp/search?linkCode=xm2&amp;SubscriptionId=AKIAJ6I5BZH2QF5SA2AQ&amp;keywords=Micro%20USB%20FTDI%20Basic%20Breakout%20Module%20for%20Arduino%203.3V%2F5V&amp;tag=openhomeautomation-20&amp;creative=12738&amp;url=search-alias%3Daws-amazon-aps&amp;camp=2025?tag=openhomeauto-21“ class=„affiliate-click“ onclick=„fbq('track', 'InitiateCheckout'); trackOutboundLink('https://www.amazon.de/gp/search?linkCode=xm2&amp;SubscriptionId=AKIAJ6I5BZH2QF5SA2AQ&amp;keywords=Micro%20USB%20FTDI%20Basic%20Breakout%20Module%20for%20Arduino%203.3V%2F5V&amp;tag=openhomeautomation-20&amp;creative=12738&amp;url=search-alias%3Daws-amazon-aps&amp;camp=2025?tag=openhomeauto-21'); return false;“>FTDI breakout board</a>&#160;to program the Arduino chip directly on the breadboard. But for this project I won&#8217;t have any external power running on the breadboard so I will just use an Arduino Uno board to program the microcontroller.</p> <p>To power the Arduino, you will need a battery. The best is to power the Arduino directly from the battery, so you don&#8217;t have to use any voltage regulators that will suck some power. I used a&#160;<a href=„https://www.amazon.de/dp/B0006SDBAM?tag=openhomeauto-21“ rel=„nofollow“ class=„affiliate-click“ onclick=„fbq('track', 'InitiateCheckout'); trackOutboundLink('https://www.amazon.de/dp/B0006SDBAM?tag=openhomeauto-21'); return false;“>set of two AA batteries</a>&#160;(1.5V each) with a&#160;<a href=„https://www.amazon.de/gp/search?linkCode=xm2&amp;SubscriptionId=AKIAJ6I5BZH2QF5SA2AQ&amp;keywords=uxcell%C2%AE%20Black%20Plastic%202%20x%201.5V%20AA%20Battery%20Lead%20Wired%20Cell%20Case%20Box&amp;tag=openhomeautomation-20&amp;creative=12738&amp;url=search-alias%3Daws-amazon-aps&amp;camp=2025?tag=openhomeauto-21“ rel=„nofollow“ class=„affiliate-click“ onclick=„fbq('track', 'InitiateCheckout'); trackOutboundLink('https://www.amazon.de/gp/search?linkCode=xm2&amp;SubscriptionId=AKIAJ6I5BZH2QF5SA2AQ&amp;keywords=uxcell%C2%AE%20Black%20Plastic%202%20x%201.5V%20AA%20Battery%20Lead%20Wired%20Cell%20Case%20Box&amp;tag=openhomeautomation-20&amp;creative=12738&amp;url=search-alias%3Daws-amazon-aps&amp;camp=2025?tag=openhomeauto-21'); return false;“>battery holder</a>&#160;thus powering the microcontroller with around 3V, which is fine according to the&#160;<a href=„http://www.atmel.com/devices/atmega328.aspx“>ATmega328 documentation</a>.</p> <p>You will also need several components around the chip. You will need&#160;<a href=„https://www.amazon.de/gp/search?linkCode=xm2&amp;SubscriptionId=AKIAJ6I5BZH2QF5SA2AQ&amp;keywords=10uf%20450v%20Capacitor%20105c%20High%20Temp%2C%20Radial%20Leads&amp;tag=openhomeautomation-20&amp;creative=12738&amp;url=search-alias%3Daws-amazon-aps&amp;camp=2025?tag=openhomeauto-21“ rel=„nofollow“ class=„affiliate-click“ onclick=„fbq('track', 'InitiateCheckout'); trackOutboundLink('https://www.amazon.de/gp/search?linkCode=xm2&amp;SubscriptionId=AKIAJ6I5BZH2QF5SA2AQ&amp;keywords=10uf%20450v%20Capacitor%20105c%20High%20Temp%2C%20Radial%20Leads&amp;tag=openhomeautomation-20&amp;creative=12738&amp;url=search-alias%3Daws-amazon-aps&amp;camp=2025?tag=openhomeauto-21'); return false;“>one 10uF capacitor</a>,&#160;<a href=„https://www.amazon.de/dp/B0087ZBK4K?tag=openhomeauto-21“ rel=„nofollow“ class=„affiliate-click“ onclick=„fbq('track', 'InitiateCheckout'); trackOutboundLink('https://www.amazon.de/dp/B0087ZBK4K?tag=openhomeauto-21'); return false;“>two 22pF capacitors</a>,&#160;<a href=„https://www.amazon.de/dp/B00B5RJF1M?tag=openhomeauto-21“ rel=„nofollow“ class=„affiliate-click“ onclick=„fbq('track', 'InitiateCheckout'); trackOutboundLink('https://www.amazon.de/dp/B00B5RJF1M?tag=openhomeauto-21'); return false;“>one 10K Ohm resistor</a>,&#160;<a href=„https://www.amazon.de/dp/B00B5LNEF6?tag=openhomeauto-21“ rel=„nofollow“ class=„affiliate-click“ onclick=„fbq('track', 'InitiateCheckout'); trackOutboundLink('https://www.amazon.de/dp/B00B5LNEF6?tag=openhomeauto-21'); return false;“>one 220 Ohm resistor</a>,&#160;<a href=„https://www.amazon.de/gp/search?linkCode=xm2&amp;SubscriptionId=AKIAJ6I5BZH2QF5SA2AQ&amp;keywords=Bluecell%2050%20PCS%20Green%20LED%20Electronics%205mm%20Bulb%20light&amp;tag=openhomeautomation-20&amp;creative=12738&amp;url=search-alias%3Daws-amazon-aps&amp;camp=2025?tag=openhomeauto-21“ rel=„nofollow“ class=„affiliate-click“ onclick=„fbq('track', 'InitiateCheckout'); trackOutboundLink('https://www.amazon.de/gp/search?linkCode=xm2&amp;SubscriptionId=AKIAJ6I5BZH2QF5SA2AQ&amp;keywords=Bluecell%2050%20PCS%20Green%20LED%20Electronics%205mm%20Bulb%20light&amp;tag=openhomeautomation-20&amp;creative=12738&amp;url=search-alias%3Daws-amazon-aps&amp;camp=2025?tag=openhomeauto-21'); return false;“>one green LED</a>, and one&#160;<a href=„https://www.amazon.de/gp/search?linkCode=xm2&amp;SubscriptionId=AKIAJ6I5BZH2QF5SA2AQ&amp;keywords=50%20Pcs%2016.000MHz%20AT49S%2020PF%20DIP%20Quartz%20Crystal%20Oscillator&amp;tag=openhomeautomation-20&amp;creative=12738&amp;url=search-alias%3Daws-amazon-aps&amp;camp=2025?tag=openhomeauto-21“ rel=„nofollow“ class=„affiliate-click“ onclick=„fbq('track', 'InitiateCheckout'); trackOutboundLink('https://www.amazon.de/gp/search?linkCode=xm2&amp;SubscriptionId=AKIAJ6I5BZH2QF5SA2AQ&amp;keywords=50%20Pcs%2016.000MHz%20AT49S%2020PF%20DIP%20Quartz%20Crystal%20Oscillator&amp;tag=openhomeautomation-20&amp;creative=12738&amp;url=search-alias%3Daws-amazon-aps&amp;camp=2025?tag=openhomeauto-21'); return false;“>16MHz crystal clock</a>.</p> <p>Finally, you will need a&#160;<a href=„https://www.amazon.de/gp/search?linkCode=xm2&amp;SubscriptionId=AKIAJ6I5BZH2QF5SA2AQ&amp;keywords=microtivity%20IB401%20400-point%20Experiment%20Breadboard%20w%2F%20Jumper%20Wires&amp;tag=openhomeautomation-20&amp;creative=12738&amp;url=search-alias%3Daws-amazon-aps&amp;camp=2025?tag=openhomeauto-21“ rel=„nofollow“ class=„affiliate-click“ onclick=„fbq('track', 'InitiateCheckout'); trackOutboundLink('https://www.amazon.de/gp/search?linkCode=xm2&amp;SubscriptionId=AKIAJ6I5BZH2QF5SA2AQ&amp;keywords=microtivity%20IB401%20400-point%20Experiment%20Breadboard%20w%2F%20Jumper%20Wires&amp;tag=openhomeautomation-20&amp;creative=12738&amp;url=search-alias%3Daws-amazon-aps&amp;camp=2025?tag=openhomeauto-21'); return false;“>breadboard and some jumper wires</a>.</p> <p>This is the list of the components that were used in this article:</p> <ul><li><a href=„https://www.amazon.de/gp/search?linkCode=xm2&amp;SubscriptionId=AKIAJ6I5BZH2QF5SA2AQ&amp;keywords=3-pack%20NEW%20Atmega328p-pu%20Chip%20w%2F%20Arduino%20UNO%20Bootloader%20%20DIP%20IC%20Socket%20Bundle&amp;tag=openhomeautomation-20&amp;creative=12738&amp;url=search-alias%3Daws-amazon-aps&amp;camp=2025?tag=openhomeauto-21“ class=„affiliate-click“ onclick=„fbq('track', 'InitiateCheckout'); trackOutboundLink('https://www.amazon.de/gp/search?linkCode=xm2&amp;SubscriptionId=AKIAJ6I5BZH2QF5SA2AQ&amp;keywords=3-pack%20NEW%20Atmega328p-pu%20Chip%20w%2F%20Arduino%20UNO%20Bootloader%20%20DIP%20IC%20Socket%20Bundle&amp;tag=openhomeautomation-20&amp;creative=12738&amp;url=search-alias%3Daws-amazon-aps&amp;camp=2025?tag=openhomeauto-21'); return false;“>Atmel&#160;ATmega328</a></li> <li><a href=„https://www.amazon.de/gp/search?linkCode=xm2&amp;SubscriptionId=AKIAJ6I5BZH2QF5SA2AQ&amp;keywords=10uf%20450v%20Capacitor%20105c%20High%20Temp%2C%20Radial%20Leads&amp;tag=openhomeautomation-20&amp;creative=12738&amp;url=search-alias%3Daws-amazon-aps&amp;camp=2025?tag=openhomeauto-21“ rel=„nofollow“ class=„affiliate-click“ onclick=„fbq('track', 'InitiateCheckout'); trackOutboundLink('https://www.amazon.de/gp/search?linkCode=xm2&amp;SubscriptionId=AKIAJ6I5BZH2QF5SA2AQ&amp;keywords=10uf%20450v%20Capacitor%20105c%20High%20Temp%2C%20Radial%20Leads&amp;tag=openhomeautomation-20&amp;creative=12738&amp;url=search-alias%3Daws-amazon-aps&amp;camp=2025?tag=openhomeauto-21'); return false;“>10uF capacitor</a></li> <li><a href=„https://www.amazon.de/dp/B0087ZBK4K?tag=openhomeauto-21“ rel=„nofollow“ class=„affiliate-click“ onclick=„fbq('track', 'InitiateCheckout'); trackOutboundLink('https://www.amazon.de/dp/B0087ZBK4K?tag=openhomeauto-21'); return false;“>Two 22pF capacitors</a></li> <li><a href=„https://www.amazon.de/dp/B00B5RJF1M?tag=openhomeauto-21“ rel=„nofollow“ class=„affiliate-click“ onclick=„fbq('track', 'InitiateCheckout'); trackOutboundLink('https://www.amazon.de/dp/B00B5RJF1M?tag=openhomeauto-21'); return false;“>10K Ohm resistor</a></li> <li><a href=„https://www.amazon.de/dp/B00B5LNEF6?tag=openhomeauto-21“ rel=„nofollow“ class=„affiliate-click“ onclick=„fbq('track', 'InitiateCheckout'); trackOutboundLink('https://www.amazon.de/dp/B00B5LNEF6?tag=openhomeauto-21'); return false;“>220 Ohm resistor</a></li> <li><a href=„https://www.amazon.de/gp/search?linkCode=xm2&amp;SubscriptionId=AKIAJ6I5BZH2QF5SA2AQ&amp;keywords=Bluecell%2050%20PCS%20Green%20LED%20Electronics%205mm%20Bulb%20light&amp;tag=openhomeautomation-20&amp;creative=12738&amp;url=search-alias%3Daws-amazon-aps&amp;camp=2025?tag=openhomeauto-21“ rel=„nofollow“ class=„affiliate-click“ onclick=„fbq('track', 'InitiateCheckout'); trackOutboundLink('https://www.amazon.de/gp/search?linkCode=xm2&amp;SubscriptionId=AKIAJ6I5BZH2QF5SA2AQ&amp;keywords=Bluecell%2050%20PCS%20Green%20LED%20Electronics%205mm%20Bulb%20light&amp;tag=openhomeautomation-20&amp;creative=12738&amp;url=search-alias%3Daws-amazon-aps&amp;camp=2025?tag=openhomeauto-21'); return false;“>One green LED</a></li> <li><a href=„https://www.amazon.de/gp/search?linkCode=xm2&amp;SubscriptionId=AKIAJ6I5BZH2QF5SA2AQ&amp;keywords=50%20Pcs%2016.000MHz%20AT49S%2020PF%20DIP%20Quartz%20Crystal%20Oscillator&amp;tag=openhomeautomation-20&amp;creative=12738&amp;url=search-alias%3Daws-amazon-aps&amp;camp=2025?tag=openhomeauto-21“ rel=„nofollow“ class=„affiliate-click“ onclick=„fbq('track', 'InitiateCheckout'); trackOutboundLink('https://www.amazon.de/gp/search?linkCode=xm2&amp;SubscriptionId=AKIAJ6I5BZH2QF5SA2AQ&amp;keywords=50%20Pcs%2016.000MHz%20AT49S%2020PF%20DIP%20Quartz%20Crystal%20Oscillator&amp;tag=openhomeautomation-20&amp;creative=12738&amp;url=search-alias%3Daws-amazon-aps&amp;camp=2025?tag=openhomeauto-21'); return false;“>16MHz crystal clock</a></li> <li><a href=„https://www.amazon.de/gp/search?linkCode=xm2&amp;SubscriptionId=AKIAJ6I5BZH2QF5SA2AQ&amp;keywords=uxcell%C2%AE%20Black%20Plastic%202%20x%201.5V%20AA%20Battery%20Lead%20Wired%20Cell%20Case%20Box&amp;tag=openhomeautomation-20&amp;creative=12738&amp;url=search-alias%3Daws-amazon-aps&amp;camp=2025?tag=openhomeauto-21“ rel=„nofollow“ class=„affiliate-click“ onclick=„fbq('track', 'InitiateCheckout'); trackOutboundLink('https://www.amazon.de/gp/search?linkCode=xm2&amp;SubscriptionId=AKIAJ6I5BZH2QF5SA2AQ&amp;keywords=uxcell%C2%AE%20Black%20Plastic%202%20x%201.5V%20AA%20Battery%20Lead%20Wired%20Cell%20Case%20Box&amp;tag=openhomeautomation-20&amp;creative=12738&amp;url=search-alias%3Daws-amazon-aps&amp;camp=2025?tag=openhomeauto-21'); return false;“>Battery holder</a></li> <li><a href=„https://www.amazon.de/dp/B0006SDBAM?tag=openhomeauto-21“ rel=„nofollow“ class=„affiliate-click“ onclick=„fbq('track', 'InitiateCheckout'); trackOutboundLink('https://www.amazon.de/dp/B0006SDBAM?tag=openhomeauto-21'); return false;“>2 AA batteries</a></li> <li><a href=„https://www.amazon.de/gp/search?linkCode=xm2&amp;SubscriptionId=AKIAJ6I5BZH2QF5SA2AQ&amp;keywords=microtivity%20IB401%20400-point%20Experiment%20Breadboard%20w%2F%20Jumper%20Wires&amp;tag=openhomeautomation-20&amp;creative=12738&amp;url=search-alias%3Daws-amazon-aps&amp;camp=2025?tag=openhomeauto-21“ rel=„nofollow“ class=„affiliate-click“ onclick=„fbq('track', 'InitiateCheckout'); trackOutboundLink('https://www.amazon.de/gp/search?linkCode=xm2&amp;SubscriptionId=AKIAJ6I5BZH2QF5SA2AQ&amp;keywords=microtivity%20IB401%20400-point%20Experiment%20Breadboard%20w%2F%20Jumper%20Wires&amp;tag=openhomeautomation-20&amp;creative=12738&amp;url=search-alias%3Daws-amazon-aps&amp;camp=2025?tag=openhomeauto-21'); return false;“>Breadboard and some jumper wires</a></li> </ul><p>On the software side, you just need the usual Arduino IDE.&#160;Note that in this tutorial, we will only cover a tiny part of the possibilities offered by the Arduino platform.&#160;[Arduino course]</p> <h3>Hardware Configuration</h3> <p>This project is a bit complex to build, so be sure to follow the instructions. This is how it should look like at the end:</p> <p><a href=„https://openhomeautomation.net/cdn/storage/Images/qWqAAPt43uuqk6eyh/original/qWqAAPt43uuqk6eyh.jpg“><img class=„aligncenter wp-image-762“ src=„https://openhomeautomation.net/cdn/storage/Images/qWqAAPt43uuqk6eyh/original/qWqAAPt43uuqk6eyh.jpg“ alt=„arduino_low_power“ width=„576“ height=„384“ sizes=„(max-width: 576px) 100vw, 576px“/></a></p> <p>First, put the microcontroller in the center of the breadboard. You can then take care about the power: connect power lines on each side, connect the negative power rail to the two GND pins of the microcontroller, and the positive power rail to VCC, AVCC, and AREF. Also, add the 10uF capacitor between two power rails. Finally, add the battery to the system.</p> <p>You also have to add the crystal between the X1 and X2 pins, with 22pF capacitors going from each pin to the ground. Also, you need to connect the RST pin to the positive power rail using a 10K Ohm resistor. To see if the system is working, connect the green LED in series with a 220 Ohm resistor to the digital pin 13 of the Arduino board, the other side going to the ground.</p> <p>This is the complete schematics of the project:</p> <p><a href=„https://openhomeautomation.net/cdn/storage/Images/S7tCcAsbSqmyEzKyb/original/S7tCcAsbSqmyEzKyb.jpg“><img class=„aligncenter wp-image-773“ src=„https://openhomeautomation.net/cdn/storage/Images/S7tCcAsbSqmyEzKyb/original/S7tCcAsbSqmyEzKyb.jpg“ alt=„arduino_low_power_schem“ width=„576“ height=„409“ sizes=„(max-width: 576px) 100vw, 576px“/></a></p> <h3>Testing your Arduino system</h3> <p>It&#8217;s now time to test if the hardware part is working. What I did in this project is to use the Arduino Uno board to program the chip, and then I just &#8220;transplanted&#8221; the chip on the breadboard. You can just use the default &#8220;blink&#8221; sketch to program the microcontroller. After this is done, just replace the chip on the breadboard, and plug your battery (my battery pack even has a nice on/off switch). The LED should just goes on and off every second as expected.</p> <h3>Optimizing for Low-power</h3> <p>So now, we have an autonomous Arduino system. But it still consuming way too much power. Indeed, even when the LED is off, the Arduino chip is still active and consumes power. But there are functions on the microcontroller to put it to sleep during the time it is inactive, and re-activate the chip when we need to change the state of an output or to perform some measurements. I tested many solutions to really reduce the power to the lowest value possible, and the best I found is the&#160;<a href=„https://github.com/jcw/jeelib“>JeeLib library</a>. You can just <a href=„https://github.com/jcw/jeelib“>download it</a> and install it by placing the folder in your Arduino/libraries/ folder.</p> <p>This is the sketch I used:</p> <pre class=„“ data-enlighter-language=„null“>#include &lt;JeeLib.h&gt; Low power functions library int led_pin = 13; ISR(WDT_vect) { Sleepy::watchdogEvent(); } Setup the watchdog void setup() { pinMode(led_pin, OUTPUT); } void loop() { Turn the LED on and sleep for 5 seconds digitalWrite(led_pin, HIGH); Sleepy::loseSomeTime(5000); Turn the LED off and sleep for 5 seconds digitalWrite(led_pin, LOW); Sleepy::loseSomeTime(5000); }</pre> <p>You basically just have to include the JeeLib library with:</p> <pre class=„“ data-enlighter-language=„null“>#include &lt;JeeLib.h&gt;</pre> <p>Then initialize the watchdog with:</p> <pre class=„“ data-enlighter-language=„null“>ISR(WDT_vect) { Sleepy::watchdogEvent(); }</pre> <p>Finally, you can put the Arduino to sleep for a given period of time with:</p> <pre class=„“ data-enlighter-language=„null“>Sleepy::loseSomeTime(5000);</pre> <p>Upload the sketch with the Arduino IDE and replace the chip on the breadboard. You should see your Arduino having the same behavior as before (with 5 seconds intervals). But the difference is that now when the LED is off, the Arduino chip doesn&#8217;t use a lot of power. To finish this article, I wanted to actually quantify the power consumption of the system we just built. You can do the exact same by placing a multimeter between one of the power lines. For example, I connected the positive pin of the battery to one pin of my multimeter, and the other pin to the positive power rail of the breadboard. Here are the results:</p> <ul><li>LED off, without the JeeLib library: 6.7 mA</li> <li>LED on, without the JeeLib library: 8.8 mA</li> <li>LED off, with the JeeLib library: 43 uA (!)</li> <li>LED on, with the JeeLib library: 2.2mA</li> </ul><p>From these results, we can see that our breadboard-Arduino consumes 6.7 mA when doing nothing without caring about putting it to sleep. For information, that will drain your two batteries in about a month. Which is actually not so bad, but we can do better. With the sleep functions, this can be reduced to 43 uA, which is a 150x improvement.</p> <p>Let&#8217;s do some calculations to see how it will impact a real project, for example a temperature sensor. It takes about 500 ms to perform a measurement, at about 2.5 mA of current. Then, the systems sleeps for 10 seconds and the loop starts again. The &#8220;mean&#8221; is then 0.16 mA over a complete loop. With batteries rated at 2500 mAh, it means in theory the system will last &#8230; nearly 2 years without changing the batteries! Of course, some other effects will actually modify this number, but it gives you an idea.</p> <h3>How to Go Further</h3> <p>Really, you can adapt this idea to every system where the active time is small compared to the sleep time, and make your Arduino last for years without changing the battery! If you want to learn more about the topic, note that there is a complete guide on how to build your own systems from scratch in our <a href=„http://www.openhomeautomation.net/home-automation-arduino/“>Home Automation with Arduino</a> product.</p> </html>

Cookies helfen bei der Bereitstellung von Inhalten. Diese Website verwendet Cookies. Mit der Nutzung der Website erklären Sie sich damit einverstanden, dass Cookies auf Ihrem Computer gespeichert werden. Außerdem bestätigen Sie, dass Sie unsere Datenschutzerklärung gelesen und verstanden haben. Wenn Sie nicht einverstanden sind, verlassen Sie die Website.Weitere Information