<?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>Francis Shanahan[.com] &#187; Things I&#8217;ve Made</title>
	<atom:link href="http://francisshanahan.com/index.php/category/things-ive-made/feed/" rel="self" type="application/rss+xml" />
	<link>http://francisshanahan.com</link>
	<description>Thoughts on technology from a citizen scientist</description>
	<lastBuildDate>Fri, 27 Jan 2012 14:18:12 +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>Stream a webcam using Javascript, NodeJS, Android, Opera Mobile, Web Sockets and HTML5</title>
		<link>http://francisshanahan.com/index.php/2011/stream-a-webcam-using-javascript-nodejs-android-opera-mobile-web-sockets-and-html5/</link>
		<comments>http://francisshanahan.com/index.php/2011/stream-a-webcam-using-javascript-nodejs-android-opera-mobile-web-sockets-and-html5/#comments</comments>
		<pubDate>Mon, 19 Sep 2011 20:29:04 +0000</pubDate>
		<dc:creator>Francis</dc:creator>
				<category><![CDATA[Cool & Future Tech]]></category>
		<category><![CDATA[Featured]]></category>
		<category><![CDATA[Headline]]></category>
		<category><![CDATA[html5]]></category>
		<category><![CDATA[Things I've Made]]></category>

		<guid isPermaLink="false">http://francisshanahan.com/?p=3265</guid>
		<description><![CDATA[With all the recent Goruck-ness it&#8217;s time to throw out a tech post. I&#8217;ve been prepping for a NodeJS presentation recently and wanted a unique demo. I had also come across the experimental build of Opera which supports accessing the native webcam of a mobile device. So I threw these two technologies together and came up with a Javascript powered way to stream a video camera from a mobile device to a bunch of desktop (or mobile) clients. 
HTML5 had originally laid out support for a new element (the &#8220;device&#8221; ...]]></description>
			<content:encoded><![CDATA[<p>With all the recent Goruck-ness it&#8217;s time to throw out a tech post. I&#8217;ve been prepping for a NodeJS presentation recently and wanted a unique demo. I had also come across the experimental build of Opera which supports accessing the native webcam of a mobile device. So I threw these two technologies together and came up with a Javascript powered way to stream a video camera from a mobile device to a bunch of desktop (or mobile) clients. </p>
<p>HTML5 had originally laid out support for a new element (the &#8220;device&#8221; element) but it appears this element has been scrapped now in favour of the &#8220;getUserMedia&#8221; API. So far I have only seen the Opera Mobile Experimental build support this but hopefully it&#8217;ll get into Dolphin and other mobile browsers soon. </p>
<p><a href="http://my.opera.com/core/blog/2011/03/23/webcam-orientation-preview">http://my.opera.com/core/blog/2011/03/23/webcam-orientation-preview</a></p>
<p>If you just want to cut to the chase here&#8217;s a video of the final result:<br />
<iframe width="560" height="315" src="http://www.youtube.com/embed/cjmuwA8l1LQ" frameborder="0" allowfullscreen></iframe></p>
<p>There are three moving parts here</p>
<ul>
<li>a) The client page which captures the video</li>
<li>b) the server which is a simple Node broadcast server </li>
<li>c) and the Client which is just a web page that renders the output. </li>
</ul>
<p>The client is just a copy-paste from Opera&#8217;s website. I take the video stream, render it to a canvas, then grab the canvas as a base64 encoded image. One image per frame. I could not find a way to limit the video&#8217;s size so the resulting image is fairly large (240&#215;400 on an HTC Incredible).  I down-sampled, cutting the image data to reduce the traffic over the wire. Framerates are still pretty poor but this is just an experiment. </p>
<p>The server is a generic websockets server and gets a message which is a raw data/base64 stream. It broadcasts this down the any connected clients. </p>
<p>The client then is the simplest of all, just connects to the socket server and renders whatever it gets to an <img> tag. </p>
<p>It&#8217;s all Javascript. </p>
<p>Client (this is a jade view). </p>
<pre class="brush: javascript">

h1
    Remote Webcam using NodeJS, Opera, Web Sockets and HTML5/Canvas
video(autoplay=true,id=&quot;sourcevid&quot;)
canvas(id=&quot;output&quot;)
div(id=&quot;log&quot;)
script
    var log = function(msg) {
       document.getElementById(&#039;log&#039;).innerHTML = document.getElementById(&#039;log&#039;).innerHTML + msg + &quot;&lt;br/&gt;&quot;;
    };
    var video = document.getElementsByTagName(&#039;video&#039;)[0],
        heading = document.getElementsByTagName(&#039;h1&#039;)[0];
    if(navigator.getUserMedia) {
        navigator.getUserMedia(&#039;video&#039;, successCallback, errorCallback);

        function successCallback( stream ) {
            video.src = stream;
        };

        function errorCallback( error ) {
            heading.textContent = &quot;An error occurred: [CODE &quot; + error.code + &quot;]&quot;;
        };
    } else {
        heading.textContent = &quot;Native web camera streaming is not supported in this browser!&quot;;
    };

    var back = document.createElement(&#039;canvas&#039;);
    var backcontext = back.getContext(&#039;2d&#039;);

    var ws;

    if(&#039;WebSocket&#039; in window){
        connect(&#039;ws://192.168.2.100:8080/&#039;);
    } else {
        log (&#039;web sockets not supported&#039;);
     }

    function connect(host) {
        ws = new WebSocket(host);
        ws.onopen = function () {
            log(&#039;connected&#039;);
        };

        ws.onclose = function () {
            log(&#039;socket closed&#039;);
        };

        ws.onerror = function (evt) {
            log(&#039;&lt;span style=&quot;color: red;&quot;&gt;ERROR:&lt;/span&gt; &#039; + evt.data);
        };
    };

    function send(msg){
        if (ws != null) {
            if(ws.readyState === 1) {
               ws.send(msg);
            }
        } else {
            //log (&#039;not ready yet&#039;);
        }
    }    

    cw = 120;//240;//video.clientWidth;
    ch = 200;//400;//video.clientHeight;
    log(&#039;width = &#039; + ch);
    back.width = cw;
    back.height = ch;
    draw(video, backcontext, cw, ch);

    function draw(v, bc, w, h) {

        // First, draw it into the backing canvas
        bc.drawImage(v, 0, 0, w, h);

        // Grab the pixel data from the backing canvas
        var stringData=back.toDataURL();

        // send it on the wire
        send(stringData);

        // Start over! 10 frames a second = 100milliseconds
        setTimeout(function(){ draw(v, bc, w, h); });
    }
</pre>
<p>The server. Simple Broadcast app.</p>
<pre class="brush: javascript">

var sys = require(&quot;sys&quot;),
    ws = require(&quot;./ws.js&quot;);

var clients = [];

ws.createServer(
	function (websocket) {

		clients.push(websocket);

		websocket.addListener(&quot;connect&quot;, function (resource) {
			// emitted after handshake
			sys.debug(&quot;connect: &quot; + resource);
		}).addListener(&quot;data&quot;, function (data) {

		// handle incoming data
		// send data to ALL clients whenever ANY client send up data
		for (var i = 0 ; i &lt; clients.length ; i ++ ) {
			clients[i].write(data);
		}

    }).addListener(&quot;close&quot;, function () {

		// emitted when server or client closes connection
		sys.debug(&quot;close&quot;);
    });
  }).listen(8080);

  sys.debug(&quot;Listening on port 8080&quot;);
</pre>
<p>The client. </p>
<pre class="brush: javascript">

&lt;img src=&quot;&quot; id=&quot;frame&quot; style=&quot;width:240px;height:400px&quot;/&gt;

&lt;div id=&quot;log&quot;&gt;&lt;/div&gt;

&lt;script type=&quot;text/javascript&quot;&gt;

	var img; 

	function Init() {

		img = document.getElementById(&quot;frame&quot;);	

	}

	$(document).ready(function () {

		Init();

	});

// Web socket connection stuff is next...	

	if(&#039;WebSocket&#039; in window){

		connect(&#039;ws://localhost:8080/&#039;);		

	} else {

		log (&#039;web sockets not supported&#039;);

	}

	var ws;

	function connect(host) {

		ws = new WebSocket(host);

		ws.onopen = function () {

			log(&#039;connected&#039;);

		};

		ws.onmessage = function (evt) {  	

            if (evt.data != null) {		

			  if ((evt.data[0]=== &quot;d&quot;) &amp;amp;amp;amp;amp;&amp;amp;amp;amp;amp; (evt.data[1]===&quot;a&quot;) ) img.src=evt.data;	//log(&#039;got&#039; + evt.data);

			}

		};

		ws.onclose = function () {

			log(&#039;socket closed&#039;);

		};

		ws.onerror = function (evt) { 

			log(&#039;&lt;span style=&quot;color: red;&quot;&gt;ERROR:&lt;/span&gt; &#039; + evt.data); 

		};

	};

	function log(msg){

		document.getElementById(&#039;log&#039;).innerHTML = msg + &quot;&lt;br/&gt;&quot; + document.getElementById(&#039;log&#039;).innerHTML ;

	}
&lt;/script&gt;
</pre>
<p>Instead of broadcasting, you could store these frames in a MongoDB for assembly later. This would make the ultimate, storage independent video camera. Never run out of storage again!</p>
<p>I really need to start storing these snippets on github&#8230;</p>
<p>P.S. Everyone knows insects are clockwork which is why god made so many of them. Today&#8217;s image is from <a href="http://www.insectlabstudio.com/">http://www.insectlabstudio.com/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://francisshanahan.com/index.php/2011/stream-a-webcam-using-javascript-nodejs-android-opera-mobile-web-sockets-and-html5/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Solving the Traveling Salesman Problem with Genetic Algorithms and HTML5 Web Workers</title>
		<link>http://francisshanahan.com/index.php/2010/html5-workers-genetic-algorithm-traveling-salesman-problem/</link>
		<comments>http://francisshanahan.com/index.php/2010/html5-workers-genetic-algorithm-traveling-salesman-problem/#comments</comments>
		<pubDate>Sun, 10 Oct 2010 01:51:00 +0000</pubDate>
		<dc:creator>Francis</dc:creator>
				<category><![CDATA[Cool & Future Tech]]></category>
		<category><![CDATA[Featured]]></category>
		<category><![CDATA[Headline]]></category>
		<category><![CDATA[html5]]></category>
		<category><![CDATA[Things I've Made]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[Web Experiments]]></category>

		<guid isPermaLink="false">http://francisshanahan.com/?p=2912</guid>
		<description><![CDATA[Irreducible Complexity &#8211; the world is too complex to have evolved!  Let&#8217;s see&#8230;
HTML5 introduces the ability to perform multi-threading in the browser using Javascript through the notion of &#8220;Web Workers&#8221;. So far I have only seen examples of using workers to calculate very high prime numbers. I took a fresh look at these from the standpoint of genetic algorithms and applied it to the Traveling Salesman Problem (a classic). The results are a multi-threaded implementation of the TSP in Javascript capable of converging on a solution for up to 200 ...]]></description>
			<content:encoded><![CDATA[<p>Irreducible Complexity &#8211; the world is too complex to have evolved!  Let&#8217;s see&#8230;</p>
<p>HTML5 introduces the ability to perform multi-threading in the browser using Javascript through the notion of &#8220;Web Workers&#8221;. So far I have only seen examples of using workers to calculate very high prime numbers. I took a fresh look at these from the standpoint of genetic algorithms and applied it to the Traveling Salesman Problem (a classic). The results are a multi-threaded implementation of the TSP in Javascript capable of converging on a solution for up to 200 cities, all with a zero-footprint.</p>
<p>This project was born on a plane over the Atlantic last week. With such a long title to this post I thought about breaking it up into multiple posts but got lazy and figured if you&#8217;re on this site to begin with, chances are you&#8217;re familiar with all these concepts already so here goes.</p>
<p>First a refresher:</p>
<blockquote><p>The <strong>Travelling Salesman Problem</strong> (<strong>TSP</strong>) is an <a title="NP-hard" href="http://en.wikipedia.org/wiki/NP-hard">NP-hard</a> problem in combinatorial optimization studied in operations research and theoretical computer science. Given a list of cities and their pairwise distances, the task is to find a shortest possible tour that visits each city exactly once.</p>
<p>The most direct solution would be to try all permutations (ordered combinations) and see which one is cheapest (using brute force search). The running time for this approach lies within a polynomial factor of <em>O</em>(<em>n</em>!), the factorial of the number of cities, so this solution becomes impractical even for only 20 cities.</p>
<p><a href="http://en.wikipedia.org/wiki/Travelling_salesman_problem">http://en.wikipedia.org/wiki/Travelling_salesman_problem</a></p></blockquote>
<p>Instead of Brute Force I will try to converge on the solution using a genetic algorithm.</p>
<p>At this point you may want to flip to the finished project using<strong> CHROME 7+ or Firefox 4+ or Opera 10+</strong></p>
<p><a href="http://francisshanahan.com/tsa/tsaGAworkers.htm" target="_blank">http://francisshanahan.com/tsa/tsaGAworkers.htm</a></p>
<p>Genetic algorithms are those which can be said to exhibit the characteristics of evolution, i.e. a coded sequence, mutation, a fit function and iterative progression. The typical flow is as follows:</p>
<ol>
<li>Develop a sequence of instructions (the DNA)</li>
<li>Develop a large number of these sequences (the population). In the code I called these &#8220;strands&#8221;.</li>
<li>Score the population for fitness.</li>
<li>Sort by fitness score and select the top-performers.</li>
<li>Generate a new population based off the top-performers.</li>
<li>Modify or mutate this new population and repeat the process with this new generation.</li>
</ol>
<p>Over time the population will tend to converge on a solution. This is a genetic algorithm and it&#8217;s not guaranteed to give the absolute best solution. As you can guess the rate at which the population converges on the best solution is determined by a number of factors:</p>
<ol>
<li>Population Size</li>
<li>Population diversity</li>
<li>Mutation Rate</li>
<li>Fitness Function</li>
<li>The number of generations</li>
<li>The number of &#8220;parents&#8221; selected to breed from.</li>
</ol>
<p>A closely related process is that of &#8220;Hill Climbing&#8221;. Hill Climbing I would say is more deterministic (less probabilistic). A typical hill climbing algorithm is as follows:</p>
<ol>
<li>Develop a sequence of instructions (the DNA)</li>
<li>Score the solution for fitness.</li>
<li>Modify or mutate this solution and score.</li>
<li>If the child is better than the parent it becomes the new parent.</li>
<li>Repeat the process (go back to step #2).</li>
</ol>
<p>So what&#8217;s the difference? Well for one, with hill climbing we only ever advance if the new descendant is better than the current solution. With each generation you always converge. With a Genetic Algorithm you advance regardless and hope for convergence over time. Convergence in a GA is not assured.</p>
<p>A more subtle difference is that the Hill Climbing algorithm is fixed on a specific path. It always chooses a better solution, even though there is a chance that this vector will not ultimately result in the absolute solution. However in a GA, the algorithm chooses a set of &#8220;good&#8221; solutions to breed from, and hence includes the possibility that a current inferior solution might ultimately lead to a better absolute solution overall.</p>
<p>This GA approach mimics real evolution much more closely. It allows for the possibility that a currently superior branch might die off and yield to a currently inferior solution. I think of this as more of a &#8220;strategic&#8221; solution than a &#8220;tactical&#8221; hill climbing solution.</p>
<p>Applying GA to the Traveling Salesman Problem I ended up with this:</p>
<ol>
<li>I create a set of random cities within a specific area.</li>
<li>Then I create a route through all cities (dna in the source code).</li>
<li>Then I score the route by calculating the overall length of the route.  A score + dna = a single strand.</li>
<li>Then I create a population of these strands.</li>
<li>I sort by fitness score and select the 5 best regardless of score.</li>
<li>I create a new generation based on these 5, mutating approximately 80% of the time.</li>
<li>A mutation is basically swapping two cities at random. There is no intelligence to the mutation.</li>
<li>Score this new generation and repeat the process (go back to step 5).</li>
</ol>
<p>This works nicely and is pretty trivial code in Javascript involving a little bit of math and a lot of array copies. In order to get decent results for a problem space of 100 cities or more it&#8217;s necessary to to repeat this process for at least 20-50 generations at a time. All processing is sequential and the browser hangs up whilst this is going on. To achieve solutions to a higher number of cities some other means of processing is needed.</p>
<p>Enter web workers.</p>
<p>Web Workers are new in HTML5 and in a nutshell they allow you to execute Javascript in a separate thread (in parallel) from the current browser thread. So far Chrome, Opera, Firefox have all implemented web workers. ). I&#8217;m not going to explain the basics of workers here as Mozilla has an EXCELLENT explanation of how to get started here: <a href="https://developer.mozilla.org/En/Using_web_workers">https://developer.mozilla.org/En/Using_web_workers</a></p>
<p>I&#8217;m using them as follows:</p>
<ol>
<li>Create a large population of possible solutions (my solution uses 1000)</li>
<li>Create a number of workers, my solution uses 10.</li>
<li>Split up the population across the workers, giving each 100 solutions to work on.</li>
<li>Mutate and score each one within the worker (10 threads operating in parallel).</li>
<li>Join back and Collect the results.</li>
<li>Sort the entire population and repeat.</li>
</ol>
<p>Couple of advantages here are that not only do we get parallel execution and finish processing quicker, we don&#8217;t hang up the UI thread so the browser remains responsive throughout.</p>
<p>Web Workers are great for processing but little else. They cannot access the DOM, the cannot generate page events, they cannot do much of anything. What they can do is receive information from the parent page, process information and send it back. This information is limited to strings. You can serialize your objects to a json string and then do an eval on the worker side but this ultimately will be done for you by the browser. So far only Firefox and Opera are capable of serializing JSON objects between the page and the worker thread. Hence the example solution only works in these browsers.</p>
<p>A couple of things I noticed in working with this approach.</p>
<ol>
<li>A larger population does not always guarantee a better solution. There is a balance for any given problem space and fitness function.</li>
<li>Mutation rate: You cannot simply change EVERYthing on each generation. You must maintain some of the core DNA in order to improve. Otherwise the solution is too random and does not converge.</li>
<li>Similarly, too little mutation and the solution converges too slowly.</li>
<li>Number of Breeders &#8211; you would think breeding from the single-best solution at any given point would be ideal. Surprisingly the system did better when a higher number, say 10% of the population is used to breed from. Too many and again you don&#8217;t converge. Too few and the system can be boxed into a dead-end solution ala the Hill Climbing approach.</li>
</ol>
<p>The key thing to remember is at no point have I written an algorithm to find the shortest distance. I&#8217;ve simply put pieces together in a closed system, assigned probabilities and set the thing in motion. Even still it&#8217;s pretty fascinating.</p>
<p><img class="alignleft" src="http://francisshanahan.com/tsa/tsp.png" alt="50 cities, 1000 generations" width="297" height="293" />Over the course of the past week I&#8217;ve run this thing many times. It&#8217;s the type of thing I can waste hours with. I tried various combinations of mutation rate, population size etc to get the right balance. Initially the system did not converge at all. Then I found it would converge but very quickly plateau and run out of ideas so to speak. Amping up the mutation fixed this but negatively impacted convergence, so I tweaked the number of breeders a little. Back and forth until I got it to where it is today. It&#8217;s fun to watch the code try to figure out new pathways, occasionally it&#8217;ll drop a segment in favour of a different route, only to bring that same piece back in later.  This is where my knowledge of GA falls short. I&#8217;m not sure I&#8217;ve gotten it right and to take it any further would require some heavy duty research. It&#8217;ll suffice for now.</p>
<p>This is a crude system with only 1 test for fitness and no competing goals. Imagine scaling this up to &#8220;earth&#8221; scale with billions of competing factors, each of varying weights, trillions of instructions per individual,  3.5 billion years of evolution and a system that feeds BACK on itself, altering the fitness functions as it goes. The possibilities are astounding.</p>
<p>As you can tell I had a lot of fun with this one. Genetic algorithms are a powerful concept, particularly when dealing with difficult to solve problems (e.g.  NP-hard). The outcome is highly probabilistic and how the algorithm progresses essentially mimics our own progression as life on planet earth. Too cool.</p>
<p>Now flip to the finished project using<strong> CHROME 7+ or Firefox 4+ or Opera 10+</strong></p>
<p><a href="http://francisshanahan.com/tsa/tsaGAworkers.htm" target="_blank">http://francisshanahan.com/tsa/tsaGAworkers.htm</a></p>
]]></content:encoded>
			<wfw:commentRss>http://francisshanahan.com/index.php/2010/html5-workers-genetic-algorithm-traveling-salesman-problem/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Kirigami and Origami</title>
		<link>http://francisshanahan.com/index.php/2010/kirigami-and-origami/</link>
		<comments>http://francisshanahan.com/index.php/2010/kirigami-and-origami/#comments</comments>
		<pubDate>Mon, 07 Jun 2010 19:01:04 +0000</pubDate>
		<dc:creator>Francis</dc:creator>
				<category><![CDATA[Featured]]></category>
		<category><![CDATA[Headline]]></category>
		<category><![CDATA[Life & Introspection]]></category>
		<category><![CDATA[Things I've Made]]></category>
		<category><![CDATA[kirigami]]></category>
		<category><![CDATA[origami]]></category>

		<guid isPermaLink="false">http://francisshanahan.com/?p=2542</guid>
		<description><![CDATA[File this under “do try this at home”. Since Christmas I have been occasionally practicing Origami which has been a lot of fun. Origami, particularly unit-origami as you might think has some fairly strong roots in geometry and some exquisite forms can be produced with some surprisingly complex folds. Probably the best example of this is the Bisected Cube folded from a single sheet, the bisection is covered exactly by a 2nd sheet of paper folded into a perfect hexagon.
This past weekend I tried my hand at Kirigami. Kirigami is ...]]></description>
			<content:encoded><![CDATA[<p>File this under “do try this at home”. Since Christmas I have been occasionally practicing Origami which has been a lot of fun. Origami, particularly unit-origami as you might think has some fairly strong roots in geometry and some exquisite forms can be produced with some surprisingly complex folds. Probably the best example of this is the Bisected Cube folded from a single sheet, the bisection is covered exactly by a 2nd sheet of paper folded into a perfect hexagon.</p>
<p>This past weekend I tried my hand at Kirigami. Kirigami is like Origami but cutting is allowed. Typically take one sheet of paper but you can combine multiple pieces as in unit-Origami.</p>
<p>This a cheap past-time and a lot of fun. I recommend a good cutting board, a fresh Xacto, some graph paper and plenty of quiet. I was going to publish up the patterns for these but I think that’d spoil it for the reader.</p>
<p>Here are some photos of the pieces I’ve cut and models I’ve folded. I find the animals far more challenging but not as mathematical or as satisfying.</p>
<p><embed type="application/x-shockwave-flash" src="http://picasaweb.google.com/s/c/bin/slideshow.swf" width="600" height="400" flashvars="host=picasaweb.google.com&#038;hl=en_US&#038;feat=flashalbum&#038;RGB=0x000000&#038;feed=http%3A%2F%2Fpicasaweb.google.com%2Fdata%2Ffeed%2Fapi%2Fuser%2Ffrancisshanahan%2Falbumid%2F5479013890130554033%3Falt%3Drss%26kind%3Dphoto%26hl%3Den_US" pluginspage="http://www.macromedia.com/go/getflashplayer"></embed></p>
]]></content:encoded>
			<wfw:commentRss>http://francisshanahan.com/index.php/2010/kirigami-and-origami/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to Build a 8&#215;8 RGB LED Matrix with PWM using an Arduino</title>
		<link>http://francisshanahan.com/index.php/2009/how-to-build-a-8x8x3-led-matrix-with-pwm-using-an-arduino/</link>
		<comments>http://francisshanahan.com/index.php/2009/how-to-build-a-8x8x3-led-matrix-with-pwm-using-an-arduino/#comments</comments>
		<pubDate>Thu, 14 May 2009 11:30:22 +0000</pubDate>
		<dc:creator>Francis</dc:creator>
				<category><![CDATA[Electronics]]></category>
		<category><![CDATA[Featured]]></category>
		<category><![CDATA[Headline]]></category>
		<category><![CDATA[Things I've Made]]></category>
		<category><![CDATA[arduino]]></category>
		<category><![CDATA[LED matrix]]></category>
		<category><![CDATA[PWM]]></category>
		<category><![CDATA[RGB]]></category>

		<guid isPermaLink="false">http://francisshanahan.com/www/?p=2248</guid>
		<description><![CDATA[A while ago I designed a circuit that would power an 8&#215;8 RGB LED Matrix (192 LEDs in all) using only 3 pins from an Arduino Diecimila and supporting Pulse Width Modulation. I&#8217;ve uploaded some videos of this project on Youtube and folks have been emailing me with questions on how it works. In this post I&#8217;ll try to answer all those questions so you can build your own.
I started with the LED Matrix component itself. I used an RGB 8&#215;8 common anode matrix from LedSee (only $10 on ebay). ...]]></description>
			<content:encoded><![CDATA[<p>A while ago I designed a circuit that would power an 8&#215;8 RGB LED Matrix (192 LEDs in all) using only 3 pins from an Arduino Diecimila and supporting Pulse Width Modulation. I&#8217;ve uploaded some videos of this project on Youtube and folks have been emailing me with questions on how it works. In this post I&#8217;ll try to answer all those questions so you can build your own.</p>
<p>I started with the LED Matrix component itself. I used an RGB 8&#215;8 common anode matrix from LedSee (only $10 on ebay). The matrix takes 32 pins: 8 anodes, 8 cathodes for Red, 8 for Green and 8 for Blue.  Then I had an arduino Diecimila which was about $25 I think but you can use any ATMega based board.</p>
<p>A little googling revealed that a thing called a Shift Register could help me drive all those 32 pins using just a couple from the arduino. Shift Registers are cheap and easy to source. I used the 74HC595 IC.</p>
<p>The arduino website has a tutorial on Shift Registers which can be found here: <a href="http://www.arduino.cc/en/Tutorial/ShiftOut">http://www.arduino.cc/en/Tutorial/ShiftOut</a>. This explains what they are, how they work, the clock, latch and data pins as well as how to chain them together.</p>
<p>After a few evenings of experimentation I knew I could drive 8 pins per 74HC595 chip. If I chained enough together I could drive all 32 pins. So I was set.</p>
<p><img class="alignleft" title="Breadboard prototype" src="http://lh5.ggpht.com/_45WOFW8ZSb4/SV8CMUwQHmI/AAAAAAAAFIk/dtM0myXcaZI/s800/050.JPG" alt="breadboard prototype" width="280" />Next I drew up the schematic on paper. I played with a few prototypes using Breadboard until I had confidence that the circuit would work. This was a smart move as it turned out there was a problem. I found through experimentation that the Red LEDs were overpowering the Green and the Blue. I couldn&#8217;t figure it out since the code treated them all as equals. I went back to the reference manual for the LED matrix and found that the operating voltage of the RED LEDs in the matrix is actually lower than the Blue or Green.</p>
<p>I was able to even them out by introducing a higher resistor (330) into the RED cathodes than is in line with the blue and green (220 ohms). That was a true moment of enlightenment.</p>
<p>There&#8217;s a lot of wires so I put it into Visio. Here&#8217;s the result:<br />
<a href="http://picasaweb.google.com/lh/photo/4m0f5w6KA1bAIHIswXBFcg?feat=embedwebsite"><img src="http://lh4.ggpht.com/_45WOFW8ZSb4/SV66O0j6HlI/AAAAAAAAFGg/WcVBQAnX1Vs/s400/LEDMatrixSchematic.png" align="center" /></a></p>
<p>The blue, green and yellow lines go to the Arduino.</p>
<p>Next up I worked on the code. Besides turning the LEDs on and off I wanted to actually get different colors. I had no idea how to do this but it turned out Robert aka &#8220;MadWorm&#8221; had already figured it out: [<a href="http://blog.spitzenpfeil.org/wordpress/wp-content/uploads/2008/10/matrix_code.pde" target="_blank">LINK</a>]. My code is essentially based entirely off of Robert&#8217;s so I won&#8217;t complicate or confuse you with my own extensions. </p>
<p>To better understand the ISR business, I&#8217;ll refer you this time to ucHobby [<a href="http://www.uchobby.com/index.php/2007/11/24/arduino-interrupts/">LINK</a>]</p>
<p>The arduino supports an interrupt which is essentially a routine that runs in the the background, almost like a separate thread, from your code. This interrupt is what updates the Matrix pins and it happens very very fast. Even better is that it frees up the main loop of your Arduino sketch to do the interesting stuff like update the actual matrix data.</p>
<p>Pulse Width Modulation or PWM is essentially a way of simulating an analog output from a binary source. Huh? Wha? </p>
<p>If I turn on a Red LED I get red, if I turn on a Blue LED I get blue. If I turn them on both at the same time I get purple. What if I want to get some color in between? with this type of system you can&#8217;t get anything but 7 colors (R, G, B, RG, RB, GB, RGB). The only way is to turn on the LEDs partially. But an LED can only be fully on or fully off, how can you get a &#8220;partial&#8221; LED? The answer is PWM. </p>
<p>Pulse Width Modulation varies the time for which an LED is active. It&#8217;s still either fully on or fully off during that time, but if you think of that time as a wave, the &#8220;width&#8221; of the &#8220;pulse&#8221; during which the LED is active varies. Here&#8217;s a good visual: </p>
<p><img src="http://upload.wikimedia.org/wikipedia/commons/thumb/8/8e/PWM%2C_3-level.svg/350px-PWM%2C_3-level.svg.png" alt="PWM" /></p>
<p>The result is an ability to &#8220;mix&#8221; colors by different degrees and get a far wider range than the 7 possible combinations of RGB. The good news is this is all implemented within Robert&#8217;s ISR code above. </p>
<p>So I soldered away busily for three nights and in the end I had a nice little circuit board. Definitely not as small as it could be but good enough for a RevA. </p>
<p>At this point I had everything working nicely so I built simple case of Cherry/Lexan and four hex-head bolts to finish up. </p>
<p>That&#8217;s basically it! You can checkout the pictures below or find the video on Youtube. I had a lot of fun making this thing. It sits proudly on my desk today and although many have tried, no one can resist asking &#8220;what is that thing&#8221;. </p>
<p><embed type="application/x-shockwave-flash" src="http://picasaweb.google.com/s/c/bin/slideshow.swf" width="600" height="400" flashvars="host=picasaweb.google.com&#038;captions=1&#038;hl=en_US&#038;feat=flashalbum&#038;RGB=0x000000&#038;feed=http%3A%2F%2Fpicasaweb.google.com%2Fdata%2Ffeed%2Fapi%2Fuser%2Ffrancisshanahan%2Falbumid%2F5287314028583882001%3Falt%3Drss%26kind%3Dphoto%26hl%3Den_US" pluginspage="http://www.macromedia.com/go/getflashplayer"></embed>The PWM is very tough to videotape but take a peek at the pics. Here&#8217;s my daughter playing with the prototype: </p>
<p><object width="425" height="344"><param value="http://www.youtube.com/v/QMKiN_5nrUI&amp;hl=en&amp;fs=1" name="movie" /><param value="true" name="allowFullScreen" /><param value="always" name="allowscriptaccess" /><embed width="425" height="344" allowfullscreen="true" allowscriptaccess="always" type="application/x-shockwave-flash" src="http://www.youtube.com/v/QMKiN_5nrUI&amp;hl=en&amp;fs=1"></embed></object> </p>
]]></content:encoded>
			<wfw:commentRss>http://francisshanahan.com/index.php/2009/how-to-build-a-8x8x3-led-matrix-with-pwm-using-an-arduino/feed/</wfw:commentRss>
		<slash:comments>64</slash:comments>
		</item>
		<item>
		<title>Flickr + Composite Image Maker + Silverlight Deep Zoom</title>
		<link>http://francisshanahan.com/index.php/2009/flickr-composite-image-maker-silverlight-deep-zoom/</link>
		<comments>http://francisshanahan.com/index.php/2009/flickr-composite-image-maker-silverlight-deep-zoom/#comments</comments>
		<pubDate>Fri, 20 Mar 2009 01:01:38 +0000</pubDate>
		<dc:creator>Francis</dc:creator>
				<category><![CDATA[Cool & Future Tech]]></category>
		<category><![CDATA[Featured]]></category>
		<category><![CDATA[Headline]]></category>
		<category><![CDATA[Things I've Made]]></category>
		<category><![CDATA[deep zoom]]></category>
		<category><![CDATA[silverlight]]></category>

		<guid isPermaLink="false">http://francisshanahan.com/www/?p=1930</guid>
		<description><![CDATA[First install Silverlight v2.0 [HERE] then check this out: http://www.francisshanahan.com/zoom/ then come back and read the rest.
Silverlight 3.5 was announced recently so I finally took 5mins to look at their &#8220;Deep Zoom&#8221; technology. Deep Zoom provides a way to view a HUGE image by converting it into what they call an &#8220;image pyramid&#8221;. Similar to what Google Maps does. It just so happened that I have a thing that makes huge images. It&#8217;s a side project I&#8217;ve been working on for about 18 months now. Anyway, I fired it up ...]]></description>
			<content:encoded><![CDATA[<p>First install Silverlight v2.0 [<a href="http://silverlight.net/GetStarted/">HERE</a>] then check this out: <a href="http://www.francisshanahan.com/zoom/">http://www.francisshanahan.com/zoom/</a> then come back and read the rest.</p>
<p>Silverlight 3.5 was announced recently so I finally took 5mins to look at their &#8220;Deep Zoom&#8221; technology. Deep Zoom provides a way to view a HUGE image by converting it into what they call an &#8220;image pyramid&#8221;. Similar to what Google Maps does. It just so happened that I have a thing that makes huge images. It&#8217;s a side project I&#8217;ve been working on for about 18 months now. Anyway, I fired it up and made two huge images, one of a Tiger and another of Ethan. More on how these images were created in a later post. Meanwhile email me if you&#8217;d like an image of your own.</p>
<p>For now enjoy the Deep Zooms of these images HERE: <a href="http://www.francisshanahan.com/zoom/default.aspx">http://www.francisshanahan.com/zoom/default.aspx</a><br />
Make sure you click the Full Screen link for full effect. </p>
<p>NOTE:<strong> If you&#8217;re not seeing anything </strong>, install Silverlight first by going here [<a href="http://silverlight.net/GetStarted/">http://silverlight.net/GetStarted/</a>] and look for the &#8220;runtime&#8221; link on the right (midway down). </p>
]]></content:encoded>
			<wfw:commentRss>http://francisshanahan.com/index.php/2009/flickr-composite-image-maker-silverlight-deep-zoom/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>How I Tweaked WordPress</title>
		<link>http://francisshanahan.com/index.php/2009/how-i-tweaked-wordpress/</link>
		<comments>http://francisshanahan.com/index.php/2009/how-i-tweaked-wordpress/#comments</comments>
		<pubDate>Tue, 17 Feb 2009 14:27:05 +0000</pubDate>
		<dc:creator>Francis</dc:creator>
				<category><![CDATA[Featured]]></category>
		<category><![CDATA[General Computing]]></category>
		<category><![CDATA[Headline]]></category>
		<category><![CDATA[Things I've Made]]></category>
		<category><![CDATA[blog]]></category>
		<category><![CDATA[tweaking]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://francisshanahan.com/www/?p=1732</guid>
		<description><![CDATA[WordPress is pretty nice out of the box but there&#8217;s a few things you&#8217;ll want to do on top of the base install. I&#8217;ve been tweaking WordPress 2.7 since the day I installed it. It&#8217;s humming just as I like now and I figured I&#8217;d share the few things I changed.

I started with wordpess 2.5 which was my host&#8217;s default installation. I immediately upgraded to 2.7. This was as simple as ftp&#8217;ing some files across and running a database script.
I migrated my old data, which was in SQL Server into ...]]></description>
			<content:encoded><![CDATA[<p>WordPress is pretty nice out of the box but there&#8217;s a few things you&#8217;ll want to do on top of the base install. I&#8217;ve been tweaking WordPress 2.7 since the day I installed it. It&#8217;s humming just as I like now and I figured I&#8217;d share the few things I changed.</p>
<ol>
<li>I started with wordpess 2.5 which was my host&#8217;s default installation. I immediately upgraded to 2.7. This was as simple as ftp&#8217;ing some files across and running a database script.</li>
<li>I migrated my old data, which was in SQL Server into mySQL using some simple SQL scripts. This took about an hour as I&#8217;d never seen the wordpress scheme before. I lost my tags in the process but no big deal.</li>
<li>Then I grabbed the Arthemia Lite theme (<a href="http://colorlabsproject.com/arthemia/">http://colorlabsproject.com/arthemia/</a>) which I&#8217;d first seen on my buddy Chris Webb&#8217;s site (<a href="http://ckwebb.com" target="_blank">ckwebb.com</a>). The lite version is free but with reduced functionality.</li>
<li>I grabbed JCarousel (<a href="http://sorgalla.com/jcarousel/" target="_blank">http://sorgalla.com/jcarousel/</a>) and modified the index.php template to make the featured items scroll in the top right.</li>
<li>I threw in some Google Adsense ads into the main template.</li>
<li>I migrated from Feedburner to Google Feedburner and added in Ads into the RSS in the process.</li>
<li>I did some UI tweaks around the theme but nothing too crazy. E.g. Added an image to the Single Post page, updated the favicon etc.</li>
<li>As far as plugins go I&#8217;m using Akismet for spam prevention, Contact Form ][, All in One SEO and WP Super Cache.</li>
<li>Modified the Thumbnail script (timthumb) so I don&#8217;t have to upload the images to my server and can link to them directly. This makes new posts much much faster.</li>
</ol>
<p>That&#8217;s about it. Last night I upgraded from 2.7 to 2.7.1 which was very easy and took about 10 mins. Pretty happy so far.</p>
]]></content:encoded>
			<wfw:commentRss>http://francisshanahan.com/index.php/2009/how-i-tweaked-wordpress/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Time for a Change</title>
		<link>http://francisshanahan.com/index.php/2009/time-for-a-change/</link>
		<comments>http://francisshanahan.com/index.php/2009/time-for-a-change/#comments</comments>
		<pubDate>Sat, 07 Feb 2009 03:53:23 +0000</pubDate>
		<dc:creator>Francis</dc:creator>
				<category><![CDATA[Things I've Made]]></category>
		<category><![CDATA[site]]></category>

		<guid isPermaLink="false">http://francisshanahan.com/www/?p=1693</guid>
		<description><![CDATA[A quick blog as I&#8217;m exhausted. Regulars will notice I&#8217;ve switched to WordPress. Content has been migrated from SQL Server to mySQL and I&#8217;ve done a fair bit of tweaking to the Arthemia Lite (free) theme to snazz it up. Looks almost like the pro version now. 
This new blog will allow a lot more features than I could&#8217;ve kept up with writing myself. Ping backs, Trackbacks, Gravatar support, a snazzy admin console, widgets galore and a nice theme (much better than my CSS/artistic bent would ever come up with). ...]]></description>
			<content:encoded><![CDATA[<p>A quick blog as I&#8217;m exhausted. Regulars will notice I&#8217;ve switched to WordPress. Content has been migrated from SQL Server to mySQL and I&#8217;ve done a fair bit of tweaking to the Arthemia Lite (free) theme to snazz it up. Looks almost like the pro version now. </p>
<p>This new blog will allow a lot more features than I could&#8217;ve kept up with writing myself. Ping backs, Trackbacks, Gravatar support, a snazzy admin console, widgets galore and a nice theme (much better than my CSS/artistic bent would ever come up with). All in all I&#8217;m happy with it and will write more on the motivation behind switching in a few days. </p>
<p>All the old content is still there, links will continue to work although are now redirected. The RSS feed has been moved over but if you subscribed through feedburner you won&#8217;t notice a difference. </p>
<p>Let&#8217;s see how it goes for now. </p>
]]></content:encoded>
			<wfw:commentRss>http://francisshanahan.com/index.php/2009/time-for-a-change/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Foolstr.com Soft Launch</title>
		<link>http://francisshanahan.com/index.php/2009/foolstrcom-soft-launch/</link>
		<comments>http://francisshanahan.com/index.php/2009/foolstrcom-soft-launch/#comments</comments>
		<pubDate>Fri, 09 Jan 2009 21:51:00 +0000</pubDate>
		<dc:creator>Francis</dc:creator>
				<category><![CDATA[Digital Identity]]></category>
		<category><![CDATA[Featured]]></category>
		<category><![CDATA[Things I've Made]]></category>
		<category><![CDATA[Web Experiments]]></category>
		<category><![CDATA[foolstr.com]]></category>
		<category><![CDATA[openID]]></category>
		<category><![CDATA[opinions]]></category>
		<category><![CDATA[soapbox]]></category>
		<category><![CDATA[social network]]></category>
		<category><![CDATA[web2.0]]></category>

		<guid isPermaLink="false">http://francisshanahan.com/www/index.php/2009/foolstrcom-soft-launch/</guid>
		<description><![CDATA[             &#34;The fool is proud of the one thing he knows&#8230;&#34;

             foolstr is a new website, located at www.foolstr.com. It&#8217;s all about the Wisdom of Crowds. foolstr lets you publish your ideas, lessons learned and get feedback from the community. It&#8217;s a simple social site, intended to gather up collective wisdom. 

foolstr is innovative in that it relies on OpenID as its form of authentication. This ...]]></description>
			<content:encoded><![CDATA[<div class="myC1"><a target="_blank" href="http://www.foolstr.com"><img align="right" alt="foolstr.com" src="http://foolstr.com/images/fs.png" /></a>             &quot;The fool is proud of the one thing he knows&#8230;&quot;</div>
<p></p>
<div class="myC1">             <a href="http://www.foolstr.com/">foolstr </a>is a new website, located at <a href="http://www.foolstr.com/">www.foolstr.com</a>. It&#8217;s all about the Wisdom of Crowds. foolstr lets you publish your ideas, lessons learned and get feedback from the community. It&#8217;s a simple social site, intended to gather up collective wisdom. </div>
<p>
<a href="http://www.foolstr.com/">foolstr </a>is innovative in that it relies on OpenID as its form of authentication. This means foolstr doesn&#8217;t invade your privacy and registration is a snap. It&#8217;s also completely anonymous. Things like Passwords or Email addresses, we don&#8217;t need &#8216;em. Your email or password is never sent to Foolstr, you don&#8217;t have to remember a NEW password, you don&#8217;t have to remember ANYthing. Try it and see!</p>
<p>It&#8217;s a fun site and we want the barrier of entry to be small. You can post content without even registering and so far there is some interesting content. </p>
<p>From a technical side this site is another experiment, this time dealing with OpenID to determine just how viable this technology is. So far it seems sound for this level of authentication. The question is will the public understand it and be comfortable with this as a means of authentication. We&#8217;ll see. I&#8217;ve also hooked up the Yahoo Term Extraction API for content analysis and Google Analytics for Traffic. </p>
<p>So blog about it, Facebook it, Digg it, tell your friends, share your ideas and opinions and vote on what&#8217;s there. Let&#8217;s see what the fools know&#8230;</p>
<p>Foolstr&#8217;s still in pre-alpha, with many kinks still being ironed out. If you find a bug, post back to <a target="_blank" href="http://foolstr.blogspot.com">http://foolstr.blogspot.com</a> or use the contact page at foolstr.com.</p>
<p>Now get out there and tell us something we don&#8217;t already know!!! <br />
<a target="_blank" href="http://FOOLSTR.COM">HTTP://FOOLSTR.COM</a></p>
]]></content:encoded>
			<wfw:commentRss>http://francisshanahan.com/index.php/2009/foolstrcom-soft-launch/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Science is Wonderful</title>
		<link>http://francisshanahan.com/index.php/2009/science-is-wonderful/</link>
		<comments>http://francisshanahan.com/index.php/2009/science-is-wonderful/#comments</comments>
		<pubDate>Sun, 04 Jan 2009 13:54:00 +0000</pubDate>
		<dc:creator>Francis</dc:creator>
				<category><![CDATA[Electronics]]></category>
		<category><![CDATA[Featured]]></category>
		<category><![CDATA[Science]]></category>
		<category><![CDATA[Things I've Made]]></category>
		<category><![CDATA[arduino]]></category>
		<category><![CDATA[kids]]></category>
		<category><![CDATA[processing 1.0]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://francisshanahan.com/www/index.php/2009/science-is-wonderful/</guid>
		<description><![CDATA[Kids are like giant sponges. I finally got my Arduino powered RGB LED Matrix soldered together and firing on all cylinders last night. I wrote a simple interface in Processing and then showed the kids after lunch today. Within about 30seconds they were having fun turning on and off lights. Here&#8217;s the result: 

 
They saw how things were linked together, how a click on the screen lit a dot on the matrix and it was simple enough but yet they could quickly make shapes and letters. They got a ...]]></description>
			<content:encoded><![CDATA[<p>Kids are like giant sponges. I finally got my Arduino powered RGB LED Matrix soldered together and firing on all cylinders last night. I wrote a simple interface in Processing and then showed the kids after lunch today. Within about 30seconds they were having fun turning on and off lights. Here&#8217;s the result: </p>
<p>
<object width="425" height="344"><param value="http://www.youtube.com/v/QMKiN_5nrUI&amp;hl=en&amp;fs=1" name="movie" /><param value="true" name="allowFullScreen" /><param value="always" name="allowscriptaccess" /><embed width="425" height="344" allowfullscreen="true" allowscriptaccess="always" type="application/x-shockwave-flash" src="http://www.youtube.com/v/QMKiN_5nrUI&amp;hl=en&amp;fs=1"></embed></object> </p>
<p>They saw how things were linked together, how a click on the screen lit a dot on the matrix and it was simple enough but yet they could quickly make shapes and letters. They got a big kick out of it and I&#8217;m really glad to be able to expose them to science and learning at such an early age.</p>
<p>If you&#8217;re interested in a closer look at the matrix driver circuit, checkout the gallery here:<br />
<embed type="application/x-shockwave-flash" src="http://picasaweb.google.com/s/c/bin/slideshow.swf" width="400" height="267" flashvars="host=picasaweb.google.com&#038;RGB=0x000000&#038;feed=http%3A%2F%2Fpicasaweb.google.com%2Fdata%2Ffeed%2Fapi%2Fuser%2Ffrancisshanahan%2Falbumid%2F5287314028583882001%3Fkind%3Dphoto%26alt%3Drss" pluginspage="http://www.macromedia.com/go/getflashplayer"></embed></p>
]]></content:encoded>
			<wfw:commentRss>http://francisshanahan.com/index.php/2009/science-is-wonderful/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Math + Woodwork = Homemade Wooden Burr Puzzles</title>
		<link>http://francisshanahan.com/index.php/2008/math-woodwork-homemade-wooden-burr-puzzles/</link>
		<comments>http://francisshanahan.com/index.php/2008/math-woodwork-homemade-wooden-burr-puzzles/#comments</comments>
		<pubDate>Mon, 11 Aug 2008 06:18:00 +0000</pubDate>
		<dc:creator>Francis</dc:creator>
				<category><![CDATA[Things I've Made]]></category>
		<category><![CDATA[Woodworking]]></category>
		<category><![CDATA[math]]></category>
		<category><![CDATA[puzzles]]></category>
		<category><![CDATA[woodwork]]></category>

		<guid isPermaLink="false">http://francisshanahan.com/www/index.php/2008/math-woodwork-homemade-wooden-burr-puzzles/</guid>
		<description><![CDATA[This weekend I was in dire need of a mental escape. Woodworking in the basement is both a physical and mental endeavour which generally only succeeds when you give it adequate focus. I don&#8217;t recommend woodworking when you&#8217;re mind&#8217;s not on your work [LINK]. 
I came across IBM&#8217;s website on burr puzzles [LINK] and decided to make one. 
&#34;Burr puzzles are interlocking puzzles known in Europe and Asia since at least the 18th century. Traditionally they are made from wood&#8230;.and require special wood so that the pieces do not change ...]]></description>
			<content:encoded><![CDATA[<p><a href="http://picasaweb.google.com/francisshanahan/20080809Burr/photo?authkey=Be3nuM3u4ik#5232721157662933154"><img align="left" src="http://lh5.ggpht.com/francisshanahan/SJ5cKzMrgKI/AAAAAAAACgE/43X8_9jDYK8/s144/001.JPG" alt="" /></a>This weekend I was in dire need of a mental escape. Woodworking in the basement is both a physical and mental endeavour which generally only succeeds when you give it adequate focus. I don&#8217;t recommend woodworking when you&#8217;re mind&#8217;s not on your work [<a target="_blank" href="http://francisshanahan.com/detail.aspx?cid=681">LINK</a>]. </p>
<p>I came across IBM&#8217;s website on burr puzzles [<a target="_blank" href="http://www.research.ibm.com/BurrPuzzles/">LINK</a>] and decided to make one. </p>
<p><em>&quot;Burr puzzles are <span class="mw-redirect">interlocking puzzles</span> known in Europe and Asia since at least the 18th century. Traditionally they are made from wood&#8230;.and require special wood so that the pieces do not change shape too much in changing temperature and humidity.&quot;</p>
<p>&quot;From the late 1980s to the mid 1990 Bill Cutler and others undertook a complete analysis of all six-piece burrs&#8230;. From this analysis we now know that there are roughly 35.65 billion ways to assemble burr puzzles pieces (71.3 billion if mirror images are counted also). Of these 35.65 billion logical assemblies 5.95 billion can be taken apart.&quot;</p>
<p></em>Burrs? You had me at &quot;35.65 billion&quot;. </p>
<p><a href="http://picasaweb.google.com/francisshanahan/20080809Burr/photo?authkey=Be3nuM3u4ik#5232721089910512994"><img align="right" alt="Winkler pieces" src="http://lh5.ggpht.com/francisshanahan/SJ5cG2zPnWI/AAAAAAAACf8/NMQ-wnpc_ms/s144/010.JPG" /></a> I first picked &quot;David Winkler&#8217;s favorite level 5 burr&quot; [<a target="_blank" href="http://www.research.ibm.com/BurrPuzzles/B6JW5F23.html">LINK</a>]. This is a &quot;notchable&quot; burr meaning you can construct it entirely by notching the pieces. I used a bit of red-oak I had laying around. This burr is 6 units long, 2 wide. The unit size in my case is 3/8&quot; which I found a good size. The design in this case is a &quot;5.4&quot; meaning there are 5 moves required to remove the first piece, then 4 to remove the 2nd. </p>
<p>My kids got a good kick out of this one and they&#8217;ll likely play with it in years to come. Sunday night I caught the bug again and decided to make another. This time a &quot;general&quot; design meaning one where the pieces are not just notched but also have some partial voids. Slightly more complex to create but allows for more complex solution. I decided to go all out and chose Peter Marineau&#8217;s<br />
Piston Puzzle Burr [<a href="http://www.research.ibm.com/BurrPuzzles/B6JM9.html" target="_blank">LINK</a>].</p>
<p><em>&quot;1986: Peter Marineau designed this puzzle by hand. It was the highest         level burr known before Bill Cutler did his exhaustive computer         analysis.&quot;</p>
<p></em>I made this one out of cherry with its tighter grain and the fit is a lot better, mostly due to me taking my time. The action in Marineau&#8217;s is such that the first piece only comes out after a full 9 moves then 3 more for the 2nd piece. So cool. <em><br />
</em><br />
I imagine this is the type of puzzle my grandfather would have enjoyed making if he had had the same resources available as me. The chisel remains the most dangerous tool in my shop.</p>
]]></content:encoded>
			<wfw:commentRss>http://francisshanahan.com/index.php/2008/math-woodwork-homemade-wooden-burr-puzzles/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

