<?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>Tue, 22 May 2012 22:18:24 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>New solar setup</title>
		<link>http://jeelabs.org/2012/05/15/new-solar-setup/</link>
		<comments>http://jeelabs.org/2012/05/15/new-solar-setup/#comments</comments>
		<pubDate>Mon, 14 May 2012 22:01:08 +0000</pubDate>
		<dc:creator>jcw</dc:creator>
				<category><![CDATA[Hardware]]></category>
		<category><![CDATA[LowPower]]></category>
		<category><![CDATA[Solar]]></category>

		<guid isPermaLink="false">http://jeelabs.org/?p=19500</guid>
		<description><![CDATA[Time for another experiment, this time combining my small solar panel with the 3.4 mAh Lithium battery which seems to work so well. The circuit I&#8217;m going to try is as follows: Here&#8217;s the construction, cozily attached to the back of the solar cell: Same solar cell, I think it can supply up to 4.5V [...]]]></description>
			<content:encoded><![CDATA[<p>Time for another experiment, this time combining my small <a href="http://jeelabs.org/2012/05/09/not-long-enough/">solar panel</a> with the 3.4 mAh <a href="http://jeelabs.org/2012/05/02/tiny-lithium-packet-test/">Lithium battery</a> which seems to work so well. The circuit I&#8217;m going to try is as follows:</p>

<p><img src="http://jeelabs.org/wp-content/uploads/2012/05/JCs-Grid-page-16.png" alt="JC s Grid page 16" title="JC's Grid, page 16.png" border="0" width="548" height="230" /></p>

<p>Here&#8217;s the construction, cozily attached to the back of the solar cell:</p>

<p><img src="http://jeelabs.org/wp-content/uploads/2012/05/DSC_31281.jpg" alt="DSC 3128" title="DSC_3128.jpg" border="0" width="604" height="440" /></p>

<p>Same solar cell, I think it can supply up to 4.5V @ 1 mA in full sunlight.</p>

<p>The tricky bit is that the rechargable lithium cell needs to be treated with care. For maximum life, it needs to be hooked up to a voltage source between 2.8V and 3.2V, and the charge current has to be limited.</p>

<p>Note that the 1 kΩ resistor is put in series with the battery not only to charge it, but also when taking charge <em>out</em> of it. Seems odd, but that&#8217;s the way the datasheet and examples show it. Then again, with a 10 µA current draw the voltage drop and losses are only about 10 mV. A diode bypass could be added later, if necessary.</p>

<p>The diode after the regulator has the nice effect of dropping the 3.3V output to an appropriate value, as well as blocking all reverse current flow. There is no further circuitry for the regulator, since I don&#8217;t really care what it does when there is too much or too little power coming from the solar cell. Let&#8217;s assume it&#8217;s stable without caps.</p>

<p>It all looks a bit wasteful, i.e. linearly regulating the incoming voltage straight down to 3.3V regardless of PV output levels and discarding the excess. But given that this little 3V @ 3.4 mAH battery has already supported a few days of running time when fully charged, maybe it&#8217;s still ok.</p>

<p>I&#8217;ll let this charge for a day or two.</p>
]]></content:encoded>
			<wfw:commentRss>http://jeelabs.org/2012/05/15/new-solar-setup/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Watching it go down</title>
		<link>http://jeelabs.org/2012/05/13/watching-it-go-down/</link>
		<comments>http://jeelabs.org/2012/05/13/watching-it-go-down/#comments</comments>
		<pubDate>Sat, 12 May 2012 22:01:25 +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=19477</guid>
		<description><![CDATA[Now that there&#8217;s low-power vccRead() code to measure the current power supply voltage, we can finally get a bit more valuable info from the radioBlip sketch, which sends out one packet per minute. So here&#8217;s a new radioBlip2 sketch which combines both functions. To support more test nodes, I&#8217;m adding a byte to the payload [...]]]></description>
			<content:encoded><![CDATA[<p>Now that there&#8217;s low-power <a href="https://github.com/jcw/jeelib/blob/master/examples/Ports/bandgap/bandgap.ino">vccRead()</a> code to measure the current power supply voltage, we can finally get a bit more valuable info from the <a href="https://github.com/jcw/jeelib/blob/master/examples/RF12/radioBlip/radioBlip.ino">radioBlip</a> sketch, which sends out one packet per minute.</p>

<p>So here&#8217;s a new <a href="https://github.com/jcw/jeelib/blob/master/examples/RF12/radioBlip2/radioBlip2.ino">radioBlip2</a> sketch which combines both functions. To support more test nodes, I&#8217;m adding a byte to the payload for a unique node ID, as well as a byte with the measured voltage level:</p>

<p><img src="http://jeelabs.org/wp-content/uploads/2012/05/Screen-Shot-2012-05-09-at-18.28.02.png" alt="Screen Shot 2012 05 09 at 18 28 02" title="Screen Shot 2012-05-09 at 18.28.02.png" border="0" width="104" height="72" /></p>

<p>As a quick test I used a JeeNode without regulator, running off an electrolytic 1000 µF cap, charged to 5V via a USB BUB, and then disconnected (this is running the RFM12B module beyond its 3.8V max specs, BTW):</p>

<p><img src="http://jeelabs.org/wp-content/uploads/2012/05/DSC_3127.jpg" alt="DSC 3127" title="DSC_3127.jpg" border="0" width="604" height="272" /></p>

<p>Here&#8217;s a dump of the received packets:</p>

<pre><code>    L 16:56:32.032 usb-A600dVPp OK 17 1 0 0 0 1 209
    L 16:57:35.859 usb-A600dVPp OK 17 2 0 0 0 1 181
    L 16:58:39.543 usb-A600dVPp OK 17 3 0 0 0 1 155
    L 16:59:43.029 usb-A600dVPp OK 17 4 0 0 0 1 134
    L 17:00:46.323 usb-A600dVPp OK 17 5 0 0 0 1 115
    L 17:01:49.431 usb-A600dVPp OK 17 6 0 0 0 1 98
    L 17:02:52.314 usb-A600dVPp OK 17 7 0 0 0 1 82
    L 17:03:55.016 usb-A600dVPp OK 17 8 0 0 0 1 66
    L 17:04:57.526 usb-A600dVPp OK 17 9 0 0 0 1 50
</code></pre>

<p>Or, more graphically, as voltage &#8211; showing 8 minutes before the sketch runs out of juice:</p>

<p><img src="http://jeelabs.org/wp-content/uploads/2012/05/Screen-Shot-2012-05-09-at-19.06.19.png" alt="Screen Shot 2012 05 09 at 19 06 19" title="Screen Shot 2012-05-09 at 19.06.19.png" border="0" width="420" height="192" /></p>

<p>This consumes only marginally more power than without the VCC measurements:  the original radioBlip sketch lasted 1 minute longer under similar conditions, i.e. one extra packet transmission.</p>
]]></content:encoded>
			<wfw:commentRss>http://jeelabs.org/2012/05/13/watching-it-go-down/feed/</wfw:commentRss>
		<slash:comments>14</slash:comments>
		</item>
		<item>
		<title>Improved VCC measurement</title>
		<link>http://jeelabs.org/2012/05/12/improved-vcc-measurement/</link>
		<comments>http://jeelabs.org/2012/05/12/improved-vcc-measurement/#comments</comments>
		<pubDate>Fri, 11 May 2012 22:01:11 +0000</pubDate>
		<dc:creator>jcw</dc:creator>
				<category><![CDATA[AVR]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[LowPower]]></category>

		<guid isPermaLink="false">http://jeelabs.org/?p=19452</guid>
		<description><![CDATA[As shown in this post, it is possible to read out the approximate level of VCC by comparing the internal 1.1 V bandgap with the current VCC level. But since this is about tracking battery voltage on an ultra-low power node, I wanted to tinker with it a bit further, to use as little energy [...]]]></description>
			<content:encoded><![CDATA[<p>As shown in <a href="http://jeelabs.org/2012/05/04/measuring-vcc-via-the-bandgap/">this post</a>, it is possible to read out the approximate level of VCC by comparing the internal 1.1 V bandgap with the current VCC level.</p>

<p>But since this is about tracking battery voltage on an ultra-low power node, I wanted to tinker with it a bit further, to use as little energy as possible when making that actual supply voltage measurement. Here&#8217;s an improved <a href="https://github.com/jcw/jeelib/blob/master/examples/Ports/bandgap/bandgap.ino">bandgap</a> sketch which adds a couple of low-power techniques:</p>

<p><img src="http://jeelabs.org/wp-content/uploads/2012/05/Screen-Shot-2012-05-09-at-15.42.39.png" alt="Screen Shot 2012 05 09 at 15 42 39" title="Screen Shot 2012-05-09 at 15.42.39.png" border="0" width="386" height="577" /></p>

<p>First thing to note is that the ADC is now run in <em>noise-<del>canceling</del>-reducing</em> mode, i.e. a special sleep mode which turns off part of the chip to let the ADC work more accurately. With as nice side-effect that it also saves power.</p>

<p>The other change was to drop the 250 µs busy waiting, and use 4 ADC measurements to get a stable result.</p>

<p>The main delay was replaced by a call to <em>loseSomeTime()</em> of course &#8211; the JeeLib way of powering down.</p>

<p>Lastly, I changed the sketch to send out the measurement results over wireless, to get rid of the serial port activity which would skew the power consumption measurements.</p>

<p>Speaking of which, here is the power consumption during the call to <em>vccRead()</em> &#8211; my favorite graph :)</p>

<p><img src="http://jeelabs.org/wp-content/uploads/2012/05/SCR41.png" alt="SCR41" title="SCR41.PNG" border="0" width="604" height="478" /></p>

<p>As usual, the red line is the integral of the current, i.e. the cumulative energy consumption (about 2300 nC).</p>

<p>And as you can see, it takes about 550 µs @ 3.5 mA current draw to perform this battery level measurement. The first ADC measurement takes a bit longer (25 cycles i.s.o. 13), just like the ATmega datasheet says.</p>

<p>The total of 2300 nC corresponds to a mere 2.3 µA average current draw when performed once a second, so it looks like calling <em>vccRead()</em> could easily be done once a minute without draining the power source very much.</p>

<p>The final result is pretty accurate: 201 for 5V and 147 for a 4V battery. I&#8217;ve tried a few units, and they all are within a few counts of the expected value &#8211; the 4-fold ADC readout w/ noise reduction appears to be effective!</p>

<p><strong>Update</strong> &#8211; The latest version of the <a href="https://github.com/jcw/jeelib/blob/master/examples/Ports/bandgap/bandgap.ino">bandgap</a> sketch adds support for an adjustable number of ADC readouts.</p>
]]></content:encoded>
			<wfw:commentRss>http://jeelabs.org/2012/05/12/improved-vcc-measurement/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Not long enough</title>
		<link>http://jeelabs.org/2012/05/09/not-long-enough/</link>
		<comments>http://jeelabs.org/2012/05/09/not-long-enough/#comments</comments>
		<pubDate>Tue, 08 May 2012 22:01:35 +0000</pubDate>
		<dc:creator>jcw</dc:creator>
				<category><![CDATA[Hardware]]></category>
		<category><![CDATA[LowPower]]></category>

		<guid isPermaLink="false">http://jeelabs.org/?p=19423</guid>
		<description><![CDATA[My second solar setup did not fare well: Started during the day, with the supercap charged up in bright daylight behind a window, it was able to power the JeeNode for about 16 hours &#8211; and then in the middle of the night it gave up: L 02:36:44.743 usb-A600dVPp OK 17 30 4 0 0 [...]]]></description>
			<content:encoded><![CDATA[<p>My <a href="http://jeelabs.org/2012/04/28/tiny-solar-cell-part-2/">second solar setup</a> did not fare well:</p>

<p><img src="http://jeelabs.org/wp-content/uploads/2012/05/DSC_30861.jpg" alt="DSC 3086" title="DSC_3086.jpg" border="0" width="604" height="463" /></p>

<p>Started during the day, with the supercap charged up in bright daylight behind a window, it was able to power the JeeNode for about 16 hours &#8211; and then in the middle of the night it gave up:</p>

<pre><code>    L 02:36:44.743 usb-A600dVPp OK 17 30 4 0 0
    L 02:37:48.074 usb-A600dVPp OK 17 31 4 0 0
    L 02:38:51.402 usb-A600dVPp OK 17 32 4 0 0
    L 02:39:54.725 usb-A600dVPp OK 17 33 4 0 0
</code></pre>

<p>Times are in UTC and we&#8217;re in the CEST time zone, so this was two hours later &#8211; i.e. around 4:30 AM.</p>

<p>I left it there for another few days, but unfortunately once dead this setup never recovers. The main reason for this is probably that the RFM12B starts up in a very power hungry mode (well, relatively speaking anyway) with a 0.6 mA current consumption &#8211; because it starts with the crystal oscillator enabled.</p>

<p>Maybe the self-leakage of the supercap was still too high, and would be (much) lower after a few days in the mostly-charged state, so I&#8217;m not ruling out using supercaps just yet. But as it stands, not getting through even a single night is not good enough &#8211; let alone being used in darker spots or on very dark winter days.</p>

<p><em>More experimentation needed!</em></p>
]]></content:encoded>
			<wfw:commentRss>http://jeelabs.org/2012/05/09/not-long-enough/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>How low can it go?</title>
		<link>http://jeelabs.org/2012/05/07/how-low-can-it-go/</link>
		<comments>http://jeelabs.org/2012/05/07/how-low-can-it-go/#comments</comments>
		<pubDate>Sun, 06 May 2012 22:01:08 +0000</pubDate>
		<dc:creator>jcw</dc:creator>
				<category><![CDATA[AVR]]></category>
		<category><![CDATA[Hardware]]></category>
		<category><![CDATA[LowPower]]></category>

		<guid isPermaLink="false">http://jeelabs.org/?p=19218</guid>
		<description><![CDATA[While experimenting with various alternate power sources for a JeeNode, I was curious as to just how low it could go in terms of voltage and still function as a simple wireless transmit node. Made the following mods to push things a bit more than usual: adjusted the fuses to set the brownout level to [...]]]></description>
			<content:encoded><![CDATA[<p>While experimenting with various alternate power sources for a JeeNode, I was curious as to just how low it could go in terms of voltage and still function as a simple wireless transmit node.</p>

<p>Made the following mods to push things a bit more than usual:</p>

<ul>
<li>adjusted the fuses to set the brownout level to 1.8V iso 2.7V (efuse: 0&#215;06)</li>
<li>changed the RFM12B&#8217;s low-battery level to 2.2V iso 3.1V (rf12_control: 0xC040)</li>
<li>removed the voltage regulator from a JeeNode, and keep just the electrolytic cap</li>
<li>changed the <a href="https://github.com/jcw/jeelib/blob/master/examples/RF12/radioBlip/radioBlip.ino">radioBlip</a> sketch to run at 8 MHz, i.e. 16 MHz clock % 2</li>
</ul>

<p>This is the same setup as with the <a href="http://jeelabs.org/?p=19123">Tiny Lithium discharge</a> setup described a few days ago, BTW.</p>

<p>Here&#8217;s the JeeNode-under-test (JUT?) &#8211; the cap I used here is again 100 µF:</p>

<p><img src="http://jeelabs.org/wp-content/uploads/2012/04/DSC_3070.jpg" alt="DSC 3070" title="DSC_3070.jpg" border="0" width="604" height="216" /></p>

<p>One pair of wires is from the power supply, the other from the multimeter.</p>

<p>And then it&#8217;s just a matter of hooking it up to a power supply and gradually lowering the supply voltage.</p>

<p>And the result is &#8230; 3.0, 2.9, 2.8, 2.7, 2.6, 2.5, 2.4, 2.3, 2.2, 2.1, 2.0, 1.9, 1.85 Volt still works!</p>

<p>Anything lower than that and the sketch stops sending out packets once a minute &#8211; <em>but then again, that&#8217;s probably just the brownout detector of the ATmega kicking in!</em></p>

<p>To get it back up, I re-connected the power supply at 2.1 V and the node started its blips again&#8230; lower didn&#8217;t work, my hunch is that the RFM12B&#8217;s clock circuit needs that slightly higher voltage level to start oscillating.</p>
]]></content:encoded>
			<wfw:commentRss>http://jeelabs.org/2012/05/07/how-low-can-it-go/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Measuring VCC via the bandgap</title>
		<link>http://jeelabs.org/2012/05/04/measuring-vcc-via-the-bandgap/</link>
		<comments>http://jeelabs.org/2012/05/04/measuring-vcc-via-the-bandgap/#comments</comments>
		<pubDate>Thu, 03 May 2012 22:01:42 +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=19208</guid>
		<description><![CDATA[The ATmega&#8217;s (and ATtiny&#8217;s for that matter) all have a 10-bit ADC which can be used measure analog voltages. These ADC&#8217;s are ratiometric, meaning they measure relative to the analog reference voltage (usually VCC). On a 5V Arduino, that means you can measure 0..5V as 0..1023, or roughly 5 mV per step. On a 3.3V [...]]]></description>
			<content:encoded><![CDATA[<p>The ATmega&#8217;s (and ATtiny&#8217;s for that matter) all have a 10-bit ADC which can be used measure analog voltages. These ADC&#8217;s are <em>ratiometric</em>, meaning they measure relative to the analog reference voltage (usually VCC).</p>

<p>On a 5V Arduino, that means you can measure 0..5V as 0..1023, or roughly 5 mV per step.</p>

<p>On a 3.3V JeeNode, the measurements are from 0 to 3.3V, or roughly 3.3 mV per step.</p>

<p>There&#8217;s no point connecting VCC to an analog input and trying to measure it that way, because no matter what you do, the ADC readout will be 1023.</p>

<p><em>So can we figure out what voltage we&#8217;re running at? This would be very useful when running off batteries.</em></p>

<p>Well, there is also a &#8220;bandgap reference&#8221; in each ATmega/ATtiny, which is essentially a 1.1V voltage reference. If we read out that value <em>relative</em> to our VCC, then a little math will do the trick:</p>

<ul>
<li>suppose we read out an ADC value &#8220;x&#8221; which represents 1.1V</li>
<li>with 5V as VCC, that value would be around 1100 / 5000 * 1023 = 225</li>
<li>whereas with 3.3V as VCC, we&#8217;d expect a reading of 1100 / 3300 * 1023 = 341</li>
<li>more generally, 1100 / VCC * 1023 = x</li>
<li>solving for VCC, we get VCC = 1100 / x * 1023</li>
</ul>

<p>So all we have to do is measure that 1.1V bandgap reference voltage and we can deduce what VCC was!</p>

<p>Unfortunately, the Arduino&#8217;s <em>analogRead()</em> doesn&#8217;t support this, so I&#8217;ve set up this <a href="https://github.com/jcw/jeelib/blob/master/examples/Ports/bandgap/bandgap.ino">bandgap</a> demo sketch:</p>

<p><img src="http://jeelabs.org/wp-content/uploads/2012/04/Screen-Shot-2012-04-22-at-21.44.43.png" alt="Screen Shot 2012 04 22 at 21 44 43" title="Screen Shot 2012-04-22 at 21.44.43.png" border="0" width="412" height="296" /></p>

<p>Sample output, when run on a JeeNode SMD in this case:</p>

<p><img src="http://jeelabs.org/wp-content/uploads/2012/04/Screen-Shot-2012-04-22-at-21.47.20.png" alt="Screen Shot 2012 04 22 at 21 47 20" title="Screen Shot 2012-04-22 at 21.47.20.png" border="0" width="87" height="99" /></p>

<p>There&#8217;s a delay in the vccRead() code, which helps stabilize the measurement. Here&#8217;s what happens with <em>vccRead(10)</em> &#8211; i.e. 10 µs delay instead of the default 250 µs:</p>

<p><img src="http://jeelabs.org/wp-content/uploads/2012/04/Screen-Shot-2012-04-22-at-21.51.15.png" alt="Screen Shot 2012 04 22 at 21 51 15" title="Screen Shot 2012-04-22 at 21.51.15.png" border="0" width="68" height="170" /></p>

<p>Quite different values as you can see&#8230;</p>

<p>And here&#8217;s the result on an RBBB with older ATmega168 chip, running at 5V:</p>

<p><img src="http://jeelabs.org/wp-content/uploads/2012/04/Screen-Shot-2012-04-22-at-21.53.44.png" alt="Screen Shot 2012 04 22 at 21 53 44" title="Screen Shot 2012-04-22 at 21.53.44.png" border="0" width="74" height="99" /></p>

<p>I don&#8217;t know whether the 168&#8242;s bandgap accuracy is lower, but as you can see these figures are about 10% off (the supply voltage was measured to be 5.12 V on my VC170 multimeter). IOW, the bandgap accuracy is not great &#8211; as stated in the datasheet, which specifies 1.0 .. 1.2V @ 25°C when VCC is 2.7V. Note also that the bandgap reference needs 70 µs to start up, so it may not immediately be usable when coming out of a power-down state.</p>

<p>Still, this could be an excellent way to predict low-battery conditions <em>before</em> an ATmega or ATtiny starts to run out of steam.</p>
]]></content:encoded>
			<wfw:commentRss>http://jeelabs.org/2012/05/04/measuring-vcc-via-the-bandgap/feed/</wfw:commentRss>
		<slash:comments>16</slash:comments>
		</item>
		<item>
		<title>Trying to measure capacitor leakage</title>
		<link>http://jeelabs.org/2012/04/07/trying-to-measure-capacitor-leakage/</link>
		<comments>http://jeelabs.org/2012/04/07/trying-to-measure-capacitor-leakage/#comments</comments>
		<pubDate>Fri, 06 Apr 2012 22:01:36 +0000</pubDate>
		<dc:creator>jcw</dc:creator>
				<category><![CDATA[Hardware]]></category>
		<category><![CDATA[LowPower]]></category>

		<guid isPermaLink="false">http://jeelabs.org/?p=18718</guid>
		<description><![CDATA[Capacitors have a &#8220;leakage current&#8221;, i.e. when you charge them up fully, the leakage current will cause them to slowly lose that charge. I was wondering about this in the context of an ultra-low power JeeNode, which has a 10 µF buffer cap right after the voltage regulator. Does its leakage affect battery lifetimes? Time [...]]]></description>
			<content:encoded><![CDATA[<p>Capacitors have a &#8220;leakage current&#8221;, i.e. when you charge them up fully, the leakage current will cause them to slowly lose that charge. I was wondering about this in the context of an ultra-low power JeeNode, which has a 10 µF buffer cap right after the voltage regulator. Does its leakage affect battery lifetimes?</p>

<p>Time to do a quick test &#8211; I used the 47 µF 25V cap included with JeeNode kits these days:</p>

<p><img src="http://jeelabs.org/wp-content/uploads/2012/03/DSC_2981.jpg" alt="DSC 2981" title="DSC_2981.jpg" border="0" width="604" height="248" /></p>

<p>So how do you measure leakage currents, which are bound to be very small at 3.3V? Well, you could charge up the cap and then insert a multimeter in series in its most sensitive range. <a href="http://jeelabs.org/2012/03/22/tk-multimeter/">This multimeter</a> goes down to 0.1 µA resolution, although its accuracy is specified as 1.6 % + 5 digits, so the really low values aren&#8217;t very precise.</p>

<p>A simpler way is to use the <a href="http://en.wikipedia.org/wiki/RC_time_constant">RC time constant</a> as a basis. The idea is that a real-world cap can be treated like a perfect cap (which would keep its charge forever) plus a resistor in parallel. That resistor merely &#8220;happens&#8221; to be situated inside the cap.</p>

<p>What I did was charge the cap from a 3x AA battery pack which was just about 4.0V, then disconnect the battery and watch the discharge on the oscilloscope:</p>

<p><img src="http://jeelabs.org/wp-content/uploads/2012/03/SCR02.png" alt="SCR02" title="SCR02.PNG" border="0" width="604" height="442" /></p>

<p>As you can see, it took 500 seconds for the charge in the capacitor to drop by some 2.5V &#8211; note the exponential decay, which matches the assumption that the leakage comes from a fixed resistance.</p>

<p>Can we derive the leakage from this? <em>Sure we can!</em></p>

<p>The formula for RC discharge is:</p>

<pre><code>    T = R x C
</code></pre>

<p>Where <strong>T</strong> (in seconds) is the time for the cap to discharge by 63.2 percent, <strong>R</strong> is the discharge resistor (in ohms), and <strong>C</strong> is the capacitor size (in farads).</p>

<p>Above, it took 500 seconds to drop from 3.98 V to 1.48 V, which by pure accident is almost exactly 63.2 %, so T = 500 and C = 0.000,047 &#8211; giving us all the info needed to calculate R = 500 / 0.000,046 = 10638298 ≈ 10.6 MΩ.</p>

<p>Using ohm&#8217;s law (E = I x R), that means the leakage current at the start is 4 V / 10.6 MΩ = 0.376 µA.</p>

<p>The good news is that such a result would not be of any concern with ultra-low power JeeNodes &#8211; the regulator + ATmega + RFM12B use an order of magnitude more than that, even when powered down.</p>

<p>But the bad news is that this result is in fact completely bogus: to measure the charge, I placed the oscilloscope probe over the cap, and it happens to have 10 MΩ internal resistance itself. So basically the entire discharge behavior shown above was caused by the probe i.s.o. the capacitor&#8217;s own leakage!</p>

<p><em>So it looks like I&#8217;ll need a different setup to measure real leakage, which is probably in the nanoamp range&#8230;</em></p>
]]></content:encoded>
			<wfw:commentRss>http://jeelabs.org/2012/04/07/trying-to-measure-capacitor-leakage/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>75 days and counting</title>
		<link>http://jeelabs.org/2012/03/30/75-days-and-counting/</link>
		<comments>http://jeelabs.org/2012/03/30/75-days-and-counting/#comments</comments>
		<pubDate>Thu, 29 Mar 2012 22:01:57 +0000</pubDate>
		<dc:creator>jcw</dc:creator>
				<category><![CDATA[AVR]]></category>
		<category><![CDATA[Hardware]]></category>
		<category><![CDATA[LowPower]]></category>

		<guid isPermaLink="false">http://jeelabs.org/?p=18649</guid>
		<description><![CDATA[The JeeNode Micro based on the ATtiny84 is getting more and more use around here. One of the ways it can be powered is via a CR2032 coin cell on its back: I&#8217;ve got one with the radioBlip sketch running here, to see how long it will last on a single coin cell. Well&#8230; today [...]]]></description>
			<content:encoded><![CDATA[<p>The JeeNode Micro based on the ATtiny84 is getting more and more use around here. One of the ways it can be powered is via a CR2032 coin cell on its back:</p>

<p><img src="http://jeelabs.org/wp-content/uploads/2012/01/DSC_2858.jpg" alt="" /></p>

<p>I&#8217;ve got one with the <a href="https://github.com/jcw/jeelib/blob/master/examples/RF12/radioBlip/radioBlip.ino">radioBlip</a> sketch running here, to see how long it will last on a single coin cell.</p>

<p>Well&#8230; today it passed the 75-day mark &#8211; celebration time!</p>

<p><em>Onwards!</em></p>
]]></content:encoded>
			<wfw:commentRss>http://jeelabs.org/2012/03/30/75-days-and-counting/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<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>
	</channel>
</rss>

<!-- Dynamic page generated in 0.507 seconds. -->
<!-- Cached page generated by WP-Super-Cache on 2012-05-23 10:41:04 -->

