<?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>Maartendamen&#039;s blog &#187; sensorbin</title>
	<atom:link href="http://www.maartendamen.com/tag/sensorbin/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.maartendamen.com</link>
	<description>Blogging on various IT subjects</description>
	<lastBuildDate>Tue, 22 Nov 2011 21:27:03 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Automating/reading sensorbin status using JeeNode/Arduino</title>
		<link>http://www.maartendamen.com/2010/01/automating-a-sensor-bin-using-jeenodearduino/</link>
		<comments>http://www.maartendamen.com/2010/01/automating-a-sensor-bin-using-jeenodearduino/#comments</comments>
		<pubDate>Sat, 30 Jan 2010 13:16:31 +0000</pubDate>
		<dc:creator>Maarten</dc:creator>
				<category><![CDATA[Home automation]]></category>
		<category><![CDATA[arduino]]></category>
		<category><![CDATA[jeenode]]></category>
		<category><![CDATA[sensorbin]]></category>

		<guid isPermaLink="false">http://www.maartendamen.com/?p=129</guid>
		<description><![CDATA[I&#8217;m currently playing around with Jeenode boards. The JeeNode is a small wireless board with an 8-bit Atmel RISC microprocessor. JeeNodes are compatible with the Arduino platform and can be programmed under Windows, Mac OS X, or Linux using sketches created with the Arduino IDE. As a first test of it&#8217;s capabilities, I wanted to [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m currently playing around with Jeenode boards. The JeeNode is a small wireless board with an 8-bit Atmel RISC microprocessor. <a href="http://www.jeelabs.org">JeeNodes</a> are compatible with the <a href="http://arduino.cc/">Arduino</a> platform and can be programmed under Windows, Mac OS X, or Linux using sketches created with the Arduino IDE. As a first test of it&#8217;s capabilities, I wanted to read out the state of the cover of my recycle bin.</p>
<p>I have one of these recycle bins:<br />
<a href="http://www.easybin.nl/Easybin_2009-2010/assortiment.html">http://www.easybin.nl/Easybin_2009-2010/assortiment.html</a><br />
(deluxe 50)</p>
<p>The cover automatically opens when it detects motion over it.. this is nice and hygienic.</p>
<p>I decided to open up my bin. Once opened I quickly notices the most interesting part of the bin.. the motion sensor and the LED that flashes when the bin is in the open state.</p>
<p><span id="more-129"></span></p>
<p>The LED has the following states:</p>
<ul>
<li>Short red flashes when the device is alive;</li>
<li>constantly green lid when the cover is open;</li>
<li>constant red lid when the cover is closing.</li>
</ul>
<p>This led is a so called bi-color LED. It has 3 pins, one pin supplies power for the green color.. the other pin supplies power for the red color. The middle pin is the neutral/GND pin.<br />
Using a multimeter I measured the voltages on the pins.. turns out there was 2 volt on it. Great! This could be connected to the analog ports of the JeeNode.</p>
<p>I soldered some leads on the existing sensorbin board:<br />
<img class="alignnone size-full wp-image-131" title="sesnsorbin1" src="http://www.maartendamen.com/wp-content/uploads/2010/01/sesnsorbin1.png" alt="sesnsorbin1" width="563" height="422" /></p>
<p><em>Image 1: the sensorbin board with additional wires connected.</em></p>
<p>The orange wire is the green led color, the middle wire is the ground and the blue wire is the red color.<br />
Now that I connected the leads to the exisiting board I connected the orange wire to analog port 1 of the jeenode. The middle wire to ground port 1. And the blue wire to analog port 2.</p>
<p>I was now ready to go ahead and upload a &#8216;sketch&#8217; (this is a program that runs on the microprocessor) to my JeeNode.<br />
This is what I came up with:</p>
<pre class="brush: cpp; title: ; notranslate">
#include &lt;Ports.h&gt;
#include &lt;RF12.h&gt;

Port input (1);

/* is the bin open? */
byte isopen = 0;

void setup () {
 // initialize the serial port and the RF12 driver
 Serial.begin(57600);
 Serial.print(&quot;\n[SensorBin]&quot;);
 rf12_config();
 // set up easy transmissions at maximum rate
 rf12_easyInit(0);
}

void loop () {
 int state = input.anaRead();

 if (state &gt; 600 &amp;&amp; isopen == 0) {
 Serial.print(&quot;Cover is opened!&quot;);
 Serial.println();
 isopen = 1;
 } else if (state &lt; 600 &amp;&amp; isopen == 1) {
 Serial.print(&quot;Cover is closed again..&quot;);
 Serial.println();
 isopen = 0;
 }

 delay(1000);
}
</pre>
<p>And here is the test result:</p>
<p><img src="file:///C:/Users/Maarten/AppData/Local/Temp/moz-screenshot-3.png" alt="" /><img class="alignnone size-full wp-image-134" title="sensorbin2" src="http://www.maartendamen.com/wp-content/uploads/2010/01/sensorbin2.png" alt="sensorbin2" width="654" height="608" /></p>
<p><em>Image 2: output log from Arduino serial port monitor</em></p>
<p>Excellent! So, I can now read the status of my recycle bin.. is this life saving? No.. not really but atleast it gave me some insight on the JeeNode and Arduino platform.<br />
I want to extend this concept with the following:</p>
<ul>
<li>Sending the status of RF;</li>
<li>reading out the battery status (percentage left) of the recycle bin (this is handy to get e-mail notifications from home automation software);</li>
<li>putting in a light sensor so I can read the light status of the room the recycle bin is placed in;</li>
<li>putting in a motion sensor so I can get the motion status of the room the recycle bin is placed in;</li>
<li>etc.</li>
</ul>
<p>Oh btw.. just for for fun.. this is my test setup (JeeNode connected to USB-BUB in front, sensorbin hardware board in the back):</p>
<p><img class="alignnone size-full wp-image-135" title="sensorbin3" src="http://www.maartendamen.com/wp-content/uploads/2010/01/sensorbin3.png" alt="sensorbin3" width="704" height="528" /></p>
<p><em>Image 3: test setup in action :-)</em></p>
]]></content:encoded>
			<wfw:commentRss>http://www.maartendamen.com/2010/01/automating-a-sensor-bin-using-jeenodearduino/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

