<?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>Hack a Day &#187; IR remote</title>
	<atom:link href="http://hackaday.com/tag/ir-remote/feed/" rel="self" type="application/rss+xml" />
	<link>http://hackaday.com</link>
	<description>Fresh hacks every day</description>
	<lastBuildDate>Sun, 12 Feb 2012 08:27:59 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='hackaday.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://1.gravatar.com/blavatar/5560f98f805877b0e332f191cb9e0af3?s=96&#038;d=http%3A%2F%2Fs2.wp.com%2Fi%2Fbuttonw-com.png</url>
		<title>Hack a Day &#187; IR remote</title>
		<link>http://hackaday.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://hackaday.com/osd.xml" title="Hack a Day" />
	<atom:link rel='hub' href='http://hackaday.com/?pushpress=hub'/>
		<item>
		<title>Playing snake with a TV remote</title>
		<link>http://hackaday.com/2011/09/06/playing-snake-with-a-tv-remote/</link>
		<comments>http://hackaday.com/2011/09/06/playing-snake-with-a-tv-remote/#comments</comments>
		<pubDate>Tue, 06 Sep 2011 15:01:10 +0000</pubDate>
		<dc:creator>Brian Benchoff</dc:creator>
				<category><![CDATA[led hacks]]></category>
		<category><![CDATA[misc hacks]]></category>
		<category><![CDATA[IR remote]]></category>
		<category><![CDATA[led]]></category>
		<category><![CDATA[led matrix]]></category>
		<category><![CDATA[remote]]></category>
		<category><![CDATA[snake]]></category>
		<category><![CDATA[snake game]]></category>

		<guid isPermaLink="false">http://hackaday.com/?p=54837</guid>
		<description><![CDATA[[vinod] sent in his replica of a Snake game, the game to play on old Nokia dumb phones. The build is based on a PIC16F877 microcontroller just like previous Snake builds we&#8217;ve seen, but [vinod] didn&#8217;t use physical buttons in his build. Instead, he used a Philips infrared TV remote to control the game. The [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=hackaday.com&amp;blog=4779443&amp;post=54837&amp;subd=hackadaycom&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone size-full wp-image-54838" title="snake" src="http://hackadaycom.files.wordpress.com/2011/09/snake.png" alt="" width="470" height="367" /></p>
<p>[vinod] sent in his <a href="http://vinodstanur.blogspot.com/2011/07/tv-remote-controlled-snake-game-in-810.html">replica of a Snake game</a>, <em>the</em> game to play on old Nokia dumb phones.</p>
<p>The build is based on a PIC16F877 microcontroller <a href="http://hackaday.com/2010/06/28/links-expanded-snake-on-led-matrix/">just like previous Snake builds we&#8217;ve seen</a>, but [vinod] didn&#8217;t use physical buttons in his build. Instead, he used a Philips infrared TV remote to control the game. The infrared controller only takes up one pin on the microcontroller, as opposed to the 4 pins of the easiest four button setup. [vinod] also threw in a simple one-transistor level converter so Snake can be played with a PC via RS-232. With the PIC code included in the build, it&#8217;s a great build that reminds us of a more civilized age.</p>
<p>The video of [vinod]&#8216;s snake game in action is posted after the break, but we noticed that the snake is allowed to &#8216;warp around&#8217; the sides of the LED matrix. Some people might consider that cheating but that can be fixed by changing a few lines of code.</p>
<p><span id="more-54837"></span></p>
<span style="text-align:center; display: block;"><a href="http://hackaday.com/2011/09/06/playing-snake-with-a-tv-remote/"><img src="http://img.youtube.com/vi/EuEvCTFW_AI/2.jpg" alt="" /></a></span>
<br />Filed under: <a href='http://hackaday.com/category/led-hacks/'>led hacks</a>, <a href='http://hackaday.com/category/misc-hacks/'>misc hacks</a>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/hackadaycom.wordpress.com/54837/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/hackadaycom.wordpress.com/54837/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/hackadaycom.wordpress.com/54837/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/hackadaycom.wordpress.com/54837/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/hackadaycom.wordpress.com/54837/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/hackadaycom.wordpress.com/54837/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/hackadaycom.wordpress.com/54837/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/hackadaycom.wordpress.com/54837/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/hackadaycom.wordpress.com/54837/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/hackadaycom.wordpress.com/54837/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/hackadaycom.wordpress.com/54837/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/hackadaycom.wordpress.com/54837/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/hackadaycom.wordpress.com/54837/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/hackadaycom.wordpress.com/54837/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=hackaday.com&amp;blog=4779443&amp;post=54837&amp;subd=hackadaycom&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://hackaday.com/2011/09/06/playing-snake-with-a-tv-remote/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">brianbenchoff</media:title>
		</media:content>

		<media:content url="http://hackadaycom.files.wordpress.com/2011/09/snake.png" medium="image">
			<media:title type="html">snake</media:title>
		</media:content>
	</item>
		<item>
		<title>How-to: USB remote control receiver</title>
		<link>http://hackaday.com/2008/10/30/how-to-usb-remote-control-receiver/</link>
		<comments>http://hackaday.com/2008/10/30/how-to-usb-remote-control-receiver/#comments</comments>
		<pubDate>Fri, 31 Oct 2008 01:34:08 +0000</pubDate>
		<dc:creator>Ian</dc:creator>
				<category><![CDATA[home entertainment hacks]]></category>
		<category><![CDATA[how-to]]></category>
		<category><![CDATA[peripherals hacks]]></category>
		<category><![CDATA[computer remote control]]></category>
		<category><![CDATA[decode ir signals]]></category>
		<category><![CDATA[electronics]]></category>
		<category><![CDATA[IR remote]]></category>
		<category><![CDATA[logic analyzer]]></category>
		<category><![CDATA[pc remote control]]></category>
		<category><![CDATA[remote]]></category>
		<category><![CDATA[remote control]]></category>
		<category><![CDATA[usb ir receiver]]></category>
		<category><![CDATA[usb remote]]></category>

		<guid isPermaLink="false">http://hackadaycom.wordpress.com/?p=5239</guid>
		<description><![CDATA[Now that we listen to MP3s, and watch XVIDs or x264s, a computer is the entertainment center in at least one room of most homes. Unless you have a special HTPC, though, you&#8217;re probably stuck using the keyboard to pause, change the volume, and fast-forward through annoying Mythbusters recaps. PC remote control receivers range from [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=hackaday.com&amp;blog=4779443&amp;post=5239&amp;subd=hackadaycom&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone size-full wp-image-5305" title="remir" src="http://hackadaycom.files.wordpress.com/2008/10/remir.jpg" alt="" width="450" height="346" /></p>
<p>Now that we listen to <a title="MP3 - Mahalo" href="http://www.mahalo.com/MP3">MP3s</a>, and watch XVIDs or x264s, a computer is the entertainment center in at least one room of most homes. Unless you have a special HTPC, though, you&#8217;re probably stuck using the keyboard to pause, change the volume, and fast-forward through annoying Mythbusters recaps. PC remote control receivers range from ancient serial port designs (who has one?) to USB devices not supported by popular software. In this how-to we design a USB infrared receiver that imitates a common protocol supported by software for Windows, Linux, and <a title="Mac Hacks - Mahalo" href="http://www.mahalo.com/Mac_Hacks">Mac</a>. We&#8217;ve got a full guide to the protocol plus schematics and a parts list.</p>
<p><span id="more-5239"></span><strong>Design overview</strong></p>
<p><strong><img class="alignnone size-full wp-image-5306" title="overview" src="http://hackadaycom.files.wordpress.com/2008/10/overview.png" alt="" width="450" height="174" /><br />
</strong></p>
<p>Remote controls transmit data on an modulated infrared beam. An infrared receiver IC separates the modulated beam into a clean stream of 0s and 1s. The data stream is decoded by a microcontroller and sent to a computer over a USB connection. Software processes the codes and triggers actions on the computer.</p>
<p><strong>Background</strong></p>
<p><em>Computer infrared receivers</em></p>
<p>The <a href="http://www.lirc.org/receivers.html">oldest PC infrared receiver design</a> uses a receiver IC to toggle a serial port pin, usually DCD. This design probably originated on <a href="http://en.wikipedia.org/wiki/USENET">Usenet</a>, and it&#8217;s still the most popular on the web: <a href="http://www.engadget.com/2006/05/16/how-to-ir-remote-control-your-computer/">Engadget</a>, <a href="http://www.instructables.com/id/IR-Remote-Control-For-your-Computer/">Instructables</a>, etc. These aren&#8217;t true serial devices because they don&#8217;t send data to the PC. Instead, a computer program times pulses on the serial port and demodulates the signal. This is a super simple design, but it depends on direct interrupt access and timing precision that&#8217;s no longer available in Windows. Linux or Mac users can try this receiver, if you still have a serial port. We couldn&#8217;t get this type of receiver to work with the serial port on a modern Windows XP PC, and don&#8217;t expect the precise timing to transfer through a USB-&gt;serial converter.</p>
<p>Some more advanced infrared receivers are true serial port devices that measure or decoding infrared signals before sending data to the computer. The <a href="http://fly.cc.fer.hr/~mozgic/UIR/">UIR/IRMan</a> and <a href="http://users.skynet.be/sky50985/">UIR2</a> incorporate a classic PIC 16F84, but don&#8217;t provide firmware and/or source code. These devices should work on a modern computer, through a USB-&gt;serial converter if necessary. The <a href="http://www.xs4all.nl/~dicks/avr/usbtiny/">USBTINY</a> and <a href="http://usbirboy.sourceforge.net/">USBIRBOY</a> are native USB devices, but lack wide support.</p>
<p><em>Receiver software</em></p>
<p>Regardless of receiver type, the computer needs a program to listen for incoming remote commands and convert them to actions on the computer. Linux and Mac users have <a href="http://www.lirc.org/">LIRC</a>, which supports a bunch of different receiver types. Windows users are a bit less fortunate. <a href="http://winlirc.sourceforge.net/">WinLIRC</a> is an abandoned Windows port of LIRC for simple interrupt-based serial port receivers; WinLIRC was last developed in 2003. <a href="http://www.promixis.com/products.php">Girder</a> was originally a freeware PC automation utility, but has become expensive bloatware with a 30 day trial. Fortunately, the last <a href="http://www.oldversion.com/talk/showthread.php?t=1465">freeware version of Girder (3.2.9b)</a> is still available for download.</p>
<p><strong>Working with IR remote protocols</strong></p>
<p><em>Decoding IR signals</em><strong><br />
</strong></p>
<p>Remote controls encode commands in the spacing or timing of a 38KHz carrier pulse, [San Bergmans] has an <a href="http://www.sbprojects.com/knowledge/ir/ir.htm">explanation of the principals involved</a>. An infrared receiver IC separates the data stream from the carrier. Our job is to decode the data stream with a microcontroller. There are dozens of remote control protocols, but Phillips&#8217; <a href="http://www.sbprojects.com/knowledge/ir/rc5.htm">RC5</a> is widespread and commonly used by hobbyists.</p>
<p>RC5 is stream of 14 equal length bits of exactly 1.778ms per bit time. A pulse during the first half of the bit time represents 0, a pulse in the second half represents 1. This scheme is called <a href="http://en.wikipedia.org/wiki/Manchester_coding">Manchester coding</a>.</p>
<p><img class="alignnone size-full wp-image-5293" title="logic-450" src="http://hackadaycom.files.wordpress.com/2008/10/logic-450.png" alt="" width="450" height="134" /></p>
<p>We used a logic analyzer to examine the output of a Happauge WinTV remote control, a <a href="http://osdir.com/ml/hardware.lirc/2006-04/msg00061.html">known</a> RC5 remote. The diagram shows two presses of the 1 button, and two presses of the 2 button; note that the output is inversed and the Manchester coding is backwards from the above description.</p>
<p>The first two bit times are start bits, followed by a toggle bit. The toggle bit inverses each time a button is pressed so the receiver can tell the difference between a hold and a repeated press. The next 5 bits are the address (0b11110=0x1E), followed by the command (0b000001=0&#215;01, 0b000010=0&#215;02). A backwards compatible extension to RC5 uses the second start bit as command bit 7.</p>
<p><em>Representing remote codes to the computer</em></p>
<p>Looking at previous designs, we saw three general methods of communicating remote commands to a computer:</p>
<ul>
<li>Protocol specific receivers decode one protocol, and send actual decoded commands to the PC</li>
<li>A more general type of receiver measures the timing and spacing of each pulse and sends the full waveform to the PC for analysis.</li>
<li>Some receivers create a unique hash for a signal, but don&#8217;t actually include enough data to fully recreate the waveform.</li>
</ul>
<p>While our preference is towards the general hash method, our only remote uses RC5 and it was more interesting to build an RC5 specific decoder. We describe modifications for a more general version in the firmware section.</p>
<p><em>Computer interface protocol</em></p>
<p>We didn&#8217;t want to write our own receiver software or driver, so we looked for an existing, well established communication protocol to imitate. The  UIR/IRMAN/IRA/CTInfra/Hollywood+ type receiver is supported by Girder and LIRC, and uses a <a href="http://www.raphnet.net/divers/documentation/irman_protocol.txt">simple serial protocol with handshake</a>:</p>
<ul>
<li>The device is initialized by the DTS and DTR pins of the serial port. We don&#8217;t have these and don&#8217;t care.</li>
<li>The computer sends &#8220;IR&#8221;, with an optional delay. The device replies &#8220;OK&#8221;. We&#8217;ll just send &#8220;OK&#8221; on every &#8220;R&#8221;</li>
<li>Remote control codes are sent as a unique six byte hash. We&#8217;ll decode an RC5 signal and send the actual values, but a generic hash could be used instead.</li>
</ul>
<p>This protocol is for a serial port device, but our USB receiver will appear as a virtual serial port and the program won&#8217;t know the difference.</p>
<p><strong>Hardware</strong></p>
<p><img class="alignnone size-full wp-image-5294" title="cct" src="http://hackadaycom.files.wordpress.com/2008/10/cct.png" alt="" width="453" height="253" /></p>
<p><a href="http://hackadaycom.files.wordpress.com/2008/10/cct-large2.png">Click here for a full size schematic</a> (png). Our receiver is based on a USB enabled PIC <a href="http://www.microchip.com/wwwproducts/Devices.aspx?dDocName=en010273">18F2455</a> microcontroller, the smaller, cheaper version of the 18F2550. The 18F family is programmable with the hobbyist favorite <a href="http://www.instructables.com/id/Business-Card-PIC-Programmer/">JDM-style programmers</a> if <a href="http://www.diylife.com/2008/02/15/program-a-pic-microcontroller/">a diode is used</a> to drop VPP to a safe level. The PIC gets one decoupling capacitor (C1), and a diode (D1) and resistor(R1) on the <a href="http://www.instructables.com/id/Understanding-ICSP-for-PIC-Microcontrollers/">ICSP programming header</a>. We exposed the serial port on a pin header for debugging or a mixed USB/serial port version using a <a href="http://www.maxim-ic.com/quick_view2.cfm/qv_pk/1369">MAX RS232 transceiver</a> IC.</p>
<p>The USB peripheral requires a 20MHz external clock (Q1, C5,6), and a .220uF capacitor. We faked the capacitor using 2 x .1uF decoupling capacitors (C2,3). A 3mm LED (LED1) and a 330ohm current limiting resistor (R2) show USB connection status.</p>
<p>We used a TSOP-1738 infrared receiver IC which calls for a 4.7uF decoupling capacitor (C4). If you can&#8217;t find this particular IC, <a href="http://www.lirc.org/receivers.html">any receiver listed here</a> should work. The TSOP-1738 output is the inverse of the received signal, it pulls to ground when a pulse is detected, so a pull-up resistor (R3) holds the pin high when no signal is present. Check if you use a different receiver, you may need to use a pull-down resistor and reverse the Manchester decoding routine in the firmware.</p>
<p>The circuit draws power from the USB bus, so we don&#8217;t need an additional power supply.</p>
<p><em>Parts list</em></p>
<p><img class="alignnone size-full wp-image-5295" title="brd" src="http://hackadaycom.files.wordpress.com/2008/10/brd.png" alt="" width="451" height="324" /></p>
<p><a href="http://hackadaycom.files.wordpress.com/2008/10/brd-large.png">Click here for a full size placement diagram</a> (png).<em> </em>The PCB design is 100% through-hole and single sided. The schematic and PCB were made with<a href="http://www.cadsoft.de"> Cadsoft Eagle</a>, freeware versions are available for most platforms. All the files are included in the <a href="http://hosted.hackaday.com/USBIRr.v1a.zip">project archive</a> (zip).</p>
<table style="text-align:center;height:302px;" border="0" width="299">
<tbody>
<tr>
<td width="43">
<div><strong>Part</strong></div>
</td>
<td width="135">
<div><strong>Description</strong></div>
</td>
</tr>
<tr>
<td>
<div>IC1</div>
</td>
<td>
<div><a href="http://www.mouser.com/Search/ProductDetail.aspx?qs=W2ndVjZwIIJcNNcdKyvBpg%3d%3d">PIC 18F2455</a></div>
</td>
</tr>
<tr>
<td>
<div>&#8211;</div>
</td>
<td>
<div><a href="http://www.mouser.com/Search/ProductDetail.aspx?R=571-1-390261-9">28 pin .300 socket</a></div>
</td>
</tr>
<tr>
<td>
<div>C1,2,3</div>
</td>
<td>
<div><a href="http://www.mouser.com/Search/ProductDetail.aspx?qs=9AX3phJxokWIpR5WRGtIJw%3d%3d">0.1uF capacitor</a></div>
</td>
</tr>
<tr>
<td>
<div>C4</div>
</td>
<td>
<div><a href="http://www.mouser.com/Search/ProductDetail.aspx?qs=uVOgrT8JCzAhqeVLfh7brw==">4.7uF capacitor</a></div>
</td>
</tr>
<tr>
<td>
<div>C5,6</div>
</td>
<td>
<div><a href="http://www.mouser.com/Search/ProductDetail.aspx?qs=MQgq2qvN%2feSRs7vKBDt0OA%3d%3d">27pF capacitor</a> (<a href="http://www.mouser.com/Search/ProductDetail.aspx?qs=x3u4YJAyqD7XMSE5%2fJr6lg%3d%3d">15pF</a> might be better)</div>
</td>
</tr>
<tr>
<td>
<div>D1</div>
</td>
<td>
<div><a href="http://www.mouser.com/Search/ProductDetail.aspx?qs=TNTIDjy6APqozHdyHHFUGA%3d%3d">1N4181 diode</a></div>
</td>
</tr>
<tr>
<td>
<div>Q1</div>
</td>
<td>
<div><a href="http://www.mouser.com/Search/ProductDetail.aspx?R=ECS-200-S-1Xvirtualkey59070000virtualkey520-HCA2000-SX">20MHz crystal</a></div>
</td>
</tr>
<tr>
<td>
<div>R1,3</div>
</td>
<td>
<div><a href="http://www.mouser.com/Search/ProductDetail.aspx?qs=IP4CA2YhK0BxnZulBOfonw%3d%3d">10K ohm resistor</a></div>
</td>
</tr>
<tr>
<td>
<div>R2</div>
</td>
<td>
<div><a href="http://www.mouser.com/Search/ProductDetail.aspx?qs=ULgY8XwKjTmmv2gtdH4CoQ%3d%3d">330 ohm resistor</a></div>
</td>
</tr>
<tr>
<td>
<div>TSOP</div>
</td>
<td>
<div>TSOP1738 (obsolete, try <a href="http://www.mouser.com/Search/ProductDetail.aspx?qs=oNDV51lhjEM7P54c1MlVIg%3d%3d">TSOP1138</a>)</div>
</td>
</tr>
<tr>
<td>
<div>USB</div>
</td>
<td>
<div><a href="http://www.mouser.com/Search/ProductDetail.aspx?qs=N76qWb2E9MJwqgFT2KIWcQ%3d%3d">USB &#8216;B&#8217; plug, female</a></div>
</td>
</tr>
<tr>
<td>
<div>SER</div>
</td>
<td>
<div><a href="http://www.mouser.com/Search/ProductDetail.aspx?R=4-103329-0virtualkey57100000virtualkey571-41033290">.1&#8243; pin header</a></div>
</td>
</tr>
<tr>
<td>
<div>ICSP</div>
</td>
<td>
<div><a href="http://www.mouser.com/Search/ProductDetail.aspx?R=4-103329-0virtualkey57100000virtualkey571-41033290">.1&#8243; pin header</a></div>
</td>
</tr>
</tbody>
</table>
<p><img class="alignnone size-full wp-image-5296" title="render" src="http://hackadaycom.files.wordpress.com/2008/10/render.jpg" alt="" width="450" height="229" /></p>
<p><strong>Firmware</strong></p>
<p>The firmware is written in C using Microchip&#8217;s free demonstration <a href="http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&amp;nodeId=1406&amp;dDocName=en010014">C18 compiler</a>. Firmware and source are included in the <a href="http://hosted.hackaday.com/USBIRr.v1a.zip">project archive</a> (zip).</p>
<p>We used <a href="http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&amp;nodeId=2680&amp;dDocName=en537044">version 2.3 of Microchip&#8217;s USB stack</a> to create a USB serial port using the default drivers already available on most systems. The USB stack has simple functions to enumerate the USB device and transfer data between device and host. It only took a few pin changes to get  the CDC demonstration working on our custom hardware.</p>
<p>Our implementation of the UIR/IRMAN/IRA/CTInfra/Hollywood+ protocol simply responds to the letter &#8216;R&#8217; with &#8216;OK&#8217;. This should satisfy the handshake requirements of any implementation of this protocol.</p>
<p>We chose to specifically decode RC5 (and RC5x) because it&#8217;s a widely used protocol, and the only type of remote we have to work with. Most of the decoding is done in the interrupt handler:</p>
<ul>
<li>The first signal change triggers an interrupt that starts a 889us (one-half bit period) timer.</li>
<li>On each timer interrupt, one-half of a Manchester coded bit is sampled.</li>
<li>Every other interrupt the measurements are compared, and the bit value is calculated to be 0, 1, or an error. Errors reset the decoding routing.</li>
<li>At the end of each transmission the address and command bytes are decoded, and sent to the host with 4 buffer bytes(0). We discard the toggle bit because it would confuse the PC software into thinking every other press was a unique code. We append the second start bit to the command bit for RC5x compliance; this just adds 0&#215;40 to non RC5x remote codes.</li>
</ul>
<p>A more general version can be made by removing the Manchester coding step (3), and sending 48 sample bits (all 6 bytes) to the computer.</p>
<p><strong>Installing the USB infrared receiver</strong></p>
<p>Most operating systems already have drivers that support a virtual serial port device like the receiver. Windows XP has the required drivers, but needs help from an .inf file to properly associate them with our device.</p>
<p>Windows will show the new hardware dialog the first time you plug in the receiver. Choose to use a custom driver and point it to the .inf file included in the <a href="http://hosted.hackaday.com/USBIRr.v1a.zip">project archive</a> (zip). This links the device to a driver already included in Windows, and adds the receiver as a COM port. You can check the COM port number in the control panel.</p>
<p>Mac and Linux users can use the receiver with LIRC, but Windows users will be faced with the choice of the old, freeware Girder, or the new, 30-day trial shareware version. We used the freeware version of Girder, but hope you guys can suggest a great, open source alternative that we overlooked.</p>
<p><img class="alignnone size-full wp-image-5297" title="girder" src="http://hackadaycom.files.wordpress.com/2008/10/girder.png" alt="" width="427" height="213" /></p>
<p>Regardless of the computer-side control software you use, configure it for a UIR/IRMAN/IRA/CTInfra/Hollywood+ style receiver, and enter the COM port or serial address assigned to it. Our receiver is also compatible with any protocol options like &#8216;Fast UIR Init&#8217; and &#8216;Skip UIR Init Check&#8217;, which shorten or eliminate the &#8220;IR&#8221;-&gt;&#8221;OK&#8221; handshake.  Now test the receiver and add a remote according to the documentation for your software.</p>
<p><strong>Manual terminal interface and debugging</strong></p>
<p>If you have a problem with the receiver, or you&#8217;re just curious, try to interface it from a serial terminal. We really like the serial terminal on <a href="http://www.hw-group.com/products/hercules/index_en.html">Hercules</a>. Set the correct COM port, but the speed and configuration settings are ignored by the USB serial port driver.</p>
<p><img class="alignnone size-full wp-image-5298" title="hercu" src="http://hackadaycom.files.wordpress.com/2008/10/hercu.png" alt="" width="450" height="216" /></p>
<p>A capital &#8216;R&#8217; will prompt the receiver to reply &#8216;OK&#8217;. RC5 codes are returned as raw bytes, so be sure to set your terminal to show HEX values rather than interpret it as <a title="ASCII - Mahalo" href="http://www.mahalo.com/ASCII">ASCII</a> text. The first byte is the RC5 address byte (0x1E), followed by the command byte (0&#215;41), and then four buffer 0s to comply with the UIR/IRman protocol. The image shows the handshake, and the output of a short press on the 1,2, and 3 buttons.</p>
<p><img class="alignnone size-full wp-image-5299" title="portmon-irman" src="http://hackadaycom.files.wordpress.com/2008/10/portmon-irman.png" alt="" width="450" height="127" /></p>
<p>A free utility called <a href="http://technet.microsoft.com/en-us/sysinternals/bb896644.aspx">Portmon</a> logs COM port activity for review. This is helpful for spying on existing receiver protocols, and debugging the interaction of our custom hardware and closed/proprietary software. The image shows Girder sending the initialization string &#8216;IR&#8217; (0&#215;49,0&#215;52), and the receiver reply &#8216;OK&#8217; (0x4F,0x4B).</p>
<p><strong>Taking it further</strong></p>
<p>Our RC5x compliant receiver follows a widely used interface protocol. There&#8217;s a ton of possibilities for additional features in an open source infrared receiver:</p>
<ul>
<li>Support all remotes through a generic hash generator, like the original UIR/IRman hardware.</li>
<li>Add additional remote protocol decoders, like <a href="http://www.sbprojects.com/knowledge/ir/rc6.htm">RC6</a>.</li>
<li>Support multiple, configurable interface protocols.</li>
<li>Implement the serial port I/O.</li>
<li>Store configuration options in EEPROM, including protocol, interface mode, timing options, serial port, etc.</li>
</ul>
<p><img class="alignnone size-full wp-image-5292" title="ird" src="http://hackadaycom.files.wordpress.com/2008/10/ird.jpg" alt="" width="450" height="372" /></p>
<br />Posted in home entertainment hacks, how-to, peripherals hacks  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/hackadaycom.wordpress.com/5239/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/hackadaycom.wordpress.com/5239/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/hackadaycom.wordpress.com/5239/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/hackadaycom.wordpress.com/5239/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/hackadaycom.wordpress.com/5239/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/hackadaycom.wordpress.com/5239/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/hackadaycom.wordpress.com/5239/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/hackadaycom.wordpress.com/5239/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/hackadaycom.wordpress.com/5239/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/hackadaycom.wordpress.com/5239/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/hackadaycom.wordpress.com/5239/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/hackadaycom.wordpress.com/5239/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/hackadaycom.wordpress.com/5239/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/hackadaycom.wordpress.com/5239/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=hackaday.com&amp;blog=4779443&amp;post=5239&amp;subd=hackadaycom&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://hackaday.com/2008/10/30/how-to-usb-remote-control-receiver/feed/</wfw:commentRss>
		<slash:comments>121</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">Ian</media:title>
		</media:content>

		<media:content url="http://hackadaycom.files.wordpress.com/2008/10/remir.jpg" medium="image">
			<media:title type="html">remir</media:title>
		</media:content>

		<media:content url="http://hackadaycom.files.wordpress.com/2008/10/overview.png" medium="image">
			<media:title type="html">overview</media:title>
		</media:content>

		<media:content url="http://hackadaycom.files.wordpress.com/2008/10/logic-450.png" medium="image">
			<media:title type="html">logic-450</media:title>
		</media:content>

		<media:content url="http://hackadaycom.files.wordpress.com/2008/10/cct.png" medium="image">
			<media:title type="html">cct</media:title>
		</media:content>

		<media:content url="http://hackadaycom.files.wordpress.com/2008/10/brd.png" medium="image">
			<media:title type="html">brd</media:title>
		</media:content>

		<media:content url="http://hackadaycom.files.wordpress.com/2008/10/render.jpg" medium="image">
			<media:title type="html">render</media:title>
		</media:content>

		<media:content url="http://hackadaycom.files.wordpress.com/2008/10/girder.png" medium="image">
			<media:title type="html">girder</media:title>
		</media:content>

		<media:content url="http://hackadaycom.files.wordpress.com/2008/10/hercu.png" medium="image">
			<media:title type="html">hercu</media:title>
		</media:content>

		<media:content url="http://hackadaycom.files.wordpress.com/2008/10/portmon-irman.png" medium="image">
			<media:title type="html">portmon-irman</media:title>
		</media:content>

		<media:content url="http://hackadaycom.files.wordpress.com/2008/10/ird.jpg" medium="image">
			<media:title type="html">ird</media:title>
		</media:content>
	</item>
		<item>
		<title>Control Media Center with programmable IR receiver</title>
		<link>http://hackaday.com/2008/09/28/control-media-center-with-programmable-ir-receiver/</link>
		<comments>http://hackaday.com/2008/09/28/control-media-center-with-programmable-ir-receiver/#comments</comments>
		<pubDate>Sun, 28 Sep 2008 23:30:45 +0000</pubDate>
		<dc:creator>Jason Rollette</dc:creator>
				<category><![CDATA[home entertainment hacks]]></category>
		<category><![CDATA[misc hacks]]></category>
		<category><![CDATA[attiny13]]></category>
		<category><![CDATA[IR reciever]]></category>
		<category><![CDATA[IR remote]]></category>
		<category><![CDATA[media center]]></category>
		<category><![CDATA[microcontroller]]></category>
		<category><![CDATA[Remote Control Reciever]]></category>

		<guid isPermaLink="false">http://hackadaycom.wordpress.com/?p=3879</guid>
		<description><![CDATA[This IR receiver based on ATtiny13 microcontroller is used to control a Media Center box via a remote. The circuit is powered by 20 pin ATX connector pin 9 &#8220;+5VSB&#8221; because it is the only pin that is powered when the computer is off, or in standby. The receiver is programmed to accept the codes [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=hackaday.com&amp;blog=4779443&amp;post=3879&amp;subd=hackadaycom&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone size-full wp-image-3878" title="inrecome" src="http://hackadaycom.files.wordpress.com/2008/09/inrecome.jpg" alt="" width="450" height="337" /></p>
<p>This <a href="http://www.serasidis.gr/circuits/InReCoMe/InReCoMe.htm" target="_blank">IR receiver</a> based on ATtiny13 microcontroller is used to control a Media Center box via a remote. The circuit is powered by 20 pin ATX connector pin 9 &#8220;+5VSB&#8221; because it is the only pin that is powered when the computer is off, or in standby. The receiver is programmed to accept the codes from the remote by holding down the switch while pressing the remote button. The circuit can use &#8220;Girder&#8221; or &#8220;PC remote control&#8221; as controlling software on the Media Center.</p>
<br />Posted in home entertainment hacks, misc hacks  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/hackadaycom.wordpress.com/3879/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/hackadaycom.wordpress.com/3879/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/hackadaycom.wordpress.com/3879/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/hackadaycom.wordpress.com/3879/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/hackadaycom.wordpress.com/3879/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/hackadaycom.wordpress.com/3879/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/hackadaycom.wordpress.com/3879/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/hackadaycom.wordpress.com/3879/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/hackadaycom.wordpress.com/3879/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/hackadaycom.wordpress.com/3879/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/hackadaycom.wordpress.com/3879/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/hackadaycom.wordpress.com/3879/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/hackadaycom.wordpress.com/3879/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/hackadaycom.wordpress.com/3879/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=hackaday.com&amp;blog=4779443&amp;post=3879&amp;subd=hackadaycom&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://hackaday.com/2008/09/28/control-media-center-with-programmable-ir-receiver/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">Jason Rollette</media:title>
		</media:content>

		<media:content url="http://hackadaycom.files.wordpress.com/2008/09/inrecome.jpg" medium="image">
			<media:title type="html">inrecome</media:title>
		</media:content>
	</item>
	</channel>
</rss>
