<?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; JeePlug</title>
	<atom:link href="http://jeelabs.org/tag/jeeplug/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>Analog Plug readout</title>
		<link>http://jeelabs.org/2012/04/13/analog-plug-readout/</link>
		<comments>http://jeelabs.org/2012/04/13/analog-plug-readout/#comments</comments>
		<pubDate>Thu, 12 Apr 2012 22:01:33 +0000</pubDate>
		<dc:creator>jcw</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[JeePlug]]></category>

		<guid isPermaLink="false">http://jeelabs.org/?p=18797</guid>
		<description><![CDATA[The analog plug contains an MCP3424 4-channel ADC which has up to 18 bits of resolution and a programmable gain up to 8x. This can measure microvolts, and it works in the range of ± 2.048 V (or ± 0.256 V for 8x gain). However, the analog_demo example sketch was a bit limited, reading out [...]]]></description>
			<content:encoded><![CDATA[<p>The analog plug contains an MCP3424 4-channel ADC which has up to 18 bits of resolution and a programmable gain up to 8x. This can measure microvolts, and it works in the range of ± 2.048 V (or ± 0.256 V for 8x gain).</p>

<p>However, the <a href="https://github.com/jcw/jeelib/blob/master/examples/Ports/analog_demo/analog_demo.ino">analog_demo</a> example sketch was a bit limited, reading out just a single fixed channel, so I&#8217;ve added a new AnalogPlug class to <a href="https://github.com/jcw/jeelib">JeeLib</a> to simplify using the Analog Plug hardware. An example:</p>

<p><img src="http://jeelabs.org/wp-content/uploads/2012/04/Screen-Shot-2012-04-01-at-21.10.25.png" alt="Screen Shot 2012 04 01 at 21 10 25" title="Screen Shot 2012-04-01 at 21.10.25.png" border="0" width="388" height="323" /></p>

<p>This interfaces to an Analog Plug on port 1, and uses 0&#215;69 as default I2C device address. There are a number of ways to use this, but if you want to read out multiple channels, you have to select the proper channel and then wait for at least one conversion to complete. Since conversions take time, especially at 18-bit resolution, a delay() is needed to get proper results.</p>

<p>Sample output:</p>

<p><img src="http://jeelabs.org/wp-content/uploads/2012/04/Screen-Shot-2012-04-01-at-21.18.18.png" alt="Screen Shot 2012 04 01 at 21 18 18" title="Screen Shot 2012-04-01 at 21.18.18.png" border="0" width="160" height="145" /></p>

<p>I tied a 1.5V battery to channel 1 and left the rest of the pins unconnected. Touching both battery pins lowers the voltage briefly, as you can see.</p>

<p>These results are in microvolts, due to this expression in the code:</p>

<pre><code>    long uvolts = ((adc.reading() &gt;&gt; 8) * 1000) / 64;
</code></pre>

<p>Here&#8217;s the reasoning behind this formula:</p>

<ul>
<li>the <em>reading()</em> call returns 32 bits of I2C data, but we only need the first 24 bits</li>
<li>of these 24 bits, the first 6 will simply be a sign-extended copy of bit 18</li>
<li>the top of the measurement range is 2.047 Volts, i.e. 2047 millivolts</li>
<li>but we want to report in terms of microvolts, so we multiply by 1000</li>
<li>only 11 bits are needed to represent 0 .. 2047 mV, the remaining 6 bits are fractional</li>
<li>so we shift right by 6 bits (i.e. divide by 64) to get the actual result</li>
</ul>

<p>It&#8217;s a bit convoluted, but as you can see, the measured value comes out as about 1.477 Volts, with a few more digits of resolution. If you do the math, you&#8217;ll see that the actual &#8220;step&#8221; size of these measurements is 1000 / 64 = 15.625 µV &#8211; and it drops to under 2 µV when used with 8x gain!</p>

<p>With this sort of precision, electrical noise can easily creep in. But it&#8217;s pretty neat: 5 digits of precision for 4 channels, with nothing more than one teeny little I2C chip.</p>
]]></content:encoded>
			<wfw:commentRss>http://jeelabs.org/2012/04/13/analog-plug-readout/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Latching relays</title>
		<link>http://jeelabs.org/2011/06/22/latching-relays/</link>
		<comments>http://jeelabs.org/2011/06/22/latching-relays/#comments</comments>
		<pubDate>Tue, 21 Jun 2011 22:01:00 +0000</pubDate>
		<dc:creator>jcw</dc:creator>
				<category><![CDATA[Hardware]]></category>
		<category><![CDATA[JeePlug]]></category>
		<category><![CDATA[Power]]></category>

		<guid isPermaLink="false">http://jeelabs.org/?p=14073</guid>
		<description><![CDATA[The traditional relay looks like this (thank you Wikipedia): A spring pulls on the vertical lever on the right (above its pivot), keeping the contact pushed agains the &#8220;NC&#8221; contact &#8211; hence the name: normally closed. An electromagnet can pull the (iron) lever towards the left, against the &#8220;NO&#8221; contact &#8211; i.e. normally open, but [...]]]></description>
			<content:encoded><![CDATA[<p>The traditional relay looks like this (thank you <a href="http://en.wikipedia.org/wiki/Relay">Wikipedia</a>):</p>

<p><img src="http://jeelabs.org/wp-content/uploads/2011/06/relay.jpg" alt="Relay" /></p>

<p>A spring pulls on the vertical lever on the right (above its pivot), keeping the contact pushed agains the &#8220;NC&#8221; contact &#8211; hence the name: <em>normally closed</em>.</p>

<p>An electromagnet can pull the (iron) lever towards the left, against the &#8220;NO&#8221; contact &#8211; i.e. <em>normally open</em>, but closed once the electromagnet is powered.</p>

<p>Great invention. Perhaps the first example of electric amplification: using a small amount of electricity to switch a potentially much larger voltage or current.</p>

<p>For ultra-low power devices, ordinary relays have a drawback: you have to <em>keep</em> them energized as long as you want to keep the &#8220;NO&#8221; contact closed. With the <a href="rp1">Relay Plug</a>, things are no different &#8211; the latest relays used on it have a coil resistance of about 125 Ω, and each of the two requires 40 mA @ 5V to stay &#8220;on&#8221;:</p>

<p><img src="http://jeelabs.org/wp-content/uploads/2011/06/dsc_2591.jpg" alt="Dsc 2591" /></p>

<p>That amount of current consumption is not so convenient with batteries &#8211; when turned on, they wouldn&#8217;t last more than a day or two on a bunch of AA batteries.</p>

<p>Fortunately there&#8217;s an alternative, called a &#8220;bi-stable&#8221; or <a href="http://en.wikipedia.org/wiki/Relay#Latching_relay">latching relay</a>. It uses two coils to move that lever back and forth, with weak magnets in the relay set up in such a way that they&#8217;ll stay in place without using a spring as counter-force.</p>

<p>The benefit is that latching relays don&#8217;t need any power to stay in their current state (be it open or closed), you only need to give them a pulse to <em>change</em> their state from ON to OFF or from OFF to ON.</p>

<p>There are actually two types of latching relays:</p>

<ul>
<li>dual coil, usually with a common pin which should be tied to ground</li>
<li>single coil, where changing the state is done by applying reverse voltages</li>
</ul>

<p>Most dual coil latching relays can also be used in single-coil mode, by simply leaving that common pin floating.</p>

<p>In principle, the circuitry for a dual-coil latching relay is simple: you just need two relay drivers and then turn one <em>or</em> the other on <em>briefly</em> to make the relay change its state. The point being that you only need to pulse them very briefly, 10..100 msec should be enough.</p>

<p>Unfortunately, the Relay Plug isn&#8217;t usable for bi-stable relays, because it assumes a common <em>PWR</em> pin, not <em>GND</em>. It turns out that these relays are polarized. Thinking about this a bit more, this is actually quite logical: the force of the little latching magnet(s) need to be overcome with a magnetic field with a specific <em>opposite</em> orientation.</p>

<p><em>But there&#8217;s a surprising way out&#8230;</em></p>

<p>With single-coil plugs, the trick is to let current flow in different directions to set or reset the relay. IOW, either connect one pin to PWR and the other to GND (briefly), or vice versa. Hm, that sounds awfully like running an electric motor forwards or backward&#8230;</p>

<p>Now here&#8217;s the trick: instead of a Relay Plug, use the <a href="/dm1">DC Motor Plug</a>!</p>

<p><img src="http://jeelabs.org/wp-content/uploads/2011/06/dsc_2310_large.jpg" alt="Dsc 2310 Large" /></p>

<p>It contains two <a href="http://en.wikipedia.org/wiki/H_bridge">H-Bridges</a> which are intended to control two small DC motors (or one stepper motor), allowing them to run in either direction.</p>

<p><em>You even get 4 additional general-purpose I/O pins thrown in&#8230;</em></p>

<p>Now, instead of hooking up a motor, just hook up a relay, and only pulse the power briefly (by making both sides GND or PWR the rest of the time). With as added benefit that the DC Motor Plug will support <em>two</em> latching relays, and being an I2C device, it&#8217;ll also allow daisy-chaining with other I2C plugs.</p>

<p>Note that the chips used on the DC Motor Plug require at least 4.5V to operate, according to the data sheet. Maybe a slightly lower voltage will work &#8211; I haven&#8217;t tried it.</p>

<p><strong>Update</strong> &#8211; DC Motor Plug is confirmed to work. The 5V relays I was testing this with appear to switch reliably with pulses down to 4 ms, using this test code (modified from the <a href="http://jeelabs.net/projects/cafe/repository/entry/Ports/examples/dcmotor_demo/dcmotor_demo.pde">dcmotor&#95;demo.pde</a>) sketch:</p>

<p><img src="http://jeelabs.org/wp-content/uploads/2011/06/screen_shot_2011_06_22_at_163358.png" alt="Screen Shot 2011 06 22 at 16.33.58" /></p>
]]></content:encoded>
			<wfw:commentRss>http://jeelabs.org/2011/06/22/latching-relays/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Controlling the Dimmer Plug</title>
		<link>http://jeelabs.org/2011/06/11/controlling-the-dimmer-plug/</link>
		<comments>http://jeelabs.org/2011/06/11/controlling-the-dimmer-plug/#comments</comments>
		<pubDate>Fri, 10 Jun 2011 22:01:41 +0000</pubDate>
		<dc:creator>jcw</dc:creator>
				<category><![CDATA[Hardware]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[JeePlug]]></category>

		<guid isPermaLink="false">http://jeelabs.org/?p=13802</guid>
		<description><![CDATA[The Dimmer Plug contains an I2C chip which can control the brightness of up to 16 individual LEDs using hardware PWM. The advantage over the ATmega&#8217;s PWM is that there is no limitation to use only the DIO2, DIO3, or IRQ pin (the only ones which support hardware PWM), and of course that 16 individual [...]]]></description>
			<content:encoded><![CDATA[<p>The <a href="/dp1">Dimmer Plug</a> contains an I2C chip which can control the brightness of up to 16 individual LEDs using hardware PWM. The advantage over the ATmega&#8217;s PWM is that there is no limitation to use only the DIO2, DIO3, or IRQ pin (the only ones which support hardware PWM), and of course that 16 individual LEDs can be controlled. In fact, since there are 3 solder jumpers, up to 128 LEDs can be controlled from a single I2C port (by daisy-chaining <em>eight</em> Dimmer Plugs).</p>

<p>Note that the output of the Dimmer Plug is only suited for driving single low-power LEDs with a series resistor. The default setup assumes that these LEDs are tied to 3.3V or 5V. For higher voltages and higher power, additional driver circuitry must be added (transistors, MOSFETs, or the ULN2803 8-wide driver, for example).</p>

<p>Here&#8217;s a demo setup:</p>

<p><img src="http://jeelabs.org/wp-content/uploads/2011/06/dsc_2559.jpg" alt="Dsc 2559" /></p>

<p><em>(it&#8217;s not visible here, but the test LED has a 470 Ω resistor in series)</em></p>

<p>Although software PWM can handle more I/O pins, that does place a fairly high load on the ATmega, and the dimming takes place at a much lower frequency, which can be visible to the naked eye (and quite annoying).</p>

<p>The disadvantage of the Dimmer Plug is that it&#8217;s based on a fairly complex chip, the PCA9635. I&#8217;ve extended the <em>DimmerPlug</em> class in the Ports library a bit further to make it somewhat easier to use.</p>

<p>There&#8217;s also an updated <a href="http://jeelabs.net/projects/cafe/repository/entry/Ports/examples/dimmer_demo/dimmer_demo.pde">dimmer&#95;demo.pde</a> sketch:</p>

<p><img src="http://jeelabs.org/wp-content/uploads/2011/06/Screen-shot-2011-06-04-at-22.44.58.png" alt="" /></p>

<p>It exercises several of the PCA9635&#8242;s features:</p>

<ul>
<li>all 16 output are set to maximum brightness</li>
<li>the &#8220;group blink&#8221; mode is enabled, using a specified blink frequency and blink duty cycle</li>
<li>the sketch waits 10 seconds, while blinking</li>
<li>the chip is reset to its default &#8220;group dimming&#8221; mode</li>
<li>then gradually make all channels dim at the same time</li>
<li>and lastly enter a loop, which illustrates how to do per-channel dimming</li>
</ul>

<p>The <em>setMulti()</em> call takes a start register number, then a variable of arguments 0..255, and then a &#8220;-1&#8243; value to mark the end. It is shorthand for calling <em>setReg()</em> with successive register values, but more efficient.</p>

<p>The code in <em>loop()</em> does some tricky bit fiddling. Figuring out what it does is left as exercise for the reader, but you can simply ignore it if you don&#8217;t care about such trickery. The main thing to note is that indiviudal LEDs can be controlled by setting their corresponding register: <em>dimmer.PWM0</em>, <em>dimmer.PWM1</em>, &#8230;, up to <em>dimmer.PWM15</em>.</p>

<p>As you can see, the PCA9635 can control individual outputs, but also several outputs combined via the &#8220;group&#8221; modes. There are other options, i.e. only controlling a subset of the outputs in group mode, inverting the output signal, using open-collector mode instead of the default totem-pole configuration, and more. You will need to go through the datasheet (<a href="http://www.nxp.com/documents/data_sheet/PCA9635.pdf">PDF</a>) to take full advantage of all this. All registers in the PCA9635 can bet read and written using the <em>getReg()</em> and <em>setReg()</em> calls, respectively.</p>

<p><em>But for simple uses, the above should be sufficient!</em></p>
]]></content:encoded>
			<wfw:commentRss>http://jeelabs.org/2011/06/11/controlling-the-dimmer-plug/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Funky plug</title>
		<link>http://jeelabs.org/2011/05/27/funky-plug/</link>
		<comments>http://jeelabs.org/2011/05/27/funky-plug/#comments</comments>
		<pubDate>Thu, 26 May 2011 22:01:17 +0000</pubDate>
		<dc:creator>jcw</dc:creator>
				<category><![CDATA[Hardware]]></category>
		<category><![CDATA[JeePlug]]></category>

		<guid isPermaLink="false">http://jeelabs.org/?p=13622</guid>
		<description><![CDATA[What is this thing? Maybe you can guess from the other side? Simple &#8211; it&#8217;s a funny kind of DIP switch, to manually configure 4 input pins as needed: When used with internal pull-ups, this causes each switch to pull an I/O pin down when latched in the top position (as indicated in parentheses). Works [...]]]></description>
			<content:encoded><![CDATA[<p><em>What is this thing?</em></p>

<p><img src="http://jeelabs.org/wp-content/uploads/2011/05/dsc_2533.jpg" alt="Dsc 2533" /></p>

<p>Maybe you can guess from the other side?</p>

<p><img src="http://jeelabs.org/wp-content/uploads/2011/05/dsc_2534.jpg" alt="Dsc 2534" /></p>

<p>Simple &#8211; it&#8217;s a funny kind of DIP switch, to manually configure 4 input pins as needed:</p>

<p><img src="http://jeelabs.org/wp-content/uploads/2011/05/screen_shot_2011_05_25_at_131743.png" alt="Screen Shot 2011 05 25 at 13.17.43" /></p>

<p>When used with internal pull-ups, this causes each switch to pull an I/O pin down when latched in the top position (as indicated in parentheses).</p>

<p>Works on any pair of ports and in any orientation, of course &#8211; but then the pin assignments will be different.</p>
]]></content:encoded>
			<wfw:commentRss>http://jeelabs.org/2011/05/27/funky-plug/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Relays at last</title>
		<link>http://jeelabs.org/2011/05/02/relays-at-last/</link>
		<comments>http://jeelabs.org/2011/05/02/relays-at-last/#comments</comments>
		<pubDate>Sun, 01 May 2011 22:01:42 +0000</pubDate>
		<dc:creator>jcw</dc:creator>
				<category><![CDATA[Hardware]]></category>
		<category><![CDATA[Home automation]]></category>
		<category><![CDATA[JeePlug]]></category>

		<guid isPermaLink="false">http://jeelabs.org/?p=13304</guid>
		<description><![CDATA[It has taken months to settle this issue, but I&#8217;m happy to report that the supply problems are all over now&#8230; the Relay Plug board has been redesigned to accommodate a slightly different model: Still fits, still same size. And still rated 5A @ 250 VAC. The coil resistance is 125 Ω, which means each [...]]]></description>
			<content:encoded><![CDATA[<p>It has taken months to settle this issue, but I&#8217;m happy to report that the supply problems are all over now&#8230; the <a href="//jeelabs.org/ry2">Relay Plug</a> board has been redesigned to accommodate a slightly different model:</p>

<p><img src="http://jeelabs.org/wp-content/uploads/2011/05/dsc_2488.jpg" alt="Dsc 2488" /></p>

<p>Still fits, still same size. And still rated 5A @ 250 VAC.</p>

<p>The coil resistance is 125 Ω, which means each of the two relays will draw 40 mA @ 5V when closed. Slightly more than the previous model, but well with the specs of the on-board relay drivers.</p>

<p>The point of it all is that these new relays have a <em>major</em> distinguishing feature: I&#8217;ve got them in stock, at last :)</p>

<p>For the record: first an order for the original units was postponed from January to May, then a second order with another supplier was pushed back to June when they told me the stock listed on their website was grabbed by someone else moments before me&#8230;</p>

<p>All is well again now. End of story. <em>Well&#8230; until the next supply issue pops up, anyway!</em></p>
]]></content:encoded>
			<wfw:commentRss>http://jeelabs.org/2011/05/02/relays-at-last/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>OOK fix</title>
		<link>http://jeelabs.org/2011/02/10/ook-fix/</link>
		<comments>http://jeelabs.org/2011/02/10/ook-fix/#comments</comments>
		<pubDate>Wed, 09 Feb 2011 23:01:32 +0000</pubDate>
		<dc:creator>jcw</dc:creator>
				<category><![CDATA[Hardware]]></category>
		<category><![CDATA[JeePlug]]></category>
		<category><![CDATA[Network]]></category>

		<guid isPermaLink="false">http://jeelabs.org/?p=13168</guid>
		<description><![CDATA[Here&#8217;s a great suggestion from Stefan Schulze (&#8220;kami&#8221; on the forum) for getting that wrong 433 MHz transmitter working with the OOK 433 Plug: Sideways: It requires some pin-bending, and you can attach an optional antenna, as he did. I&#8217;m currently discussing option with the supplier to find a more &#8220;official&#8221; solution, but if you [...]]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s a great suggestion from Stefan Schulze (&#8220;kami&#8221; on the forum) for getting that wrong 433 MHz transmitter working with the <a href="/oo1">OOK 433 Plug</a>:</p>

<p><img src="http://jeelabs.org/wp-content/uploads/2011/02/img_5951.jpg" alt="Img 5951" /></p>

<p>Sideways:</p>

<p><img src="http://jeelabs.org/wp-content/uploads/2011/02/img_5950.jpg" alt="Img 5950" /></p>

<p>It requires some pin-bending, and you can attach an optional antenna, as he did.</p>

<p>I&#8217;m currently discussing option with the supplier to find a more &#8220;official&#8221; solution, but if you want to use the OOK plug right now, the above is definitely an option.</p>

<p><em>Thanks, Stefan!</em></p>

<p><strong>Update</strong> &#8211; For everyone who received the OOK 433 Plug in its current form: I will send a solution out to everyone once it has been worked out. If you don&#8217;t need the TX side immediately, it might be an option to postpone soldering it until that solution is available.</p>

<p><strong>Update #2</strong> &#8211; Problem has been resolved, the OOK Plug is now supplied with the correct 3-pin transmitter.</p>
]]></content:encoded>
			<wfw:commentRss>http://jeelabs.org/2011/02/10/ook-fix/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>OOK Murphy</title>
		<link>http://jeelabs.org/2011/02/08/ook-murphy/</link>
		<comments>http://jeelabs.org/2011/02/08/ook-murphy/#comments</comments>
		<pubDate>Mon, 07 Feb 2011 23:01:38 +0000</pubDate>
		<dc:creator>jcw</dc:creator>
				<category><![CDATA[Hardware]]></category>
		<category><![CDATA[JeePlug]]></category>
		<category><![CDATA[Network]]></category>

		<guid isPermaLink="false">http://jeelabs.org/?p=13159</guid>
		<description><![CDATA[Looks like there is a problem with the OOK 433 Plug&#8230; Here&#8217;s the transmitter I started out with: Here&#8217;s the print layout I designed, based on that: Everything worked fine. So I ordered larger quantities, to be ready for production. Here&#8217;s what I got in that new batch order: Whoops&#8230; different unit! Worse still, the [...]]]></description>
			<content:encoded><![CDATA[<p>Looks like there is a problem with the <a href="/oo1">OOK 433 Plug</a>&#8230;</p>

<p>Here&#8217;s the transmitter I started out with:</p>

<p><img src="http://jeelabs.org/wp-content/uploads/2011/02/dsc_2455_2.jpg" alt="Dsc 2455 2" /></p>

<p>Here&#8217;s the print layout I designed, based on that:</p>

<p><img src="http://jeelabs.org/wp-content/uploads/2011/02/screen_shot_2011_02_07_at_203625.png" alt="Screen Shot 2011 02 07 at 20.36.25" /></p>

<p>Everything worked fine. So I ordered larger quantities, to be ready for production. Here&#8217;s what I got in that new batch order:</p>

<p><img src="http://jeelabs.org/wp-content/uploads/2011/02/dsc_2455_3.jpg" alt="Dsc 2455 3" /></p>

<p><em>Whoops&#8230; different unit!</em></p>

<p>Worse still, the original board had +, Gnd, Data as pins (as seen on the board layout), whereas the new boards have Data, Gnd, +, Antenna. It would be possible to cut the antenna pin off, but that&#8217;s not enough since the pinout is in fact <em>reversed!</em></p>

<p>I&#8217;ve contacted the supplier. Let&#8217;s see how this goes. For the time being, I&#8217;m forced to take the OOK 433 Plug &#8220;off the shelf&#8221;. Sorry about that &#8211; please hang in there, also if you&#8217;ve already ordered this plug. Note that this only affects the 433 MHz <em>transmitter</em> &#8211; the 433 MHz <em>receiver</em> should work just fine.</p>
]]></content:encoded>
			<wfw:commentRss>http://jeelabs.org/2011/02/08/ook-murphy/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>New OOK and DCF relay</title>
		<link>http://jeelabs.org/2011/01/29/new-ook-and-dcf-relay/</link>
		<comments>http://jeelabs.org/2011/01/29/new-ook-and-dcf-relay/#comments</comments>
		<pubDate>Fri, 28 Jan 2011 23:01:38 +0000</pubDate>
		<dc:creator>jcw</dc:creator>
				<category><![CDATA[Hardware]]></category>
		<category><![CDATA[Home automation]]></category>
		<category><![CDATA[JeeNode]]></category>
		<category><![CDATA[JeePlug]]></category>
		<category><![CDATA[Network]]></category>

		<guid isPermaLink="false">http://jeelabs.org/?p=13019</guid>
		<description><![CDATA[With all the pieces finally in place, and now that I&#8217;m getting a little bit more time to hack around again, this seemed like a good time to reconsider the OOKrelay. So I combined a JeeNode USB, the new OOK 433 Plug, a Carrier Board with box, and half a Carrier Card: In the top [...]]]></description>
			<content:encoded><![CDATA[<p>With all the pieces <em>finally</em> in place, and now that I&#8217;m getting a little bit more time to hack around again, this seemed like a good time to reconsider the <a href="http://jeelabs.net/projects/cafe/wiki/OokRelaypde_sketch">OOKrelay</a>.</p>

<p>So I combined a <a href="/ju3">JeeNode USB</a>, the new <a href="/oo1">OOK 433 Plug</a>, a <a href="/cb2">Carrier Board</a> with box, and half a <a href="/cc1">Carrier Card</a>:</p>

<p><img src="http://jeelabs.org/wp-content/uploads/2011/01/dsc_2429.jpg" alt="Dsc 2429" /></p>

<p>In the top left I also added a DCF77 receiver from <a href="http://www2.conrad.nl/goto.php?artikel=641138">Conrad</a>, attached to the Carrier Card prototyping board. It&#8217;s a bit hard to see, because the little receiver board is actually mounted upright. Here&#8217;s a better view:</p>

<p><img src="http://jeelabs.org/wp-content/uploads/2011/01/dsc_2430.jpg" alt="Dsc 2430" /></p>

<p>A JeeNode USB was selected, because this thing will be powered permanently, and I chose to hide the connector inside the box to make it more robust. So all this needs is a little USB charger. The LiPo charge option might be useful if I decide to make this thing more autonomous one day (i.e. to record accurate power outage times).</p>

<p>Note that this is a modded JeeNode, as described <a href="http://jeelabs.org/2011/01/27/ook-reception-with-rfm12b-2/">here</a>, to be able to receive 868 MHz OOK signals.</p>

<p>So what this thing can do &#8211; as far as the hardware goes &#8211; is listen for both 433 MHz and 868 MHz OOK signals at the same time, as well as pick up the <a href="http://en.wikipedia.org/wiki/DCF77">DCF77</a> atomic clock signals from Frankfurt. Sending out 433/868 MHz OOK is possible too, but since the unit isn&#8217;t constantly listening for OOK packets, it&#8217;ll have to poll for such commands, which will introduce a small delay.</p>

<p><em>That&#8217;s the hardware, i.e. the easy part&#8230;</em></p>

<p>The software will be a lot more work. I&#8217;m going to adapt / re-implement the functionality from the OOKrelay sketch, i.e. this unit will decode and re-transmit all incoming data as RF12 packets, so that they can be picked up by a JeeLink hooked up to my PC/Mac. The clock signal will be useful to accurately time-stamp all receptions, and is really of more general use.</p>

<p>So far, the following I/O pins have been used:</p>

<ul>
<li>one port for the OOK 433 Plug, i.e. one DIO and one AIO pin</li>
<li>one input pin for the modded JeeNode, to receive 868 MHz OOK signals</li>
<li>one input pin for the DCF77 signal</li>
</ul>

<p>There is still lots of room left for expansion. A <a href="/pp1">Pressure Plug</a> perhaps, to track barometric pressure. Or a <a href="/mp1">Memory Plug</a> to save up the last data while the central receiver is unavailable. Or both, since these can combined on a single I2C port.</p>

<p>Absent from all this, is a display. First of all, squeezing a 2&#215;16 LCD in there would have been very tight, but more importantly, now that there is a <a href="http://jeelabs.org/2011/01/05/glcd-library/">JeePU</a>, there really is no need. I&#8217;m already sending the info out by wireless, so a remote graphical display is definitely an option &#8211; without PC &#8211; or I could use a central server to get this info to the right place(s). This box is intended to be hidden out of sight, somewhere centrally in the house.</p>

<p>Only thing I might consider is a small LED near the USB cable, to indicate that all is well. <em>Maybe&#8230; I&#8217;m not too fond of blinking LEDs everywhere in the house :)</em></p>
]]></content:encoded>
			<wfw:commentRss>http://jeelabs.org/2011/01/29/new-ook-and-dcf-relay/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Meet the OOK 433 Plug</title>
		<link>http://jeelabs.org/2011/01/28/meet-the-ook-433-plug/</link>
		<comments>http://jeelabs.org/2011/01/28/meet-the-ook-433-plug/#comments</comments>
		<pubDate>Thu, 27 Jan 2011 23:01:07 +0000</pubDate>
		<dc:creator>jcw</dc:creator>
				<category><![CDATA[Hardware]]></category>
		<category><![CDATA[Home automation]]></category>
		<category><![CDATA[JeePlug]]></category>
		<category><![CDATA[Network]]></category>

		<guid isPermaLink="false">http://jeelabs.org/?p=13001</guid>
		<description><![CDATA[After yesterday&#8217;s post about modding the RFM12B to receive OOK RF data, here&#8217;s a new option which goes the other way: add-on hardware for 433 MHz. Meet the OOK 433 Plug: This plug can probably be used without antenna, but adding one is bound to increase the maximum reception range (I haven&#8217;t done any range [...]]]></description>
			<content:encoded><![CDATA[<p>After yesterday&#8217;s <a href="http://jeelabs.org/2011/01/27/ook-reception-with-rfm12b-2/">post</a> about modding the RFM12B to receive <a href="http://en.wikipedia.org/wiki/On-off_keying">OOK</a> RF data, here&#8217;s a new option which goes the other way: add-on hardware for 433 MHz.</p>

<p>Meet the <a href="/oo1">OOK 433 Plug</a>:</p>

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

<p>This plug can probably be used without antenna, but adding one is bound to increase the maximum reception range (I haven&#8217;t done any range tests yet).</p>

<p>The receiver output is tied to the AIO pin, which must be configured as input on the JeeNode. The transmitter is tied to the DIO pin, to be used as output pin.</p>

<p>Both receiver and transmitter can be operated from 3..12V (I&#8217;ve only tested with 3.3V and 5V, so far). For the transmitter, I would expect the power output and range to increase with voltage, but even at 3.3V things seem to work quite well in both directions. There is a jumper to select between PWR and +3V as power supply, and there is an optional series resistor for the receiver output, which may be needed at higher voltages (normally, it can be omitted by closing that second jumper).</p>

<p>The reason for creating a separate plug is that it allows a single JeeNode to operate <em>simultaneously</em> on the 433 MHz and 868 MHz frequency bands. As suggested in the comments on yesterday&#8217;s post, a modded 868 MHz RFM12B can probably be made to receive 433 MHz OOK signals, but the receiver sensitivity is bound to be fairly low since the RF circuitry is really dimensioned for 868 MHz. Haven&#8217;t tried this, though.</p>

<p>There are several sketches which can be used with the OOK 433 Plug. To use the receiver on this board with little or no adjustment, try <a href="http://jeelabs.net/projects/cafe/wiki/Recv433_testpde_sketch">recv433&#95;test.pde</a> or <a href="http://jeelabs.net/projects/cafe/wiki/OokRelaypde_sketch">ookRelay.pde</a>. For tranmission, there is the <a href="http://jeelabs.net/projects/cafe/wiki/Send433&#95;testpde_sketch">send433_test.pde</a> sketch.</p>

<p>I expect to combine and integrate code from the different OOK and relaying sketches in the near future, now that this plug has been created, but for now you&#8217;ll have to tinker with what&#8217;s available.</p>

<p>If you have suggestions (of better still: code or docs) for new protocol handlers to add and implement on a JeeNode, please let me know or share it on the discussion <a href="http://talk.jeelabs.net/">forum</a>. It will interesting to see how many OOK protocols on 433 and 868 MHz we can figure out and implement, to make this all truly versatile for lots of different RF devices out there.</p>

<p>All code and docs are in the <a href="http://jeelabs.net/">Café</a>, with the OOK 433 Plug available from the <a href="http://jeelabs.com/products/ook-433-plug">shop</a>, as usual.</p>

<p><em>Enjoy!</em></p>

<p><em><strong>Note</strong> &#8211; This server was down on Jan 28, from about 1:00 to 10:00 (CET). I&#8217;m investigating what happened.</em></p>
]]></content:encoded>
			<wfw:commentRss>http://jeelabs.org/2011/01/28/meet-the-ook-433-plug/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Thermo Plug fix (v2)</title>
		<link>http://jeelabs.org/2011/01/26/thermo-plug-v2-fix/</link>
		<comments>http://jeelabs.org/2011/01/26/thermo-plug-v2-fix/#comments</comments>
		<pubDate>Tue, 25 Jan 2011 23:01:46 +0000</pubDate>
		<dc:creator>jcw</dc:creator>
				<category><![CDATA[Hardware]]></category>
		<category><![CDATA[JeePlug]]></category>

		<guid isPermaLink="false">http://jeelabs.org/?p=12975</guid>
		<description><![CDATA[Another day, another fix. The Thermo Plug also had a problem with layout, as described in this weblog post a while back. I&#8217;ve had a new batch of boards made which moves the thermocouple screw terminal slightly outwards to get it out of the way of the AD597 chip: The sharp edges come from the [...]]]></description>
			<content:encoded><![CDATA[<p>Another day, another fix.</p>

<p>The <a href="/tp2">Thermo Plug</a> also had a problem with layout, as described in this <a href="http://jeelabs.org/2010/11/18/thermo-plug-mismatch/">weblog post</a> a while back.</p>

<p>I&#8217;ve had a new batch of boards made which moves the thermocouple screw terminal slightly outwards to get it out of the way of the AD597 chip:</p>

<p><img src="http://jeelabs.org/wp-content/uploads/2011/01/screen_shot_2011_01_25_at_165426.png" alt="Screen Shot 2011 01 25 at 16.54.26" /></p>

<p>The sharp edges come from the fact that new plug designs are now placed differently on a panel, using routing along the longer side of the plugs.</p>

<p>All plug PCBs and all JeeNode types have boards using a &#8220;standard&#8221; 21.1 mm width. The new approach simply means that these widths are now more accurate &#8211; &#8220;across the board&#8221; one could say :)</p>

<p>I&#8217;ve also addressed the transistor pinout <a href="http://jeelabs.org/2011/01/04/thermo-murphy/">confusion</a> by adding a &#8220;C&#8221; label next to where the collector pin is.</p>

<p>Again, small tweaks, but good to have them resolved. All Thermo Plugs sent out from now on will be this new &#8220;tp2&#8243; version (the old board has &#8220;tp1&#8243; on it).</p>

<p><em>Onwards, again!</em></p>
]]></content:encoded>
			<wfw:commentRss>http://jeelabs.org/2011/01/26/thermo-plug-v2-fix/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

<!-- Dynamic page generated in 0.481 seconds. -->
<!-- Cached page generated by WP-Super-Cache on 2012-05-23 10:39:44 -->

