<?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>Digits Domotica Blog &#187; Arduino</title>
	<atom:link href="http://blog.hekkers.net/tag/arduino/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.hekkers.net</link>
	<description>My Weblog about Domotica and more</description>
	<lastBuildDate>Wed, 01 Feb 2012 19:32:52 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>No more painful toes</title>
		<link>http://blog.hekkers.net/2012/01/24/no-more-painful-toes/</link>
		<comments>http://blog.hekkers.net/2012/01/24/no-more-painful-toes/#comments</comments>
		<pubDate>Tue, 24 Jan 2012 21:42:45 +0000</pubDate>
		<dc:creator>Robert Hekkers</dc:creator>
				<category><![CDATA[Domotica]]></category>
		<category><![CDATA[Arduino]]></category>
		<category><![CDATA[LED]]></category>
		<category><![CDATA[motion sensor]]></category>

		<guid isPermaLink="false">http://blog.hekkers.net/?p=2573</guid>
		<description><![CDATA[This evening I wrote a sketch to protect my toes better. The sketch switches the LED strip on and off based on motion detection by 2 PIRs. It works The blue LED on the Protoshield indicates when there is motion detected by the PIR. The motion detection turns the LED strip on and it will [...]]]></description>
			<content:encoded><![CDATA[<p>This evening I wrote a sketch to <a href="http://blog.hekkers.net/2012/01/22/bedroom-floor-lighting/">protect my toes</a> better. The sketch switches the LED strip on and off based on motion detection by 2 PIRs. It works <img src='http://blog.hekkers.net/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
<p>The blue LED on the Protoshield indicates when there is motion detected by the PIR. The motion detection turns the LED strip on and it will stay on until a period of 15 seconds with no motion has passed &#8211; only then, the LED strip is turned off again.</p>
<p>The sketch takes care of the &#8220;soft on/off&#8221; feature, by gently raising or lowering the brightness during a configurable time-span.</p>
<p><object width="560" height="340" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://www.youtube.com/v/Eni_v2JmGvw?fs=1&amp;hl=en_US" /><param name="allowfullscreen" value="true" /><embed width="560" height="340" type="application/x-shockwave-flash" src="http://www.youtube.com/v/Eni_v2JmGvw?fs=1&amp;hl=en_US" allowFullScreen="true" allowscriptaccess="always" allowfullscreen="true" /></object></p>
<p>All that&#8217;s left to do is cleaning up the code, solder some wires, wait for the enclosure to arrive and give the LED strip, PIRs and Arduino enclosure a place under the bed.</p>
<p>Simple, yet <em>very</em> convenient automation <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/2012/01/24/no-more-painful-toes/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Bedroom floor lighting</title>
		<link>http://blog.hekkers.net/2012/01/22/bedroom-floor-lighting/</link>
		<comments>http://blog.hekkers.net/2012/01/22/bedroom-floor-lighting/#comments</comments>
		<pubDate>Sun, 22 Jan 2012 22:45:00 +0000</pubDate>
		<dc:creator>Robert Hekkers</dc:creator>
				<category><![CDATA[Domotica]]></category>
		<category><![CDATA[Arduino]]></category>
		<category><![CDATA[LED]]></category>
		<category><![CDATA[motion sensor]]></category>

		<guid isPermaLink="false">http://blog.hekkers.net/?p=2562</guid>
		<description><![CDATA[Last week I had some trouble getting out of bed during the night without hurting myself. So this evening I decided to do something about that; I need something that can light the floor while someone is walking through the bedroom at night. So I made a list of things with which I could make [...]]]></description>
			<content:encoded><![CDATA[<p>Last week I had some trouble getting out of bed during the night without hurting myself. So this evening I decided to do something about that; I need something that can light the floor while someone is walking through the bedroom at night. So I made a list of things with which I could make something useful for that:</p>
<ul>
<li>An Arduino Duemilanove;</li>
<li>a Protoshield;</li>
<li>2 PIR motion sensors;</li>
<li>a LDR;</li>
<li>a  IRLZ34N MOSFET to drive the LED strip;</li>
<li>a 12V power adapter;</li>
<li>about 2 m. of white LED strip;</li>
<li>2 LEDs (one for power and the other for motion detection);</li>
<li>an Arduino enclosure.</li>
</ul>
<p>&nbsp;</p>
<p style="text-align: center;"><a href="http://blog.hekkers.net/wp-content/uploads/2012/01/DSC_6540_b.jpg"><img class="aligncenter size-full wp-image-2564" title="Automatic Bed light for the night" src="http://blog.hekkers.net/wp-content/uploads/2012/01/DSC_6540_s.jpg" alt="Automatic Bed light for the night" width="550" height="365" /></a></p>
<p>There it is&#8230; our automatic bedroom floor lighting is being tested at this moment. The 2 PIR motion sensors will be mounted under the bed in a way that they will only be able to detect motion caused by moving legs, the LDR will be used to detect whether it&#8217;s dark in the bedroom or not and the white LED strips will be glued to the bottom side of the bed and will light the floor when motion is detected.</p>
<p>The fun thing is that this floor lighting is almost completely built from spare parts (except the enclosure). The 2 PIR motion sensors were the first motion sensors I ever bought, but the lenses were too big for my taste to actually use them. Under the bed the size of those lenses doesn&#8217;t matter. The Duemilanove is one of the many Duemilanoves I have laying around for testing/experimenting, so I can easily do with one less &#8211; I could also have picked an RBBB, Teensy or JeeNode. The number of unused protoshields made me decide for an Arduino. And all the other parts were all purchased in the past with the thought they&#8217;d be handy to have around for when you suddenly need them <img src='http://blog.hekkers.net/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
<p>No RF, Zigbee or Ethernet this time &#8211; this will be a solution that doesn&#8217;t need any other external input, nor do I think I&#8217;ll use the fact that someone&#8217;s walking through the bedroom in the rest of my system. Nevertheless, I&#8217;ll reserve some space on the Protoshield for a XBee Breakout board cause this would actually be a very good place for a Zigbee router on the 2nd floor!</p>
<p>The sketch will be a collection of code  from other sketches I&#8217;m already using, so I hope that at the end of this week I can finish this and never hurt my toes again <img src='http://blog.hekkers.net/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.hekkers.net/2012/01/22/bedroom-floor-lighting/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>In the meantime..</title>
		<link>http://blog.hekkers.net/2011/11/06/in-the-meantime/</link>
		<comments>http://blog.hekkers.net/2011/11/06/in-the-meantime/#comments</comments>
		<pubDate>Sun, 06 Nov 2011 20:45:30 +0000</pubDate>
		<dc:creator>Robert Hekkers</dc:creator>
				<category><![CDATA[Domotica]]></category>
		<category><![CDATA[Arduino]]></category>
		<category><![CDATA[Sensors]]></category>

		<guid isPermaLink="false">http://blog.hekkers.net/?p=2433</guid>
		<description><![CDATA[&#8230;mass production of sensors going on here!]]></description>
			<content:encoded><![CDATA[<p>&#8230;mass production of sensors going on here! <img src='http://blog.hekkers.net/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p><a href="http://blog.hekkers.net/wp-content/uploads/2011/11/Image00001s.jpg"><img class="aligncenter size-full wp-image-2434" title="New sensors" src="http://blog.hekkers.net/wp-content/uploads/2011/11/Image00001s.jpg" alt="New sensors" width="600" height="450" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.hekkers.net/2011/11/06/in-the-meantime/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Building the sensor hub</title>
		<link>http://blog.hekkers.net/2011/09/21/building-the-sensor-hub/</link>
		<comments>http://blog.hekkers.net/2011/09/21/building-the-sensor-hub/#comments</comments>
		<pubDate>Wed, 21 Sep 2011 20:53:01 +0000</pubDate>
		<dc:creator>Robert Hekkers</dc:creator>
				<category><![CDATA[Domotica]]></category>
		<category><![CDATA[Arduino]]></category>
		<category><![CDATA[Sensors]]></category>

		<guid isPermaLink="false">http://blog.hekkers.net/?p=2346</guid>
		<description><![CDATA[Because I&#8217;m working on 4 different things simultaneously, all 4 of them are not progressing as fast as they could. And this new sensor hub is not top priority, so sometimes it takes a while before I can spend some time on it. The last few days I came up with some basic idea; this is [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://blog.hekkers.net/wp-content/uploads/2011/09/DSC_6135c.jpg"><img class="alignleft size-full wp-image-2347" title="The basic idea" src="http://blog.hekkers.net/wp-content/uploads/2011/09/DSC_6135cr.jpg" alt="The basic idea" width="300" height="291" /></a>Because I&#8217;m working on 4 different things simultaneously, all 4 of them are not progressing as fast as they could. And this new sensor hub is not top priority, so sometimes it takes a while before I can spend some time on it. The last few days I came up with some basic idea; this is what I have in mind for my <em><a href="http://blog.hekkers.net/2011/07/30/something-old-and-something-new/">sensor hub</a></em>.</p>
<p>The lower side of the enclosure will have all the connectors for power and other wires to the sensors and the upper side is where a small 5V power adapter with USB connector (of which I bought a couple recently, for only 5 euro/piece) and cable will provide the necessary &#8216;juice&#8217; to the <a href="http://www.arduino.cc/en/Main/ArduinoBoardFio" target="_blank">Arduino Fio</a>.</p>
<p>The <a href="http://www.sparkfun.com/products/9115" target="_blank">FTDI breakout</a> on the left is just for uploading sketches (and for power, while it&#8217;s still here on my desk).</p>
<p>Inside the enclosure there&#8217;s a half-size (400 points) breadboard with double-sided tape that will hold the Fio and the required wiring. Cheap and simple; and since this setup will take care of 4 of my<a href="http://blog.hekkers.net/2011/09/11/a-new-all-in-one-sensor/"> all-in-one sensors</a>, I can live with the fact that it&#8217;s not battery powered. This certainly doesn&#8217;t mean I&#8217;ll never build battery powered sensors anymore&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.hekkers.net/2011/09/21/building-the-sensor-hub/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>First sensor finished and working</title>
		<link>http://blog.hekkers.net/2011/09/13/first-sensor-finished-and-working/</link>
		<comments>http://blog.hekkers.net/2011/09/13/first-sensor-finished-and-working/#comments</comments>
		<pubDate>Tue, 13 Sep 2011 19:30:15 +0000</pubDate>
		<dc:creator>Robert Hekkers</dc:creator>
				<category><![CDATA[Domotica]]></category>
		<category><![CDATA[Arduino]]></category>
		<category><![CDATA[Sensors]]></category>

		<guid isPermaLink="false">http://blog.hekkers.net/?p=2319</guid>
		<description><![CDATA[Today I finished soldering a cable to my first new All-in-one sensor with motion, temperature and light. Phew, after soldering those 7 wires my eyes really needed a break, even though I used a magnifying glass. The very first thing I did was getting rid of the headers for the H/L jumper; I reduced the [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://blog.hekkers.net/wp-content/uploads/2011/09/DSC_6130c.jpg"><img class="alignleft size-full wp-image-2322" title="Power wires" src="http://blog.hekkers.net/wp-content/uploads/2011/09/DSC_6130cr.jpg" alt="Power wires" width="300" height="225" /></a>Today I finished soldering a cable to my first new<a href="http://blog.hekkers.net/2011/09/11/a-new-all-in-one-sensor/"> All-in-one sensor</a> with motion, temperature and light. Phew, after soldering those 7 wires my eyes really needed a break, even though I used a magnifying glass. The very first thing I did was getting rid of the headers for the H/L jumper; I reduced the 2headers I needed to 1 mm and added a drop of solder in between; the unused header was cut away completely. This gave me some more free space  for the black wire which connects the GND pin of the PIR to pin 1 (GND) of the DS18B20. After that I connected <a href="http://datasheets.maxim-ic.com/en/ds/DS18B20.pdf" target="_blank">DS18B20</a> pin 3 (Vdd) and one leg of the LDR to each other so that I only needed 1 wire for supplying both sensors with power by connecting those to the + pin of the PIR; this is the red wire.</p>
<p>Now all the sensors were connected with each other in a way that when I would apply power to the PIR pins, the rest of the sensors would be powered as well.</p>
<p><a href="http://blog.hekkers.net/wp-content/uploads/2011/09/DSC_6134c.jpg"><img class="alignleft size-full wp-image-2324" title="Connecting the cable" src="http://blog.hekkers.net/wp-content/uploads/2011/09/DSC_6134cr.jpg" alt="Connecting the cable" width="300" height="225" /></a></p>
<p>As you can see a CAT5 cable was used; I only needed a total of 5 wires for this sensor. First I needed a way to glue the cable to the top cover of the enclosure; I saw there was some space between the PIR PCB and the top cover, so I what I did was remove the outer isolation on one half of the cable but left the other half intact. I added a drop of hot glue to it and quickly pushed it between the PCB and top cover, which made the cable isolation work like some sort of pull relief. Soldering the 5 wires was the last thing I did; cause now it was time to check some things first &#8211; does it work??</p>
<p>I wrote a small sketch that would read all the sensors once a second and display the results (do I hear a drum roll? <img src='http://blog.hekkers.net/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> :</p>
<pre>10765455 Motion:no,  Addr:28-98-C9-AF-2-0-0-A3 Temp=25.25 grC, LDR=643
10766546 Motion:no,  Addr:28-98-C9-AF-2-0-0-A3 Temp=25.25 grC, LDR=640
10767638 Motion:no,  Addr:28-98-C9-AF-2-0-0-A3 Temp=25.25 grC, LDR=640
10768730 Motion:no,  Addr:28-98-C9-AF-2-0-0-A3 Temp=25.25 grC, LDR=645
10769821 Motion:no,  Addr:28-98-C9-AF-2-0-0-A3 Temp=25.25 grC, LDR=653
10770913 Motion:no,  Addr:28-98-C9-AF-2-0-0-A3 Temp=25.25 grC, LDR=657
10772004 Motion:no,  Addr:28-98-C9-AF-2-0-0-A3 Temp=25.25 grC, LDR=663
10773096 Motion:no,  Addr:28-98-C9-AF-2-0-0-A3 Temp=25.25 grC, LDR=661
10774188 Motion:YES, Addr:28-98-C9-AF-2-0-0-A3 Temp=25.25 grC, LDR=666
10775279 Motion:YES, Addr:28-98-C9-AF-2-0-0-A3 Temp=25.25 grC, LDR=668
10776371 Motion:YES, Addr:28-98-C9-AF-2-0-0-A3 Temp=25.25 grC, LDR=663
10777462 Motion:YES, Addr:28-98-C9-AF-2-0-0-A3 Temp=25.25 grC, LDR=660</pre>
<p>It works! Maybe I&#8217;ll put some drops of hot glue here and there to make it all slightly firmer and than I can close this sensor.</p>
<p>The sketch is still very basic; it&#8217;s just some <em>Serial.print</em>s you see here, no wireless transmission is done yet and there&#8217;s an ugly <em>delay(1000)</em> in the <em>loop()</em> for the 1-Wire delay that I have to get rid of.</p>
<p>And I don&#8217;t need temperature and light sent to me every second; but waiting one second before motion is detected is way too long of course. Using interrupts for detecting motion is better I guess&#8230; soon I&#8217;ll know more about that, cause I need to be able to handle 4 PIRs (on 4 different input pins), but I can&#8217;t have 4 ISRs (Interrupt Service Routines); but the &#8216;solution&#8217; will probably suffice. Sounds like a nice subject for another post.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.hekkers.net/2011/09/13/first-sensor-finished-and-working/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Success and failure</title>
		<link>http://blog.hekkers.net/2011/09/03/success-and-failure/</link>
		<comments>http://blog.hekkers.net/2011/09/03/success-and-failure/#comments</comments>
		<pubDate>Sat, 03 Sep 2011 21:39:40 +0000</pubDate>
		<dc:creator>Robert Hekkers</dc:creator>
				<category><![CDATA[Domotica]]></category>
		<category><![CDATA[Arduino]]></category>
		<category><![CDATA[DMX]]></category>
		<category><![CDATA[LED]]></category>

		<guid isPermaLink="false">http://blog.hekkers.net/?p=2270</guid>
		<description><![CDATA[Today I continued with my &#8220;RGB LEDs for the gazebo&#8221; job; what would those 6 LED spotlights bring, in terms of light? How would it look? Well, here some images:   &#160; &#160; &#160; &#160;   &#160; &#160; &#160; &#160; &#160; &#160; I wanted to see the result before I would start digging holes, laying [...]]]></description>
			<content:encoded><![CDATA[<p>Today I continued with my &#8220;RGB LEDs for the gazebo&#8221; job; what would those 6 LED spotlights bring, in terms of light? How would it look? Well, here some images:</p>
<p><a href="http://blog.hekkers.net/wp-content/uploads/2011/09/DSC_61091.jpg"><img class="alignleft size-full wp-image-2274" title="RGB LED spotlights" src="http://blog.hekkers.net/wp-content/uploads/2011/09/DSC_6109.jpg" alt="" width="300" height="199" /></a> <a href="http://blog.hekkers.net/wp-content/uploads/2011/09/DSC_61031.jpg"><img class="alignright size-full wp-image-2273" title="RGB LED spotlights" src="http://blog.hekkers.net/wp-content/uploads/2011/09/DSC_6103.jpg" alt="" width="300" height="199" /></a></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p><a href="http://blog.hekkers.net/wp-content/uploads/2011/09/DSC_61021.jpg"><img class="size-full wp-image-2272 alignleft" title="RGB LED spotlights" src="http://blog.hekkers.net/wp-content/uploads/2011/09/DSC_6102.jpg" alt="" width="300" height="199" /></a> <a href="http://blog.hekkers.net/wp-content/uploads/2011/09/DSC_61011.jpg"><img class="alignright size-full wp-image-2271" title="RGB LED spotlights" src="http://blog.hekkers.net/wp-content/uploads/2011/09/DSC_6101.jpg" alt="" width="300" height="199" /></a></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>I wanted to see the result before I would start digging holes, laying cables under the pavement etcetera. Based on what I saw after sunset, the conclusion can only be: we have a Go! It&#8217;s exactly what I had in mind; which is a big relief actually, cause those 6 LED spotlights were quite an investment. But the result is wonderful, these LED spotlights light up the gazebo just the way I want.</p>
<p>I did have a big issue with controlling those LEDs though.. All the tests I did in my office with the LEDs on the desk next to me never failed. But today, with the LEDs, DMX decoder, Arduino+Ethernet shield+DMX shield outside it didn&#8217;t work anymore!? Everything was set up and ready to go, but I couldn&#8217;t even ping my Arduino anymore!</p>
<p>My first thought was that the new CAT5 cable of 20m length was broken, or the RJ45 connectors didn&#8217;t make good contact; but this was not the case, the cable was OK. Maybe it was the new Gigabit switch I received 2 days ago which hadn&#8217;t been used until now? Nope. What is this??</p>
<p>I took the Arduino back to the office, connected it to my PC for power and to the switch. And it worked again, just like it always did&#8230; although I did see the LEDs on the Ethernet Shield behave differently. Well, I won&#8217;t go into all the details, but eventually I found out that it was the USB connection that made the difference! <em>Without</em> a USB connection, I had to push the reset button on the Ethernet shield to make the shield work. <em>With</em> USB, the Ethernet shield worked immediately. Go figure..</p>
<p>What has USB got to do with a (dis)functioning Ethernet shield?? A lot, so it seems. What is this, a hidden feature? By design? I must have missed the addendum to the manual that says &#8220;This shield will only function with your Arduino USB port connected&#8221;&#8230; After I knew what was causing this problem, it didn&#8217;t take long before I found a <a href="http://marco.guardigli.it/2010/11/arduino-wiznet-ethernet-shield-proper.html" target="_blank">solution</a> &#8211; phew, this issue could have been a real party pooper! I haven&#8217;t tried the workaround yet, but I will. Very soon, as in tomorrow first thing!</p>
<p>Here you see me testing some colors, sitting behind my laptop under the gazebo:</p>
<p><object width="500" height="306"><param name="movie" value="http://www.youtube.com/v/U1LqB-BHBRM?version=3"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/U1LqB-BHBRM?version=3" type="application/x-shockwave-flash" width="500" height="306" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.hekkers.net/2011/09/03/success-and-failure/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Arduino DMX encoder on the test bench</title>
		<link>http://blog.hekkers.net/2011/08/20/arduino-dmx-encoder-on-the-test-bench/</link>
		<comments>http://blog.hekkers.net/2011/08/20/arduino-dmx-encoder-on-the-test-bench/#comments</comments>
		<pubDate>Sat, 20 Aug 2011 20:54:11 +0000</pubDate>
		<dc:creator>Robert Hekkers</dc:creator>
				<category><![CDATA[Domotica]]></category>
		<category><![CDATA[Arduino]]></category>
		<category><![CDATA[DMX]]></category>
		<category><![CDATA[LED]]></category>

		<guid isPermaLink="false">http://blog.hekkers.net/?p=2216</guid>
		<description><![CDATA[Today I started testing my DMX project. The ingredients: Arduino Duemilanove with Ethernet shield and DMX shield; DMX decoder PX24500; 24V PSU; 6 x Artecta RGB LED; some wires; a sketch running on the Arduino; UTP cable; software tools. After connecting all the wires, switching on the PSU, starting the Arduino and checking if the [...]]]></description>
			<content:encoded><![CDATA[<p>Today I started testing my <a href="http://en.wikipedia.org/wiki/DMX512" target="_blank">DMX</a> <a href="http://blog.hekkers.net/2011/08/10/led-lighting-for-our-gazebo/">project</a>. The ingredients:</p>
<ul>
<li>Arduino Duemilanove with Ethernet shield and DMX shield;</li>
<li>DMX decoder <a href="http://blog.hekkers.net/wp-content/uploads/2011/08/DMX-PX24500.pdf" target="_blank">PX24500</a>;</li>
<li>24V PSU;</li>
<li>6 x <a href="http://blog.hekkers.net/wp-content/uploads/2011/08/LEDSPOT.pdf" target="_blank">Artecta RGB LED</a>;</li>
<li>some wires;</li>
<li>a sketch running on the Arduino;</li>
<li>UTP cable;</li>
<li>software tools.</li>
</ul>
<p>After connecting all the wires, switching on the PSU, starting the Arduino and checking if the Arduino was succesfully connected to my LAN by pinging it, I was ready. I opened the Arduino IDE Serial Monitor so I could see what my sketch was doing and sent a &#8220;<em>command</em>&#8221; to the Arduino. For that I used <em>wget</em>, a non-interactive network retriever; most people who know Unix-like OS-es will probably know about its existence but it&#8217;s less known among the Windows folks. Well, in just a few words it&#8217;s a tool with which you can store the results of a HTTP call into a file and do all kinds of other handy stuff .</p>
<p>I started carefully; the first command sent to the Arduino was:</p>
<pre> wget http://192.168.10.177/10,0,0,5,0,0</pre>
<p>What this should do is change the R-value from its current value to 10 in 0.5 (5*0.1) seconds. G and B values are set to 0 immediately.</p>
<p>What the  Arduino webserver will receive is the following:</p>
<p><span class="Apple-style-span" style="font-family: Consolas, Monaco, monospace; font-size: 12px; line-height: 18px; white-space: pre;"> GET <span class="Apple-style-span" style="font-family: Consolas, Monaco, monospace; font-size: 12px; line-height: 18px; white-space: pre;">/10,0,0,5,0,0 </span>HTTP 1.1</span></p>
<pre> ....etc, the rest is all standard HTTP headers</pre>
<p>After parsing the request and figuring out what to do, the Arduino starts changing the LED colour by issuing DmxSimple commands according to the values received in the HTTP call.</p>
<p>Ok, the moment of truth is here&#8230; will the LEDs start producing light or not? Yeah, they did! Tadaa&#8230;</p>
<div id="attachment_2225" class="wp-caption aligncenter" style="width: 610px"><a href="http://blog.hekkers.net/wp-content/uploads/2011/08/100_0312cl.jpg"><img class="size-full wp-image-2225 " title="100_0312cl" src="http://blog.hekkers.net/wp-content/uploads/2011/08/100_0312cl.jpg" alt="" width="600" height="338" /></a><p class="wp-caption-text">This is not Red (nor is it a pipe)</p></div>
<p style="text-align: center;">
<p>The moment I saw this working, I felt the need for a more sophisticated way to control the RGB values, so I wrote a small tool in Delphi to help me pick the right color:</p>
<p><a href="http://blog.hekkers.net/wp-content/uploads/2011/08/ColorWheelToEthernet.png"><img class="alignleft size-full wp-image-2224" title="ColorWheelToEthernet" src="http://blog.hekkers.net/wp-content/uploads/2011/08/ColorWheelToEthernet.png" alt="ColorWheelToEthernet" width="384" height="244" /></a></p>
<p>With a mouse click I can now select the color; the rest is done automatically: calculating the R-, G- and B-value and performing the HTTP call. And all it took was 10 lines of code (with the help of <a href="http://www.indyproject.org/index.en.aspx" target="_blank">Indy</a> and a very nice <a href="http://mxs.bergsoft.net/index.php?p=2">Color Lib</a> made by Marco Binic). This allows me to choose a color much quicker and more precise than by editing numeric values on a command line <img src='http://blog.hekkers.net/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
<p>I did find some issues during my first DMX adventure, so I haven&#8217;t reached the phase yet where I can start digging holes in the ground; I&#8217;m not totally satisfied yet &#8211; more on those issues later, when I&#8217;ve hopefully fixed them.</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.hekkers.net/2011/08/20/arduino-dmx-encoder-on-the-test-bench/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Stacked stock</title>
		<link>http://blog.hekkers.net/2011/08/18/stacked-stock/</link>
		<comments>http://blog.hekkers.net/2011/08/18/stacked-stock/#comments</comments>
		<pubDate>Thu, 18 Aug 2011 19:02:50 +0000</pubDate>
		<dc:creator>Robert Hekkers</dc:creator>
				<category><![CDATA[Domotica]]></category>
		<category><![CDATA[Arduino]]></category>
		<category><![CDATA[DMX]]></category>
		<category><![CDATA[LED]]></category>

		<guid isPermaLink="false">http://blog.hekkers.net/?p=2211</guid>
		<description><![CDATA[Here you see an Arduino Duemilanove, an Ethernet shield and a DMX shield. Well to be honest, the top shield is 1 day old; the rest has been on the shelf for more than a year. I wanted to start using some of the stuff I bought in the past but never used, so with [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://blog.hekkers.net/wp-content/uploads/2011/08/100_0198cr.jpg"><img class="alignleft size-full wp-image-2212" title="Stacked shields" src="http://blog.hekkers.net/wp-content/uploads/2011/08/100_0198cr.jpg" alt="Stacked shields" width="300" height="342" /></a>Here you see an<a href="http://arduino.cc/en/Main/ArduinoBoardDuemilanove" target="_blank"> Arduino Duemilanove</a>, an <a href="http://arduino.cc/en/Main/ArduinoEthernetShield" target="_blank">Ethernet shield</a> and a <a href="http://en.wikipedia.org/wiki/DMX512" target="_blank">DMX shield</a>. Well to be honest, the top shield is 1 day old; the rest has been on the shelf for more than a year. I wanted to start using some of the stuff I bought in the past but never used, so with the need for a DMX encoder to <a href="http://blog.hekkers.net/2011/08/10/led-lighting-for-our-gazebo/">control 6 RGB LED spotlights</a>, I decided to do it this way.</p>
<p>It was a bit annoying that I had to deal with how the Arduino platform works with shields and that you have to find out whether you can stack more than 1 of them on top of the Arduino and not have pin conflicts between the shields you want to use; this can happen so it&#8217;s always good to have a look at the pins all the shields use and see if there are any conflicts. In my opinion, the <a href="http://jeelabs.org/" target="_blank">JeeNode</a> concept is much smarter and easier in this perspective &#8211; and documentation is much better too!</p>
<p>Now back on topic again&#8230; as I said, this combination of boards is going to be used as an Ethernet enabled DMX encoder with integrated web server. Sounds difficult? It&#8217;s not, actually&#8230;</p>
<p>The DMX shield (from the Arduino store, made by Tinker.it) uses the <a href="http://code.google.com/p/tinkerit/wiki/DmxSimple" target="_blank">DMXSimple library</a> and indeed, it&#8217;s very simple. All the hard work is hidden and all you have to do is use 2 or 3 simple functions to get DMX encoding working.</p>
<p>The same goes for the Web server part; the <a href="http://arduino.cc/en/Reference/Ethernet" target="_blank">Ethernet library</a> makes it as simple as it possibly can.</p>
<p>So all I had to do was write some code to parse the values I wanted to send to this DMX encoder (R-, G- and B-values and some time values to soften color changes); and now I&#8217;m waiting for the LED spotlights to arrive, cause I&#8217;m ready for it! Yep, that&#8217;s the other side of the story; you can build cool stuff in a matter of minutes, add your own code for some <em>extras</em> and it works!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.hekkers.net/2011/08/18/stacked-stock/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>LED lighting for our gazebo</title>
		<link>http://blog.hekkers.net/2011/08/10/led-lighting-for-our-gazebo/</link>
		<comments>http://blog.hekkers.net/2011/08/10/led-lighting-for-our-gazebo/#comments</comments>
		<pubDate>Wed, 10 Aug 2011 18:00:01 +0000</pubDate>
		<dc:creator>Robert Hekkers</dc:creator>
				<category><![CDATA[Domotica]]></category>
		<category><![CDATA[Arduino]]></category>
		<category><![CDATA[DMX]]></category>
		<category><![CDATA[LED]]></category>

		<guid isPermaLink="false">http://blog.hekkers.net/?p=2174</guid>
		<description><![CDATA[Despite all the Domotica stuff going on every day, I was able to find the time to build a gazebo in our garden this summer. I finished this gazebo in late June. Well, not quite; I still have to take care of the lighting. And somehow, everything I build or do in my spare time [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://blog.hekkers.net/wp-content/uploads/2011/08/DSC_5509r.jpg"><img class="alignleft size-full wp-image-2176" title="Gazebo" src="http://blog.hekkers.net/wp-content/uploads/2011/08/DSC_5509r.jpg" alt="Gazebo" width="300" height="199" /></a>Despite all the Domotica stuff going on every day, I was able to find the time to build a gazebo in our garden this summer. I finished this gazebo in late June. Well, not quite; I still have to take care of the lighting. And somehow, everything I build or do in my spare time just has to have a Domotica <em>touch</em> :-) This time, it&#8217;s the lighting. I could have chosen the easy way and just put a big bright light bulb in the middle for when it gets too dark outside, but that&#8217;s too ugly, easy and no fun at all.</p>
<p>So I contacted Marco Versluis of <a href="http://www.mood-ledlight.nl/" target="_blank">Mood LedLight</a> and he offered to come over and have a look at the gazebo and discuss some options for some nice and good lighting. Although I&#8217;m not the type of guy who decorates the entire home inside and outside with flashing lights at Christmas time, I <em>do</em> like to have nice lighting in the garden during the time that it&#8217;s dark and we&#8217;re still downstairs; an example of this is a <a href="http://blog.hekkers.net/2009/06/28/garden-automation/">previous garden lighting project</a>.</p>
<p>This time we chose to do the lighting with 6 RGB LED spotlights.<a href="http://blog.hekkers.net/wp-content/uploads/2011/08/LEDspotCapture.png"><img class="alignright size-full wp-image-2177" title="RGB LED spotlight" src="http://blog.hekkers.net/wp-content/uploads/2011/08/LEDspotCapture.png" alt="RGB LED spotlight" width="313" height="294" /></a></p>
<p>At each of the 6 poles of the gazebo there will be a RGB LED spotlight which will light the pole and the inside of the roof. That should be sufficient to give good lighting while sitting under the gazebo on warm nights as well as a nice view from the living room when we&#8217;re inside.</p>
<p>OK.. I admit it, I just couldn&#8217;t resist buying a DMX decoder for those 6 RGB LED spotlights &#8211; so I can produce 256 x 256 x 256 colors, who wouldn&#8217;t want that in his back yard? <img src='http://blog.hekkers.net/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' />  And of course, these LED spotlights need to be controlled from my Domotica system, otherwise it wouldn&#8217;t be much fun, right?</p>
<p>I&#8217;m not worried about accomplishing this. I found a Arduino DMX shield that should take care of the DMX encoding. And since it&#8217;s an Arduino shield and I have some unused Arduinos here, this will be plug &amp; play, hardware-wise. Developing a sketch to control it all from my domotica system shouldn&#8217;t be that hard either.</p>
<p>No, the thing that I&#8217;m thinking about most of the time is: what color should these LED spotlights produce? Just pick a color I (ehh, <em>we</em>) like? Neh, too easy. And I certainly don&#8217;t like some predictable color scenario that repeats itself every x minutes. Yuck!</p>
<p>Come on, my Domotica system has almost <strong>900</strong> device values, why can&#8217;t I create some RGB values out of all that constantly changing data and produce a real <em>geeky</em> lighting? (ah, that reminds me: I need a motion sensor for the gazebo and/or a button to override the geek-lighting scheme with something that&#8217;s more moderate and acceptable for <em>non-geeks</em> &#8230; <img src='http://blog.hekkers.net/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>So basically, I&#8217;m looking for &#8220;something&#8221; that should produce a smooth changing, unpredictable RGB value based on device values originating from our house&#8230; There&#8217;s <a href="http://www.hekkers.net/domotica/DeviceStatus.aspx" target="_blank">enough to choose from</a> I guess&#8230; like using door/window open/closed status as bits for one of the 3 RGB bytes, or on/off statuses,  motion detection, total power usage for the R value, water usage for the B value&#8230;  well, I&#8217;m still thinking what to choose &#8211; suggestions are welcome!</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.hekkers.net/2011/08/10/led-lighting-for-our-gazebo/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Something old and something new</title>
		<link>http://blog.hekkers.net/2011/07/30/something-old-and-something-new/</link>
		<comments>http://blog.hekkers.net/2011/07/30/something-old-and-something-new/#comments</comments>
		<pubDate>Sat, 30 Jul 2011 21:22:09 +0000</pubDate>
		<dc:creator>Robert Hekkers</dc:creator>
				<category><![CDATA[Domotica]]></category>
		<category><![CDATA[Arduino]]></category>
		<category><![CDATA[JeeNodes]]></category>
		<category><![CDATA[Sensors]]></category>

		<guid isPermaLink="false">http://blog.hekkers.net/?p=2136</guid>
		<description><![CDATA[While I&#8217;m logging data and waiting for it to become substantial enough to test another project with, I thought it would be nice to kill the time and start building some new sensors: motion, temperature and light. My goal is to monitor the complete second floor. For the 3 bedrooms I want to monitor motion, [...]]]></description>
			<content:encoded><![CDATA[<p>While I&#8217;m logging data and waiting for it to become substantial enough to test another project with, I thought it would be nice to kill the time and start building some new sensors: motion, temperature and light.</p>
<p>My goal is to monitor the complete second floor. For the 3 bedrooms I want to monitor motion, temperature and light. The passage will only require motion and light, while measuring the humidity in the bathroom would be nice too.</p>
<p>So, for that I need the following:</p>
<ul>
<li>5 * motion;</li>
<li>4 * temperature;</li>
<li>5 * light;</li>
<li>1 * humidity.</li>
</ul>
<p>I already have the motion sensors (<a href="http://en.wikipedia.org/wiki/Passive_infrared_sensor" target="_blank">PIR</a>), the temperature sensors (1-Wire <a href="http://www.maxim-ic.com/datasheet/index.mvp/id/2812" target="_blank">DS18B20</a>), light sensors (<a href="http://en.wikipedia.org/wiki/Light_Dependent_Resistor" target="_blank">LDR</a>), enough JeeNodes, so all I need is a new <a href="http://en.wikipedia.org/wiki/Humidity" target="_blank">humidity</a> sensor.</p>
<p>OK; the amount of sensors I want to use is a bit too much for a single <a href="http://jeelabs.net/projects/hardware/wiki/JeeNode" target="_blank">JeeNode</a> I guess. Maybe 2 JeeNodes will suffice? I didn&#8217;t do any math on this yet, but I don&#8217;t think a single JeeNode can do the job all on its own. 2 JeeNodes maybe, cause the temperature sensors can be on a single 1-Wire bus, so those sensors won&#8217;t use up much ports on the JeeNode; and maybe I can use an <a href="http://jeelabs.net/projects/hardware/wiki/Analog_Plug" target="_blank">Analog Plug</a> to measure the LDRs? We&#8217;ll see. But for now, I assume I&#8217;ll need more than 1 JeeNode. However, I don&#8217;t like to spend an XBee module on each of those JeeNodes, cause I want to keep it relatively low cost. Yeah I know, there are cheaper alternatives for XBee..</p>
<p>But wait, I&#8217;ve still got an<a href="http://www.arduino.cc/en/Main/ArduinoBoardFio" target="_blank"> Arduino Fio</a>; I&#8217;ve bought it sometime in January, not for a specific purpose but just to have a look at it, and I never found a good use for it yet. This Fio is also based on the ATmega328P and runs at 3.3V and 8 MHz. And it also has an XBee socket and USB connector. And it&#8217;s getting old, gathering dust on the shelf&#8230;</p>
<p>Now why don&#8217;t I use this Fio as a &#8216;hub&#8217;, or &#8216;central node&#8217;? It shouldn&#8217;t be too hard to make the (1,2,..) JeeNodes talk to this Arduino Fio over a few wires and use the Fio to transmit all the sensor values to the Zigbee coordinator; now that would be nice! I could power this Fio with a small USB power adapter and run a few wires (for power and serial connection) to the JeeNodes. Maybe I could just as easily use 1 JeeNode per room; this leaves enough ports available for future expansion&#8230; well, let&#8217;s think this one over for some time!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.hekkers.net/2011/07/30/something-old-and-something-new/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
	</channel>
</rss>

