<?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>Scurvyrat &#187; Digital</title>
	<atom:link href="http://scurvyrat.com/category/digital/feed/" rel="self" type="application/rss+xml" />
	<link>http://scurvyrat.com</link>
	<description>Ramblings on the Digital Sea</description>
	<lastBuildDate>Wed, 07 Dec 2011 00:39:54 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1</generator>
		<item>
		<title>Ruby v1.0b</title>
		<link>http://scurvyrat.com/2011/09/15/ruby-v1-0b/</link>
		<comments>http://scurvyrat.com/2011/09/15/ruby-v1-0b/#comments</comments>
		<pubDate>Fri, 16 Sep 2011 05:30:13 +0000</pubDate>
		<dc:creator>mark</dc:creator>
				<category><![CDATA[Digital]]></category>

		<guid isPermaLink="false">http://www.scurvyrat.com/?p=232</guid>
		<description><![CDATA[Finally getting some time to get back to this project. A few weeks ago, I got version 1.0a of the Ruby Arduino clone with RF12B module. It worked well, but...]]></description>
			<content:encoded><![CDATA[<p>Finally getting some time to get back to this project. A few weeks ago, I got <a href="http://www.scurvyrat.com/2011/08/06/bejouled-ruby-v1-0a/">version 1.0a of the Ruby</a> Arduino clone with RF12B module. It worked well, but I made some simple mistakes in the layout and the silkscreen wasn&#8217;t the easiest to read. I sent a new version out and have made 5 or 6 of them. They all work perfectly.</p>
<p>Here is what they look like:</p>
<p style="text-align: center;"><a href="http://www.scurvyrat.com/wp/wp-content/uploads/2011/09/rubyv10b.png"><img class="aligncenter size-full wp-image-233" title="rubyv10b" src="http://www.scurvyrat.com/wp/wp-content/uploads/2011/09/rubyv10b.png" alt="" width="560" height="563" /></a></p>
<p>I moved the onboard DS18B20 sensor a bit farther away from the CPU. It isn&#8217;t populated on this particular board.</p>
<p>Here is the backside:</p>
<p style="text-align: left;"><a href="http://www.scurvyrat.com/wp/wp-content/uploads/2011/09/rubyv10b_back.png"><img class="aligncenter size-full wp-image-234" title="rubyv10b_back" src="http://www.scurvyrat.com/wp/wp-content/uploads/2011/09/rubyv10b_back.png" alt="" width="560" height="616" /></a>The silkscreen is much easier to read on this verision. It isn&#8217;t perfect, but it works. I still have the Jeenodesque ports. I like having access to both regulated and unregulated power as well as ground in lots of spots. Next to the SMA connector, I have a 0603 blue LED tied to D9. This allows me to give some feedback as to what is happening (ie flash when collecting data and sending packets). I plan on having a way for the ACK packets to turn this on for debugging or off for power saving. In the case, I can drill a small hole next to the antenna hole.</p>
<p>The form factor fits into the same case from New Age Enclosures.</p>
<p>I want to get 10 or so of these running around the house to see how the collector node handles all the chatter.</p>
<p>Let me know what you think of the layout. Cheers!</p>
]]></content:encoded>
			<wfw:commentRss>http://scurvyrat.com/2011/09/15/ruby-v1-0b/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Ruby v1.0a</title>
		<link>http://scurvyrat.com/2011/08/06/bejouled-ruby-v1-0a/</link>
		<comments>http://scurvyrat.com/2011/08/06/bejouled-ruby-v1-0a/#comments</comments>
		<pubDate>Sat, 06 Aug 2011 23:04:27 +0000</pubDate>
		<dc:creator>mark</dc:creator>
				<category><![CDATA[Digital]]></category>
		<category><![CDATA[Arduino]]></category>
		<category><![CDATA[DS18B20]]></category>
		<category><![CDATA[jeenode]]></category>
		<category><![CDATA[RF12]]></category>
		<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">http://www.scurvyrat.com/?p=208</guid>
		<description><![CDATA[I got my boards back from Laen @ dorkbotpdx. He offers an amazing service. Not only is he very helpful, but the price and turnaround is amazing. Check him out....]]></description>
			<content:encoded><![CDATA[<p>I got my boards back from Laen @ <a href="http://dorkbotpdx.org/wiki/pcb_order" target="_blank">dorkbotpdx</a>. He offers an amazing service. Not only is he very helpful, but the price and turnaround is amazing. Check him out.</p>
<p>The board in this picture is my first attempt at an Arduino clone with built-in RF12B. There are some very <a href="http://jeelabs.org" target="_blank">Jeenodesque</a> parts to this board (Thank you JCW for the inspirations!). For instance, the four Jeenode ports. I am not sure if I&#8217;m going to keep these or not. As the boards get more custom, then having generic ports makes less sense. Also, the 0.1&#8243; header pins take up a ton of space on the board.</p>
<p style="text-align: center;"><a href="http://www.scurvyrat.com/wp/wp-content/uploads/2011/08/rubyv10a1.png"><img class="aligncenter size-full wp-image-211" title="Ruby v1.0a" src="http://www.scurvyrat.com/wp/wp-content/uploads/2011/08/rubyv10a1.png" alt="" width="500" height="347" /></a></p>
<p>Why make this?</p>
<p>We&#8217;ll first, because I wanted to try to make a board in Eagle. Did that. Still lots to learn, but super fun to get a working PCB back.</p>
<p>I wanted to get something that fits into a case. For another project, I had cases from new age enclosures. They make relatively cheap enclosures that are not that ugly boxes that most make. The ones I chose has 3&#8243;, 4&#8243; and 5&#8243; versions. The board will fit into any of these so there is lots of space for extra circuitry, batteries, etc&#8230;</p>
<p>I also wanted to see how well the RF12B would perform with a real antenna as opposed to a relatively precise piece of wire. It also makes the system look that much more professional. I bought a bunch of 915MHZ antennas  off of Ebay for super cheap. The swivel antennas wold be nice as I could also fold them down the side of the enclosure.</p>
<p>Lastly, I wanted to try my hand at SMD soldering. I&#8217;m mainly using 0603 components. So far so good. It isn&#8217;t fun if you need to do a bunch of reworking the boards, but relatively easy to do once you get the hang of it. Google for tutorials. There are lots of good ones out there.</p>
<p>Here is the board with the components on it.</p>
<p style="text-align: center;"><a href="http://www.scurvyrat.com/wp/wp-content/uploads/2011/08/rubyv10a2.png"><img class="aligncenter size-full wp-image-213" title="Ruby V1.0a" src="http://www.scurvyrat.com/wp/wp-content/uploads/2011/08/rubyv10a2.png" alt="" width="600" height="639" /></a></p>
<p>As you can see, there is some rework on there. I made the most basic of mistakes connecting TX-TX and RX-RX when I needed TX-RX and RX-TX on the FTDI connector. Easy fix, luckily. Also had a wrong trace to the reset on the ICSP connector. Otherwise worked well. The small chip to the upper-left of the ATMEGA128P is a DS18B20U+ chip. The three 0.1&#8243; headers to the left of that chip is if you want to hang more 1-wire devices off that pin. I currently have 5 more DS18B20s coming off that pin on one of these boards.</p>
<p>On the other side, I wired in a micro-USB connector to provide an easy power connection. I also added a blue-LED that I will use as a status light.</p>
<p>Here is the board in its case:</p>
<p><a href="http://www.scurvyrat.com/wp/wp-content/uploads/2011/08/rubyv10a3.png"><img class="aligncenter size-full wp-image-212" title="rubyv10a3" src="http://www.scurvyrat.com/wp/wp-content/uploads/2011/08/rubyv10a3.png" alt="" width="600" height="637" /></a></p>
<p>As you can see, the board actually sits in the case upside down. I wanted to put most of the components on the bottom of the board so they don&#8217;t interfere with other circuits that might be on the top or batteries etc&#8230;</p>
<p>For a first stab at it, I&#8217;m thrilled. Works as expected. I&#8217;ve sent out a version 1.0b as well as one that goes into a NEMA rated outdoor enclosure. More on that soon.</p>
]]></content:encoded>
			<wfw:commentRss>http://scurvyrat.com/2011/08/06/bejouled-ruby-v1-0a/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Radios!</title>
		<link>http://scurvyrat.com/2011/07/06/radios/</link>
		<comments>http://scurvyrat.com/2011/07/06/radios/#comments</comments>
		<pubDate>Thu, 07 Jul 2011 05:47:32 +0000</pubDate>
		<dc:creator>mark</dc:creator>
				<category><![CDATA[Digital]]></category>

		<guid isPermaLink="false">http://www.scurvyrat.com/?p=204</guid>
		<description><![CDATA[Yes! Where these are going coming in future posts. &#160;]]></description>
			<content:encoded><![CDATA[<p>Yes! Where these are going coming in future posts.</p>
<p style="text-align: center;"><a href="http://www.scurvyrat.com/wp/wp-content/uploads/2011/07/DSC_2871.jpg"><img class="aligncenter size-full wp-image-205" title="Lots of Radios" src="http://www.scurvyrat.com/wp/wp-content/uploads/2011/07/DSC_2871.jpg" alt="" width="689" height="458" /></a></p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://scurvyrat.com/2011/07/06/radios/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>RF Interference</title>
		<link>http://scurvyrat.com/2011/07/01/rf-interference/</link>
		<comments>http://scurvyrat.com/2011/07/01/rf-interference/#comments</comments>
		<pubDate>Sat, 02 Jul 2011 06:26:46 +0000</pubDate>
		<dc:creator>mark</dc:creator>
				<category><![CDATA[Digital]]></category>
		<category><![CDATA[RF12]]></category>

		<guid isPermaLink="false">http://www.scurvyrat.com/?p=182</guid>
		<description><![CDATA[I&#8217;ve been building some cabinets in the garage the last few days. I noticed that I was missing some data and dropping packets from the RF12 radios. Here is a...]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been building some cabinets in the garage the last few days. I noticed that I was missing some data and dropping packets from the RF12 radios. Here is a graph while I was working in the garage. Note the y-axis.</p>
<p><a href="http://www.scurvyrat.com/wp/wp-content/uploads/2011/07/Screen-shot-2011-07-01-at-11.18.43-PM.png"><img class="aligncenter size-full wp-image-184" title="Packet loss due to RF interference" src="http://www.scurvyrat.com/wp/wp-content/uploads/2011/07/Screen-shot-2011-07-01-at-11.18.43-PM.png" alt="" width="725" height="352" /></a><br />
<strong>Ouch</strong>. That big spike is 19 dropped packets &#8212; 19 minutes straight without new data.</p>
<p>Now check out this graph:</p>
<p><a href="http://www.scurvyrat.com/wp/wp-content/uploads/2011/07/Screen-shot-2011-07-01-at-11.19.03-PM.png"><img class="aligncenter size-full wp-image-183" title="Much better!" src="http://www.scurvyrat.com/wp/wp-content/uploads/2011/07/Screen-shot-2011-07-01-at-11.19.03-PM.png" alt="" width="738" height="356" /></a></p>
<p>So I stopped work around 6:30. Haven&#8217;t dropped a packet since then. There have been a few retries but nothing serious and zero data lost.</p>
<p>Just an example how the local environment can affect your data collection.</p>
<p>Here  is today&#8217;s action. Pretty clear that those noisy motors wreck havoc on RF transmissions. Can you tell when I stopped working?</p>
<p><a href="http://www.scurvyrat.com/wp/wp-content/uploads/2011/07/Screen-shot-2011-07-02-at-10.54.08-PM.png"><img class="aligncenter size-full wp-image-188" title="More interference" src="http://www.scurvyrat.com/wp/wp-content/uploads/2011/07/Screen-shot-2011-07-02-at-10.54.08-PM.png" alt="" width="720" height="357" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://scurvyrat.com/2011/07/01/rf-interference/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Eflite 120mAh test done!</title>
		<link>http://scurvyrat.com/2011/06/28/eflite-120mah-test-done/</link>
		<comments>http://scurvyrat.com/2011/06/28/eflite-120mah-test-done/#comments</comments>
		<pubDate>Wed, 29 Jun 2011 00:16:06 +0000</pubDate>
		<dc:creator>mark</dc:creator>
				<category><![CDATA[Digital]]></category>
		<category><![CDATA[LiPo]]></category>

		<guid isPermaLink="false">http://www.scurvyrat.com/?p=178</guid>
		<description><![CDATA[So a few days ago, the Jeenode stopped sending data. The beginning of this test can be found in this post. It stopped after sending 15,200 data points. That is...]]></description>
			<content:encoded><![CDATA[<p>So a few days ago, the Jeenode stopped sending data. The beginning of this test can be <a href="http://www.scurvyrat.com/2011/06/17/testing-the-eflite-120mah-battery-with-a-minimal-jeenode/">found in this post</a>. It stopped after sending 15,200 data points. That is pretty amazing.</p>
<p>It lasted from 2011-06-15 3:11 PM to 2011-06-26 2:59 PM. Just under 11 days on 120mAh LiPo.It shouldn&#8217;t take much solar juice to keep that small battery charged up, but now I know I get &gt; 1 week on a full charge without adding any energy to the battery. That should cover some dark days&#8230;.</p>
<p>Here is a graph of the entire time period:</p>
<p><a href="http://www.scurvyrat.com/wp/wp-content/uploads/2011/06/Screen-shot-2011-06-28-at-5.05.11-PM.png"><img class="aligncenter size-full wp-image-179" title="120mAh battery test" src="http://www.scurvyrat.com/wp/wp-content/uploads/2011/06/Screen-shot-2011-06-28-at-5.05.11-PM.png" alt="" width="733" height="450" /></a></p>
<p>You can see the battery held fairly linear until the end, the dropped off quickly. Final battery voltage when it stopped: 3.461V. Which is less than I expected as it should be something like 4V if the datasheet for the LDO regulator is right (or I&#8217;m reading it right). The datasheet says it should be the output + dropout, in this case 3.3V + 750mV or around 4.050V.</p>
<p>I tried to charge the LiPo back up using the Ladyada charger, but it wouldn&#8217;t take the charge since the Jeenode was trying to pull from the battery at the same time as the USB was trying to charge the LiPo. Got some really bouncy voltages. More investigation required here. I&#8217;m put together a circuit board which has the MOSFET/Diode that is in the reference circuit, but left off this charger. When I get that built we can see if it solves this issue.</p>
<p><strong>EDIT </strong></p>
<p>Here is a bit of the schematic to answer the below comment.</p>
<p><a href="http://scurvyrat.com/wp/wp-content/uploads/2011/06/Screen-shot-2011-12-06-at-4.29.04-PM.png"><img class="alignleft size-full wp-image-249" title="Screen shot 2011-12-06 at 4.29.04 PM" src="http://scurvyrat.com/wp/wp-content/uploads/2011/06/Screen-shot-2011-12-06-at-4.29.04-PM.png" alt="" width="176" height="297" /></a>Just a simple <a href="http://en.wikipedia.org/wiki/Voltage_divider">voltage divider</a> to get the voltage from the Lipo (~4.2V) to something less than 3.3V. Since the resistors are the same value, I&#8217;m just halving the voltage.</p>
<p><a href="http://scurvyrat.com/wp/wp-content/uploads/2011/06/415e91d513b35ad4092e9c5eb59980f0.png"><img class="alignleft size-full wp-image-251" title="415e91d513b35ad4092e9c5eb59980f0" src="http://scurvyrat.com/wp/wp-content/uploads/2011/06/415e91d513b35ad4092e9c5eb59980f0.png" alt="" width="169" height="45" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://scurvyrat.com/2011/06/28/eflite-120mah-test-done/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Testing the Eflite 120mAh battery with a minimal jeenode</title>
		<link>http://scurvyrat.com/2011/06/17/testing-the-eflite-120mah-battery-with-a-minimal-jeenode/</link>
		<comments>http://scurvyrat.com/2011/06/17/testing-the-eflite-120mah-battery-with-a-minimal-jeenode/#comments</comments>
		<pubDate>Fri, 17 Jun 2011 16:58:31 +0000</pubDate>
		<dc:creator>mark</dc:creator>
				<category><![CDATA[Digital]]></category>
		<category><![CDATA[jeenode]]></category>
		<category><![CDATA[LiPo]]></category>

		<guid isPermaLink="false">http://www.scurvyrat.com/?p=167</guid>
		<description><![CDATA[I want to build some small wireless sensor nodes that run off small LiPo batteries and use small solar cells to charge the battery. I found some small LiPo batteries...]]></description>
			<content:encoded><![CDATA[<p>I want to build some small wireless sensor nodes that run off small LiPo batteries and use small solar cells to charge the battery. I found some small LiPo batteries that are used for RC Helicopters (see <a href="http://www.scurvyrat.com/2011/06/15/reading-lipo-voltage/" target="_blank">here</a>.) I need to test how this battery holds up over time. BTW, this battery has protection circuitry &#8212; <strong>not</strong> all eflite batteries have it. I consider this a necessity since these will be remote and cannot be watched while charging. The charging circuitry also has safety cut-offs for over/under voltage but given the potentially explosive nature of LiPo batteries, I think you can&#8217;t be too careful. Anyways, onto the fun.</p>
<p>So, I put together a small Jeenode setup with a single DS18S20 temp chip, 1 blue LED and a voltage divider circuit to measure the battery voltage. The jeenode is setup to:</p>
<ol>
<li>wake-up</li>
<li>turn on LED</li>
<li>read temp</li>
<li>read voltage</li>
<li>send to receiver via RF12B</li>
<li>wait for ACK</li>
<li>resend if necc, if got ACK then,</li>
<li>go to sleep for ~1 minute</li>
</ol>
<p>Pretty simple.</p>
<p>Here is the code:</p>
<pre>#include &lt;Ports.h&gt;
#include &lt;RF12.h&gt;
#include &lt;OneWire.h&gt;

#define DEBUG      1

// ACK stuff
#define RETRY_LIMIT     9   // maximum number of times to retry
#define ACK_TIME        10  // number of milliseconds to wait for an ack

#define NODE_ID         9  // my Node ID
OneWire ds1(4);

#if DEBUG
// LED Setup
Port led (2);
#endif

OneWire ds(4);

typedef struct {
 int temp1;
 int lipo_mV;
 int retries;
 int failed_packets;
}
Payload_temp;
Payload_temp m;  // m = measurement

ISR(WDT_vect) {
 Sleepy::watchdogEvent();
}  // interrupt handler for watchdog

static int readDS18S20() {
 ds1.reset();
 ds1.skip();
 ds1.write(0x4E); // write to scratchpad
 ds1.write(0);
 ds1.write(0);
 ds1.write(0x1F); // 12-bits is enough, measurement takes 750 msec
 ds1.reset();                               // Reset device
 ds1.skip();
 ds1.write(CONVERT,1);                      // Issue Convert command
 delay(1000);                             // maybe 750ms is enough, maybe not
 ds1.reset();                    // Reset device
 ds1.skip();
 ds1.write(READSCRATCH);                   // Read Scratchpad
 byte data[12];
 for (uint8_t j = 0; j &lt; 9; j++) {               // we need 9 bytes
 data[j] = ds1.read();
 }
 ds1.reset();

 if(OneWire::crc8(data,8) != data[8]) {
#if DEBUG
 Serial.println(" crc?");
#endif
 return 0;
 }
 int16_t raw = ((int16_t)data[1] &lt;&lt; <img src='http://scurvyrat.com/wp/wp-includes/images/smilies/icon_cool.gif' alt='8)' class='wp-smiley' /> | data[0];
 float celsius = ((float)(raw &gt;&gt; 1) - 0.25 +((float)(data[7] - data[6]) / (float)data[7]));
 return int(((celsius*1.8)+32)*100);
}

//------------------------------------------------------------------------------
// SETUP
//------------------------------------------------------------------------------
void setup () {
#if DEBUG
 Serial.begin(57600);
 Serial.println("\n[120mAh Test]");
 led.mode(OUTPUT);               // setup DIO pin as output
 led.mode2(INPUT);              // setup AIO pin as output
 led.digiWrite(HIGH);                // turn on BLUE led
#endif 
 m.temp1 = 0;
 rf12_initialize(NODE_ID, RF12_915MHZ, 212);  //nodeID //freqBand //netGroup
 //rf12_config();

}

//------------------------------------------------------------------------------
// LOOP
//------------------------------------------------------------------------------
void loop () {
 m.retries = 0;
 byte i;

#if DEBUG
 led.digiWrite(1);               // turn on GREEN led
#endif
 m.temp1 = readDS18S20();
 m.lipo_mV = (map(led.anaRead(),0,1023,0,3300))/0.68;

 rf12_sleep(RF12_WAKEUP);  // turn on radio
 for (i = 0; i &lt; RETRY_LIMIT; ++i) {
 m.retries = (int)i;
 while(!rf12_canSend())
 rf12_recvDone();
 rf12_sendStart(RF12_HDR_ACK,&amp;m,sizeof m);
 rf12_sendWait(0);
 byte acked = wait_for_ACK(); // from roomNode.pde
 //rf12_recvDone();

#if DEBUG
 Serial.print("Sending Attempt #");
 Serial.print(m.retries);
 Serial.print("  Failed Packets: ");
 Serial.print(m.failed_packets);
 Serial.print("  Temp: ");
 Serial.print(m.temp1);
 Serial.print("  Lipo mV: ");
 Serial.println(m.lipo_mV);
 delay(2);
#endif

 if(acked) {
 m.failed_packets = 0;
 # if DEBUG
 Serial.print(" --&gt; Got ACK  Failed Packets: ");
 Serial.println(m.failed_packets);
 delay(2);
 #endif
 break;
 }
 }

 if(i &gt;= RETRY_LIMIT) {
 ++m.failed_packets;
 #if DEBUG
 Serial.print("Incrementing Failed Packets  -- Failed Packets: ");
 Serial.println(m.failed_packets);
 delay(2);
 #endif
 }

#if DEBUG
 Serial.println("\n\n");
 led.digiWrite(0);               // turn off led 
#endif

 rf12_sleep(RF12_SLEEP);  // turn off radio
 Sleepy::loseSomeTime(60000);  // power down AVR for ~ 1 minute // 2000 for getting the temps etc...
}

//------------------------------------------------------------------------------
// wait a few milliseconds for proper ACK to me, return true if indeed received
// see http://talk.jeelabs.net/topic/811#post-4712
static byte wait_for_ACK() {
 MilliTimer ackTimer;
 while (!ackTimer.poll(ACK_TIME)) {
 if (rf12_recvDone() &amp;&amp; rf12_crc == 0 &amp;&amp; rf12_hdr == (RF12_HDR_DST | RF12_HDR_CTL | NODE_ID))
 return 1;
 }
 return 0;
}</pre>
<p>So far the node has been running for about 36 hours. The LiPo started at 4.197V according to the ADC (the voltage divider is using 5% resistors, so this may be off a bit, but good enough for this test).</p>
<p>Here is a graph after the first 36 hours:</p>
<p><a href="http://www.scurvyrat.com/wp/wp-content/uploads/2011/06/Screen-shot-2011-06-17-at-9.43.48-AM.png"><img class="aligncenter size-full wp-image-169" title="First 36 hours" src="http://www.scurvyrat.com/wp/wp-content/uploads/2011/06/Screen-shot-2011-06-17-at-9.43.48-AM.png" alt="" width="725" height="438" /></a></p>
<p>I find it interesting that the slope isn&#8217;t linear. The current voltage is 4.06V. So it burned through ~137mV. Pretty good. The hope is that this can run for at least a week. That should get through any dark periods between solar recharging. Of course, the LED probably sucks the most juice. The final product won&#8217;t have the LED or at least will have the option to turn it off (you can do so with the DEBUG var in the sketch). I may have that as an option to turn on/off the indicators remotely.</p>
<p>Here is a graph of a 5 hour  period:</p>
<p><a href="http://www.scurvyrat.com/wp/wp-content/uploads/2011/06/Screen-shot-2011-06-17-at-9.44.00-AM.png"><img class="aligncenter size-full wp-image-168" title="5 hour graph" src="http://www.scurvyrat.com/wp/wp-content/uploads/2011/06/Screen-shot-2011-06-17-at-9.44.00-AM.png" alt="" width="725" height="445" /></a></p>
<p>You can clearly see how the battery steps down. Pretty cool. More to come as the experiment progresses.</p>
<p><strong>UPDATE: </strong></p>
<p>So its been a week. Here is the graph:</p>
<p><a href="http://www.scurvyrat.com/wp/wp-content/uploads/2011/06/Screen-shot-2011-06-22-at-11.57.19-PM.png"><img class="aligncenter size-full wp-image-174" title="7 day chart" src="http://www.scurvyrat.com/wp/wp-content/uploads/2011/06/Screen-shot-2011-06-22-at-11.57.19-PM.png" alt="" width="727" height="443" /></a></p>
<p>Current voltage reading is 3.87V, therefore we have used ~ .327V over 7 days. 10,080 data transmissions! I think this is a tribute to JCW @ <a href="http://www.jeelabs.org" target="_blank">Jeelabs</a> for developing a sleep setup that really limits the current draw. The MCP1702 says it wants about ~525mA above V<sub>REG</sub> which should equal3.825V. Hmmm. Curious to see when the system goes down&#8230;.</p>
]]></content:encoded>
			<wfw:commentRss>http://scurvyrat.com/2011/06/17/testing-the-eflite-120mah-battery-with-a-minimal-jeenode/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Reading Lipo Voltage</title>
		<link>http://scurvyrat.com/2011/06/15/reading-lipo-voltage/</link>
		<comments>http://scurvyrat.com/2011/06/15/reading-lipo-voltage/#comments</comments>
		<pubDate>Wed, 15 Jun 2011 21:50:12 +0000</pubDate>
		<dc:creator>mark</dc:creator>
				<category><![CDATA[Digital]]></category>
		<category><![CDATA[LiPo]]></category>

		<guid isPermaLink="false">http://www.scurvyrat.com/?p=157</guid>
		<description><![CDATA[I&#8217;m testing a mini LiPo battery to see how long it will power a Jeenode. I bought this battery: It is listed as a 3.7V, 120mAh 1S 14C LiPo battery....]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m testing a mini LiPo battery to see how long it will power a Jeenode. I bought this battery:</p>
<p><a href="http://www.scurvyrat.com/wp/wp-content/uploads/2011/06/eflb1201s.jpg"><img class="aligncenter size-full wp-image-158" title="eflb1201s" src="http://www.scurvyrat.com/wp/wp-content/uploads/2011/06/eflb1201s.jpg" alt="" width="300" height="300" /></a>It is listed as a 3.7V, 120mAh 1S 14C LiPo battery. It is mainly used in mini RC helicopters.</p>
<p>It appears to have a JST-XH series connector which mates with a JST micro male.</p>
<p>I want to read the voltage of the battery as it runs the sketch.</p>
<p>Connecting a voltage divider to an analog pin allows me to read the voltage of the LiPo. Since:</p>
<pre><a href="http://www.scurvyrat.com/wp/wp-content/uploads/2011/06/vdivider.png"><img class="aligncenter size-full wp-image-159" title="vdivider" src="http://www.scurvyrat.com/wp/wp-content/uploads/2011/06/vdivider.png" alt="" width="169" height="45" /></a></pre>
<p>Vin might be as high as 4.5V. So if R1=4.7k and R2=10k, we get a divider that should give us a range below 3.3V for the analog read. Vin of 4.5V would give a Vo of 3.06V.</p>
<p>To get voltage out we would then need to take the analog read of the pin, map it to 3.3V and divide it by the 0.68 from the resistor dividor. Or:</p>
<pre>int volts = (map(led.anaRead(),0,1023,0,3300))/0.68;</pre>
<p>The 3300 comes from the 3.3V analog internal reference voltage of the Jeenode.</p>
<p>Fully charged, according to the LiPo charger results in a reading of 4202 or 4.2V. Perfect.</p>
<p><strong>Update</strong>: It appears the connector is a micro min JST connector. I can&#8217;t find a matching connector from JST, but there are cables on Ebay. JST website isn&#8217;t the best to find products&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://scurvyrat.com/2011/06/15/reading-lipo-voltage/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Reading the ARSSI pin on the Si4221/HopeRF 12B</title>
		<link>http://scurvyrat.com/2011/06/14/reading-the-arssi-pin-on-the-si4221hoperf-12b/</link>
		<comments>http://scurvyrat.com/2011/06/14/reading-the-arssi-pin-on-the-si4221hoperf-12b/#comments</comments>
		<pubDate>Tue, 14 Jun 2011 21:51:53 +0000</pubDate>
		<dc:creator>mark</dc:creator>
				<category><![CDATA[Digital]]></category>
		<category><![CDATA[hopeRF]]></category>
		<category><![CDATA[RF12]]></category>
		<category><![CDATA[si4221]]></category>

		<guid isPermaLink="false">http://www.scurvyrat.com/?p=150</guid>
		<description><![CDATA[The Si4221 has a digital received signal strength indicator (RSSI). You can set a threshold in the configuration and the pin will go low when that threshold has been broken....]]></description>
			<content:encoded><![CDATA[<p>The Si4221 has a digital received signal strength indicator (RSSI). You can set a threshold in the configuration and the pin will go low when that threshold has been broken. It is handy but not as useful as an analog signal. Luckily, the Si4221 also has an analog signal.</p>
<p>There has been a bunch written about this signal. You can read about it <a href="http://www.mikrocontroller.net/topic/65984#541030" target="_blank">here</a> (German, with photo), <a href="http://blog.strobotics.com.au/2008/06/17/rfm12-tutorial-part2/" target="_blank">here</a> and <a href="http://jeelabs.org/2009/12/25/ook-reception-with-rfm12b/#comments" target="_blank">here</a>. There is work to translate this signal to an OOK scheme.</p>
<p>You need to attach a small capacitor to PIN 15. The datasheet recommends a value of 1nF or larger. I contacted Silicon Labs&#8217; tech support and they recommend a 10nF for a 1ms sampling time. They also said that the signal will be relatively noisy as the cap charges/discharges (~10/15 mV) so it is best to smooth the readings over several samples. They said you could use as small as a 1nF cap, for faster sampling, but the noise will be greater. Just to make it clear, the HopeRF datasheet recommends a 4.7nF cap.</p>
<p>The ARSSI value will change from chip to chip so for absolute measurements, you&#8217;ll need to do some characterization. For relative signal strength, it should be fine as the signal stays linear.</p>
<p>I was sent the following graph:</p>
<p><a href="http://www.scurvyrat.com/wp/wp-content/uploads/2011/06/38457_ARSSI_vs_InputPower_Si4421.png"><img class="aligncenter size-full wp-image-151" title="38457_ARSSI_vs_InputPower_Si4421" src="http://www.scurvyrat.com/wp/wp-content/uploads/2011/06/38457_ARSSI_vs_InputPower_Si4421.png" alt="" width="406" height="426" /></a></p>
<p>As you can see, the voltage is going to range between 300-1300mV. Interestingly, the graph in the datasheet is slightly different:</p>
<p>&nbsp;</p>
<p><a href="http://www.scurvyrat.com/wp/wp-content/uploads/2011/06/Screen-shot-2011-06-14-at-7.39.55-AM.png"><img class="aligncenter size-full wp-image-152" title="Screen shot 2011-06-14 at 7.39.55 AM" src="http://www.scurvyrat.com/wp/wp-content/uploads/2011/06/Screen-shot-2011-06-14-at-7.39.55-AM.png" alt="" width="623" height="332" /></a></p>
<p>where the range is 450-1150mV over the same -100dbm to -65dbm.</p>
<p>I connected a wire to the side of the 4.7uF cap that is on the RF12B module to an analog pin. I got around the range expected when receiving packets (I had the node set as 31 so it was looking for all packets for its group). I seems not to be so useful as you would need to poll it constantly when receiving packets and who knows, it might get in the way of getting that packet or ACK.</p>
]]></content:encoded>
			<wfw:commentRss>http://scurvyrat.com/2011/06/14/reading-the-arssi-pin-on-the-si4221hoperf-12b/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>DHCP on the ENC28J60</title>
		<link>http://scurvyrat.com/2011/06/07/dhcp-on-the-enc28j60/</link>
		<comments>http://scurvyrat.com/2011/06/07/dhcp-on-the-enc28j60/#comments</comments>
		<pubDate>Tue, 07 Jun 2011 16:28:54 +0000</pubDate>
		<dc:creator>mark</dc:creator>
				<category><![CDATA[Digital]]></category>

		<guid isPermaLink="false">http://www.scurvyrat.com/?p=138</guid>
		<description><![CDATA[Exciting news! Andy has created a new library for Arduino that includes DHCP. JCW has got it working on Jeenodes it appears. Follow it here. Code is available on Github...]]></description>
			<content:encoded><![CDATA[<p>Exciting news!</p>
<p>Andy has created a new library for Arduino that includes DHCP. JCW has got it working on Jeenodes it appears.</p>
<p>Follow it <a href="http://blog.thiseldo.co.uk/?p=570" target="_blank">here</a>.</p>
<p>Code is available on Github <a href="https://github.com/thiseldo/EtherShield" target="_blank">here</a>.</p>
<p>Will give it a go shortly on my Jeenode/EtherCard setup.</p>
]]></content:encoded>
			<wfw:commentRss>http://scurvyrat.com/2011/06/07/dhcp-on-the-enc28j60/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Silicon Labs&#8217; RF chips</title>
		<link>http://scurvyrat.com/2011/06/06/silicon-labs-chips/</link>
		<comments>http://scurvyrat.com/2011/06/06/silicon-labs-chips/#comments</comments>
		<pubDate>Mon, 06 Jun 2011 14:19:28 +0000</pubDate>
		<dc:creator>mark</dc:creator>
				<category><![CDATA[Digital]]></category>
		<category><![CDATA[hopeRF]]></category>
		<category><![CDATA[RF12]]></category>
		<category><![CDATA[si4221]]></category>
		<category><![CDATA[silicon labs]]></category>

		<guid isPermaLink="false">http://www.scurvyrat.com/?p=116</guid>
		<description><![CDATA[Just a few notes about Silicon Labs chips and HopeRF modules. All the info is in the datasheets or online, but I like to keep use the blog to keep...]]></description>
			<content:encoded><![CDATA[<p>Just a few notes about Silicon Labs chips and HopeRF modules. All the info is in the datasheets or online, but I like to keep use the blog to keep track of my findings and thoughts.</p>
<p>The HopeRF modules use chips from <a href="http://www.silabs.com/" target="_blank">Silicon Labs</a>. The RF12B uses the  Si4421 (<a href="http://www.silabs.com/pages/DownloadDoc.aspx?FILEURL=Support%20Documents/TechnicalDocs/Si4421.pdf&amp;src=DocumentationWebPart" target="_blank">datasheet</a>). Jeenodes from <a href="http://jeelabs.org/" target="_blank">Jeelabs</a> uses these modules and they work well. These chips are from Silicon Labs&#8217; EasyRadio set of chips. I believe Silicon Labs purchased Integration which made the original chips, in June 2008.</p>
<p>Silicon Labs also makes several other interesting modules which HopeRF have turned into modules. Mainly, the RF22B which has up to +20db output power @ 89 mA TX. These come from the EasyRadio PRO chips. The <a href="http://www.silabs.com/products/wireless/EZRadioPRO/Pages/Si44303132.aspx">Si4430/31/32</a> chips looks very interesting. Some people have done some work on drivers for the Arduino, but they may not be as used as Jeelabs RF12 library. Specifically, mikem seems to have done a lot of work getting a good driver for the RF22B. Read about it <a href="http://www.open.com.au/mikem/arduino/RF22/index.html" target="_blank">here</a>.</p>
<p>Silicon Labs has the RFM23B HopeRF modules listed on their website <a href="http://www.silabs.com/products/wireless/Pages/Hope-Microelectronics-Wireless-Module.aspx" target="_blank">here</a> &#8212; one interesting aspect is that they are pre-certified which would help in getting any product certified. As with a lot of wireless technologies they are aiming at the green energy market (smart meters, solar, etc&#8230;) These use the Si4431 chipset. (<a href="http://www.reuters.com/article/2011/04/06/idUS221142+06-Apr-2011+BW20110406" target="_blank">Press Release</a>)</p>
<p>It seems the chips can do a wide range of frequencies, but the 433MHZ need different supporting resistors and capacitors. The 833MHZ and 915MHZ use the same supporting parts.</p>
<p>Digikey sells the Si4421-A1-FT for $2.88/each, $2.77/25s or $2.69/100s. Mouser has the Si4421-A1-FT for $5.03/1 or $3.97/25s or $2.94/100s. Interesting that digikey has the price of 1 less than the price for when buying a 100 from Mouser. Pays to comparison shop. The crystal is about $1. That already puts it above what the module costs direct from HopeRF.</p>
<p><a href="http://www.scurvyrat.com/wp/wp-content/uploads/2011/06/Screen-shot-2011-06-05-at-8.54.47-PM.png"><img class="aligncenter size-full wp-image-117" title="Si4221 Pinout" src="http://www.scurvyrat.com/wp/wp-content/uploads/2011/06/Screen-shot-2011-06-05-at-8.54.47-PM.png" alt="" width="386" height="249" /></a></p>
<p>That said, it would be neat to make a small board with all the necessary components and with a SMA or RP-SMA connector for a more robust antenna. (I&#8217;ve had 3 of the 4 Jeenodes&#8217; antennas break-off since I&#8217;ve had them and I&#8217;m relatively careful with them &#8212; the antenna that comes from Modern Devices is stranded and seems to be relatively weak. I replaced them with a solid core wire and it seems a bit better. Not sure which is better for RX/TX but they are working fine with the replacement antennas.</p>
<p>Of course, the downside to building the chips onto the same board is that the supporting caps and resistors are tuned for the frequencies so you&#8217;d have to keep 2 versions stuffed with different chips instead of just shipping out a different module.<a href="http://www.scurvyrat.com/wp/wp-content/uploads/2011/06/Screen-shot-2011-06-05-at-8.57.29-PM.png"><img class="aligncenter size-full wp-image-119" title="HopeRF's RF12B -- older style chip" src="http://www.scurvyrat.com/wp/wp-content/uploads/2011/06/Screen-shot-2011-06-05-at-8.57.29-PM.png" alt="" width="274" height="272" /></a></p>
<p>The above is an older version of the module. It has 9 components and the crystal, plus the main chip of course. Interestingly, the newer version below has 8 components as well as the different main chip format. You can see the area at the bottom center that was left unstuffed. (Note: I rotated the image so it aligns with the pinout diagram below).</p>
<p style="text-align: center;"><a href="http://www.scurvyrat.com/wp/wp-content/uploads/2011/06/DSC_28321.jpg"><img class="aligncenter size-full wp-image-148" title="DSC_2832" src="http://www.scurvyrat.com/wp/wp-content/uploads/2011/06/DSC_28321.jpg" alt="" width="400" height="397" /></a></p>
<p style="text-align: left;">Here is the pinout for the module:</p>
<p style="text-align: left;"><a href="http://www.scurvyrat.com/wp/wp-content/uploads/2011/06/Screen-shot-2011-06-08-at-2.31.18-PM.png"><img class="aligncenter size-full wp-image-147" title="RF12B Pinout/HopeRF" src="http://www.scurvyrat.com/wp/wp-content/uploads/2011/06/Screen-shot-2011-06-08-at-2.31.18-PM.png" alt="" width="484" height="304" /></a></p>
<p>The datasheet shows a typical application shown below:</p>
<p><a href="http://www.scurvyrat.com/wp/wp-content/uploads/2011/06/Screen-shot-2011-06-05-at-9.36.58-PM.png"><img class="aligncenter size-full wp-image-120" title="si4421 Typical Application -- copyright Silicon Labs" src="http://www.scurvyrat.com/wp/wp-content/uploads/2011/06/Screen-shot-2011-06-05-at-9.36.58-PM.png" alt="" width="517" height="401" /></a></p>
<p>The Si4221 needs:</p>
<ul>
<li>X1 &#8211; 10MHZ Crystal (can share with the microprocessor &#8211; but that would make it not a normal Arduino I think)</li>
<li>C1 &#8211; 2.2μF</li>
<li>C2 &#8211; 10nF</li>
<li>C3 &#8211; different for each ISM band (433MHZ &#8211; 220pF, 868MHZ &#8211; 47pF, 915MHZ &#8211; 33pF)</li>
<li>C2 &amp; C3 should be 0603 ceramic capacitors</li>
<li>C4 is listed as optional and is connected to the ARSSI pin</li>
</ul>
<p>The rest of the components on the RF12B chip must be for the matching network for the antenna. From what I can understand, from my non-existent knowledge of antenna design, the matching network transforms the high impedance of the antenna to the low impedance needed for the transceiver to limit any power loss/reflectance.</p>
<p>In the Si4421&#8242;s datasheet it shows a schematic of their evaluation board (page 39) with a 50 ohm matching network. The parts of the matching network are:</p>
<ul>
<li>4 ceramic inductors  (L1-L4) in nH (nanoHenrys)</li>
<li>4 capacitors (C8-C11) C11 listed as optional</li>
</ul>
<p>different values for each depending on what frequency band you are after. The three RF inductors&#8217;s SRF (self resonant frequency), DCR (DC resistance) and Q should be similar. A high Q has low insertion loss which minimized power consumption.</p>
<p>Hmmm, on the HopeRF board there are 8 or 9 small components where as the reference design has 10 or 12, depending if you include the optional parts. Guess the reference design&#8217;s matching network is more complex.</p>
<p>The Jeenode connects only the 5 required connections: SCL, SCK, MOSI, MISO and IRQ. There is not a connection to the ARSSI or any of the other optional pins such as FFS and FFIT.</p>
]]></content:encoded>
			<wfw:commentRss>http://scurvyrat.com/2011/06/06/silicon-labs-chips/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

