<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>JeeLabs &#187; LowPower</title>
	<atom:link href="http://jeelabs.org/tag/lowpower/feed/" rel="self" type="application/rss+xml" />
	<link>http://jeelabs.org</link>
	<description>Computing stuff tied to the physical world</description>
	<lastBuildDate>Wed, 01 Feb 2012 23:01:18 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Can&#8217;t be done</title>
		<link>http://jeelabs.org/2012/01/27/cant-be-done/</link>
		<comments>http://jeelabs.org/2012/01/27/cant-be-done/#comments</comments>
		<pubDate>Thu, 26 Jan 2012 23:01:09 +0000</pubDate>
		<dc:creator>jcw</dc:creator>
				<category><![CDATA[Hardware]]></category>
		<category><![CDATA[LowPower]]></category>

		<guid isPermaLink="false">http://jeelabs.org/?p=17689</guid>
		<description><![CDATA[As you may know from posts a short while ago, I&#8217;ve been working on creating an ultra-low power supply, providing just enough energy to a JeeNode or JeeNode Micro to let it do a little work, report some data over wireless, and then go to sleep most of the time. I even designed a PCB [...]]]></description>
			<content:encoded><![CDATA[<p>As you may know from posts a <a href="http://jeelabs.org/2011/12/17/a-power-supply-which-draws-12-mw/">short while ago</a>, I&#8217;ve been working on creating an ultra-low power supply, providing just enough energy to a JeeNode or JeeNode Micro to let it do a little work, report some data over wireless, and then go to sleep most of the time.</p>

<p>I even designed a PCB for this thing and had a bunch of them produced:</p>

<p><img src="http://jeelabs.org/wp-content/uploads/2012/01/Screen-Shot-2012-01-25-at-01.57.45.png" alt="Screen Shot 2012 01 25 at 01 57 45" border="0" width="584" height="154" /></p>

<p>The <em>good</em> news is that it <a href="http://jeelabs.org/2011/12/28/finished-low-power-supply/">works</a> as intended and that I&#8217;ll be using this circuit for some projects.</p>

<p>The <em>bad</em> news is that they won&#8217;t be available as kits in the shop. Ironically, this was the first time where I actually had a batch of kits all wrapped up and ready to go, <em>ahead</em> of time.</p>

<p>But the reality is that I can&#8217;t pull it off. For two different reasons:</p>

<ul>
<li><p>The circuit is connected to live AC mains @ 230 VAC and that means there is a serious risk if you build this stuff, try it out, and then hurt yourself because of some mistake. And even after that, there is the risk that the whole circuit is not properly protected, exposing these voltages (even just humidity and condensation).</p></li>
<li><p>The other risk is that once everything works, it gets built-in for permanent use and becomes part of your house. What if it gets wet or malfunctions for some other reason, and your house burns down?</p></li>
</ul>

<p>As supplier, I&#8217;d be liable (rightly so, BTW &#8211; there is no excuse for selling stuff which might be dangerous).</p>

<p><em>The hardest part of all is that even if an accident has nothing to do with this Low-power Supply, I still have to prove that this stuff is safe under any circumstance and that it complies with all regulations!</em></p>

<p>I&#8217;m not willing to go there. Life&#8217;s too short and I don&#8217;t have the pushing power to go through it all.</p>

<p>Having said this, I <em>do</em> intend to use this supply myself and create all sorts of nodes for use here at JeeLabs. Because I <em>know</em> the risks, I <em>know</em> which failsafe features have been built into the supply, and <em>I&#8217;m</em> ok with it:</p>

<p><img src="http://jeelabs.org/wp-content/uploads/2012/01/DSC_2894.jpg" alt="DSC 2894" border="0" width="604" height="213" /></p>

<p>The design is available in the <a href="http://jeelabs.net/projects/hardware/wiki/Low-power_Supply">Café</a>, to document what I&#8217;ve done and for others to do whatever they like with it.</p>

<p>I&#8217;m not happy about this decision, in fact I hate it. I&#8217;m really proud of finding out that it is <em>possible</em> to create sensor nodes which run off just <strong>12 mW</strong> of AC mains power. But the right thing to do is to stop here.</p>
]]></content:encoded>
			<wfw:commentRss>http://jeelabs.org/2012/01/27/cant-be-done/feed/</wfw:commentRss>
		<slash:comments>17</slash:comments>
		</item>
		<item>
		<title>Putting the JNµ to sleep</title>
		<link>http://jeelabs.org/2012/01/18/putting-the-jnu-to-sleep/</link>
		<comments>http://jeelabs.org/2012/01/18/putting-the-jnu-to-sleep/#comments</comments>
		<pubDate>Tue, 17 Jan 2012 23:01:41 +0000</pubDate>
		<dc:creator>jcw</dc:creator>
				<category><![CDATA[AVR]]></category>
		<category><![CDATA[Hardware]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[LowPower]]></category>

		<guid isPermaLink="false">http://jeelabs.org/?p=17520</guid>
		<description><![CDATA[The Sleepy::loseSomeTime() code in the Ports library was never tested on a JeeNode Micro. Turns out that only a minor library difference kept it from working (the arduino-tiny library has its own version of millis(), etc): So now, the JNµ can be put to sleep as well. Here&#8217;s the jouleTest sketch I used, tweaked to [...]]]></description>
			<content:encoded><![CDATA[<p>The <em>Sleepy::loseSomeTime()</em> code in the Ports library was never tested on a <a href="/jm1">JeeNode Micro</a>. Turns out that only a minor library difference kept it from working (the <a href="http://code.google.com/p/arduino-tiny/">arduino-tiny</a> library has its own version of <em>millis()</em>, etc):</p>

<p><img src="http://jeelabs.org/wp-content/uploads/2012/01/Screen-Shot-2012-01-14-at-23.55.34.png" alt="Screen Shot 2012 01 14 at 23 55 34" border="0" width="432" height="337" /></p>

<p>So now, the JNµ can be put to sleep as well. Here&#8217;s the <a href="https://github.com/jcw/jeelib/blob/master/examples/RF12/jouleTest/jouleTest.ino">jouleTest</a> sketch I used, tweaked to run on the JNµ as well:</p>

<p><img src="http://jeelabs.org/wp-content/uploads/2012/01/Screen-Shot-2012-01-14-at-23.55.09.png" alt="Screen Shot 2012 01 14 at 23 55 09" border="0" width="376" height="450" /></p>

<p>And sure enough, about once every 10 seconds it shows that familiar packet-transmit current consumption:</p>

<p><img src="http://jeelabs.org/wp-content/uploads/2012/01/SCR88.png" alt="SCR88" border="0" width="604" height="476" /></p>

<p>The blue line is the AC-coupled supply voltage, a 3x AA Eneloop battery pack in this case. It supplies about 3.8V, but when running off a 1000 µF cap, it looks like this continues to work down to 1.8V (well below the RFM12B&#8217;s minimum 2.2V specs) &#8211; although with only about half the transmit power by then.</p>

<p>This current use <a href="http://jeelabs.org/2011/12/01/rf12-power-optimization/">fingerprint</a> is almost identical to the ATmega328 running this same code. Not surprising really, since it&#8217;s the RFM12B which determines most of the power consumption, not the ATmega vs ATtiny difference.</p>

<p><em>Onwards!</em></p>
]]></content:encoded>
			<wfw:commentRss>http://jeelabs.org/2012/01/18/putting-the-jnu-to-sleep/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Another AA booster</title>
		<link>http://jeelabs.org/2012/01/16/another-aa-booster/</link>
		<comments>http://jeelabs.org/2012/01/16/another-aa-booster/#comments</comments>
		<pubDate>Sun, 15 Jan 2012 23:01:45 +0000</pubDate>
		<dc:creator>jcw</dc:creator>
				<category><![CDATA[Hardware]]></category>
		<category><![CDATA[LowPower]]></category>

		<guid isPermaLink="false">http://jeelabs.org/?p=17466</guid>
		<description><![CDATA[Out of curiosity, I&#8217;ve been doodling around with the AS1323 boost regulator chip, as suggested by someone in the comments. It&#8217;s not super efficient, but it does claim an extraordinarily low quiescent current of 1.6 µA. Hooking up such a tiny chip is quite a challenge: The trouble is that this stuff can&#8217;t be spread [...]]]></description>
			<content:encoded><![CDATA[<p>Out of curiosity, I&#8217;ve been doodling around with the AS1323 boost regulator chip, as suggested by someone in the <a href="http://jeelabs.org/2011/12/13/developing-a-low-power-sketch/#comment-4438">comments</a>. It&#8217;s not super efficient, but it does claim an extraordinarily low quiescent current of 1.6 µA.</p>

<p>Hooking up such a tiny chip is quite a challenge:</p>

<p><img src="http://jeelabs.org/wp-content/uploads/2012/01/DSC_2856.jpg" alt="DSC 2856" border="0" width="604" height="351" /></p>

<p>The trouble is that this stuff can&#8217;t be spread out too much &#8211; the specs say that both input and output caps have to be within 5 mm of the chip. So I tied it to a pcb &#8211; mostly for stability &#8211; and then wired everything up around it.</p>

<p>Without any load, this thing operates in quite an efficient mode:</p>

<p><img src="http://jeelabs.org/wp-content/uploads/2012/01/SCR81.png" alt="SCR81" border="0" width="604" height="468" /></p>

<p>The yellow trace is the voltage drop across a 10 Ω low-side resistor, the blue trace is the output, but AC coupled, i.e. showing only the ripple voltage.</p>

<p>The red line is the math function to integrate total power use in Coulombs &#8211; more on that later.</p>

<p>If you look at the top overview graphs, you can see the current blips which are over 160 ms apart, i.e. this thing is activating only 6 times a second. And each current pulse lasts only about 150 µs. The peak current on the input side, i.e. drawn from the battery, is about 12.5 mA.</p>

<p>Let&#8217;s put a 1 kΩ load on the 3.3V output line:</p>

<p><img src="http://jeelabs.org/wp-content/uploads/2012/01/SCR83.png" alt="SCR83" border="0" width="604" height="468" /></p>

<p>I&#8217;ve adjusted the scale a bit. The switcher is now operating at about 11 KHz. The peak current drawn is almost 18 mA, but note also that the current never drops to 0 anymore &#8211; the baseline of that yellow trace is 2 divisions down from the top, so that&#8217;s about 6 mA (as expected, since the load is always drawing current).</p>

<p>Now let&#8217;s push it and change the output load to 100 Ω, i.e. about 33 mA @ 3.3V. To make that work, I had to change the input sense resistor to 1 Ω:</p>

<p><img src="http://jeelabs.org/wp-content/uploads/2012/01/SCR84.png" alt="SCR84" border="0" width="604" height="476" /></p>

<p>The baseline for the yellow trace is now halfway, same as for the blue line.</p>

<p>I also added a third probe, the green line monitors output voltage, which is indeed steady at 3.3V (both red and green lines are based at the bottom of the screen). Note the <em>huge</em> peak current draw on the battery: over 290 mA!</p>

<p>Let&#8217;s try to understand what&#8217;s going on in this last case. First of all, with a 1 Ω sense resistor, a 190..290 mA current draw creates a voltage drop of around 0.25V &#8211; which means the battery voltage isn&#8217;t really reaching the switching regulator. The battery was measured to be at 1.37V, so the switcher is getting only about 1.1V on average. The datasheet says that it will only be 70..75% efficient on such an input voltage, when generating the 3.3V output.</p>

<p>The 100 Ω output load draws about 33 mA. That&#8217;s at 3.3V, so a perfect step-up regulator would need to draw 3x as much when running off 1.1V, i.e. 100 mA. A 70% efficient switcher would draw about 150 mA (0.70 x 150 ≈ 100). What I&#8217;m seeing here is more like a 40% efficient switching result (0.40 x 250 = 100) &#8211; <em>hm, not sure why&#8230;</em></p>

<p>The other way to determine <em>average</em> current consumption, is to do some <em>Coulomb counting&#8230;</em></p>

<p>In the first screenshot, each blip uses about 900 nanocoulombs (the red line rises 4.5 divisions over the entire width of of the screen). With 6 blips per second, we use 5.4 µC each second, i.e. 5.4 µA average current draw (not quite the 1.6 µA I expected, but still very impressive for an unloaded step-up regulator).</p>

<p>The second graph is trickier. We need to figure out the Coulombs <em>increase</em> per repetitive cycle. My guess would be around 820 nC. Multiply by the switching frequency of 11.25 KHz, and you get 9.2 mC per second, i.e. 9.2 mA average battery current to deliver about 3.3 mA @ 3.3V.</p>

<p>Gotta be a bit careful here. It turns out that the battery (which is a bit old), still delivers 1.44V at this lower power level. Also, since I&#8217;m using a 10 Ω current sense resistor in this case, there&#8217;s 92 mV wasted in that resistor. That leaves about 1.35V going in. A perfect switcher would draw 3.3V / 1.35V * 3.3mA = 8.07 mA. We&#8217;re pulling 9.2 mA, which is about 87% efficiency. That seems a bit optimistic, since the AS1323 doesn&#8217;t really go much further than 80%. Oh well, there are probably several measurement errors in my quick and dirty test setup.</p>

<p>For the third case with the 100 Ω load, I end up with a figure of 215 mC/s, i.e. an average current draw of 215 mA. Better than before but still under 50% efficiency.</p>

<p>One more datapoint: with a 100 kΩ load, the switching frequency goes to 120 Hz, while still using about 800 nC per cycle, i.e. ≈ 100 µC per second, or 100 µA. Again, pretty good for what is essentially a 33 µA load @ 3.3V &#8211; even if all these estimates are off by perhaps 25%.</p>

<p><em>So this chip might work quite well for bursty ultra-low power contexts such as a mostly-sleeping JeeNode!</em></p>
]]></content:encoded>
			<wfw:commentRss>http://jeelabs.org/2012/01/16/another-aa-booster/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
		<item>
		<title>Low-power blink test</title>
		<link>http://jeelabs.org/2012/01/08/low-power-blink-test/</link>
		<comments>http://jeelabs.org/2012/01/08/low-power-blink-test/#comments</comments>
		<pubDate>Sat, 07 Jan 2012 23:01:59 +0000</pubDate>
		<dc:creator>jcw</dc:creator>
				<category><![CDATA[Hardware]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[LowPower]]></category>

		<guid isPermaLink="false">http://jeelabs.org/?p=17234</guid>
		<description><![CDATA[Here is a new snoozeBlink sketch which can run off the new experimental 12 mW Low-power Supply: It does all the right things to start off in low-power mode and puts the ATmega to sleep, even as the LED blinks! The LED is a normal red LED with a forward voltage of about 1.6V and [...]]]></description>
			<content:encoded><![CDATA[<p>Here is a new <a href="https://github.com/jcw/jeelib/blob/master/examples/Ports/snoozeBlink/snoozeBlink.ino">snoozeBlink</a> sketch which can run off the new experimental 12 mW <a href="http://jeelabs.org/2011/12/28/finished-low-power-supply/">Low-power Supply</a>:</p>

<p><img src="http://jeelabs.org/wp-content/uploads/2011/12/Screen-Shot-2011-12-28-at-14.48.03.png" alt="Screen Shot 2011 12 28 at 14 48 03" border="0" width="419" height="365" /></p>

<p>It does all the right things to start off in low-power mode and puts the ATmega to sleep, <em>even as the LED blinks!</em></p>

<p>The LED is a normal red LED with a forward voltage of about 1.6V and with a 470 Ω series resistor. The result:</p>

<p><img src="http://jeelabs.org/wp-content/uploads/2011/12/SCR03.png" alt="SCR03" border="0" width="604" height="442" /></p>

<p>(lots of noise because I&#8217;m using the default 1:10 probe and the scope at its most sensitive 1 mV/div setting)</p>

<p>Voltage over the 100 µF reservoir cap in blue, current consumption in yellow.
You can see the startup dip when the cap reaches about 6V, then the 2s wait, and then the LED blink at about 2 Hz with a 10% duty cycle. There&#8217;s not much energy to spare &#8211; the reservoir cap doesn&#8217;t even get a chance to <em>fully</em> re-charge between blinks.</p>

<p>After about 4 seconds, I turned off the power to find out what would happen. Yet there&#8217;s <em>still</em> enough energy left to get two more full blinks, and then an aborted blink as the reservoir cap voltage drops below 3V.</p>

<p>Note how the power consumption is just 3 mA while the LED is turned on. The ATmega itself is hardly ever running (the very brief 10 mA peaks got filtered out in this scope capture).</p>

<p>It can even be made to flash with a 26 mA LED current (omitting the resistor) for 16 ms @ 2 Hz. In this case the reservoir cap voltage varied from 9.4 to 4.4 V, again leaving very little energy to spare. Maybe one day this can be refined to drive a TRIAC, which needs very frequent but brief pulses (a BT137, BTA312, or L6004L3?).</p>

<p><em>But there&#8217;s actually something extra-ordinary going on with that power-up sequence &#8211; let&#8217;s investigate:</em></p>

<p><img src="http://jeelabs.org/wp-content/uploads/2011/12/SCR04.png" alt="SCR04" border="0" width="604" height="442" /></p>

<p>The BIG surprise? This is running on a <em>standard</em> JeeNode with <em>standard</em> bootstrap &#8211; no power-up troubles at all!</p>

<p>Let me try and interpret everything happening in that last image:</p>

<ul>
<li>the initial very high blip (over 25 mA) is the JeeNode&#8217;s on-board 10 µF capacitor charging up</li>
<li>the 65 ms @ 3.2 mA is the clock startup delay, as defined by the default fuse setting</li>
<li>up to this point, the reservoir cap has lost some 2V of its charge</li>
<li>the next blip is the boot loader passing control <em>immediately</em> to the sketch (!)</li>
<li>then there&#8217;s the 32 ms <em>loseSomeTime()</em> call in <em>setup()</em>, with the ATmega finally powered down</li>
<li>the last blip at the right-end side of the screen puts the RFM12B into low-power sleep mode</li>
</ul>

<p>So what&#8217;s going on, and above all why is the <a href="http://jeelabs.org/2011/11/30/all-power-up-puzzles-solved/">boot loader problem</a> gone, after all that trouble it gave me before?</p>

<p>The only explanation I can think of lies in the one change I made since then: I&#8217;m now using OptiBoot v4.4 &#8230; and it probably does the right thing, in that it <em>skips</em> the boot loader on power-up and only goes through a boot-loader sequence on reset. This is the well known <a href="http://www.ladyada.net/library/arduino/bootloader.html">ladyada fix</a>. I guess my previous boot loader setup wasn&#8217;t using that.</p>

<p>This is <em>really</em> good news. It means you just need a recently-flashed ATmega and you can continue to use the normal FTDI upload mechanism while fooling around with this ultra low-power stuff. Even the 10 µF cap and regulator on the JeeNode can be left in when powering it from the new Low-power supply.</p>
]]></content:encoded>
			<wfw:commentRss>http://jeelabs.org/2012/01/08/low-power-blink-test/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>ISP Programmers &#8211; part 2</title>
		<link>http://jeelabs.org/2012/01/05/isp-programmers-part-2/</link>
		<comments>http://jeelabs.org/2012/01/05/isp-programmers-part-2/#comments</comments>
		<pubDate>Wed, 04 Jan 2012 23:01:33 +0000</pubDate>
		<dc:creator>jcw</dc:creator>
				<category><![CDATA[AVR]]></category>
		<category><![CDATA[Hardware]]></category>
		<category><![CDATA[ISP]]></category>
		<category><![CDATA[LowPower]]></category>

		<guid isPermaLink="false">http://jeelabs.org/?p=17225</guid>
		<description><![CDATA[In yesterday&#8217;s post, I presented my latest ISP programmers, based on the isp&#95;repair2 sketch. I made a few small improvements to that sketch: the RFM12B is powered down at the end, so that the unit only consumes a few µA&#8217;s once done the programming rate has been improved by getting rid of those horribly slow [...]]]></description>
			<content:encoded><![CDATA[<p>In <a href="http://jeelabs.org/2012/01/04/isp-programmers/">yesterday&#8217;s post</a>, I presented my latest ISP programmers, based on the <a href="https://github.com/jcw/jeelib/blob/master/examples/Ports/isp_repair2/isp_repair2.ino">isp&#95;repair2</a> sketch.</p>

<p>I made a few small improvements to that sketch:</p>

<ol>
<li>the RFM12B is powered down at the end, so that the unit only consumes a few µA&#8217;s once done</li>
<li>the programming rate has been improved by getting rid of those <a href="http://jeelabs.org/2010/01/06/pin-io-performance/">horribly slow</a> <em>digitalWrite()</em> calls, etc.</li>
<li>updated RF12demo and OptiBoot to the latest version (v8 and v4.4, respectively)</li>
</ol>

<p>Furthermore, I switched from the funky switches to plain jumpers, with the following layout:</p>

<p><img src="http://jeelabs.org/wp-content/uploads/2011/12/isp-pins1.png" alt="Isp pins" border="0" width="529" height="406" /></p>

<p>Another change is that the default with no jumpers is now to burn RF12demo w/ OptiBoot for use with a 16 MHz resonator &#8211; this is a good default for JeeNodes, JeeNode USB&#8217;s, and JeeNode SMD&#8217;s. To select the other options, just hook this up to USB, change the jumpers, and watch the serial output report on reset.</p>

<p>This is the output with no jumpers and no target board attached:</p>

<blockquote>
  <p><img src="http://jeelabs.org/wp-content/uploads/2011/12/Screen-Shot-2011-12-28-at-11.49.57.png" alt="Screen Shot 2011 12 28 at 11 49 57" border="0" width="567" height="103" /></p>
</blockquote>

<p>This is the output after a normal programming cycle (again, the default case, no jumpers installed):</p>

<blockquote>
  <p><img src="http://jeelabs.org/wp-content/uploads/2011/12/Screen-Shot-2011-12-28-at-11.50.15.png" alt="Screen Shot 2011 12 28 at 11 50 15" border="0" width="558" height="211" /></p>
</blockquote>

<p>Programming takes only a few seconds. Note that this programmer is fully self-contained and includes its own LiPo battery, so all you need to do is press the 6 pins on the ISP header pads. The neat thing is that due to the normally-discharged cap on the target board, the brief power dip caused by touching the ISP pads will generate a hardware <em>power-on reset</em> in the programmer, which then immediately starts its programming cycle.</p>

<p>So the the whole workflow is now as follows:</p>

<ul>
<li>grab this thing &#8211; and let&#8217;s call it a &#8220;Portable ISP Programmer&#8221; (PIP!)</li>
<li>press the pins against the ISP header of the unit to be re-flashed</li>
<li>watch the initial LED blink on the programmer as it comes out of reset</li>
<li>wait 2..3 seconds</li>
<li>watch the <em>second</em> LED blink, indicating that it has successfully completed programming</li>
</ul>

<p>There is no power switch, since the programmer enters total power down when done. To re-charge, plug the programmer into a USB port and wait for the &#8220;charge&#8221; LED to turn off. Note that pressing the reset button also works, but that it adds a small boot loader delay before the <em>isp&#95;repair2</em> sketch gets started.</p>

<p>This has become so convenient, that I can now take any old JeeNode lying around here, and reset it to a well-known state in just a few seconds, before re-using it for some project or experiment.</p>
]]></content:encoded>
			<wfw:commentRss>http://jeelabs.org/2012/01/05/isp-programmers-part-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ISP programmers</title>
		<link>http://jeelabs.org/2012/01/04/isp-programmers/</link>
		<comments>http://jeelabs.org/2012/01/04/isp-programmers/#comments</comments>
		<pubDate>Tue, 03 Jan 2012 23:01:04 +0000</pubDate>
		<dc:creator>jcw</dc:creator>
				<category><![CDATA[AVR]]></category>
		<category><![CDATA[Hardware]]></category>
		<category><![CDATA[ISP]]></category>
		<category><![CDATA[LowPower]]></category>

		<guid isPermaLink="false">http://jeelabs.org/?p=17216</guid>
		<description><![CDATA[ISP (re-)programming is going to become more important in the future, so I&#8217;ve built a few more of these: The problem was to come up with a robust way to connect to the target board, but I think I&#8217;ve found a solution: Take a 4-pin header, slightly enlarge the holes in the plastic, and then [...]]]></description>
			<content:encoded><![CDATA[<p>ISP (re-)programming is going to become more important in the future, so I&#8217;ve built a few more of <a href="http://jeelabs.org/2011/05/28/more-bootstraps/">these</a>:</p>

<p><img src="http://jeelabs.org/wp-content/uploads/2011/12/DSC_28441.jpg" alt="DSC 2844" border="0" width="604" height="424" /></p>

<p>The problem was to come up with a <em>robust</em> way to connect to the target board, but I think I&#8217;ve found a solution:</p>

<p><img src="http://jeelabs.org/wp-content/uploads/2011/12/DSC_2843.jpg" alt="DSC 2843" border="0" width="604" height="290" /></p>

<p>Take a 4-pin header, slightly enlarge the holes in the plastic, and then gently-but-forcefully press a couple of <a href="http://en.wikipedia.org/wiki/Pogo_pin">Pogo pins</a> in there. I&#8217;m using the type with a large head with sharp edges. Here&#8217;s the whole assembly:</p>

<p><img src="http://jeelabs.org/wp-content/uploads/2011/12/DSC_2839.jpg" alt="DSC 2839" border="0" width="604" height="426" /></p>

<p>After that, it&#8217;s a matter of attaching all the wires and tying / glueing things together:</p>

<p><img src="http://jeelabs.org/wp-content/uploads/2011/12/DSC_2841.jpg" alt="DSC 2841" border="0" width="604" height="429" /></p>

<p>These units are all refurbished ones with a defective radio, since that&#8217;s not needed here.</p>

<p><img src="http://jeelabs.org/wp-content/uploads/2011/12/DSC_2840.jpg" alt="DSC 2840" border="0" width="604" height="401" /></p>

<p>The ZIP straps hold the battery and wires in place. The hot glue does the rest:</p>

<p><img src="http://jeelabs.org/wp-content/uploads/2011/12/DSC_2842.jpg" alt="DSC 2842" border="0" width="604" height="516" /></p>

<p>These programmers are considerably more effective than you might think &#8211; <em>tomorrow, I&#8217;ll explain why&#8230;</em></p>
]]></content:encoded>
			<wfw:commentRss>http://jeelabs.org/2012/01/04/isp-programmers/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>Scheduler power optimization</title>
		<link>http://jeelabs.org/2012/01/02/scheduler-power-optimization/</link>
		<comments>http://jeelabs.org/2012/01/02/scheduler-power-optimization/#comments</comments>
		<pubDate>Sun, 01 Jan 2012 23:01:35 +0000</pubDate>
		<dc:creator>jcw</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[LowPower]]></category>

		<guid isPermaLink="false">http://jeelabs.org/?p=17082</guid>
		<description><![CDATA[Last year&#8217;s post showed how a packet transmission w/ ACK reception works out in terms of power consumption. It also uncovered a fairly large &#8220;power consumption bug&#8221;, with the scheduler idling only 0.1s at a time, causing the ATmega to exit power-down mode through its watchdog far more often than necessary. Here&#8217;s the relevant code [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://jeelabs.org/2011/12/30/anatomy-of-a-room-node-transmission/">Last year&#8217;s post</a> showed how a packet transmission w/ ACK reception works out in terms of power consumption. It also uncovered a fairly large &#8220;power consumption bug&#8221;, with the scheduler idling only 0.1s at a time, causing the ATmega to exit power-down mode through its watchdog far more often than necessary.</p>

<p>Here&#8217;s the relevant code in the general-purpose Scheduler class in <a href="https://github.com/jcw/jeelib/blob/master/Ports.cpp#L863">Ports.cpp</a>:</p>

<p><img src="http://jeelabs.org/wp-content/uploads/2011/12/Screen-Shot-2011-12-21-at-19.00.38.png" alt="Screen Shot 2011 12 21 at 19 00 38" border="0" width="474" height="211" /></p>

<p>And here&#8217;s what I &#8216;m going to change it to, to optimize and stay powered-down much longer:</p>

<p><img src="http://jeelabs.org/wp-content/uploads/2011/12/Screen-Shot-2011-12-21-at-19.00.10.png" alt="Screen Shot 2011 12 21 at 19 00 10" border="0" width="472" height="226" /></p>

<p>This changes the wake-up period from 30 times per second, to roughly once every 8s, with blips like this:</p>

<p><img src="http://jeelabs.org/wp-content/uploads/2011/12/SCR582.png" alt="SCR58" border="0" width="604" height="478" /></p>

<p>My interpretation of this picture, is that the ATmega on this JeeNode needs a <em>whopping</em> 10 mA of power for 50 µs once every eight seconds to keep going. That 1 ms &#8220;lead-in&#8221; at &lt; 1 mA is probably clock startup, or something.</p>

<p>This current draw is the same as before (this capture was with PIR installed). But instead of 1800 wake-ups per minute, there will now be 10 or so. This will reduce the power consumption from 2,000 µC to roughly 10 µC!</p>

<p>Does that mean the Room Node will now last 200 times longer on a single battery? Unfortunately, no. With these low-power games, the weakest link determines total battery life. In this case, there&#8217;s a PIR sensor which has to be constantly on, drawing about 50 µA. That&#8217;s 3,000 microcoulombs per minute.</p>

<p>But still, this little optimization should add quite a bit to the lifetime of a battery:</p>

<ul>
<li>old: 3000 (PIR) + 130 (radio) + 600 (estimated) ATmega/regulator + 2,000 (scheduler) = 5730 µC/min</li>
<li>new situation, again per minute: 3,000 + 130 + 600 + 10 = 3740 µC/min</li>
</ul>

<p>If you&#8217;re wondering what &#8220;microcoulombs/minute&#8221; means: that&#8217;s just current, so rescaling it to µC/s (i.e. µA&#8217;s), we get: old ≈ 96 µA, new = 63 µA. With a 2000 mAh 3x AA battery pack, that&#8217;s 2.5 vs 3.6 <em>years</em> of run time.</p>

<p>Note that these values are fairly optimistic. With motion in the room, there will be more than one packet transmission per minute. I have yet to see the real-life battery life of these room nodes, although right now it&#8217;s looking quite good: the nodes I have around here have been working for many months &#8211; <em>2012 will tell!</em></p>

<p><em>But either way, that change of just a few lines of C code should add about 50% to the battery life. Crazy, eh?</em></p>
]]></content:encoded>
			<wfw:commentRss>http://jeelabs.org/2012/01/02/scheduler-power-optimization/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Anatomy of a Room Node transmission</title>
		<link>http://jeelabs.org/2011/12/30/anatomy-of-a-room-node-transmission/</link>
		<comments>http://jeelabs.org/2011/12/30/anatomy-of-a-room-node-transmission/#comments</comments>
		<pubDate>Thu, 29 Dec 2011 23:01:01 +0000</pubDate>
		<dc:creator>jcw</dc:creator>
				<category><![CDATA[Hardware]]></category>
		<category><![CDATA[LowPower]]></category>

		<guid isPermaLink="false">http://jeelabs.org/?p=17065</guid>
		<description><![CDATA[Now that my analysis capabilities have improved, it thought it&#8217;d be interesting to see the power consumption profile of a Room Node, running the roomNode.ino sketch. Here&#8217;s an annotated capture of a motion event: The yellow line is the current consumption of the entire room node. I&#8217;ve added some annotations, although there are still a [...]]]></description>
			<content:encoded><![CDATA[<p>Now that my analysis capabilities have improved, it thought it&#8217;d be interesting to see the power consumption profile of a Room Node, running the <a href="https://github.com/jcw/jeelib/blob/master/examples/RF12/roomNode/roomNode.ino">roomNode.ino</a> sketch. Here&#8217;s an annotated capture of a motion event:</p>

<p><img src="http://jeelabs.org/wp-content/uploads/2011/12/annotated-room-packet1.png" alt="Annotated room packet" border="0" width="604" height="459" /></p>

<p>The yellow line is the current consumption of the entire room node. I&#8217;ve added some annotations, although there are still a few things I&#8217;m not so sure about, such as the 2.5 ms delay between SHT readout and XMIT start.</p>

<p>The red line is the integral of the yellow line, i.e. the total amount of energy consumed as time progresses. It took about 3 ms between the end of the packet transmission and the first ACK packet header byte coming in &#8211; this thumb-twitching <em>with the receiver enabled</em> accounts for about 1/3rd of the power consumption!</p>

<p>There is almost always room for improvement with this sort of stuff. The closer you look, you more you find things to optimize. For example, I noticed that there were <em>blips</em> every 32 mS or so (it&#8217;s slightly irregular):</p>

<p><img src="http://jeelabs.org/wp-content/uploads/2011/12/SCR54.png" alt="SCR54" border="0" width="604" height="470" /></p>

<p>This is zoomed in on both axes. The noise level is a bit higher, perhaps due to the 2 mV/div setting of the scope.</p>

<p>That&#8217;s over 1 ms @ 0.8 mA, at about 30 times per second on average. I don&#8217;t know what it is &#8211; it&#8217;s not the PIR sensor, which was removed during this measurement. Not a lot of energy <em>per blip</em>, but it does add up: ≈ each uses 1.1 µC, i.e. some 2,000 µC per minute. Whereas the first screen shows that a transmission takes only 130 µC.</p>

<p><em>So there you go: <a href="http://en.wikipedia.org/wiki/Standby_power">vampire power</a> at microwatt levels!</em></p>

<p><strong>Update</strong> &#8211; Ah, wait &#8211; <em>of course!</em> &#8211; it&#8217;s the <em>Scheduler</em> class in the Ports library! When idling, it lets time pass in steps of 0.1s (or rather 96 ms), and there&#8217;s no other way to do this than with 32 and 64 ms watchdog timer steps.
<em><a href="http://jeelabs.org/2011/12/15/the-steepness-dilemma/">I told you</a> &#8211; there are no show-stoppers in this game, it works on logic and insight, all the way down!</em></p>
]]></content:encoded>
			<wfw:commentRss>http://jeelabs.org/2011/12/30/anatomy-of-a-room-node-transmission/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Finished Low-power Supply</title>
		<link>http://jeelabs.org/2011/12/28/finished-low-power-supply/</link>
		<comments>http://jeelabs.org/2011/12/28/finished-low-power-supply/#comments</comments>
		<pubDate>Tue, 27 Dec 2011 23:01:16 +0000</pubDate>
		<dc:creator>jcw</dc:creator>
				<category><![CDATA[Hardware]]></category>
		<category><![CDATA[LowPower]]></category>

		<guid isPermaLink="false">http://jeelabs.org/?p=17028</guid>
		<description><![CDATA[The Low-power Supply described previously on this weblog now has a PCB &#8211; and it&#8217;s about as small as a JNµ: Here&#8217;s an assembled unit, ready for testing and hooked up to power a JeeNode (w/ disabled bootstrap): And here&#8217;s the whole test setup I had to create to check this thing out: Lots of [...]]]></description>
			<content:encoded><![CDATA[<p>The Low-power Supply described <a href="http://jeelabs.org/2011/12/18/meet-the-low-power-supply/">previously</a> on this weblog now has a PCB &#8211; and it&#8217;s about as small as a JNµ:</p>

<p><img src="http://jeelabs.org/wp-content/uploads/2011/12/DSC_2827-Version-2.jpg" alt="DSC 2827  Version 2" border="0" width="604" height="448" /></p>

<p>Here&#8217;s an assembled unit, ready for testing and hooked up to power a JeeNode (w/ disabled bootstrap):</p>

<p><img src="http://jeelabs.org/wp-content/uploads/2011/12/DSC_2831.jpg" alt="DSC 2831" border="0" width="604" height="261" /></p>

<p>And here&#8217;s the whole test setup I had to create to check this thing out:</p>

<p><img src="http://jeelabs.org/wp-content/uploads/2011/12/DSC_2830.jpg" alt="DSC 2830" border="0" width="604" height="402" /></p>

<p>Lots of stuff involved, including high-voltage probe and 230V isolation transformer (to the right, out of view).</p>

<p>Here&#8217;s a demonstration of how it works &#8211; summarized as one elaborate scope capture:</p>

<p><img src="http://jeelabs.org/wp-content/uploads/2011/12/SCR42.png" alt="SCR42" border="0" width="604" height="470" /></p>

<p>Green is the mains voltage (235 Vrms), purple is the charge building up on the 100 µF reservoir capacitor, yellow is the regulated output, and blue is the JeeNode&#8217;s current consumption (measured as voltage drop over 10 Ω). Note how some of the voltages measured here differ more by than four orders of magnitude!</p>

<p>Anyway, that zoomed-in image is the clear signature of the <em>second</em> 8-byte RFM12B packet transmission. Current consumption varies from 23 to 26 mA. It&#8217;s a relatively coarse image, since it has been zoomed in 4,000 times.</p>

<p>The 3.3V supply level is reached ≈ 2s after power-up, with another 2.5s needed to fully charge the reservoir cap. You can see from the purple dips that this supply could sustain at least one packet transmit per second.</p>

<p>No surprises here, but it&#8217;s good to see that the PCB design works as intended. Next step: implement deep sleep on the ATtiny84 &#8211; hopefully this&#8217;ll take just some minor adjustments to the <em>Sleepy::loseSomeTime()</em> code.</p>
]]></content:encoded>
			<wfw:commentRss>http://jeelabs.org/2011/12/28/finished-low-power-supply/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Meet the Low-power Supply</title>
		<link>http://jeelabs.org/2011/12/18/meet-the-low-power-supply/</link>
		<comments>http://jeelabs.org/2011/12/18/meet-the-low-power-supply/#comments</comments>
		<pubDate>Sat, 17 Dec 2011 23:01:01 +0000</pubDate>
		<dc:creator>jcw</dc:creator>
				<category><![CDATA[Hardware]]></category>
		<category><![CDATA[LowPower]]></category>

		<guid isPermaLink="false">http://jeelabs.org/?p=16761</guid>
		<description><![CDATA[Now that everything is working, I want to have a ready-to use printed circuit board for it. Came up with this: It&#8217;s tiny &#8211; about 48 x 12 mm &#8211; even though it&#8217;s based entirely on through-hole parts. The idea is to build it up, add wires, and then encapsulate the whole thing in heat-shrink [...]]]></description>
			<content:encoded><![CDATA[<p>Now that everything is <a href="http://jeelabs.org/2011/12/17/a-power-supply-which-draws-12-mw/">working</a>, I want to have a ready-to use printed circuit board for it. Came up with this:</p>

<p><img src="http://jeelabs.org/wp-content/uploads/2011/12/Screen-Shot-2011-12-09-at-18.34.14.png" alt="Screen Shot 2011 12 09 at 18 34 14" border="0" width="424" height="113" /></p>

<p>It&#8217;s tiny &#8211; about 48 x 12 mm &#8211; even though it&#8217;s based entirely on through-hole parts. The idea is to build it up, add wires, and then encapsulate the whole thing in heat-shrink tubing to reduce the number of contact points.</p>

<p><em>It can not be repeated enough: when tied to AC mains, the ENTIRE circuit carries AC mains voltage levels!</em></p>

<p>I have a couple of configurations in mind (see yesterday&#8217;s post for the schematic):</p>

<ul>
<li>with C1 a 10 nF X2 cap and C4 replaced by a wire, this delivers an average of 0.3 mA on 230 VAC mains</li>
<li>with C1 a 22 nF X2 cap and C4 replaced by a wire, this delivers an average of 0.3 mA on 115 VAC mains</li>
<li>with both C1 and C4 22 nF caps, this supplies 0.3 mA on 230 VAC with no direct connection to AC mains</li>
<li>with C1 and C4 replaced by a wire, this supply can be used with 10..24V DC in &#8211; which is great for testing</li>
<li>with C1 and C4 each replaced by a 220 kΩ resistor, and R1 by a 1N4007 diode, this becomes a somewhat less efficient (but lower-profile) resistive version, again delivering up to 0.3 mA at 230 VAC</li>
</ul>

<p>With C4 replaced by a wire, this circuit will have its &#8220;GND&#8221; output tied directly to the &#8220;N&#8221; input. This is important when powering the <a href="http://jeelabs.org/2011/10/27/ac-current-node-prototype/">AC current monitor</a>, which needs to have one side of its shunt at 0V relative to AC mains.</p>

<p>Note that no matter what, even with C1 and C4 both included, faults can develop in this circuit which cause the &#8220;low voltage&#8221; output of the circuit to end up directly tied to an AC mains &#8220;live&#8221; line. This is not, and will never be, a &#8220;safe&#8221; circuit. It can only be used safely while enclosed in a plastic box, with no contacts or parts sticking out.</p>

<p>In all cases, the on-board regulator will be activated once the input voltage rises to about 6V. This is the key to being able to power up a JeeNode or JeeNode Micro with their on-board RFM12B module.</p>
]]></content:encoded>
			<wfw:commentRss>http://jeelabs.org/2011/12/18/meet-the-low-power-supply/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
	</channel>
</rss>

<!-- Dynamic page generated in 0.498 seconds. -->
<!-- Cached page generated by WP-Super-Cache on 2012-02-09 20:59:39 -->
<!-- Compression = gzip -->
