<?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</title>
	<atom:link href="http://jeelabs.org/feed/" rel="self" type="application/rss+xml" />
	<link>http://jeelabs.org</link>
	<description>Computing stuff tied to the physical world</description>
	<lastBuildDate>Mon, 13 Feb 2012 09:34:47 +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>Watchdog kicking in &#8230;</title>
		<link>http://jeelabs.org/2012/02/02/watchdog-kicking-in/</link>
		<comments>http://jeelabs.org/2012/02/02/watchdog-kicking-in/#comments</comments>
		<pubDate>Wed, 01 Feb 2012 23:01:18 +0000</pubDate>
		<dc:creator>jcw</dc:creator>
				<category><![CDATA[Musings]]></category>
		<category><![CDATA[News]]></category>

		<guid isPermaLink="false">http://jeelabs.org/?p=17868</guid>
		<description><![CDATA[History is about to repeat itself&#8230; With this 954&#8242;th post, I have an important announcement to make: I&#8217;m slamming on the brakes and taking a one month break away from this weblog. It&#8217;s a bit radical and unexpected, but there is no way around it. This weblog is &#8220;driven by passion&#8221;, as you will probably [...]]]></description>
			<content:encoded><![CDATA[<p><em>History is about to <a href="http://jeelabs.org/2011/02/27/something-needs-to-change/">repeat</a> itself&#8230;</em>
With this 954&#8242;th post, I have an important announcement to make: I&#8217;m slamming on the brakes and taking a <em>one month break</em> away from this weblog.</p>

<p>It&#8217;s a bit radical and unexpected, but there is no way around it. This weblog is &#8220;driven by passion&#8221;, as you will probably know, and the crazy bit is that there&#8217;s just too much going on here to keep things going smoothly. I&#8217;ve been running behind on shop fulfillment again, and I&#8217;ve been running behind even more on answering emails and with helping out on the forum. First thing I hope this will do, is to let me catch up and regain my footing.</p>

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

<p>In sharp contrast to last year&#8217;s emergency stop, this time it&#8217;s not so much lack of ideas or lack of energy, but lack of clear focus and direction. The stories I would love to tell need more time &#8211; diving into various aspects of physical computing in considerably more depth and detail than what&#8217;s been happening on the weblog lately. And it&#8217;s not happening because the daily bite-sized cycle is chopping up my attention (even at times when I have enough weblog posts queued up for many days on end &#8211; go figure!).
And <em>maybe</em> it&#8217;s also a <a href="http://sethgodin.typepad.com/seths_blog/2012/02/hills.html">hill climbing</a> issue.</p>

<p>For an interesting insight about attention, see Paul Graham&#8217;s essay titled <a href="http://www.paulgraham.com/makersschedule.html">Maker&#8217;s Schedule, Manager&#8217;s Schedule</a>.</p>

<p>I&#8217;ve updated the <a href="http://jeelabs.org/pub/index-a.html">alphabetical</a> and <a href="http://jeelabs.org/pub/index-c.html">chronological</a> indexes to all the posts on this weblog, to give you something to go through for the coming weeks. It&#8217;s a stopgap measure, but it&#8217;ll just have to do &#8211; and there should be enough to keep you interested and hopefully also pique your interest and keep you excited in the month ahead.</p>

<p>The difference with last year, is that I&#8217;m putting a precise cap on the duration of this &#8220;outage&#8221;: 30 days from now. That&#8217;s when this weblog will resume, probably with some announcements and adjustments to its style and format.</p>

<p><em>Talk to you one month from now!</em></p>

<p>PS. If you want to learn about electricity, then there are numerous resources on the web. Let me single out one: a 50-minute video by Walter Lewin at MIT about batteries and power (lecture 10 on <a href="http://www.archive.org/details/MIT8.02S02">this page</a>). You can get a deep understanding of what a battery is, why its internal resistance matters, what power is, how heat comes out, what shorting a battery does, and even sparks. It&#8217;s a <strong>fantastic</strong> presentation, <em>and the video was just picked at random!</em></p>
]]></content:encoded>
			<wfw:commentRss>http://jeelabs.org/2012/02/02/watchdog-kicking-in/feed/</wfw:commentRss>
		<slash:comments>21</slash:comments>
		</item>
		<item>
		<title>Component Tester &#8211; part 2</title>
		<link>http://jeelabs.org/2012/02/01/component-tester-part-2/</link>
		<comments>http://jeelabs.org/2012/02/01/component-tester-part-2/#comments</comments>
		<pubDate>Tue, 31 Jan 2012 23:01:24 +0000</pubDate>
		<dc:creator>jcw</dc:creator>
				<category><![CDATA[Hardware]]></category>

		<guid isPermaLink="false">http://jeelabs.org/?p=17792</guid>
		<description><![CDATA[After yesterday&#8217;s introduction, we&#8217;re ready for some more insight&#8230; To summarize: a straight line going through (0,0) represents a purely resistive effect. The slope of the line is related to actual resistance. With resistors, once you know the voltage, you know the current (and vice versa). Here&#8217;s a diode, i.e. a component with very specific [...]]]></description>
			<content:encoded><![CDATA[<p>After <a href="http://jeelabs.org/2012/01/31/component-tester/">yesterday&#8217;s</a> introduction, we&#8217;re ready for some more insight&#8230;</p>

<p>To summarize: a straight line going through (0,0) represents a purely resistive effect. The slope of the line is related to actual resistance. With resistors, once you know the voltage, you know the current (and vice versa).</p>

<p>Here&#8217;s a diode, i.e. a component with very specific properties (this shows why it&#8217;s called a semiconductor!):</p>

<p><img src="http://jeelabs.org/wp-content/uploads/2012/01/DSC_2904.jpg" alt="DSC 2904" border="0" width="160" height="158" /></p>

<p>With negative voltages, it just blocks (horizontal line, infinite resistance). With positive voltages it&#8217;s essentially a short circuit (vertical line, almost zero resistance). Note the &#8220;knee&#8221;: a diode starts conductiong at about 0.7V.</p>

<p>Here&#8217;s a blue LED:</p>

<p><img src="http://jeelabs.org/wp-content/uploads/2012/01/DSC_2905.jpg" alt="DSC 2905" border="0" width="160" height="157" /></p>

<p>Very much like a diode (the &#8220;D&#8221; in LED stands for <em>diode</em>, after all). Except that the knee is higher, at around 3V.</p>

<p>Here are three <a href="http://en.wikipedia.org/wiki/Zener_diode">zener diodes</a> of 3.3V, 5.1V, and 9.1V, respectively:</p>

<p><img src="http://jeelabs.org/wp-content/uploads/2012/01/DSC_2913.jpg" alt="DSC 2913" border="0" width="160" height="160" /> <img src="http://jeelabs.org/wp-content/uploads/2012/01/DSC_2914.jpg" alt="DSC 2914" border="0" width="160" height="158" /> <img src="http://jeelabs.org/wp-content/uploads/2012/01/DSC_2912.jpg" alt="DSC 2912" border="0" width="160" height="160" /></p>

<p>Note first of all that these diodes were connected in reverse compared to the diode and LED shown earlier, so the graphs are rotated by 180° compared to those. A zener is a regular diode, in that it conducts normally at around 0.7V. The difference is that when it&#8217;s blocking, it will at some point &#8220;avalanche&#8221; and start conducting anyway. This very specific voltage is what makes zeners special. But note how that avalanche knee is round and inaccurate for low voltage types. Zeners for less than 6V or so are not very precise for regulating the voltage &#8211; but 9.1V is fine.</p>

<p><em>Neat, huh? Each type of component has its distinctive <a href="http://en.wikipedia.org/wiki/Analog_signature_analysis">analog signature</a> when viewed on a CT!</em></p>

<p>So far, you&#8217;d be forgiven to conclude that a Component Tester is simply a hardware function plotter. With the horizontal axis being the voltage applied, and the vertical axis being the current flowing through the component.</p>

<p>Ah, but wait&#8230; here&#8217;s a 1 µF capacitor, showing that capacitors are fundamentally different beasts:</p>

<p><img src="http://jeelabs.org/wp-content/uploads/2012/01/DSC_2906.jpg" alt="DSC 2906" border="0" width="160" height="159" /></p>

<p>This is where things start to go crazy. No current at maximum and minimum voltage? Lots of current at zero volts? Positive <strong>and</strong> negative current at that zero-volt position? <em>What&#8217;s going on here?</em></p>

<p>The thing to keep in mind is that this is <em>not</em> simply a function of voltage vs current. We&#8217;re applying a sine wave &#8211; a voltage which very uniformly and smoothly varies between -10V and +10V. Think of a swinging pendulum, oscillating over and over again in a constant pattern.</p>

<p>Note also that the component is being driven through a 1 kΩ resistor, limiting the maximum current through it. So we&#8217;re looking at the capacitor while it&#8217;s in fact part of a circuit &#8211; i.e. a 1 kΩ resistor in series with our 1 µF cap.</p>

<p>Let&#8217;s start at the right. The capacitor is fully charged to +10V, and our voltage is starting to decrease. When the voltage is +9V, the cap is still +10V, so it starts sending out charge in the form of current to try and regain the balance. So a <em>positive</em> current flows out when the voltage is at +9V. If that voltage stayed at +9V, it would soon stop, since the charge drops, and the capacitor reaches +9V equilibrium again. But as this happens, the voltage <em>keeps</em> on dropping. In fact, it drops faster and faster, so more and more current leaks out while catching up.</p>

<p>At 0V, the rate of descent (dare I say slope or <em>derivative</em>?) is maximal, as you can see when you look at a sine wave. So at that point, the capacitor is leaking charge as fast as it can &#8211; at the rate of 4 mA in this case.</p>

<p>The voltage doesn&#8217;t stop dropping, though. I keeps on dropping to -10V, although it&#8217;s slowing down again. So the current still flows out of the cap, but slower and slower. At -10V, the voltage is no longer dropping at all, and the charge will have caught up &#8211; no more current, i.e. 0 mA.</p>

<p>Now the roller coaster ride repeats the other way around. The capacitor has -10V charge (lack of charge, if you wish to look at it that way), and voltage is about to start rising again. This time, charge has to be fed into the cap to try and equalize voltages, and so the current is now negative.</p>

<p>And sure enough, the lower negative side of the circle goes through the same changes. Until we reach +10V again.</p>

<p>So what you&#8217;re looking at is not a function, but the path of a point in space, racing around a circular path (ok&#8230; oval, since you insist). That point in space leaves a trail on the screen, and that&#8217;s the resulting image.</p>

<p><em>Phew! Still there?</em></p>

<p>The reason this happens, is due to the fact that a capacitor has <em>state</em> (or memory, if you like). It will respond to an external voltage differently, <em>depending</em> on the amount of charge it currently holds. Applying +5V to an <em>empty</em> cap will generate a different current than applying +5V to a capacitor which is currently charged up to +10V, or whatever. Current will start to flow to balance things out, but this requires <em>time</em>.</p>

<p>Very loosely speaking, you could say that capacitors &#8220;live in the time domain&#8221;. Unlike resistors &#8211; which just resist the same way under any circumstance.</p>

<p>Here&#8217;s the trace of an inductor (the secondary coil of a small transformer in this case):</p>

<p><img src="http://jeelabs.org/wp-content/uploads/2012/01/DSC_2907.jpg" alt="DSC 2907" border="0" width="160" height="158" /></p>

<p>Hey, it looks like inductors also have state! And yes indeed, they do. Capacitors and inductors are very similar, electrically. They both &#8220;live in the time domain&#8221;, although through very different mechanisms.</p>

<p>The state of a <em>capacitor</em> is its current charge level, i.e. the &#8220;amount of electricity&#8221; inside it at any particular time.</p>

<p>The state of an <em>inductor</em> is the magnetic field level it has created. When you send an electric current through a coil, that coil becomes an electro-magnet, and starts generating a magnetic field around it. When the current stops, the magnetic field wants to keep going. But it can&#8217;t and it starts fading &#8211; while it does, an electric current is <em>generated</em> in the <del>opposite</del> same direction. This effect (plus a little resistance) is what causes the tilted shape shown above.</p>

<p>As you can see, it has the same weird effect: no current at maximum or minimum voltage, and either positive or negative current at zero volts.</p>

<p>The point of these little demos was to show how current and voltage stop being linearly inter-related with caps and inductors. Because they mess with time. The charge which came in today could come out tomorrow, for example.</p>

<p>With constant voltages, capacitors and inductors are boring. But when their time effects are pitted against voltages which <em>change</em> over time, then nifty things can happen. It&#8217;s probably fair to say that the discovery of DC (direct current) brought <em>electricity</em> to the world, whereas AC (alternating current) brought <em>electronics</em> to the world.</p>

<p>For measuring DC, you can get by with a voltmeter. For AC, you need a voltmeter-over-time, a.k.a. an oscilloscope.</p>

<p>I hope this gives you a feel for what&#8217;s going on in electronic circuits. The behaviors shown here are universal, i.e. caps will behave like this every time, no matter what else sits around them, and getting an intuition about how these components react to voltages is a fantastic way to figure out all sorts of more complex circuits.</p>

<p>There&#8217;s tons more to explore about signals and circuits: filters, phase effects, crazy stuff called &#8220;complex numbers&#8221; (values with a &#8220;real&#8221; and an &#8220;imaginary&#8221; part, go figure!), switching perspectives from the &#8220;time domain&#8221; to the &#8220;frequency domain&#8221;, and Fourier transforms. None of this matters, if all you want is to turn on a lamp or work with digital signals. But if you&#8217;ve ever wondered how electronic stuff <em>really</em> works: trust me&#8230; it&#8217;s <em>fascinating.</em></p>

<p>Is anyone interested in any of this? I&#8217;d love to write a series about it one day, where intuition comes first, insight a close second, and where all the mathematics involved will become totally obvious (seriously!).</p>

<p>PS. Here&#8217;s my <em>intuitive</em> summary of what R&#8217;s, C&#8217;s, and L&#8217;s <em>do</em> (and what makes each of them unique):</p>

<ul>
<li><strong>Resistors</strong> turn electrical energy into heat (no way back with a resistor)</li>
<li><strong>Capacitors</strong> turn voltage differences into electric charge (and back)</li>
<li><strong>Inductors</strong> turn electrical current flow into magnetism (and back)</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://jeelabs.org/2012/02/01/component-tester-part-2/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
		<item>
		<title>Component Tester</title>
		<link>http://jeelabs.org/2012/01/31/component-tester/</link>
		<comments>http://jeelabs.org/2012/01/31/component-tester/#comments</comments>
		<pubDate>Mon, 30 Jan 2012 23:01:58 +0000</pubDate>
		<dc:creator>jcw</dc:creator>
				<category><![CDATA[Hardware]]></category>

		<guid isPermaLink="false">http://jeelabs.org/?p=17776</guid>
		<description><![CDATA[Hameg scopes have often included a &#8220;Component Tester&#8221; (CT) and mine&#8217;s no exception. It&#8217;s a really nifty way to identify a component and understand its basic characteristics. It requires a sine wave signal and an oscilloscope: Don&#8217;t fret too long about the above circuit (copied from this PDF, which I found via Google). It&#8217;s just [...]]]></description>
			<content:encoded><![CDATA[<p>Hameg scopes have often included a &#8220;Component Tester&#8221; (CT) and mine&#8217;s no exception. It&#8217;s a really nifty way to identify a component and <em>understand</em> its basic characteristics. It requires a sine wave signal and an oscilloscope:</p>

<p><img src="http://jeelabs.org/wp-content/uploads/2012/01/Screen-Shot-2012-01-27-at-19.32.29.png" alt="Screen Shot 2012 01 27 at 19 32 29" border="0" width="455" height="210" /></p>

<p>Don&#8217;t fret too long about the above circuit (copied from <a href="http://barrydegraaff.tk/files/Archive/electronics//Component%20Tester.pdf">this PDF</a>, which I found via Google). It&#8217;s just to show that setting up something like this is very easy &#8211; but you do need an oscilloscope with X-Y capability.</p>

<p>The basic idea is to apply a sine wave of say 10 VAC @ 50 Hz to the part you want to identify, and to then display voltage <em>over</em> versus current <em>through</em> that component.</p>

<p>My scope has the equivalent of the above simple CT circuit built in:</p>

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

<p>Two pins, on which a 50 Hz voltage is applied which varies between +10V and -10V in the form of a pure sine wave. For some reason, the scope won&#8217;t let me take screen dumps to USB in this mode, so I&#8217;ll use camera shots.</p>

<p>Here&#8217;s what you see with nothing connected (note the full scale: ±10 V on X and ±10 mA on Y):</p>

<p><img src="http://jeelabs.org/wp-content/uploads/2012/01/DSC_2900.jpg" alt="DSC 2900" border="0" width="320" height="317" /></p>

<p>The horizontal axis shows the applied voltage, and as you can see, no current is flowing. Because air insulates!</p>

<p>Let&#8217;s short the two pins with a copper wire (I&#8217;ve reduced the image scale to reduce this weblog post&#8217;s length):</p>

<p><img src="http://jeelabs.org/wp-content/uploads/2012/01/DSC_2901.jpg" alt="DSC 2901" border="0" width="160" height="159" /></p>

<p>Of course: no matter what voltage we try to put between the pins, the wire will force it to 0V, and will simply pass -10 .. +10 mA of current. As you can see in the schematic, there&#8217;s a 1 kΩ resistor in series to limit the current.</p>

<p>These two images of open vs shorted set the stage. Now let me insert a couple of different components, so you can see how they behave when subjected to this 10 Vpp sine wave. First, let&#8217;s insert a 1 kΩ resistor:</p>

<p><img src="http://jeelabs.org/wp-content/uploads/2012/01/DSC_2902.jpg" alt="DSC 2902" border="0" width="160" height="157" /></p>

<p>Make sense? Now have a look at a 10 kΩ resistor:</p>

<p><img src="http://jeelabs.org/wp-content/uploads/2012/01/DSC_2903.jpg" alt="DSC 2903" border="0" width="160" height="157" /></p>

<p>So what we have so far, is resistance varying from zero ohm (shorted) to infinite ohm (open), with two values in between. It all ends up as a straight line, with the slope varying from horizontal to vertical. <em>That&#8217;s it: resistance!</em></p>

<p>If you want an explanation: this is Ohm&#8217;s law, visualized. Voltage and current are proportional, i.e. V = I x R.</p>

<p><em>So much for the basic stuff. Tomorrow, I&#8217;ll show you a couple of considerably more interesting components.</em></p>
]]></content:encoded>
			<wfw:commentRss>http://jeelabs.org/2012/01/31/component-tester/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Capacitive power supply &#8211; part 2</title>
		<link>http://jeelabs.org/2012/01/30/capacitive-power-supply-part-2/</link>
		<comments>http://jeelabs.org/2012/01/30/capacitive-power-supply-part-2/#comments</comments>
		<pubDate>Sun, 29 Jan 2012 23:01:20 +0000</pubDate>
		<dc:creator>jcw</dc:creator>
				<category><![CDATA[Hardware]]></category>

		<guid isPermaLink="false">http://jeelabs.org/?p=17830</guid>
		<description><![CDATA[Yesterday, I tried to get to grips with how a capacitive power supply works. Real samples are a bit messy, though. So let me try something else this time, and simplify a bit: The setup is very similar, but I&#8217;m leaving out the zener diode and the rest, and more importantly, I&#8217;m going to feed [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://jeelabs.org/2012/01/29/capacitive-power-supply/">Yesterday</a>, I tried to get to grips with how a capacitive power supply works. Real samples are a bit messy, though.</p>

<p>So let me try something else this time, and <em>simplify</em> a bit:</p>

<p><img src="http://jeelabs.org/wp-content/uploads/2012/01/JCs-Doodles-page-32.png" alt="JC s Doodles page 32" border="0" width="600" height="302" /></p>

<p>The setup is very similar, but I&#8217;m leaving out the zener diode and the rest, and more importantly, I&#8217;m going to feed a real 50 Hz sine wave signal into this circuit, using my little <a href="http://jeelabs.org/2011/11/28/sine-wave-generator/">sine wave generator</a>.</p>

<p>Here again, because scopes need to measure with a common ground, I&#8217;m placing that common ground in between the resistor and the cap, and I&#8217;m using the scope&#8217;s internal &#8220;invert&#8221; feature to treat this as if the channel 1 probe were connected the other way around. Here&#8217;s what we get with this new setup:</p>

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

<p>The vertical scale of the resistor was adjusted to display the same amplitude for the resistor as for the capacitor.</p>

<ul>
<li>the <em>yellow</em> line is the voltage over the capacitor</li>
<li>the <em>blue</em> line is the voltage over the resistor</li>
<li>the <em>red</em> line is the sum of the yellow and blue lines</li>
</ul>

<p>The <em>scale</em> of the red line is not quite accurate, but its <em>shape</em> is. So the red line is in essence the <em>input</em> signal.</p>

<p><em>So what&#8217;s going on here?</em></p>

<p>As you can see, all these signals are 50 Hz sine waves. That&#8217;s quite remarkable already. Obviously the red line is a 50 Hz sine wave, since that&#8217;s what we&#8217;ve been feeding in. But so is the voltage over the capacitor, the voltage over the resistor, and hence also the <em>current</em> through this circuit!</p>

<p>What you see, is a set of sine waves which differ only in <em>phase</em> and in <em>amplitude</em>:</p>

<ul>
<li>the voltage over the capacitor (yellow) <em>lags</em> the input signal (red): it&#8217;s <em>forever</em> trying to catch up</li>
<li>the current through the capacitor, i.e. the voltage over the resistor (blue), is <em>leading</em> in phase</li>
</ul>

<p>And something else, as we saw yesterday: the current through the capacitor is related directly to the <em>slope</em> of the capacitor&#8217;s voltage change (i.e. its derivative). When the yellow line is steepest, the blue line is at its highest.</p>

<p>Let&#8217;s throw one more calculation into the mix: power. Power is input voltage (red) times input current (blue):</p>

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

<p>Looks very sine wave&#8217;ish again! There is some amplitude variation, which can probably be attributed to signal asymmetry or amplitude differences between the different sine waves. The phase of this wave is different from the ones already shown, but note that it&#8217;s also twice the frequency, i.e. 100 Hz.</p>

<p>Let&#8217;s step back for a moment. With a purely resistive circuit (as used in a resistive transformer-less supply), the current and voltage would be in lock step, i.e. sine waves with exactly the same phase, and the power consumption would be maximal (high current at times of high voltage).</p>

<p>With this capacitive setup, currents get &#8220;moved around&#8221;. That means power consumption will be less than when voltage and current match up (since this gives the largest possible results).</p>

<p>I&#8217;ll include one more screenshot, this time using the same vertical scale for all signals (except power):</p>

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

<p>This puts things more in perspective: the voltage over the capacitor (yellow) is <em>slightly</em> lagging the input signal (red) now. And the input current (blue) is out of phase w.r.t. the input signal (red). So the power consumption (red x blue) is <em>substantially</em> lower than with a resistive circuit: when the current is maximal, the input voltage is only a fraction of its maximum range. IOW, we&#8217;re drawing current when it &#8220;costs&#8221; little.</p>

<p>This is why a capacitively coupled supply is cheaper: the electricity company charges us for <em>real</em> power (i.e. V x I). We&#8217;re being charged for what happens inside a pure resistor.</p>

<p>But we&#8217;re doing a lot more: we&#8217;re taking charge out of the AC mains line on one half of the cycle and pushing it back on the other half. It might seem as if that doesn&#8217;t use up energy, but it does: current through a wire causes resistive losses (in the form of heat), and &#8220;returning&#8221; that energy one half cycle later causes those losses <em>again!</em> So the electricity company sees its electricity turn into waste heat, and they can&#8217;t charge us for it.</p>

<p>Here&#8217;s a thought experiment: suppose you had a huge capacitor, and hooked it up directly to AC mains, next to the electricity meter. According to what we&#8217;ve seen, it&#8217;ll track the 230V cycles, with current exactly 90% out of phase with AC mains voltage. Huge currents would flow at the time of zero volts. You’d be charged relatively little for the large out of phase current that flows (not quite zero because a practical capacitor has some internal losses that look like a resistive component from the outside). But your garden would be nicely heated by that current in the resistance of wires between the electricity company and your meter&#8230;</p>

<p>You can read more about &#8220;real&#8221;, &#8220;reactive&#8221;, and &#8220;apparent&#8221; power on <a href="http://en.wikipedia.org/wiki/AC_power#Real.2C_reactive.2C_and_apparent_powers">Wikipedia</a>.</p>

<p>(with a <em>tip of the hat</em> to Martyn for helping me understand this stuff a little better)</p>
]]></content:encoded>
			<wfw:commentRss>http://jeelabs.org/2012/01/30/capacitive-power-supply-part-2/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Capacitive power supply</title>
		<link>http://jeelabs.org/2012/01/29/capacitive-power-supply/</link>
		<comments>http://jeelabs.org/2012/01/29/capacitive-power-supply/#comments</comments>
		<pubDate>Sat, 28 Jan 2012 23:01:40 +0000</pubDate>
		<dc:creator>jcw</dc:creator>
				<category><![CDATA[Hardware]]></category>

		<guid isPermaLink="false">http://jeelabs.org/?p=17711</guid>
		<description><![CDATA[(Thanks for your overwhelming understanding w.r.t. not making the Low-power supply available as kit!) The concept of the transformer-less capacitive power supply still puzzles me &#8211; intuitively I still don&#8217;t get it: (the above image was copied from this excellent site with a web-calculcator for it all) So what exactly is going on here? Tomorrow, [...]]]></description>
			<content:encoded><![CDATA[<p><em>(Thanks for your <a href="http://jeelabs.org/2012/01/27/cant-be-done/#comments">overwhelming</a> understanding w.r.t. not making the Low-power supply available as kit!)</em></p>

<p>The <em>concept</em> of the transformer-less capacitive power supply still puzzles me &#8211; <em>intuitively</em> I still don&#8217;t get it:</p>

<p><img src="http://jeelabs.org/wp-content/uploads/2012/01/Capacitive-AC-DC-2.gif" alt="Capacitive AC DC 2" border="0" width="370" height="171" /></p>

<p>(the above image was copied from <a href="http://www.daycounter.com/Circuits/Transformerless-Power-Supplies/Transformerless-Power-Supplies.phtml">this excellent site</a> with a web-calculcator for it all)</p>

<p>So what <em>exactly</em> is going on here? Tomorrow, I&#8217;ll simplify that circuit in an attempt to really get it, but for now let me show you what I see on the oscilloscope. What I did was feed a ≈ 100 Vpp signal into the above circuit, which is essentially the same as in the Low-power Supply.</p>

<p>To interpret the graph, you need some info:</p>

<ul>
<li>the scope <em>ground</em> was connected <em>between</em> the capacitor and the resistor</li>
<li>the <em>yellow</em> trace is the voltage over the resistor</li>
<li>the <em>blue</em> trace is the voltage over the capacitor</li>
<li>the yellow trace is inverted, i.e. negative voltages at the top, positive at the bottom</li>
<li>zero is the middle of the screen for both signals</li>
</ul>

<p>Here&#8217;s the scope capture:</p>

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

<p>Ignore the fact that these waves are hideously complex, ignore the red lines for now, and also note that watching voltage <em>over</em> a resistor is the same as watching current <em>through</em> that resistor. Voltage and current are <em>always</em> proportional in a resistor, that&#8217;s what defines a resistor (Ohm&#8217;s law: voltage = current x resistance).</p>

<p>So what are we seeing here?</p>

<p>Well&#8230; when the yellow line is high, the blue line rises sharply. When the yellow line is zero, the blue line is flat.</p>

<p>That makes a lot of sense: the resistor is charging the capacitor. And similarly for negative values, it&#8217;s discharging the cap (and then charging it negatively).</p>

<p>So ignoring the zener and the rest of the righthand side of the circuit, this is really all that&#8217;s going on: when the input voltage is highly positive, current flows in one direction, charging the cap and dropping to zero, and when the input voltage is highly negative, the whole process unfolds in the opposite direction.</p>

<p>One more piece of the puzzle: current is &#8220;charge per time unit&#8221; (in units: Amperes is Coulombs per second).</p>

<p>In other words, the capacitor <em>accumulates</em> the charge pushed into it, in either polarity. And while it does so, the resistor &#8220;takes the heat&#8221;, so to speak: it limits the current by creating a voltage drop over itself.</p>

<p>Please let this sink in, dear reader. It&#8217;s essential to get a solid intuitive grasp on what&#8217;s going on.</p>

<p>Note also that it really makes no difference at all how complex the input signal is. The resistor and capacitor work in tandem, sharing the task of dealing with that signal. In other words: <em>the capacitor is always trying to catch up!</em></p>

<p><em>This is where it gets interesting.</em></p>

<p>You may or may not have given up in high school when it came to advanced maths / calculus &#8211; <em>derivatives and integrals</em>, in particular. If so, then get ready to finally get to grips with these incredible concepts.</p>

<p>Let me explain the red lines in the above image &#8211; they are generated by the built-in math functions of this scope. One red line is the <em>integral</em> of the value measured across the resistor, and the other red line is the <em>derivative</em> of the voltage across the capacitor. But here&#8217;s the big surprise:</p>

<ul>
<li>the <em>integral</em> of the voltage over the resistor is the same as the voltage over the capacitor!</li>
<li>the <em>derivative</em> of the voltage over the capacitor is the same as the voltage over the resistor! </li>
</ul>

<p>What&#8217;s the point? Well, this means that I didn&#8217;t have to measure both signals to see what&#8217;s going on. I could have omitted the blue trace, because it can be calculated from the yellow trace (and vice versa). Even though these traces have completely different shapes, they are in fact totally inter-locked and inter-related.</p>

<p>As I said before, the voltage <em>over</em> a resistor is proportional to the current <em>through</em> it. So the derivative of the voltage over the cap is the same as the current <em>through</em> it (the current flowing through the resistor and the capacitor is always the same, since they are connected in series).</p>

<p>The derivative is the rate of change, i.e. the <em>slope</em> of the graph. Integrating the <em>current</em> (i.e. the derivative) is like adding &#8220;all the little currents together over time. A capacitor is no more and no less than a &#8220;current integrator&#8221;.</p>

<p>And that&#8217;s exactly the same as saying that a capacitor <em>accumulates</em> charge. It&#8217;s like a tiny rechargeable battery, it takes the current pushed through it and it stores that current (as charge). As the charge accumulates, the voltage rises. Loosely speaking, this is the same as saying that it pushes back harder and harder against the incoming current. At some point it pushes back so hard, that no more current comes in. At that same point, there will be zero volts over the resistor, and the voltage over the cap stays constant. Check the graph to see where that happens.</p>

<p>One last observation is that the blue line is a lot smoother than the yellow line. That&#8217;s not surprising: when you integrate (accumulate) a jittery signal, things tend to smooth out. That&#8217;s why capacitors are also a fundamental component in <em>filters</em>, i.e. circuits which let some frequencies through more and others less. That schematic we&#8217;ve been looking at here is also known as an <a href="http://en.wikipedia.org/wiki/RC_circuit">RC circuit</a> &#8211; if you ignore the zener and the rest. One way to look at an RC filter is to see the capacitor as the sluggish part, and the resistor as taking up the slack. So with any input signal, the voltage over the cap is related to the low frequencies, while the resistor follows more the high frequencies.</p>

<p>Did this explain how a capacitive power supply works? Probably not. But first we need to get to grips with what a capacitor does, and hopefully this little experiment helped you get some intuition for what&#8217;s going on.</p>

<p>I&#8217;ll try to take this further tomorrow, by simplifying things a bit. <em>Stay tuned!</em></p>
]]></content:encoded>
			<wfw:commentRss>http://jeelabs.org/2012/01/29/capacitive-power-supply/feed/</wfw:commentRss>
		<slash:comments>19</slash:comments>
		</item>
		<item>
		<title>DIY versus outsourcing</title>
		<link>http://jeelabs.org/2012/01/28/diy-versus-outsourcing/</link>
		<comments>http://jeelabs.org/2012/01/28/diy-versus-outsourcing/#comments</comments>
		<pubDate>Fri, 27 Jan 2012 23:01:08 +0000</pubDate>
		<dc:creator>jcw</dc:creator>
				<category><![CDATA[Musings]]></category>

		<guid isPermaLink="false">http://jeelabs.org/?p=17741</guid>
		<description><![CDATA[Currently on the front page of the JeeLabs shop: The benefit of doing everything yourself, is that you can make things work exactly as you want them. The drawback of doing everything yourself, is that you have to do everything yourself&#8230; Having become pretty independent in my work areas, my hobbies, and my income streams [...]]]></description>
			<content:encoded><![CDATA[<p>Currently on the front page of the JeeLabs <a href="http://jeelabs.com/">shop</a>:</p>

<p><img src="http://jeelabs.org/wp-content/uploads/2012/01/Screen-Shot-2012-01-27-at-16.15.38.png" alt="Screen Shot 2012 01 27 at 16 15 38" border="0" width="408" height="79" /></p>

<p>The <em>benefit</em> of doing everything yourself, is that you can make things work exactly as you want them.</p>

<p>The <em>drawback</em> of doing everything yourself, is that you have to do everything yourself&#8230;</p>

<p>Having become pretty independent in my work areas, my hobbies, and my income streams over the years, I know all about those trade-offs. Or at least I think I know about most aspects of this <em>DIY-vs-outsourcing</em> range.</p>

<p><em>It&#8217;s a bit like trying to stay on your feet with a floor covered with marbles&#8230;</em></p>

<p>Example: I used to rent a web server (a real physical one, with full root access and Linux on it). No worries about hardware outages or connectivity details. Being housed at an ISP with thousands of servers, means they&#8217;ll have round-the-clock watchdogs and support staff, and will jump into action the <em>minute</em> something is seriously wrong.</p>

<p>At the same time, I had total control over the web server software and operating system configuration. With a Linux distribution such as Debian, maintenance was delightfully simple (&#8220;apt-get update &amp;&amp; apt-get upgrade&#8221;).</p>

<p>The flip side is that I had to choose and configure a web server (&#8220;lighty&#8221; / lighttpd at the time), and technologies to create dynamic database-driven websites (I built my own back then, based on Metakit &#8211; my own database).</p>

<p>Did it work? Sure. Did it evolve? Nope. Too busy. Didn&#8217;t want to risk breaking anything.</p>

<p>Only thing that setup did was track security updates (automatically). I had two break-ins over the 10 years that this went on. Learned more about <a href="http://en.wikipedia.org/wiki/Rootkit">rootkits</a> than I care about (they&#8217;re evolving to amazingly sophisticated levels).</p>

<p>Did I learn a lot? You bet. And some of that knowledge is priceless and timeless. Big, big benefit.</p>

<p>But I also had to learn lots of stuff I really care very little about. For me, network routing, package installation dependencies, mail server configuration, and lighttpd configuration were a waste of time. The latter because lighttpd wasn&#8217;t really kept up to date very actively by its developer(s). Other options became more practical, meaning that all that lighttpd-specific knowledge is now useless to me.</p>

<p>The story is repeating itself right now. Redmine, which I use on <a href="http://jeelabs.net/">http://jeelabs.net/</a> is not up to date, because I haven&#8217;t found a simple upgrade path. The <em>difference</em> is that it&#8217;s not just me not updating <em>my</em> stuff, I now have the same stagnant state with stuff from <em>others</em>. So what&#8217;s the point of Redmine? As far as I&#8217;m concerned, it&#8217;s a dead end (luckily, everything in there is stored in <a href="http://daringfireball.net/projects/markdown/">Markdown</a> format &#8211; a solid long-term standard which I also use for the forum and the weblog).</p>

<p>With the forum, running on Drupal, it&#8217;s different again. Module updates are automated more or less, so I tend to track them from time to time. But Drupal itself is a little harder to update. And sure enough, it&#8217;s falling behind&#8230;
With Drupal, I&#8217;m also running into not being knowledgeable enough to put it to really good use.</p>

<p>But the reason for writing this post is a different one &#8211; see the message at the top.</p>

<p>For the web shop, I use the Shopify web store service. They have the servers (at Rackspace &#8211; very good ops, I&#8217;ve used them for a couple of years). And Shopify develop and run the web store software (using Ruby on Rails).</p>

<p>They take care of dealing with nasty things such as possible DoS attacks, heavy data security, financial gateway interfaces &#8211; lots of important issues I no longer need to worry about. <em>So far so good.</em></p>

<p>But they have their own agenda:</p>

<ul>
<li>some things don&#8217;t change, and that&#8217;s good: it works, the shop is operational</li>
<li>some things don&#8217;t change, but that&#8217;s bad: years have gone by, and they still haven&#8217;t got a clue about VAT</li>
<li>some things change, and that&#8217;s good: improvements to the service, new features for customers</li>
<li>some things change, but that&#8217;s bad: they change their API and their XML data structures</li>
</ul>

<p>That last one is what bites me now. I created a little scripted setup whereby I always pull information about orders from their shop database, to fill <em>my</em> database here with all the details, so I can generate paper invoices, and do the fulfillment of orders here. Doing this here was necessary to be able to do the Value Added Tax thing properly, as required by law and as my accountant wants it, of course.</p>

<p>So to summarize, the choices are:</p>

<ol>
<li>do everything yourself (and pay in time)</li>
<li>outsource everything (and pay in money)</li>
<li>choose a mix (and deal with the interface changes)</li>
</ol>

<p>Everything is a trade-off, of course.
In my case, I&#8217;m moving more and more to #1 as far as operational choices are concerned (own server, own fiber connection), and #2 as far as day-to-day software use is concerned (solid, but actively developed open source software, and Apple hardware + Mac OSX for my main workplaces). These choices are optimal for me, in terms of cost and stability.</p>

<p>The choice to host my own servers was made a lot simpler because I&#8217;m running VM&#8217;s for the different sites, built from ready-to-run images from <a href="http://www.turnkeylinux.org/">TurnKey Linux</a>. What makes them (and others, like <a href="http://bitnami.org/">Bitnami</a>) different, is that all VMs are automatically backed up to the cloud (Amazon S3 in my case). The way TKL does this is really clever, reducing the amount of data in incremental backups, even for all the records stored in MySQL. So not only are my VM&#8217;s pre-configured and run out of the box, they automatically self-update and they automatically self-backup &#8211; if anything goes completely wrong, I can switch to cloud-based <em>instances</em> and be up and running again in no time.</p>

<p>TurnKey Linux is an example of using third-party stuff to side-step (and in fact avoid) a massive amount of effort, while retaining maximum operational flexibiity. My Amazon S3 bill is a whopping $1.01 per month&#8230;</p>

<p>But the web shop setup at Shopify is <em>far</em> from optimal. It was supposed to be choice #2, but ended up being #3 due to the mismatch between what I need (a European shop with <em>correct</em> VAT handling) and what they offer (flashy stuff, aimed at the masses). In hindsight, it was a bad choice, but I really don&#8217;t want to do this myself.</p>

<p><em>Oh well, I&#8217;ll suffer the consequences &#8211; will fix my scripts and get everything going again by next Monday!</em></p>

<p>PS. My little presentation yesterday at <a href="http://hackersnl.nl/2012/2012-01-26-hackersnl-5/">HackersNL #5</a> can be found <a href="http://jeelabs.org/pub/hackersnl5.pdf">here</a> (PDF) &#8211; for those who read Dutch.</p>
]]></content:encoded>
			<wfw:commentRss>http://jeelabs.org/2012/01/28/diy-versus-outsourcing/feed/</wfw:commentRss>
		<slash:comments>5</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>Tektronix 475</title>
		<link>http://jeelabs.org/2012/01/26/tektronix-475/</link>
		<comments>http://jeelabs.org/2012/01/26/tektronix-475/#comments</comments>
		<pubDate>Wed, 25 Jan 2012 23:01:44 +0000</pubDate>
		<dc:creator>jcw</dc:creator>
				<category><![CDATA[Hardware]]></category>

		<guid isPermaLink="false">http://jeelabs.org/?p=17669</guid>
		<description><![CDATA[Oh boy, I&#8217;ve been bitten by the collector&#8217;s bug&#8230; Couldn&#8217;t resist an excellent offer on Marktplaats (the Dutch equivalent of eBay) for a fully operational analog scope built in the late 70&#8242;s. The Tektronix 475 is, ehm&#8230; slightly larger than the Hameg HMO2024: Then again, they are quite comparable &#8211; both are specified as 200 [...]]]></description>
			<content:encoded><![CDATA[<p><em>Oh boy, I&#8217;ve been bitten by the collector&#8217;s bug&#8230;</em></p>

<p>Couldn&#8217;t resist an excellent offer on Marktplaats (the Dutch equivalent of eBay) for a fully operational analog scope built in the late 70&#8242;s. The <a href="http://en.wikipedia.org/wiki/Tektronix">Tektronix</a> 475 is, ehm&#8230; <em>slightly</em> larger than the Hameg HMO2024:</p>

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

<p>Then again, they are quite comparable &#8211; both are specified as 200 MHz bandwidth. Check &#8216;em out:</p>

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

<p>The Tek will need to be re-calibrated, but as far as I can tell all the functions work and all the switches, knobs, and indicators are in good order. The previous owner said he had used it for a long time, but not intensively.</p>

<p>First thing I <em>had</em> to try was the <a href="http://jeelabs.org/2011/12/31/tempus-fugit/">analog clock</a>, of course:</p>

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

<p>Apart from that? Oh, I don&#8217;t know. I&#8217;ll refurbish and re-calibrate it one day, there&#8217;s <a href="http://www.amplifier.cd/Test_Equipment/Tektronix/Tektronix_other/475.htm">lots of info</a> about this classic workhorse out on the web, and I really would like to learn how to diagnose and repair stuff. Even <em>old</em> stuff.</p>

<p>This is a <em>single-beam</em> unit, meaning it can&#8217;t show two signals at the same time. Newer and more advanced models are dual-beam, but this one has to either &#8220;alternate&#8221; between the two beam displays, or &#8220;chop&#8221; them up and draw bits of one and the other in an interleaved fashion. It&#8217;s also not a storage scope, so you&#8217;ve got to look <em>very</em> carefully if you want to see one-shot events &#8211; the display on the screen shows only as long as the phosphor glow lasts!</p>

<p>Fantastic engineering. Electronics, mechanical, operation, documentation, service &#8211; everything!</p>

<p>Would I have bought the Hameg if I&#8217;d had this one at the time? You bet &#8211; the &#8220;S&#8221; in <a href="http://en.wikipedia.org/wiki/Digital_storage_oscilloscope">DSO</a> is a game changer, especially with microcontrollers and physical computing. But that huge Tek brick is more endearing :)</p>

<p><em>Heh, I&#8217;ve never before collected anything in my life &#8211; this is fun!</em></p>
]]></content:encoded>
			<wfw:commentRss>http://jeelabs.org/2012/01/26/tektronix-475/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>The PWR vs the +3V pin</title>
		<link>http://jeelabs.org/2012/01/25/the-pwr-vs-the-3v-pin/</link>
		<comments>http://jeelabs.org/2012/01/25/the-pwr-vs-the-3v-pin/#comments</comments>
		<pubDate>Tue, 24 Jan 2012 23:01:03 +0000</pubDate>
		<dc:creator>jcw</dc:creator>
				<category><![CDATA[AVR]]></category>
		<category><![CDATA[Hardware]]></category>

		<guid isPermaLink="false">http://jeelabs.org/?p=17658</guid>
		<description><![CDATA[JeeNodes and plugs use 6-pin headers with the following pin assignment: (there&#8217;s usually a big printed dot near the PWR pin for orientation) There has been some confusion about what PWR is w.r.t. +3V and how to use it, so let me elaborate a bit. First: &#8220;+3V&#8221; is the main regulated power reference for most [...]]]></description>
			<content:encoded><![CDATA[<p>JeeNodes and plugs use 6-pin headers with the following pin assignment:</p>

<p><img src="http://jeelabs.org/wp-content/uploads/2012/01/port.png" alt="Port" border="0" width="350" height="44" /></p>

<p>(there&#8217;s usually a big printed dot near the PWR pin for orientation)</p>

<p>There has been some confusion about what PWR is w.r.t. +3V and how to use it, so let me elaborate a bit.</p>

<p>First: <strong>&#8220;+3V&#8221; is the main regulated power reference for most chips and circuits.</strong> And to make it more complicated: it&#8217;s actually 3.3V, not 3.0V. The &#8220;+3V&#8221; label merely identifies the pin (VCC would be too confusing).</p>

<p>The ATmega on the JeeNode, as well as most (but not all) chips on attached plugs run on this 3.3V voltage level. It is also the reference level for all digital I/O (0 = 0V, 1 = 3.3V), as well as for the ADC when used for analog inputs (1023 steps of 3.22580645161 millivolt each).</p>

<p>As for the other supply pin: <strong>&#8220;PWR&#8221; is usually a higher voltage from which +3V is derived</strong>.</p>

<p>There&#8217;s a voltage regulator on the JeeNode which can take any input voltage on &#8220;PWR&#8221; up to about 13V as input and which produces the 3.3V regulated voltage on the &#8220;+3V&#8221; pin.</p>

<p>The JeeNode regulator has some limits: it&#8217;s can&#8217;t supply more than 250 mA <em>and</em> it can&#8217;t dissipate more than about 600 mW. It&#8217;ll shutdown if either of these are exceeded (and it&#8217;ll get damaged if you feed it more than 13V). These figures are fairly limiting: if you run a JeeNode off 12V on the PWR pin, then it actually won&#8217;t be able to supply more than 70 mA. With 5V on the PWR pin, the limit will be current, not power dissipation, i.e. 250 mA max.</p>

<p>That&#8217;s for a JeeNode with through-hole components, i.e. an MCP1702 regulator in a TO-92 package. With the JeeNode SMD and JeeNode USB, you get even less power from the regulator: at most about 250 mW of heat dissipation. That&#8217;s 150 mA @ 5V, and only 28 mA @ 12V. In short: the JN SMD and JN USB are not really meant to be powered from more than 5V &#8211; or at least not without an extra external regulator (on the plus side: the MCP1703 supports up to 16V on the PWR pin). Note also that the JeeNode USB doesn&#8217;t support more than 7V on the PWR pin, due to limitations of the on-board LiPo charger &#8211; but that should not be an issue since it&#8217;s really only meant to be powered from 5V via USB.</p>

<p>As you can see, there are several limiting factors as to what voltage is supported on the PWR pin. Keep in mind that JeeNodes were designed for ultra-low power consumption, and the regulator was selected for its extremely low idle current draw, not its &#8220;high-end&#8221; characteristics.</p>

<p><em>But that&#8217;s not all&#8230;</em></p>

<p>One trap for the unwary is with the <a href="/ju3">JeeNode USB</a>: it doesn&#8217;t actually feed 5V to the PWR pin when connected to USB but only 4.2V. This is due to the LiPo charger circuit, which allows a LiPo battery to be connected between PWR and GND. With a LiPo battery, the JeeNode USB becomes a very convenient stand-alone unit: low-power <em>untethered</em> operation while not connected to USB, and automatic LiPo charging while connected to USB. It even has a voltage divider on board to monitor the LiPo battery voltage (tied to PC6, i.e. analog 6 in Arduino-speak).</p>

<p>The trouble here is that when you connect plugs to the JeeNode USB, you won&#8217;t get the full 5V you might expect. This affects all those plugs which don&#8217;t run entirely off +3V but expect some higher voltage on PWR.</p>

<p><em>And here&#8217;s another tricky situation&#8230;</em></p>

<p>With the <a href="/aa2">AA Power Board</a>, you can run JeeNodes off a single AA cell. In this case, there isn&#8217;t a voltage higher than 3.3V anywhere in the circuit &#8211; so what to do with the PWR line? Well, there&#8217;s a solder jumper on the AA board to let you decide: it&#8217;s normally open, but you can connect it to either +3V or to the battery &#8220;+&#8221; (i.e. 1.2..1.5V). Obviously, this setup will be even less suited for plugs which expect a higher voltage than 3.3V to operate.</p>

<p>As you see, the +3V pin is solidly specified as always being 3.3V, but the PWR pin level can be all over the map.</p>

<p>The following plugs are especially affected:</p>

<ul>
<li><p>the <a href="/lp1">LCD Plug</a> will work, when used with a 3.3V display (as shipped by JeeLabs), but will only be suitable with 5V displays if PWR carries 5V</p></li>
<li><p>the <a href="/gb1">Graphics Board</a> assumes that PWR is 5V, because the display needs it (it&#8217;ll probably still work with 4.2V, but PWR should not be above 5V)</p></li>
</ul>

<p>Most plugs will be fine, though, since they only use the +3V supply. The only issue here is to make sure that the total current consumption off +3V is not too high.</p>

<p><strong>Using a JeeNode with an unregulated power supply</strong></p>

<p>The maximum allowed voltage on the PWR pin is about 13V. Unfortunately, many 12V power bricks are fairly badly calibrated, and often deliver substantially more than 12V under no-load conditions. You could easily damage the JeeNode&#8217;s on-board regulator with a cheap 12V power brick &#8211; better use a 5V or 9V brick.</p>

<p>If you do want to power a JeeNode off 12V (perhaps you need 12V on the rest of the circuit for LEDs, relays, or motor power), then the best approach is to insert a 5V regulator and feed that 5V level to PWR. This can easily be done with a &#8220;7805&#8243; regulator chip, which is available from many electronics parts sources.</p>
]]></content:encoded>
			<wfw:commentRss>http://jeelabs.org/2012/01/25/the-pwr-vs-the-3v-pin/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Too much heat</title>
		<link>http://jeelabs.org/2012/01/24/too-much-heat/</link>
		<comments>http://jeelabs.org/2012/01/24/too-much-heat/#comments</comments>
		<pubDate>Mon, 23 Jan 2012 23:01:11 +0000</pubDate>
		<dc:creator>jcw</dc:creator>
				<category><![CDATA[Hardware]]></category>

		<guid isPermaLink="false">http://jeelabs.org/?p=17634</guid>
		<description><![CDATA[To avoid switching noise near the work bench, I wanted to drive my LED strips from a plain ol&#8217; transformer -> bridge -> capacitor supply. It would have to supply about 2A @ 12V for my LEDs. Here&#8217;s the setup: Ignore the diodes at the top, these were 1N4004 diodes which weren&#8217;t quite up to [...]]]></description>
			<content:encoded><![CDATA[<p>To avoid switching noise near the work bench, I wanted to drive my LED strips from a plain ol&#8217; transformer -> bridge -> capacitor supply. It would have to supply about 2A @ 12V for my LEDs. Here&#8217;s the setup:</p>

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

<p>Ignore the diodes at the top, these were 1N4004 diodes which weren&#8217;t quite up to the task. The ones at the bottom right are Schottky diodes for a lower voltage drop, rated at 5A. The capacitor is 2200 µF, but ripple isn&#8217;t an issue.</p>

<p>Alas, the heat from this thing is excessive. I even went for an <em>artsy</em> swiss-cheese design:</p>

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

<p>Trouble is the transformer (and surprisingly <em>not</em> the diodes!) &#8211; I measured them both, with everything closed:</p>

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

<p>Diodes heated up to 75°C &#8211; but the transformer went all the way up to well over 90°C within the hour! AC mains consumption is 50W, so this silly thing is eating up half the power while trying to behave like a stove&#8230;</p>

<p>The transformer is a cheap 2x6V @ 2.5A unit I had lying around (draws 3.7W, even without any load). I&#8217;ll keep this as a high-ripple 12..20 VDC power brick for testing -
<em>but it definitely can&#8217;t be used continuously @ 2 Amps!</em></p>

<p>PS. If you&#8217;d like to meet up &#8211; I&#8217;ll be presenting <em>JeeStuff</em> at HackersNL coming <a href="http://hackersnl.nl/2012/2012-01-26-hackersnl-5/">Thursday evening</a> in Utrecht.</p>
]]></content:encoded>
			<wfw:commentRss>http://jeelabs.org/2012/01/24/too-much-heat/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
	</channel>
</rss>

<!-- Dynamic page generated in 0.635 seconds. -->
<!-- Cached page generated by WP-Super-Cache on 2012-02-23 10:31:17 -->
<!-- Compression = gzip -->
