<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Toolunious</title>
	<atom:link href="http://toolunious.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://toolunious.wordpress.com</link>
	<description></description>
	<lastBuildDate>Mon, 26 Oct 2009 18:03:42 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='toolunious.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Toolunious</title>
		<link>http://toolunious.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://toolunious.wordpress.com/osd.xml" title="Toolunious" />
	<atom:link rel='hub' href='http://toolunious.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Wifi internet radio(2)</title>
		<link>http://toolunious.wordpress.com/2009/10/26/wifi-internet-radio2/</link>
		<comments>http://toolunious.wordpress.com/2009/10/26/wifi-internet-radio2/#comments</comments>
		<pubDate>Mon, 26 Oct 2009 11:07:42 +0000</pubDate>
		<dc:creator>toolunious</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://toolunious.wordpress.com/?p=24</guid>
		<description><![CDATA[Here&#8217;s a quick review of what I&#8217;ve been doing lately in my attempt to create a Wifi internet radio. Started with a simple &#8220;copy-and-paste&#8221; manner of posts Jeff (link) wrote about a similar project, I found that I had to deviate from some strategies. This series of posts describe my actions from the point that [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=toolunious.wordpress.com&amp;blog=9662523&amp;post=24&amp;subd=toolunious&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s a quick review of what I&#8217;ve been doing lately in my attempt to create a Wifi internet radio. Started with a simple &#8220;copy-and-paste&#8221; manner of posts Jeff (<a href="http://www.mightyohm.com">link</a>) wrote about a similar project, I found that I had to deviate from some strategies. This series of posts describe my actions from the point that I veered from Jeff&#8217;s course. This post will explain my work for now that I&#8217;ve put in the user interface.</p>
<p>Since my last post, I&#8217;ve been busy with coding the routines for handling the user input and projecting the construction of the controller. The coding involved a simple bash script that reads the input from the controller. The script determines its action depending on the context of the input and will eventually carry out that action. The user later on reads &#8211; in some cases also hears &#8211; the result. This is of course, only possible when there is a controller to begin with. The controller&#8217;s task is to read input (by reading the state of four buttons and a variable potentiometer), sending this data to the router over a USB connection and sending translated input from the router to an LCD.</p>
<p>Both elements are not finished yet. I&#8217;ve ordered all the components necessary and created a schematic of the controller.</p>
<p><span id="more-24"></span></p>
<p><strong>The controller</strong></p>
<p>The Arduino I mentioned in my previous post was intended as a controller since I decided to add it to the project. I now have decided that the Arduino is way too functional to be locked in a wooden box, never to be heard from again. After reading several articles and how-to&#8217;s on the subject, I found that programming a new <a href="http://igbt-china.com/images/Sell%20ATMEGA16L-8PU%20ATMEL%20Integrated%20Circuits%20China.jpg">Atmel micro controller</a> with the Arduino and using this instead will be cheaper and more interesting than using the Arduino as an easy way out.</p>
<p>And so I&#8217;ve gathered the required details and began projecting this new course. There is a <a href="http://itp.nyu.edu/physcomp/Tutorials/ArduinoBreadboard">practical how-to</a> available that explains how the microcontroller can be integrated into a circuit without blowing it up. It basically describes how to set up the power supply and the crystals in order to make this work. It even covers including a USB break-out adapter to the circuit!</p>
<p>Of course I do not need a power supply as described in the article, since I use the power supply provided by the USB adapter.</p>
<p>The parts I will use:</p>
<ul>
<li>1 x 10k resistor</li>
<li>4 x 1k resistor</li>
<li>2 x 22pf capacitor</li>
<li>4 x strategic push button</li>
<li>1 x variable potentiometer</li>
<li>1 x Atmel atmega168 microcontroller</li>
<li>1 x 16MHZ timer crystal</li>
<li>1 x <a href="http://www.freeduino.eu/index.php?main_page=product_info&amp;cPath=4&amp;products_id=34">USB to Serial adapter</a></li>
</ul>
<p>I&#8217;m soldering this on 2 print boards (buttons and variable potentiometer; microcontroller and USB adapter).</p>
<p>Here I want to take a brief moment to talk about software, <a href="http://www.google.com/search?ie=UTF-8&amp;oe=UTF-8&amp;sourceid=navclient&amp;gfns=o&amp;q=circuit+design+software">circuit design software</a> that is. I stumbled on several options, varying from easy-to-use educational software as <a href="http://www.yenka.com">Yenka</a> (<img src="http://www.file-extensions.org/imgs/company-logo/891/linux-online-inc.jpg" alt="linux" width="19" height="22" />wine!) to professional software (Eagle, Geda, Oregano).  I would like to take this opportunity to mention <a href="http://www.lis.inpg.fr/realise_au_lis/kicad/">Kicad</a> here. Kicad is simple, well documented and conveys neat 3d modeling. I would say that simpleness is by far the most important reason to go for Kicad, other software solutions out there are simply not simple.</p>
<p>When it comes to designing and simulating basic circuits, Yenka is your friend.</p>
<p>I have used Kicad as a mean to designing the circuit of the controller. The schematic:</p>
<div id="attachment_28" class="wp-caption alignnone" style="width: 210px"><a href="http://toolunious.files.wordpress.com/2009/10/schematic_controller1.png?w=1024"><img class="size-large wp-image-28" title="Schematic of controller" src="http://toolunious.files.wordpress.com/2009/10/schematic_controller1.png?w=200&#038;h=120" alt="Note: the LCD is not included in the bill of materials " width="200" height="120" /></a><p class="wp-caption-text">Note: the LCD is not included in the bill of materials </p></div>
<p>This schematic includes the USB to serial adapter, which I made from scratch (other software solutions didn&#8217;t provide it either, I&#8217;ve checked). Here is the <a href="http://www.box.net/shared/eh3vivf9br">library file</a> which you can import in the library editor in Kicad. The following schematic covers the buttons and the variable potentiometer, pretty basic, but a schematic nonetheless.</p>
<p><a href="http://toolunious.files.wordpress.com/2009/10/project.png"><img class="alignnone size-full wp-image-30" title="Input components" src="http://toolunious.files.wordpress.com/2009/10/project.png?w=500&#038;h=375" alt="Input components" width="500" height="375" /></a></p>
<p>I&#8217;ve mentioned earlier that I didn&#8217;t finish both the script and the controller. I did, however, put some time in designing the end-product in Google&#8217;s SketchUp. It is still in &#8216;beta&#8217; but I believe it is in the right direction. See these images below for an inner and outer view of the wifi internet radio. I&#8217;ve added an Arduino Duemillenove to illustrate the controller.</p>
<p><a href="http://toolunious.files.wordpress.com/2009/10/showcase_outer01.png"><img class="alignnone size-medium wp-image-32" title="Front side" src="http://toolunious.files.wordpress.com/2009/10/showcase_outer01.png?w=300&#038;h=166" alt="Front side" width="300" height="166" /></a><a href="http://toolunious.files.wordpress.com/2009/10/showcase_inner01.png"><img class="alignnone size-medium wp-image-31" title="Inside the radio" src="http://toolunious.files.wordpress.com/2009/10/showcase_inner01.png?w=300&#038;h=199" alt="Inside the radio" width="300" height="199" /></a></p>
<p>So far so good, my next post will be a somewhat in-depth how-to about building the controller. This will also be added to <a href="http://circuitsforbeginners.blogspot.com/">Circuits For Beginners</a>, a source for other circuit plans and tutorials explaining how to build them.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/toolunious.wordpress.com/24/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/toolunious.wordpress.com/24/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/toolunious.wordpress.com/24/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/toolunious.wordpress.com/24/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/toolunious.wordpress.com/24/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/toolunious.wordpress.com/24/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/toolunious.wordpress.com/24/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/toolunious.wordpress.com/24/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/toolunious.wordpress.com/24/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/toolunious.wordpress.com/24/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/toolunious.wordpress.com/24/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/toolunious.wordpress.com/24/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/toolunious.wordpress.com/24/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/toolunious.wordpress.com/24/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=toolunious.wordpress.com&amp;blog=9662523&amp;post=24&amp;subd=toolunious&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://toolunious.wordpress.com/2009/10/26/wifi-internet-radio2/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/9f6ec9e014fead7963e81ec2a028959d?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">toolunious</media:title>
		</media:content>

		<media:content url="http://www.file-extensions.org/imgs/company-logo/891/linux-online-inc.jpg" medium="image">
			<media:title type="html">linux</media:title>
		</media:content>

		<media:content url="http://toolunious.files.wordpress.com/2009/10/schematic_controller1.png?w=1024" medium="image">
			<media:title type="html">Schematic of controller</media:title>
		</media:content>

		<media:content url="http://toolunious.files.wordpress.com/2009/10/project.png" medium="image">
			<media:title type="html">Input components</media:title>
		</media:content>

		<media:content url="http://toolunious.files.wordpress.com/2009/10/showcase_outer01.png?w=300" medium="image">
			<media:title type="html">Front side</media:title>
		</media:content>

		<media:content url="http://toolunious.files.wordpress.com/2009/10/showcase_inner01.png?w=300" medium="image">
			<media:title type="html">Inside the radio</media:title>
		</media:content>
	</item>
		<item>
		<title>Wifi internet radio(1)</title>
		<link>http://toolunious.wordpress.com/2009/09/29/wifi-internet-radio/</link>
		<comments>http://toolunious.wordpress.com/2009/09/29/wifi-internet-radio/#comments</comments>
		<pubDate>Tue, 29 Sep 2009 12:03:21 +0000</pubDate>
		<dc:creator>toolunious</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[electronics]]></category>
		<category><![CDATA[project]]></category>
		<category><![CDATA[wifi radio]]></category>

		<guid isPermaLink="false">http://toolunious.wordpress.com/?p=3</guid>
		<description><![CDATA[Building a WiFi connected internet radio player: an amateur&#8217;s perspective. This post is meant to describe the steps taken in the process of making a Wifi Internet Radio, based upon an idea of Jeff (at mightyohm.com). The project&#8217;s goal is to create a stand-alone player for internet music streams over a WiFi-connection. This is done [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=toolunious.wordpress.com&amp;blog=9662523&amp;post=3&amp;subd=toolunious&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Building a WiFi connected internet radio player: an amateur&#8217;s perspective.</p>
<p>This post is meant to describe the steps taken in the process of making a Wifi Internet Radio, based upon an idea of Jeff (at mightyohm.com). The project&#8217;s goal is to create a stand-alone player for internet music streams over a WiFi-connection. This is done by the help of an <a title="Asus wl500GU router" href="http://images.google.com/imgres?imgurl=http://img155.imageshack.us/img155/3404/asuswifirouterccex2.th.gif&amp;imgrefurl=http://www.sulit.com.ph/index.php/view%2Bclassifieds/id/1094220/Asus%2BWL-520gU%2BWiFi%2BRouter&amp;usg=__9fmh4kSDDIlB-YfsjICxFQAf5w4=&amp;h=150&amp;w=142&amp;sz=3&amp;hl=en&amp;start=2&amp;um=1&amp;tbnid=IN6qQztOLDec5M:&amp;tbnh=96&amp;tbnw=91&amp;prev=/images%3Fq%3Dasus%2Bwl500gu%26hl%3Den%26sa%3DN%26um%3D1" target="_blank">Asus wl500GU router</a> combined with a minimal set of input components to support a user in configuring the WiFi-connection (all common encryptions should be supported), adjusting the volume or choosing a radio station. While I was working on this project, I deviated in some extend (some things turned out not to work, or just seemed more satisfying when done differently) of Jeff&#8217;s approach in reaching this goal. Because of this, I&#8217;m keeping track of my work for my own review later on and for any other person interested.</p>
<div class="wp-caption alignnone" style="width: 410px"><a href="http://picasaweb.google.com/lh/photo/Pq4sP-9b0JEvj2oreXto3g?feat=directlink"><img title="Current state of project" src="http://lh5.ggpht.com/_ZZmAXUhkGQc/SsCaKmlaPcI/AAAAAAAACTA/tDiDRI2qOHA/s400/IMG_1311.JPG" alt="Current state of project" width="400" height="300" /></a><p class="wp-caption-text">Current state of the project</p></div>
<p><span id="more-3"></span></p>
<p>So far I&#8217;ve managed to:</p>
<ol>
<li>re-flash the router with a self-compiled Open-WRT distribution (Kamikaze 8.09 &#8211; following the steps provided by Jeff);</li>
<li>successfully made the router play an internet stream (Jeff, also);</li>
<li>successfully made an Arduino Duemillanove write to a LCD (What is the title of the song currently playing?);</li>
<li>send data from the router to the Arduino (although it is arguable whether the current approach will suffice)</li>
</ol>
<p>For the first two steps I will advise you to read the posts written by Jeff <a href="http://www.mightyohm.com/blog/2008/10/building-a-wifi-radio-part-3-hacking-the-asus-wl-520gu/" target="_blank">here</a>. I will try to cover the following two steps, making the current state of the project replicable.</p>
<p>3. <strong>Writing &#8220;blah&#8221; to the LCD</strong></p>
<p>For now, the arduino is loaded with a sketch capable of reading the serial buffer and writing any valid chars to the LCD. The arduino DK comes with a library called &#8216;LiquidCrystal&#8217;, dealing with the communication to the LCD. It pretty much covers a simple 4-bit connection that transmits pre-set character codes. This sketch should handle any input components later on in the project as well.</p>
<div class="wp-caption aligncenter" style="width: 505px"><img title="LCDArduino schema" src="http://arduino.nu/Schema%20LCD%20def.jpg" alt="" width="495" height="460" /><p class="wp-caption-text">LCDArduino schema (arduino.nu)</p></div>
<p>! If you use the schema provided by arduino.nu, don&#8217;t forget to connect the E(nable) pin: it&#8217;s quite important as I found out.</p>
<p>After everything is set up it&#8217;s time to upload the sketch to the Arduino via an usb connection. I&#8217;ve written <a href="https://www.box.net/shared/cmh8i6v58u" target="_blank">this sketch</a> to let the Arduino receive serial input and send it to the LCD. I figured that a 16 (screen width) x 2 (lines) x 2 (`screens`) configuration provides the best readability.  The script basically scrolls to a &#8216;new&#8217; set of two lines when the input is higher than 16&#215;2=32 chars, provided that there is no `return` character (numbero 10 in the Arduino ASCII table). The LCD&#8217;s buffer didn&#8217;t allow any more of these screens so I&#8217;ll just see if this suits practical use. I&#8217;m thinking of controlling the serial input when this gets too big, before outputting anything from the router.</p>
<p>4. <strong>Transmitting &#8216;Title: Let It Be&#8217; to Arduino</strong></p>
<p>And headaches begin. Apparently, open-wrt on a wl500GU (thus, Kamikaze 8.09 on a broadcom device) is not handling serial transmission correctly. So far I wasn&#8217;t able to send a, what would look like, title whatsoever following preached approaches present online. These approaches consist of setting the baud speed to 9600 bps and redirecting an echo to the device brought to light when plugging in the Arduino (open-wrt says /dev/usb/tts/0, my desktop /dev/ttyUSB0). Attempts on my desktop proved this approach being worthy, but the router was not showing any changes other than a short flickering of the display. I could have tried avoiding all, speculated, problems by updating the current 2.4 kernel to 2.6. I haven&#8217;t done this however for the simple reason that the router&#8217;s wifi capability is not &#8211; completely &#8211; supported in 2.6. For example, it doesn&#8217;t support the WEP encryption method (yet, it seems there is some progress here) &#8211; let alone the somewhat unstable state it is in now, considering WiFi. <em> </em></p>
<p>This was, of course, not what I wanted so I had to try something else (or dive into the world of drivers: I don&#8217;t think I want to be there already). Further experimenting showed that {cat &gt; /dev/usb/tts/0} did work after entering some characters and commiting them with return. Making it possible to show you this:</p>
<span style="text-align:center; display: block;"><a href="http://toolunious.wordpress.com/2009/09/29/wifi-internet-radio/"><img src="http://img.youtube.com/vi/u7pQauUhNNI/2.jpg" alt="" /></a></span>
<p>It may be arguable, as I stated earlier, whether such an approach suffices in a later stage. Mainly because the cat command isn&#8217;t really open for input when implementing it in a script. Still, after some struggling with the driver involved (the ftdi one), it seems I am forced &#8211; for now- to try reaching the <em>stdin </em>of a process running the cat command. Luckily, this is easily done by redirecting the first-intended {echo} to /proc/#process-id here#/fd/1 (not sure about the number 1, but {ls -al} showed this file was linked with the device involved. <strong>Edit (26/10/2009): I&#8217;ve learned that the <em>stty </em>command did the job when given the right flags. For a wl500GU router with open-wrt the following command will succeed in communicating with an Arduino: </strong><em>stty -F /dev/ttyUSB0 9600 raw -parenb -parodd cs8 -hupcl -cstopb clocal</em></p>
<p>Soon, I will describe any further steps taken in building myself an internet radio player.</p>
<p>There is another post! Click <a href="http://toolunious.wordpress.com/2009/10/26/wifi-internet-radio2/">here</a> for part two.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/toolunious.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/toolunious.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/toolunious.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/toolunious.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/toolunious.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/toolunious.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/toolunious.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/toolunious.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/toolunious.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/toolunious.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/toolunious.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/toolunious.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/toolunious.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/toolunious.wordpress.com/3/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=toolunious.wordpress.com&amp;blog=9662523&amp;post=3&amp;subd=toolunious&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://toolunious.wordpress.com/2009/09/29/wifi-internet-radio/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/9f6ec9e014fead7963e81ec2a028959d?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">toolunious</media:title>
		</media:content>

		<media:content url="http://lh5.ggpht.com/_ZZmAXUhkGQc/SsCaKmlaPcI/AAAAAAAACTA/tDiDRI2qOHA/s400/IMG_1311.JPG" medium="image">
			<media:title type="html">Current state of project</media:title>
		</media:content>

		<media:content url="http://arduino.nu/Schema%20LCD%20def.jpg" medium="image">
			<media:title type="html">LCDArduino schema</media:title>
		</media:content>
	</item>
	</channel>
</rss>
