<?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>Digit's Domotica Blog</title>
	<atom:link href="http://blog.hekkers.net/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.hekkers.net</link>
	<description>My Weblog about Domotica and more</description>
	<lastBuildDate>Sat, 31 Jul 2010 10:42:33 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Remote sensor programming</title>
		<link>http://blog.hekkers.net/2010/07/31/remote-sensor-programming/</link>
		<comments>http://blog.hekkers.net/2010/07/31/remote-sensor-programming/#comments</comments>
		<pubDate>Sat, 31 Jul 2010 10:42:33 +0000</pubDate>
		<dc:creator>Robert Hekkers</dc:creator>
				<category><![CDATA[Domotica]]></category>

		<guid isPermaLink="false">http://blog.hekkers.net/?p=1204</guid>
		<description><![CDATA[Now that i&#8217;m very confident that my interrupt-driven motion sensor is finished, i was wondering what else there is to add; the first thing that comes to my mind is remotely adjusting the way the sketch works; no i don&#8217;t mean uploading a whole new sketch, but adjusting some parameters. For example, it should be [...]]]></description>
			<content:encoded><![CDATA[<p>Now that i&#8217;m very confident that my interrupt-driven motion sensor is finished, i was wondering what else there is to add; the first thing that comes to my mind is remotely adjusting the way the sketch works; no i don&#8217;t mean uploading a whole new sketch, but adjusting some parameters. For example, it should be relatively easy to adjust the heartbeat interval, or the motion report interval. Or disable sending the additional information in the packet that is being sent (packet size reduction = power reduction!); or disable motion reporting completely, e.g. disabling the sensor temporarily! What else can i think of?  <img src='http://blog.hekkers.net/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />  It <em>does</em> sound like something that&#8217;s nice to have&#8230;</p>
<p>The question is, do i really need it? Or shall i proceed with a door/window sensor? Or go on building these motion sensors until i have replaced all the MS13 sensors i removed from my house some time ago and the few that are still being used? Or first finish the LED strips&#8230; tough choices!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.hekkers.net/2010/07/31/remote-sensor-programming/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Motion sensor v2 built and in use</title>
		<link>http://blog.hekkers.net/2010/07/29/motion-sensor-v2-built-and-in-use/</link>
		<comments>http://blog.hekkers.net/2010/07/29/motion-sensor-v2-built-and-in-use/#comments</comments>
		<pubDate>Thu, 29 Jul 2010 20:18:43 +0000</pubDate>
		<dc:creator>Robert Hekkers</dc:creator>
				<category><![CDATA[Domotica]]></category>
		<category><![CDATA[JeeNodes]]></category>
		<category><![CDATA[motion sensor]]></category>
		<category><![CDATA[Sensors]]></category>
		<category><![CDATA[Zigbee]]></category>

		<guid isPermaLink="false">http://blog.hekkers.net/?p=1207</guid>
		<description><![CDATA[Two motion sensors v2 are in use right now, yippee! I upgraded an existing v1 sensor to a v2 and built a new one. The v2 sensor specs are very different from the v1 but much more promising, yet all i needed to do to was soldering the digital output of the PIR to another [...]]]></description>
			<content:encoded><![CDATA[<p>Two motion sensors v2 are in use right now, yippee!</p>
<p>I upgraded an <a href="http://blog.hekkers.net/2010/06/20/new-motion-sensor-in-use/" target="_self">existing v1 sensor</a> to a v2 and built a new one. The v2 sensor specs are very different from the v1 but much more  promising, yet all i needed to do to was soldering the digital output of  the PIR to another JeeNode port (namely ATmega INT1) and use a different digital port for serial I/O with the XBee. Oh, and upload a new  sketch of course. Now i have 2 identical v2 sensors:</p>
<div id="attachment_1215" class="wp-caption alignnone" style="width: 431px"><a href="http://blog.hekkers.net/wp-content/uploads/2010/07/DSC_3429_resize.jpg"><img class="size-full wp-image-1215" title="v1 upgraded to v2" src="http://blog.hekkers.net/wp-content/uploads/2010/07/DSC_3429_resize.jpg" alt="" width="421" height="280" /></a><p class="wp-caption-text">v1 upgraded to v2</p></div>
<p>Looking back at how this motion sensor evolved i am wondering, why didn&#8217;t i think of <a href="http://blog.hekkers.net/2010/07/25/really-powering-down-this-time/" target="_self">interrupts</a> in the first place&#8230; not very smart actually..</p>
<p>Or maybe i <em>did</em> think about interrupts but unconsciously thought it would be to hard for me to handle already, cause that&#8217;s what you read all the time: interrupts are a tough subject! Maybe it is, but i didn&#8217;t notice that yet! <img src='http://blog.hekkers.net/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>So now I&#8217;ve got 2 motion sensors with the following features:</p>
<ul>
<li>powered by 3 * 1.2V, 2000 mAh rechargeable batteries;</li>
<li>PIR with digital output, 100µA standby power usage and 5m detection range;</li>
<li>a JeeNode that&#8217;s effectively running only a total of about 180 seconds per day (0.2 %), even with 350-400 motion reports and lots of heartbeats. The rest of the time the JeeNode is in power down mode;</li>
<li>it&#8217;s ZigBee based which is better than 433 MHz in my opinion, especially when you&#8217;ve got a lot of sensors;</li>
<li>relatively small sensor housing compared to commercial (mostly big and ugly) products;</li>
<li>completely DIY so everything is how i want it to be;</li>
<li>interrupt-based, the best you can get I&#8217;d say;</li>
<li>need i go on?  <img src='http://blog.hekkers.net/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </li>
</ul>
<p>I&#8217;m gonna monitor this sensor very closely in the coming months and learn from it. Here you see one of the sensors being used in the kitchen:</p>
<div id="attachment_1214" class="wp-caption alignnone" style="width: 431px"><a href="http://blog.hekkers.net/wp-content/uploads/2010/07/DSC_3432_resize.jpg"><img class="size-full wp-image-1214" title="Motion v2 in the kitchen" src="http://blog.hekkers.net/wp-content/uploads/2010/07/DSC_3432_resize.jpg" alt="" width="421" height="280" /></a><p class="wp-caption-text">Motion v2 in the kitchen</p></div>
<p>The sketch that&#8217;s currently running on these sensors can be found <a href="http://www.hekkers.net/files/Motionv2_20100729.txt">here</a>.</p>
<p>Finished? Almost; some loose ends in the sketch. Maybe it can be made even smaller/faster/less energy consuming. But I&#8217;ll look into that when the 3rd sensor is built.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.hekkers.net/2010/07/29/motion-sensor-v2-built-and-in-use/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Motion Sensor v2</title>
		<link>http://blog.hekkers.net/2010/07/27/motion-sensor-v2/</link>
		<comments>http://blog.hekkers.net/2010/07/27/motion-sensor-v2/#comments</comments>
		<pubDate>Tue, 27 Jul 2010 22:08:34 +0000</pubDate>
		<dc:creator>Robert Hekkers</dc:creator>
				<category><![CDATA[Domotica]]></category>
		<category><![CDATA[JeeNodes]]></category>
		<category><![CDATA[motion sensor]]></category>
		<category><![CDATA[Sensors]]></category>

		<guid isPermaLink="false">http://blog.hekkers.net/?p=1192</guid>
		<description><![CDATA[Here it is, Motion Sensor v2. Not much different from v1 really, the only thing that has changed is that the PIR output has moved to an interrupt pin. And the sketch looks somewhat different here and there. Later this week i&#8217;ll build my 2nd motion sensor and start using it right away; i&#8217;m very [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://blog.hekkers.net/wp-content/uploads/2010/07/DSC_3425_resize.jpg"><img class="alignnone size-full wp-image-1202" title="Motion Sensor v2" src="http://blog.hekkers.net/wp-content/uploads/2010/07/DSC_3425_resize.jpg" alt="" width="421" height="280" /></a></p>
<p>Here it is, Motion Sensor v2. Not much different from v1 really, the only thing that has changed is that the PIR output has moved to an interrupt pin. And the sketch looks somewhat different here and there. Later this week i&#8217;ll build my 2nd motion sensor and start using it right away; i&#8217;m very curious about the results! I&#8217;ll also change my 1st motion sensor that&#8217;s already in use, to an interrupt driven model. Don&#8217;t want to wait for what will happen with those batteries&#8230;</p>
<p>The <a href="http://cafe.jeelabs.net/lab/jn4/" target="_blank">JeeNode</a> is completely powered down most of the time. It only gets woken up by the Watchdog timer every 8 seconds or when motion is detected. But even when motion is detected, it&#8217;s powered down most of the time, cause a &#8216;blip&#8217; sent to my <a href="http://www.hekkers.net/domotica/" target="_blank">Domotica System</a> every 4 seconds during continuous motion is more than enough.</p>
<p>When the motion interrupt is triggered, the &#8216;blip&#8217; is sent to my system, followed by a power down for 4 seconds <em>without</em> interrupt trigger set. When those 4 seconds have passed (wake up is done by the watchdog timer) a power down is done <em>with</em> interrupt trigger and the whole loop starts all over again. Capice? It doesn&#8217;t get much easier than this <img src='http://blog.hekkers.net/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>And of course there&#8217;s a heartbeat sent every 64 (8 times 8 ) seconds.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.hekkers.net/2010/07/27/motion-sensor-v2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Adding Sense Control</title>
		<link>http://blog.hekkers.net/2010/07/26/adding-sense-control/</link>
		<comments>http://blog.hekkers.net/2010/07/26/adding-sense-control/#comments</comments>
		<pubDate>Mon, 26 Jul 2010 19:18:09 +0000</pubDate>
		<dc:creator>Robert Hekkers</dc:creator>
				<category><![CDATA[Domotica]]></category>
		<category><![CDATA[Arduino]]></category>
		<category><![CDATA[JeeNodes]]></category>
		<category><![CDATA[motion sensor]]></category>
		<category><![CDATA[Sensors]]></category>

		<guid isPermaLink="false">http://blog.hekkers.net/?p=1184</guid>
		<description><![CDATA[While i was quite happy yesterday with the new way i&#8217;m going to handle things on the JeeNode regarding the motion sensor (PIR), i already knew i wasn&#8217;t finished yet; this was nice, but only a first step. Cause what i had created was an IRQ being fired when the input becomes low. Well, the [...]]]></description>
			<content:encoded><![CDATA[<p>While i was quite happy <a href="http://blog.hekkers.net/2010/07/25/really-powering-down-this-time/" target="_self">yesterday</a> with the new way i&#8217;m going to handle things on the JeeNode regarding the motion sensor (PIR), i already knew i wasn&#8217;t finished yet; this was nice, but only a first step.</p>
<p>Cause what i had created was an IRQ being fired when the input becomes low. Well, the PIR output becomes high when there&#8217;s motion detected, so this is unusable, actually. For a brief moment i considered using a transistor as a NOT gate to invert the PIR output, but there had to be an easier way. Why would you only be able to activate an External Interrupt when a pin becomes low?? I read some topics on various forums, but those were very contradictory; some said i could, some said otherwise. OK, in that case, i&#8217;ll sort it out myself .. cause i really need interrupts based on a rise or a change!</p>
<p>Page 71 of the ATmega datasheet learned me that INT0 and INT1 indeed have Interrupt Sense Control and it&#8217;s only a matter of setting the right bits in the External Interrupt Control Register A, aka EICRA:</p>
<div id="attachment_1187" class="wp-caption aligncenter" style="width: 700px"><a href="http://blog.hekkers.net/wp-content/uploads/2010/07/Capture26-7-2010-21.06.53.png"><img class="size-full wp-image-1187" title="Bit 3 and 2 of EICRA" src="http://blog.hekkers.net/wp-content/uploads/2010/07/Capture26-7-2010-21.06.53.png" alt="" width="690" height="165" /></a><p class="wp-caption-text">Bit 3 and 2 of EICRA</p></div>
<p>So it can be done, only thing is to figure out how&#8230;</p>
<p>The Arduino attachInterrupt() function has a 2nd parameter with which you can control what triggers an interrupt; the values are the constants LOW, CHANGE, RISING and FALLING (found in wiring.h). So why didn&#8217;t that nice Sleep library i found earlier have this feature? All i can do is call this function:</p>
<pre>void SleepClass::powerDownAndWakeupExternalEvent(uint8_t interruptNumber)
{
 attachInterrupt(interruptNumber, SleepClass::external_event_handler, LOW);
 set_sleep_mode_and_sleep(SLEEP_MODE_PWR_DOWN);
 detachInterrupt(interruptNumber);
}
</pre>
<p>OK; changing things in the library depending on the kind of Sense Control i need for a specific sensor type is not an option of course, so i added a 2nd parameter to that function:</p>
<pre>void SleepClass::powerDownAnd...Event(uint8_t interruptNumber, int mode)
{
 attachInterrupt(interruptNumber, SleepClass::external_event_handler, mode);
 set_sleep_mode_and_sleep(SLEEP_MODE_PWR_DOWN);
 detachInterrupt(interruptNumber);
</pre>
<p>}</p>
<p>That&#8217;s better; now i can choose whatever Sense Control I want; I&#8217;ve checked all of them right away:</p>
<pre>Sleep.powerDownAndWakeupExternalEvent(0, RISING);</pre>
<p>What a surprise, its working, all of them! RISING is just what i need right now for the PIR; CHANGE is what i would need for a door sensor.</p>
<p>Now i&#8217;m already modifying libraries and I can even understand what</p>
<pre>EICRA = (EICRA &amp; ~((1 &lt;&lt; ISC00) | (1 &lt;&lt; ISC01))) | (mode &lt;&lt; ISC00);</pre>
<p>does&#8230; i wonder where or when (if ever) this will end&#8230;</p>
<p>But I&#8217;m still not finished! Cause with all this powering down going on, it has become increasingly hard to keep a notion of time; millis() has become useless cause how can i determine the time that has passed since the last power down? On the other hand, do i really need to know that? Time will tell <img src='http://blog.hekkers.net/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.hekkers.net/2010/07/26/adding-sense-control/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Really powering down this time</title>
		<link>http://blog.hekkers.net/2010/07/25/really-powering-down-this-time/</link>
		<comments>http://blog.hekkers.net/2010/07/25/really-powering-down-this-time/#comments</comments>
		<pubDate>Sun, 25 Jul 2010 15:01:42 +0000</pubDate>
		<dc:creator>Robert Hekkers</dc:creator>
				<category><![CDATA[Domotica]]></category>
		<category><![CDATA[Arduino]]></category>
		<category><![CDATA[JeeNodes]]></category>
		<category><![CDATA[motion sensor]]></category>
		<category><![CDATA[Sensors]]></category>

		<guid isPermaLink="false">http://blog.hekkers.net/?p=1174</guid>
		<description><![CDATA[Having a first set of batteries empty wasn&#8217;t  funny.. they lasted only 7 weeks! Way to short. And i kept on thinking that it might not have been caused by a bad battery.. what could i do next? Wait another 7 weeks to find out that I&#8217;m wrong? Neh.. that didn&#8217;t feel the right thing [...]]]></description>
			<content:encoded><![CDATA[<p>Having a first set of batteries empty wasn&#8217;t <a href="http://blog.hekkers.net/2010/07/24/new-batteries/" target="_self"> funny</a>.. they lasted only 7 weeks! Way to short. And i kept on thinking that it might <em>not</em> have been caused by a bad battery.. what could i do next? Wait another 7 weeks to find out that I&#8217;m wrong? Neh.. that didn&#8217;t feel the right thing to do; Power down as much as possible and use an external interrupt would possibly give the best results anyway, so why not start with that right now!</p>
<p>I started with attaching a push-button to an Arduino, using a pull-up resistor to keep the input high when the button isn&#8217;t pressed:</p>
<div id="attachment_1176" class="wp-caption aligncenter" style="width: 610px"><a href="http://blog.hekkers.net/wp-content/uploads/2010/07/DSC_3424c_resize.jpg"><img class="size-full wp-image-1176" title="Arduino with push-button" src="http://blog.hekkers.net/wp-content/uploads/2010/07/DSC_3424c_resize.jpg" alt="" width="600" height="250" /></a><p class="wp-caption-text">Arduino with push-button</p></div>
<p>After that i started reading about interrupts. Here&#8217;s a table that shows the Wake-up sources that are available in the various sleep modes:</p>
<div id="attachment_1175" class="wp-caption aligncenter" style="width: 628px"><a href="http://blog.hekkers.net/wp-content/uploads/2010/07/Capture25-7-2010-16.10.27.png"><img class="size-full wp-image-1175 " title="ATmega48PA/88PA/168PA/328P Wake-up sources" src="http://blog.hekkers.net/wp-content/uploads/2010/07/Capture25-7-2010-16.10.27.png" alt="" width="618" height="302" /></a><p class="wp-caption-text">ATmega48PA/88PA/168PA/328P Wake-up sources</p></div>
<p>Both things i need are available: INT0 and/or INT1 and the Watchdog Timer, so it was time to start sketching <img src='http://blog.hekkers.net/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>After 5 different sketches with all the same miserable results (freezing Arduino), i finally found a <a href="http://code.google.com/p/arms22/downloads/detail?name=Sleep003.zip&amp;can=2&amp;q=" target="_blank">sleep library</a> that did exactly what i wanted. I combined this library with code i had found <a href="http://blog.hekkers.net/2009/12/25/atmega328-and-its-watchdog-timer/" target="_self">earlier</a> regarding setting up and using the Watchdog Timer, and what i have now, is just what i need. Below a sample of the Serial Monitor output and <a href="http://www.hekkers.net/files/INTerrupt_6.txt" target="_blank">here</a> is the sketch that produced it.</p>
<pre>39171 I'm awake, caused by the WDT
39205 Sleeping...
39327 I'm awake, caused by the WDT
39362 Sleeping...
39484 I'm awake, caused by the WDT
39519 Sleeping...
39640 I'm awake, caused by the WDT
39674 Sleeping...
39796 I'm awake, caused by INT0
Doing some work...finished!
40257 Sleeping...
40377 I'm awake, caused by INT0
Doing some work...finished!
40839 Sleeping...
40960 I'm awake, caused by INT0
Doing some work...finished!
41421 Sleeping...
41542 I'm awake, caused by the WDT
41577 Sleeping...
41698 I'm awake, caused by INT0
Doing some work...finished!
42160 Sleeping...
42280 I'm awake, caused by the WDT
42315 Sleeping...
42437 I'm awake, caused by the WDT
42472 Sleeping...
42593 I'm awake, caused by the WDT
42628 Sleeping...

etc. etc.
</pre>
<p>Cool stuff! <img src='http://blog.hekkers.net/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />  Let&#8217;s see how we can change the <a href="http://blog.hekkers.net/2010/06/20/new-motion-sensor-in-use/" target="_self">motion sensor</a> to make use of this!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.hekkers.net/2010/07/25/really-powering-down-this-time/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>One problem less</title>
		<link>http://blog.hekkers.net/2010/07/25/one-problem-less/</link>
		<comments>http://blog.hekkers.net/2010/07/25/one-problem-less/#comments</comments>
		<pubDate>Sun, 25 Jul 2010 07:42:14 +0000</pubDate>
		<dc:creator>Robert Hekkers</dc:creator>
				<category><![CDATA[Domotica]]></category>

		<guid isPermaLink="false">http://blog.hekkers.net/?p=1166</guid>
		<description><![CDATA[A sudden memory increase yesterday morning made me aware that there was something wrong in my system. Memory usage was increasing fast, while the memory count wasn&#8217;t. So probably no memory leak, but a static buffer that kept on growing bigger and bigger. Reviewing the logs indicated the ZigBee Coordinator was constantly receiving packets with [...]]]></description>
			<content:encoded><![CDATA[<div id="attachment_1167" class="wp-caption alignnone" style="width: 287px"><a href="http://blog.hekkers.net/wp-content/uploads/2010/07/Capture24-7-2010-13.41.26.png"><img class="size-full wp-image-1167" title="Sudden memory increase" src="http://blog.hekkers.net/wp-content/uploads/2010/07/Capture24-7-2010-13.41.26.png" alt="" width="277" height="125" /></a><p class="wp-caption-text">Sudden memory increase</p></div>
<p>A sudden memory increase yesterday morning made me aware that there was something wrong in my system. Memory usage was increasing fast, while the memory count wasn&#8217;t. So probably no memory leak, but a static buffer that kept on growing bigger and bigger. Reviewing the logs indicated the ZigBee Coordinator was constantly receiving packets with bad checksums:</p>
<pre>09:50:32 ZigBee: Rcvd Frame:97 01 00 13 A2 00 40 33 1F 7B 31 D7 44 42 00 7E
09:50:32 ZigBee: Invalid Checksum !! (Rcvd=00,Calc=66)
09:50:32 ZigBee: Rcvd Frame:97 01 00 13 A2 00 40 33 1F 7B 31 D7 44 42 00 7E
09:50:32 ZigBee: Invalid Checksum !! (Rcvd=00,Calc=66)
09:50:35 ZigBee: Rcvd Frame:97 01 00 13 A2 00 40 33 1F 7B 31 D7 44 42 00 7E
09:50:35 ZigBee: Invalid Checksum !! (Rcvd=00,Calc=66)
</pre>
<p>Strange; it looks like always the same packet is being received. That can&#8217;t be right! I removed the batteries from the XBee that seemed to be constantly sending these bad packets, but they kept on coming in; yeah right, without batteries <img src='http://blog.hekkers.net/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>So there must be a problem with the read buffer in the ZigBee API. Looking at the code, i saw it right away&#8230; i forgot to skip a byte, resulting in always the same bad packet being spotted in the buffer! And that buffer kept on growing and growing. The fix was easy:</p>
<p><a href="http://blog.hekkers.net/wp-content/uploads/2010/07/Capture24-7-2010-14.07.37.png"><img class="alignnone size-full wp-image-1169" title="Fixed it!" src="http://blog.hekkers.net/wp-content/uploads/2010/07/Capture24-7-2010-14.07.37.png" alt="" width="581" height="186" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.hekkers.net/2010/07/25/one-problem-less/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>New batteries !?!</title>
		<link>http://blog.hekkers.net/2010/07/24/new-batteries/</link>
		<comments>http://blog.hekkers.net/2010/07/24/new-batteries/#comments</comments>
		<pubDate>Sat, 24 Jul 2010 06:01:30 +0000</pubDate>
		<dc:creator>Robert Hekkers</dc:creator>
				<category><![CDATA[Domotica]]></category>
		<category><![CDATA[motion sensor]]></category>

		<guid isPermaLink="false">http://blog.hekkers.net/?p=1151</guid>
		<description><![CDATA[Not long after i noticed the rapid supply voltage drop on my motion sensor, this sensor stopped working. July 23th at 02:02 AM to be precise, cause that&#8217;s when the last motion detection was sent and no more heartbeats were received anymore after that. That same day, in the evening, i replaced the batteries: A [...]]]></description>
			<content:encoded><![CDATA[<p>Not long after i noticed the rapid supply voltage drop on my motion sensor, this sensor stopped working. July 23th at 02:02 AM to be precise, cause that&#8217;s when the last motion detection was sent and no more heartbeats were received anymore after that. That same day, in the evening, i replaced the batteries:</p>
<div id="attachment_1152" class="wp-caption alignnone" style="width: 601px"><a href="http://blog.hekkers.net/wp-content/uploads/2010/07/SupVoltPic_000108.png"><img class="size-full wp-image-1152" title="New batteries" src="http://blog.hekkers.net/wp-content/uploads/2010/07/SupVoltPic_000108.png" alt="" width="591" height="150" /></a><p class="wp-caption-text">New batteries installed</p></div>
<p>A few things i noticed are:</p>
<ul>
<li>The new batteries for the motion sensor start at 3188 mV, which is significantly lower than the voltage on the other sensors;</li>
<li>The motion sensor stopped working sooner than i expected based on <a href="http://blog.hekkers.net/2010/06/25/xbee-supply-voltage-monitoring-2/" target="_self">earlier findings</a>;</li>
<li>The sensor behaved like i wished it would, during the time the batteries couldn&#8217;t cope anymore (no <a href="http://blog.hekkers.net/2010/06/20/no-more/" target="_self">MS13 nightmares</a>);</li>
<li>Replacing the batteries was enough to get it all working again (Yeeha!).</li>
</ul>
<p>In the meantime, the batteries on my Lux Sensor are still within the same 5 mV range since i started logging:</p>
<div id="attachment_1153" class="wp-caption alignnone" style="width: 601px"><a href="http://blog.hekkers.net/wp-content/uploads/2010/07/SupVoltPic_000106.png"><img class="size-full wp-image-1153 " title="Constant Supply Voltage on XBR4 (Lux sensor)" src="http://blog.hekkers.net/wp-content/uploads/2010/07/SupVoltPic_000106.png" alt="" width="591" height="150" /></a><p class="wp-caption-text">Constant Supply Voltage on XBR4 (Lux sensor)</p></div>
<p>So that sensor is still doing OK i guess <img src='http://blog.hekkers.net/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>This time the motion sensor got 3 brand new and fully charged batteries. We&#8217;ll see what will happen this time.</p>
<p>I think i&#8217;ll start reading some more about handling external interrupts on the ATMega328&#8230; just in case, maybe i will need it.</p>
<p>But first, lets see how these new batteries keep the sensor working and if I&#8217;m not satisfied with the results, i will start using the energy saving version of the PIR, or lower the clock the ATMega328 is running on, or increase the sleep period on the JeeNode, use more powerful batteries, optimize the sketch, or &#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.hekkers.net/2010/07/24/new-batteries/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Dropping fast&#8230;</title>
		<link>http://blog.hekkers.net/2010/07/24/dropping-fast/</link>
		<comments>http://blog.hekkers.net/2010/07/24/dropping-fast/#comments</comments>
		<pubDate>Fri, 23 Jul 2010 23:01:13 +0000</pubDate>
		<dc:creator>Robert Hekkers</dc:creator>
				<category><![CDATA[Domotica]]></category>
		<category><![CDATA[JeeNodes]]></category>
		<category><![CDATA[motion sensor]]></category>
		<category><![CDATA[Sensors]]></category>
		<category><![CDATA[Xbee]]></category>

		<guid isPermaLink="false">http://blog.hekkers.net/?p=1142</guid>
		<description><![CDATA[Oops&#8230; the Supply Voltage on my motion sensor is already down to 3060 millivolts. Suddenly it&#8217;s dropping very fast; this sensor has been operational for more then 7 weeks now, with IIRC 2 new and 1 older rechargeable battery of a brand with which i&#8217;ve had bad experiences before. I hope that&#8217;s what is causing [...]]]></description>
			<content:encoded><![CDATA[<div id="attachment_1143" class="wp-caption alignnone" style="width: 601px"><a href="http://blog.hekkers.net/wp-content/uploads/2010/07/SupVoltPic_000019.png"><img class="size-full wp-image-1143" title="XBee Supply Voltage dropping fast!" src="http://blog.hekkers.net/wp-content/uploads/2010/07/SupVoltPic_000019.png" alt="" width="591" height="150" /></a><p class="wp-caption-text">XBee Supply Voltage dropping fast!</p></div>
<p>Oops&#8230; the Supply Voltage on my motion sensor is already down to 3060 millivolts. Suddenly it&#8217;s dropping very fast; this sensor has been operational for more then 7 weeks now, with IIRC 2 new and 1 older rechargeable battery of a brand with which i&#8217;ve had bad experiences before. I hope that&#8217;s what is causing this, cause if not, i have some work to do <img src='http://blog.hekkers.net/wp-includes/images/smilies/icon_sad.gif' alt=':-(' class='wp-smiley' /> </p>
<p>The other 2 battery powered sensors are still doing fine, BTW:</p>
<div id="attachment_1144" class="wp-caption alignnone" style="width: 838px"><a href="http://www.hekkers.net/domotica/devicestatus.aspx"><img class="size-full wp-image-1144 " title="Supply Voltages" src="http://blog.hekkers.net/wp-content/uploads/2010/07/Capture22-7-2010-22.10.58.png" alt="" width="828" height="66" /></a><p class="wp-caption-text">Supply Voltages (click to view the realtime values)</p></div>
]]></content:encoded>
			<wfw:commentRss>http://blog.hekkers.net/2010/07/24/dropping-fast/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Monitoring Me.</title>
		<link>http://blog.hekkers.net/2010/07/22/monitoring-me/</link>
		<comments>http://blog.hekkers.net/2010/07/22/monitoring-me/#comments</comments>
		<pubDate>Thu, 22 Jul 2010 20:01:39 +0000</pubDate>
		<dc:creator>Robert Hekkers</dc:creator>
				<category><![CDATA[Domotica]]></category>

		<guid isPermaLink="false">http://blog.hekkers.net/?p=1125</guid>
		<description><![CDATA[Yes, i&#8217;m a person who likes to monitor things&#8230; as much as he can! The 2 charts above show the memory usage of the Domotica system i created during the past 5 years. I like to think that this system, that is running it&#8217;s 135th version since august 2008, is able to keep on running [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone size-full wp-image-1126" title="Monitoring me" src="http://blog.hekkers.net/wp-content/uploads/2010/07/capture18-7-2010-234824.png" alt="Monitoring me" width="550" height="319" /></p>
<p>Yes, i&#8217;m a person who likes to monitor things&#8230; as much as he can!</p>
<p>The 2 charts above show the memory usage of the Domotica system i created during the past 5 years. I like to think that this system, that is running it&#8217;s 135th version since august 2008, is able to keep on running for months, even years. But will it? Actually, i can&#8217;t tell. Do i catch all errors that can occur in a correct way? Do i anticipate on abnormal situations correctly? Does my system continue working if a subsystem fails? Those are all questions that are hard to answer. I mean, I think I&#8217;m doing OK cause I have had only 1 occasion of a total system breakdown in those 5 years, but&#8230; that very special situation i didn&#8217;t think of, <em>can</em> happen. And that situation <em>will</em> happen, some day. Does the name <strong>Murphy</strong> ring a bell? Hopefully this will not happen while I&#8217;m on vacation, where there are less-than-normal resources to fix the problem right away.</p>
<p>With more and more tasks being performed by my Domotica System and not being able to figure out anymore what special situations will be able to crash it, I&#8217;m residing to the more obvious ones, like monitoring things  like memory usage, odd data being received and how it&#8217;s being handled, things like that. The 2 charts shown above represent how many kilobytes are being used and how many memory allocations are made in my system. I know, this only gives me some insight in how well i wrote my own code, but it also tells me how well it will perform over a period three times as long as the average &#8216;up time&#8217; of my system (5 days) without any special situations. And, it also tells me how well it performs on anticipated problems, where error handling has to take control and make sure everything keeps working as expected. But no matter how well it anticipates a problem, anticipated or not: if my system runs out of memory it&#8217;s done&#8230; the system will stop unexpected and no &#8216;catch&#8217; will resolve that issue. And that&#8217;s what I&#8217;m doing these days, amongst other things: monitoring my own Home Automation system;  my own creation, <em>me</em>&#8230;</p>
<p>That&#8217;s the best i can do without trying to think of (and test) all scenarios my system will face while I&#8217;m away. That&#8217;s just not doable anymore, with so many different interfaces.</p>
<p>BTW, despite all the negative thinking above: it&#8217;s looking good; and just like the last 4 years, it will perform just fine <img src='http://blog.hekkers.net/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.hekkers.net/2010/07/22/monitoring-me/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ZigBee Coordinator relocated</title>
		<link>http://blog.hekkers.net/2010/07/20/zigbee-coordinator-relocated/</link>
		<comments>http://blog.hekkers.net/2010/07/20/zigbee-coordinator-relocated/#comments</comments>
		<pubDate>Tue, 20 Jul 2010 15:03:53 +0000</pubDate>
		<dc:creator>Robert Hekkers</dc:creator>
				<category><![CDATA[Domotica]]></category>
		<category><![CDATA[Zigbee]]></category>

		<guid isPermaLink="false">http://blog.hekkers.net/?p=1106</guid>
		<description><![CDATA[This is how my ZigBee Coordinator has been on my desk since the beginning: Not a good idea to keep it this way forever. So it was time to give it a nice enclosure and move it to the meter cabinet. I found an enclosure in which there&#8217;s plenty of room for the XBee Explorer [...]]]></description>
			<content:encoded><![CDATA[<p>This is how my ZigBee Coordinator has been on my desk since the beginning:</p>
<p><img class="alignnone size-full wp-image-1107" title="ZigBee Coordinator" src="http://blog.hekkers.net/wp-content/uploads/2010/07/dsc_3404c_resize.jpg" alt="ZigBee Coordinator" width="400" height="266" /></p>
<p>Not a good idea to keep it this way forever. So it was time to give it a nice enclosure and move it to the meter cabinet. I found an enclosure in which there&#8217;s plenty of room for the XBee Explorer board. Some sawing, drilling and adjusting resulted in the following.</p>
<p><img class="alignnone size-full wp-image-1109" title="Zigbee Coordinator" src="http://blog.hekkers.net/wp-content/uploads/2010/07/dsc_3400_resize.jpg" alt="Zigbee Coordinator" width="360" height="239" /><img class="alignnone size-full wp-image-1120" title="Coordinator" src="http://blog.hekkers.net/wp-content/uploads/2010/07/dsc_3402_cresize_resize1.jpg" alt="Coordinator" width="360" height="192" /></p>
<p>That looks much better! It doesn&#8217;t bring any new functionality, but it does make things look more &#8220;complete&#8221;&#8230;one of those things i often forget, because the next thing is already waiting to get started&#8230; <img src='http://blog.hekkers.net/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.hekkers.net/2010/07/20/zigbee-coordinator-relocated/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
