<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/atom10full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><feed xmlns="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearch/1.1/" xmlns:georss="http://www.georss.org/georss" xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr="http://purl.org/syndication/thread/1.0" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" gd:etag="W/&quot;A0IFQnYzeip7ImA9WhRVGEk.&quot;"><id>tag:blogger.com,1999:blog-32430925</id><updated>2012-01-17T17:18:33.882-08:00</updated><category term="arduino" /><category term="virtualization" /><category term="virtualbox" /><category term="oscilloscope" /><category term="sony remote protocol" /><category term="ldr" /><category term="ir receiver" /><category term="kubuntu" /><category term="gentoo" /><category term="simple labs" /><category term="relay" /><category term="ir remote" /><category term="scope" /><category term="transmitter" /><category term="relays" /><category term="wireless relay" /><category term="home automation" /><category term="probots" /><category term="electronics" /><category term="picoscope" /><category term="delay circuit" /><category term="receiver" /><category term="sensors" /><category term="ir emitter" /><category term="lucid lynx" /><category term="induinox" /><category term="555 timer" /><category term="lcd" /><category term="leds" /><title>My thoughts in e-text</title><subtitle type="html">Life is complex, it has a real part and an imaginary part.</subtitle><link rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml" href="http://chandan-pitta.blogspot.com/feeds/posts/default" /><link rel="alternate" type="text/html" href="http://chandan-pitta.blogspot.com/" /><link rel="next" type="application/atom+xml" href="http://www.blogger.com/feeds/32430925/posts/default?start-index=26&amp;max-results=25&amp;redirect=false&amp;v=2" /><author><name>Chandan Pitta</name><uri>https://profiles.google.com/108073397456181759055</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh5.googleusercontent.com/-wYryPSd3yss/AAAAAAAAAAI/AAAAAAAAEgc/kTrWHJtpxUg/s512-c/photo.jpg" /></author><generator version="7.00" uri="http://www.blogger.com">Blogger</generator><openSearch:totalResults>71</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/atom+xml" href="http://feeds.feedburner.com/MyThoughtsInE-text" /><feedburner:info uri="mythoughtsine-text" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><entry gd:etag="W/&quot;D0YHQHk9fyp7ImA9WhRWEEs.&quot;"><id>tag:blogger.com,1999:blog-32430925.post-2447355358132024730</id><published>2011-12-28T01:35:00.000-08:00</published><updated>2011-12-28T01:38:51.767-08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-12-28T01:38:51.767-08:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="relay" /><category scheme="http://www.blogger.com/atom/ns#" term="555 timer" /><category scheme="http://www.blogger.com/atom/ns#" term="delay circuit" /><title>Power Off Delay Circuit</title><content type="html">&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
Recently I have been kicking myself for forgetting to turn off the motor that pumps water from a sump to an overhead tank at home. Every time I turn on the motor, I try to remember to turn it off in 30 minutes (about the time it takes to fill up the overhead tank from empty to full), but I keep forgetting to turn it off most of the time, wasting a lot of water before I realize it. Then I got an idea. Why not just make a simple, cost effective timer circuit that will turn off the motor after say 30 minutes?&lt;br /&gt;
&lt;br /&gt;
So I started thinking about it. All I need is a 555 timer and the correct resistors and capacitors that will delay the timer for the exact time I want the motor to stay on. Next I need a relay to control the motor.&lt;br /&gt;
&lt;br /&gt;
First the timer has to run in monostable mode. We just need a one-shot pulse. The pulse should be long enough to keep running the motor. Next we use t = 1.1RC to get the approximate time (in seconds) the output of 555 timer will be high based on the R (in ohms) and C (in Farads) values. I wanted the motor to be on for 30 minutes. And since the time is so long I would need a huge capacitor. The biggest I could quickly find was a 1000uF capacitor. Plugging in those values:&lt;br /&gt;
&lt;blockquote class="tr_bq"&gt;
&lt;blockquote class="tr_bq"&gt;
t = RC&lt;/blockquote&gt;
&lt;/blockquote&gt;
&lt;blockquote class="tr_bq"&gt;
&lt;blockquote class="tr_bq"&gt;
30 * 60 = R *&amp;nbsp; 1000 x 10^-6&lt;/blockquote&gt;
&lt;/blockquote&gt;
&lt;blockquote class="tr_bq"&gt;
&lt;blockquote class="tr_bq"&gt;
R = 30 * 60 / 1000 MOhms = 1.8 MOhms &lt;/blockquote&gt;
&lt;/blockquote&gt;
&lt;br /&gt;
However, the best I could find was a 2M4 resistor. Which would mean the motor will be on for more than 30 minutes. I could mix a bunch of resistors to get 1M8 resistance, but I decided to keep it simple. So put 2 2M4 resistors in parallel and let the time come down to 22 minutes. That is fine for my purpose. Next I proceeded with the circuit diagram.&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://1.bp.blogspot.com/-Ed5KFjrzzUg/TvrdrVDyOLI/AAAAAAAAFOU/FUMyhzfUDNo/s1600/motor_timer1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://1.bp.blogspot.com/-Ed5KFjrzzUg/TvrdrVDyOLI/AAAAAAAAFOU/FUMyhzfUDNo/s1600/motor_timer1.png" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://1.bp.blogspot.com/-v-Xi6AuWLGY/TvrdD7KIr4I/AAAAAAAAFOI/D939uEslTLY/s1600/motor_timer.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;br /&gt;&lt;/a&gt;&lt;/div&gt;
Pretty straight forward circuit for running the timer in monostable mode. The trigger pin (pin 2) has to be low (the voltage on the pin should be below 1/3 the supply voltage) for a small period of time. Normally a 100K resistor in series with 1uF capacitor is used. I was too lazy to find those and just used what I had (1K in series with 100uF). Once the trigger goes high the relay is ON for 22 minutes.&lt;br /&gt;
&lt;br /&gt;
Next I made the circuit on a breadboard to make sure it works and then proceeded to built the circuit board. Been a long time since I used the soldering iron. However, I did not plan on a proper design and so the wires crisscrossed each other.&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://3.bp.blogspot.com/-WAyCfXgI2go/TvrgMsua2BI/AAAAAAAAFOg/UaFFALGm_A0/s1600/IMG_3550.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="222" src="http://3.bp.blogspot.com/-WAyCfXgI2go/TvrgMsua2BI/AAAAAAAAFOg/UaFFALGm_A0/s400/IMG_3550.jpg" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
All done. Now to actually test it. The plan is to connect the motor to the NO (normally open) of the relay. I have not yet tested the circuit, but hopefully I will be able to do it this weekend.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/32430925-2447355358132024730?l=chandan-pitta.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/fdcFCtCHZc9YMZdtxZB88N86Bi0/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/fdcFCtCHZc9YMZdtxZB88N86Bi0/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/fdcFCtCHZc9YMZdtxZB88N86Bi0/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/fdcFCtCHZc9YMZdtxZB88N86Bi0/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/MyThoughtsInE-text/~4/fOl-is1DvzM" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://chandan-pitta.blogspot.com/feeds/2447355358132024730/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=32430925&amp;postID=2447355358132024730" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/32430925/posts/default/2447355358132024730?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/32430925/posts/default/2447355358132024730?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/MyThoughtsInE-text/~3/fOl-is1DvzM/power-off-delay-circuit.html" title="Power Off Delay Circuit" /><author><name>Chandan Pitta</name><uri>https://profiles.google.com/108073397456181759055</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh5.googleusercontent.com/-wYryPSd3yss/AAAAAAAAAAI/AAAAAAAAEgc/kTrWHJtpxUg/s512-c/photo.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://1.bp.blogspot.com/-Ed5KFjrzzUg/TvrdrVDyOLI/AAAAAAAAFOU/FUMyhzfUDNo/s72-c/motor_timer1.png" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://chandan-pitta.blogspot.com/2011/12/power-off-delay-circuit.html</feedburner:origLink></entry><entry gd:etag="W/&quot;D0cCR3o9cCp7ImA9WhRTGU8.&quot;"><id>tag:blogger.com,1999:blog-32430925.post-5098907251202207577</id><published>2011-11-10T03:37:00.000-08:00</published><updated>2011-11-10T03:37:46.468-08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-11-10T03:37:46.468-08:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="ldr" /><category scheme="http://www.blogger.com/atom/ns#" term="arduino" /><category scheme="http://www.blogger.com/atom/ns#" term="relays" /><category scheme="http://www.blogger.com/atom/ns#" term="wireless relay" /><title>InduinoX and wireless relays: Part II</title><content type="html">&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
In &lt;a href="http://chandan-pitta.blogspot.com/2008/05/elisa-problems-marshalling-mediauri.html#%21/2011/10/induinox-and-wireless-relays-part-i.html"&gt;my last post&lt;/a&gt;, I played a bit with the wireless relays to turn on a light. In this post I will show how to use LDR to detect when to turn on the light depending on the ambient light.&lt;br /&gt;
&lt;br /&gt;
Lets dive into the code quickly&lt;br /&gt;
&lt;br /&gt;
&lt;div style="background-color: rgba(255, 255, 255, 0.918); color: #222222; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;
#define TRUE &amp;nbsp;1&lt;/div&gt;
&lt;div style="background-color: rgba(255, 255, 255, 0.918); color: #222222; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;
#define FALSE 0&lt;/div&gt;
&lt;div style="background-color: rgba(255, 255, 255, 0.918); color: #222222; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="background-color: rgba(255, 255, 255, 0.918); color: #222222; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;
int LIGHT_PIN = 7;&lt;/div&gt;
&lt;div style="background-color: rgba(255, 255, 255, 0.918); color: #222222; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;
int SLEEP_TIME = 100;&lt;/div&gt;
&lt;div style="background-color: rgba(255, 255, 255, 0.918); color: #222222; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;
int LDR_PIN = 3;&lt;/div&gt;
&lt;div style="background-color: rgba(255, 255, 255, 0.918); color: #222222; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;
int LDR_THRESHOLD_FOR_DARK = 350;&lt;/div&gt;
&lt;div style="background-color: rgba(255, 255, 255, 0.918); color: #222222; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;
int MAX_COUNT_BEFORE_TOGGLE = 10;&lt;/div&gt;
&lt;div style="background-color: rgba(255, 255, 255, 0.918); color: #222222; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="background-color: rgba(255, 255, 255, 0.918); color: #222222; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;
int isLightOn = FALSE;&lt;/div&gt;
&lt;div style="background-color: rgba(255, 255, 255, 0.918); color: #222222; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;
int toggleCount = 0;&lt;/div&gt;
&lt;div style="background-color: rgba(255, 255, 255, 0.918); color: #222222; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="background-color: rgba(255, 255, 255, 0.918); color: #222222; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;
void setup() {&lt;/div&gt;
&lt;div style="background-color: rgba(255, 255, 255, 0.918); color: #222222; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;
&amp;nbsp; turnOffDevice(LIGHT_PIN);&lt;/div&gt;
&lt;div style="background-color: rgba(255, 255, 255, 0.918); color: #222222; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;
&amp;nbsp; digitalWrite(LIGHT_PIN, LOW);&lt;/div&gt;
&lt;div style="background-color: rgba(255, 255, 255, 0.918); color: #222222; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="background-color: rgba(255, 255, 255, 0.918); color: #222222; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;
&amp;nbsp; Serial.begin(115200);&lt;/div&gt;
&lt;div style="background-color: rgba(255, 255, 255, 0.918); color: #222222; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;
}&lt;/div&gt;
&lt;div style="background-color: rgba(255, 255, 255, 0.918); color: #222222; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="background-color: rgba(255, 255, 255, 0.918); color: #222222; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;
void turnOffDevice(int pin) {&lt;/div&gt;
&lt;div style="background-color: rgba(255, 255, 255, 0.918); color: #222222; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;
&amp;nbsp; pinMode(pin, INPUT);&lt;/div&gt;
&lt;div style="background-color: rgba(255, 255, 255, 0.918); color: #222222; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;
}&lt;/div&gt;
&lt;div style="background-color: rgba(255, 255, 255, 0.918); color: #222222; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="background-color: rgba(255, 255, 255, 0.918); color: #222222; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;
void turnOnDevice(int pin) {&lt;/div&gt;
&lt;div style="background-color: rgba(255, 255, 255, 0.918); color: #222222; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;
&amp;nbsp; pinMode(pin, OUTPUT);&lt;/div&gt;
&lt;div style="background-color: rgba(255, 255, 255, 0.918); color: #222222; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;
}&lt;/div&gt;
&lt;div style="background-color: rgba(255, 255, 255, 0.918); color: #222222; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="background-color: rgba(255, 255, 255, 0.918); color: #222222; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;
void toggleLight() {&lt;/div&gt;
&lt;div style="background-color: rgba(255, 255, 255, 0.918); color: #222222; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;
&amp;nbsp; if (isLightOn) {&lt;/div&gt;
&lt;div style="background-color: rgba(255, 255, 255, 0.918); color: #222222; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;
&amp;nbsp; &amp;nbsp; turnOffDevice(LIGHT_PIN);&lt;/div&gt;
&lt;div style="background-color: rgba(255, 255, 255, 0.918); color: #222222; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;
&amp;nbsp; &amp;nbsp; isLightOn = FALSE;&lt;/div&gt;
&lt;div style="background-color: rgba(255, 255, 255, 0.918); color: #222222; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;
&amp;nbsp; } else {&lt;/div&gt;
&lt;div style="background-color: rgba(255, 255, 255, 0.918); color: #222222; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;
&amp;nbsp; &amp;nbsp; turnOnDevice(LIGHT_PIN);&lt;/div&gt;
&lt;div style="background-color: rgba(255, 255, 255, 0.918); color: #222222; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;
&amp;nbsp; &amp;nbsp; isLightOn = TRUE;&lt;/div&gt;
&lt;div style="background-color: rgba(255, 255, 255, 0.918); color: #222222; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;
&amp;nbsp; }&lt;/div&gt;
&lt;div style="background-color: rgba(255, 255, 255, 0.918); color: #222222; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;
}&lt;/div&gt;
&lt;div style="background-color: rgba(255, 255, 255, 0.918); color: #222222; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="background-color: rgba(255, 255, 255, 0.918); color: #222222; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;
void toggleLightIfNecessary(int input, int threshold) {&lt;/div&gt;
&lt;div style="background-color: rgba(255, 255, 255, 0.918); color: #222222; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;
&amp;nbsp; if (input &amp;gt; threshold) {&lt;/div&gt;
&lt;div style="background-color: rgba(255, 255, 255, 0.918); color: #222222; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;
&amp;nbsp; &amp;nbsp; toggleCount++;&lt;/div&gt;
&lt;div style="background-color: rgba(255, 255, 255, 0.918); color: #222222; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;
&amp;nbsp; &amp;nbsp; if (toggleCount &amp;gt; MAX_COUNT_BEFORE_TOGGLE) {&lt;/div&gt;
&lt;div style="background-color: rgba(255, 255, 255, 0.918); color: #222222; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; toggleLight();&lt;/div&gt;
&lt;div style="background-color: rgba(255, 255, 255, 0.918); color: #222222; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; toggleCount = 0;&lt;/div&gt;
&lt;div style="background-color: rgba(255, 255, 255, 0.918); color: #222222; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;
&amp;nbsp; &amp;nbsp; }&lt;/div&gt;
&lt;div style="background-color: rgba(255, 255, 255, 0.918); color: #222222; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;
&amp;nbsp; } else {&lt;/div&gt;
&lt;div style="background-color: rgba(255, 255, 255, 0.918); color: #222222; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;
&amp;nbsp; &amp;nbsp; toggleCount = 0;&lt;/div&gt;
&lt;div style="background-color: rgba(255, 255, 255, 0.918); color: #222222; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;
&amp;nbsp; }&lt;/div&gt;
&lt;div style="background-color: rgba(255, 255, 255, 0.918); color: #222222; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;
}&lt;/div&gt;
&lt;div style="background-color: rgba(255, 255, 255, 0.918); color: #222222; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="background-color: rgba(255, 255, 255, 0.918); color: #222222; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;
void loop()&lt;/div&gt;
&lt;div style="background-color: rgba(255, 255, 255, 0.918); color: #222222; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;
{&lt;/div&gt;
&lt;div style="background-color: rgba(255, 255, 255, 0.918); color: #222222; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;
&amp;nbsp; delay(SLEEP_TIME);&lt;/div&gt;
&lt;div style="background-color: rgba(255, 255, 255, 0.918); color: #222222; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;
&amp;nbsp; int ldrReading = 1023 - analogRead(LDR_PIN);&lt;/div&gt;
&lt;div style="background-color: rgba(255, 255, 255, 0.918); color: #222222; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;
&amp;nbsp; Serial.println(ldrReading);&lt;/div&gt;
&lt;div style="background-color: rgba(255, 255, 255, 0.918); color: #222222; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="background-color: rgba(255, 255, 255, 0.918); color: #222222; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;
&amp;nbsp; Serial.println(toggleCount);&lt;/div&gt;
&lt;div style="background-color: rgba(255, 255, 255, 0.918); color: #222222; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;
&amp;nbsp; if (isLightOn) {&lt;/div&gt;
&lt;div style="background-color: rgba(255, 255, 255, 0.918); color: #222222; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;
&amp;nbsp; &amp;nbsp; toggleLightIfNecessary(&lt;wbr&gt;&lt;/wbr&gt;ldrReading, LDR_THRESHOLD_FOR_DARK);&lt;/div&gt;
&lt;div style="background-color: rgba(255, 255, 255, 0.918); color: #222222; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;
&amp;nbsp; } else {&lt;/div&gt;
&lt;div style="background-color: rgba(255, 255, 255, 0.918); color: #222222; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;
&amp;nbsp; &amp;nbsp; toggleLightIfNecessary(1023 - ldrReading,&lt;/div&gt;
&lt;div style="background-color: rgba(255, 255, 255, 0.918); color: #222222; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;1023 - LDR_THRESHOLD_FOR_DARK);&lt;/div&gt;
&lt;div style="background-color: rgba(255, 255, 255, 0.918); color: #222222; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;
&amp;nbsp; }&lt;/div&gt;
&lt;div style="background-color: rgba(255, 255, 255, 0.918); color: #222222; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;
}&lt;/div&gt;
&lt;br /&gt;
So in the loop(), I keep reading the data from the light sensor, invert it and check to see if the light is already turned on. If it is already on and there is enough ambient light, then I turn in off. If the light is off, then it is turned on if the ambient light is not sufficient. &lt;br /&gt;
&lt;br /&gt;
In both cases, I make sure the sensor data is consistently above or below the threshold. Otherwise the light might turn on when some one's shadow causes the light sensor to report a low light etc.&lt;br /&gt;
&lt;br /&gt;
Some things to note:&lt;br /&gt;
&lt;ol style="text-align: left;"&gt;
&lt;li&gt;In this experiment, I made sure that the light sensor is pointed away from the light source and towards a window from where sun light comes into the room.&lt;/li&gt;
&lt;li&gt;The threshold value is empirical, based on conditions in my room and my "feeling" of darkness.&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/32430925-5098907251202207577?l=chandan-pitta.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/7HcEkkBxwtBw8iLrAvP7pft2Q70/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/7HcEkkBxwtBw8iLrAvP7pft2Q70/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/7HcEkkBxwtBw8iLrAvP7pft2Q70/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/7HcEkkBxwtBw8iLrAvP7pft2Q70/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/MyThoughtsInE-text/~4/m6K-FTUkfj0" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://chandan-pitta.blogspot.com/feeds/5098907251202207577/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=32430925&amp;postID=5098907251202207577" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/32430925/posts/default/5098907251202207577?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/32430925/posts/default/5098907251202207577?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/MyThoughtsInE-text/~3/m6K-FTUkfj0/induinox-and-wireless-relays-part-ii.html" title="InduinoX and wireless relays: Part II" /><author><name>Chandan Pitta</name><uri>https://profiles.google.com/108073397456181759055</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh5.googleusercontent.com/-wYryPSd3yss/AAAAAAAAAAI/AAAAAAAAEgc/kTrWHJtpxUg/s512-c/photo.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://chandan-pitta.blogspot.com/2011/11/induinox-and-wireless-relays-part-ii.html</feedburner:origLink></entry><entry gd:etag="W/&quot;C0UNQHc8fyp7ImA9WhdaFk0.&quot;"><id>tag:blogger.com,1999:blog-32430925.post-2278199793172589338</id><published>2011-10-25T20:50:00.000-07:00</published><updated>2011-10-25T20:54:51.977-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-10-25T20:54:51.977-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="electronics" /><category scheme="http://www.blogger.com/atom/ns#" term="arduino" /><category scheme="http://www.blogger.com/atom/ns#" term="relays" /><category scheme="http://www.blogger.com/atom/ns#" term="induinox" /><title>InduinoX and wireless relays: Part I</title><content type="html">&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
It has been a while since I &lt;a href="http://chandan-pitta.blogspot.com/2011/09/purchase-experience-with-probot.html"&gt;received my wireless relay&lt;/a&gt; and I finally got some time this weekend to put them to good use.&lt;br /&gt;
&lt;br /&gt;
The connections were really simple. I connected a 5V DC power supply (check polarity, the center pin should be positive) to the wireless transmitter and a 12V DC power supply to the relay board (which also has the receiver).&lt;br /&gt;
&lt;br /&gt;
To control the relays using InduinoX, I connected the wireless transmitter board ground to the InduinoX board's ground. Connected the relay 0 pin on the board to digital pin 7 on InduinoX.&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://2.bp.blogspot.com/-wwXUWAMpYQg/Tqd9Rr8gn6I/AAAAAAAAEzM/Oi_UfhPasUk/s1600/transmitter.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="196" src="http://2.bp.blogspot.com/-wwXUWAMpYQg/Tqd9Rr8gn6I/AAAAAAAAEzM/Oi_UfhPasUk/s400/transmitter.jpg" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
Finally connecte the light bulb to mains neutral, the live from mains to the common pin on the relay and "normally closed" (NC) pin on the relay to the light bulb.&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://4.bp.blogspot.com/-pAqnpE4_vZk/Tqd_RvmxM6I/AAAAAAAAEzU/Q-PCyzKleYY/s1600/relay.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="260" src="http://4.bp.blogspot.com/-pAqnpE4_vZk/Tqd_RvmxM6I/AAAAAAAAEzU/Q-PCyzKleYY/s400/relay.jpg" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
Generally you would connect the "Normally open" (NO) pin to the light bulb instead of NC, but I will explain in a minute why I had to connect NC. Now to the coding part. The &lt;a href="http://probots.co.in/Manuals/4%20Channel%20Wireless%20Relay%20Board%20-%20Starter%20Guide.pdf"&gt;specification for the relay&lt;/a&gt; tells us that when the relay pin is open (high impedance), the relay is active. And when the relay pin is connected to the ground, the relay is inactive.&lt;br /&gt;
&lt;br /&gt;
On the InduinoX board, when a digital pin is set to input mode, the input impedance is very high causing it to act like an open switch. So setting the pin 7 to input mode will cause the relay to be active. Now the InduinoX board always starts with all the digital pins set to input mode which means the relay will start off being active. Which is why I connected the NC pin to the light bulb otherwise with NO connected to the light bulb, the light will be on when the InduinoX starts up.&lt;br /&gt;
&lt;br /&gt;
To turn off the relay I have to connect the relay pin to ground. The way it is done with InduinoX is by setting the pin to output mode and then send low signal. Here is the code for all this logic.&lt;br /&gt;
&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;#define TRUE &amp;nbsp;1&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;#define FALSE 0&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;int LIGHT_PIN = 7;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;int SLEEP_TIME = 1000;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;int isLightOn = FALSE;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;void setup() {&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; turnOffDevice(LIGHT_PIN);&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; digitalWrite(LIGHT_PIN, LOW);&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;void turnOffDevice(int pin) {&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; pinMode(pin, INPUT);&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;void turnOnDevice(int pin) {&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; pinMode(pin, OUTPUT);&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;void loop()&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; delay(SLEEP_TIME);&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; if (isLightOn) {&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; turnOffDevice(LIGHT_PIN);&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; isLightOn = FALSE;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; } else {&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; turnOnDevice(LIGHT_PIN);&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; isLightOn = TRUE;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; }&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
A more exciting project with the light bulb and LDR in my next post.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-BZZ8g9OmPKQ/TqeC3puJL4I/AAAAAAAAEzc/b9g1vwbYBt4/s1600/IMG_3336.JPG" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" height="223" src="http://3.bp.blogspot.com/-BZZ8g9OmPKQ/TqeC3puJL4I/AAAAAAAAEzc/b9g1vwbYBt4/s400/IMG_3336.JPG" width="400" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;When light bulb is off&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-5jGKCaZQWTQ/TqeDFwSqoxI/AAAAAAAAEzk/hSHGZ4vimoE/s1600/IMG_3339.JPG" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" height="223" src="http://2.bp.blogspot.com/-5jGKCaZQWTQ/TqeDFwSqoxI/AAAAAAAAEzk/hSHGZ4vimoE/s400/IMG_3339.JPG" width="400" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;When light bulb is on&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/32430925-2278199793172589338?l=chandan-pitta.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/XeXQG8xghAuPYginlAs1LFbNCiw/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/XeXQG8xghAuPYginlAs1LFbNCiw/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/XeXQG8xghAuPYginlAs1LFbNCiw/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/XeXQG8xghAuPYginlAs1LFbNCiw/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/MyThoughtsInE-text/~4/oMxSIepcSmM" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://chandan-pitta.blogspot.com/feeds/2278199793172589338/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=32430925&amp;postID=2278199793172589338" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/32430925/posts/default/2278199793172589338?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/32430925/posts/default/2278199793172589338?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/MyThoughtsInE-text/~3/oMxSIepcSmM/induinox-and-wireless-relays-part-i.html" title="InduinoX and wireless relays: Part I" /><author><name>Chandan Pitta</name><uri>https://profiles.google.com/108073397456181759055</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh5.googleusercontent.com/-wYryPSd3yss/AAAAAAAAAAI/AAAAAAAAEgc/kTrWHJtpxUg/s512-c/photo.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://2.bp.blogspot.com/-wwXUWAMpYQg/Tqd9Rr8gn6I/AAAAAAAAEzM/Oi_UfhPasUk/s72-c/transmitter.jpg" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://chandan-pitta.blogspot.com/2011/10/induinox-and-wireless-relays-part-i.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CEEFRn86eip7ImA9WhdbGUk.&quot;"><id>tag:blogger.com,1999:blog-32430925.post-150035122402208282</id><published>2011-10-18T05:56:00.000-07:00</published><updated>2011-10-18T05:56:57.112-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-10-18T05:56:57.112-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="arduino" /><category scheme="http://www.blogger.com/atom/ns#" term="scope" /><category scheme="http://www.blogger.com/atom/ns#" term="picoscope" /><category scheme="http://www.blogger.com/atom/ns#" term="oscilloscope" /><title>Scopes and electronics</title><content type="html">&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
An oscilloscope is very important for any electronic&amp;nbsp;enthusiast. Recently I have been &lt;a href="http://chandan-pitta.blogspot.com/2011/10/induinox-ir-emitter.html"&gt;trying to send IR remote codes&lt;/a&gt; from an arduino board to my TV. I was having some trouble with timings and my TV would not respond properly. Without the oscilloscope this would not have been easy to debug.&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
I have been looking for some not very expensive, simple to use oscilloscope that can be connected to my computer, so I can save data. I came upon &lt;a href="http://www.picotech.com/"&gt;PicoScope&lt;/a&gt;. They have a wide variety of products, but the one that caught my eye is the &lt;a href="http://www.picotech.com/ultracompact-oscilloscopes.html"&gt;PicoScope 2205&lt;/a&gt;&amp;nbsp;which came in my budget and good enough for my projects. However it is not available in India. Lucky for me my sister and brother-in-law are in UK! I asked them for the PicoScope 2205 and 2 probes (x1 and x10). Thanks to them I now have an oscilloscope.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;
&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-6cyTtXyeIFQ/Tp1w-8LhrRI/AAAAAAAAEyo/zPJwpxvJyaU/s1600/IMG_3209.JPG" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" height="223" src="http://1.bp.blogspot.com/-6cyTtXyeIFQ/Tp1w-8LhrRI/AAAAAAAAEyo/zPJwpxvJyaU/s400/IMG_3209.JPG" width="400" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;Contents of PicoScope 2205 and Probes&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
So when I had to find the IR signal coming from my TV remote, I connected the probe to the IR receiver data out pin on the arduino board and started recording the signal using the &lt;a href="http://www.picotech.com/data-logging-software.html"&gt;PicoLog&lt;/a&gt; software. It is really simple to use PicoLog. I did not even read any manual or help files. Launched the app, started a new recording and setup the recording method to "Fast block", and "Stop" action at the end of one run.&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://3.bp.blogspot.com/-3RstHaRZlhI/Tp1ySug1a5I/AAAAAAAAEyw/_u_BoiGYq38/s1600/pico_1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://3.bp.blogspot.com/-3RstHaRZlhI/Tp1ySug1a5I/AAAAAAAAEyw/_u_BoiGYq38/s1600/pico_1.png" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
Then the recording parameters have to be set a bit. Basically I went for 5 us time base&amp;nbsp;(the lowest I could go to get a full command from my remote)&amp;nbsp;and maximum samples possible. That makes for a 81 ms recording time on the PicoScope 2205 buffer. Good enough, because I know that the signal cannot last for more than 45 ms. I set the range on Channel A to 5V DC.&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://1.bp.blogspot.com/-4gREdFH7HqI/Tp1zmT84EjI/AAAAAAAAEy4/KByMrNIhWyY/s1600/pico_2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="295" src="http://1.bp.blogspot.com/-4gREdFH7HqI/Tp1zmT84EjI/AAAAAAAAEy4/KByMrNIhWyY/s400/pico_2.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
Finally I had to set the trigger on Channel A to "Falling" direction. That is because I found that for some reason the data out pin on the IR receiver is high when there is no signal and goes low when it detects a IR signal. Set the threshold to 2000 mV, but higher would also work. Just wanted to be on the safe side.&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://2.bp.blogspot.com/--5icahyYiTo/Tp10sGcSYrI/AAAAAAAAEzA/pifequLUS0Y/s1600/pico_3.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://2.bp.blogspot.com/--5icahyYiTo/Tp10sGcSYrI/AAAAAAAAEzA/pifequLUS0Y/s1600/pico_3.png" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
That's it for the configuration part. Next I connected the probe on the data pin of IR receiver and pressed the volume up button on my remote. The trigger happened, data got recorded by PicoLog and this is what I got.&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://2.bp.blogspot.com/-gciJExmhOVM/TpRjJlIRAII/AAAAAAAAEsI/gqK5-pM2_eg/s1600/receiver.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="156" src="http://2.bp.blogspot.com/-gciJExmhOVM/TpRjJlIRAII/AAAAAAAAEsI/gqK5-pM2_eg/s400/receiver.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
I see a lot of other uses for my oscilloscope in future. I suggest you get one too if you are serious about electronic projects.&lt;/div&gt;
&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/32430925-150035122402208282?l=chandan-pitta.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/SGvSmVeYBdh-226_Yf-1THXPSHc/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/SGvSmVeYBdh-226_Yf-1THXPSHc/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/SGvSmVeYBdh-226_Yf-1THXPSHc/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/SGvSmVeYBdh-226_Yf-1THXPSHc/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/MyThoughtsInE-text/~4/ktGhcjSdxZs" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://chandan-pitta.blogspot.com/feeds/150035122402208282/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=32430925&amp;postID=150035122402208282" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/32430925/posts/default/150035122402208282?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/32430925/posts/default/150035122402208282?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/MyThoughtsInE-text/~3/ktGhcjSdxZs/scopes-and-electronics.html" title="Scopes and electronics" /><author><name>Chandan Pitta</name><uri>https://profiles.google.com/108073397456181759055</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh5.googleusercontent.com/-wYryPSd3yss/AAAAAAAAAAI/AAAAAAAAEgc/kTrWHJtpxUg/s512-c/photo.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://1.bp.blogspot.com/-6cyTtXyeIFQ/Tp1w-8LhrRI/AAAAAAAAEyo/zPJwpxvJyaU/s72-c/IMG_3209.JPG" height="72" width="72" /><thr:total>1</thr:total><feedburner:origLink>http://chandan-pitta.blogspot.com/2011/10/scopes-and-electronics.html</feedburner:origLink></entry><entry gd:etag="W/&quot;A0QNQncyeCp7ImA9WhdbFUg.&quot;"><id>tag:blogger.com,1999:blog-32430925.post-3279736594419601596</id><published>2011-10-13T03:54:00.000-07:00</published><updated>2011-10-13T19:29:53.990-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-10-13T19:29:53.990-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="arduino" /><category scheme="http://www.blogger.com/atom/ns#" term="ir emitter" /><category scheme="http://www.blogger.com/atom/ns#" term="ir remote" /><category scheme="http://www.blogger.com/atom/ns#" term="induinox" /><title>InduinoX: IR Emitter</title><content type="html">&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
In my &lt;a href="http://chandan-pitta.blogspot.com/2011/10/induinox-ir-receiver.html"&gt;last post&lt;/a&gt;, I promised an arduino board based remote control. This is the post you have been waiting for. Now the InduinoX comes with an IR emitter too (don't you just love this board?)! The IR emitter is connected to analog pin 0. So you can start transmitting the remote signal you &lt;a href="http://chandan-pitta.blogspot.com/2011/10/induinox-ir-receiver.html"&gt;previously&lt;/a&gt; discovered.&lt;br /&gt;
&lt;br /&gt;
Before we go too far, make sure you have read the &lt;a href="http://chandan-pitta.blogspot.com/2011/10/ir-remotes.html"&gt;primer on IR remotes&lt;/a&gt;. My TV remote sends out the signal in the sony protocol as observed from my gnuplots and oscilloscope. You know now that according to Sony protocol, a 1 is represented by 1200ms of high and 600ms of low, while a 0 is represented by 600ms of high and 600ms of low. Also the signal is to be prefixed with a header, which is 2400ms high signal followed by a 600ms of low. So lets write some code to send the header, 0 and 1 first.&lt;br /&gt;
&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;
#define HEADER_ON &amp;nbsp;&amp;nbsp;&amp;nbsp;2400&lt;br /&gt;
#define HEADER_OFF &amp;nbsp;&amp;nbsp;600&lt;br /&gt;
#define BIT_1_ON &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;1200&lt;br /&gt;
#define BIT_1_OFF &amp;nbsp;&amp;nbsp;&amp;nbsp;600&lt;br /&gt;
#define BIT_0_ON &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;600&lt;br /&gt;
#define BIT_0_OFF &amp;nbsp;&amp;nbsp;&amp;nbsp;600&lt;br /&gt;
&lt;br /&gt;
void sendHeader() {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;sendHigh(HEADER_ON);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;sendLow(HEADER_OFF);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
void sendBit1() {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;sendHigh(BIT_1_ON);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;sendLow(BIT_1_OFF);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
void sendBit0() {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;sendHigh(BIT_0_ON);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;sendLow(BIT_0_OFF);&lt;br /&gt;
}&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
So far, so good. Now you have to remember that the signal should be modulated with a 40 kHz signal. Which means a high should really be quick successions of high and low at 40 kHz. The time period of 40 kHz signal is 25 microseconds (1/40,000th of a second). So have to wiggle the IR LED low to high and from high to low every 12.5 ms. Which is why our sendHigh() and sendLow() look like this (note that on the InduinoX, the IR emitter is connected to analog pin 0):&lt;br /&gt;
&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;
#define IR_PIN A0&lt;br /&gt;
&lt;br /&gt;
int cmdTime = 0;&lt;br /&gt;
&lt;br /&gt;
void sendHigh(int time) {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;cmdTime += time;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;while (time &amp;gt; 0) {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;digitalWrite(IR_PIN, HIGH); &amp;nbsp;// sets the pin high&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;delayMicroseconds(10); &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;// sleep for 13 us (3us delay for pin high)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;digitalWrite(IR_PIN, LOW); &amp;nbsp;&amp;nbsp;// sets the pin low&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;delayMicroseconds(9); &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;// sleep for 12 us (3 us delay for pin low)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;time -= 25;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
void sendLow(int time) {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;cmdTime += time;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;while (time &amp;gt; 0) {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;digitalWrite(IR_PIN, LOW); &amp;nbsp;&amp;nbsp;// sets the pin low&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;delayMicroseconds(10); &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;// sleep for 13 us (3us delay for pin low)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;digitalWrite(IR_PIN, LOW); &amp;nbsp;&amp;nbsp;// sets the pin low&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;delayMicroseconds(9); &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;// sleep for 12 us (3 us delay for pin low)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;time -= 25;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;}&lt;br /&gt;
}&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Finally it is time to send the signal.&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;br /&gt;
#define BITS &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;12&lt;br /&gt;
&lt;br /&gt;
void sendCmdOnce(int cmd, int last) {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;cmdTime = 0;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;cli(); &amp;nbsp;// Disable interrupts so our timings can be accurate&lt;br /&gt;
&amp;nbsp;&amp;nbsp;sendHeader();&lt;br /&gt;
&amp;nbsp;&amp;nbsp;for (int i = BITS - 1; i &amp;gt;= 0; i--) {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if ((cmd &amp;amp; (1 &amp;lt;&amp;lt; i)) == 0) {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;sendBit0();&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;} else {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;sendBit1();&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;
&amp;nbsp;&amp;nbsp;}&lt;br /&gt;
&amp;nbsp;&amp;nbsp;sei(); &amp;nbsp;// Enable interrupts&lt;br /&gt;
}&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
We are not done yet! Remember that sony protocol requires you to send the same signal at least 3 times every 45ms. Here is the code for that:&lt;br /&gt;
&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;
void sendCmd(int cmd) {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;for (int i = 0; i &amp;lt; 3; i++) {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;sendCmdOnce(cmd, i);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;delay(45 - cmdTime / 1000);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;}&lt;br /&gt;
}&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Simple :).Now lets put all the code in proper order along with the setup() and loop() functions.&lt;br /&gt;
&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;
#define BITS &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;12&lt;br /&gt;
#define HEADER_ON &amp;nbsp;&amp;nbsp;&amp;nbsp;2400&lt;br /&gt;
#define HEADER_OFF &amp;nbsp;&amp;nbsp;600&lt;br /&gt;
#define BIT_1_ON &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;1200&lt;br /&gt;
#define BIT_1_OFF &amp;nbsp;&amp;nbsp;&amp;nbsp;600&lt;br /&gt;
#define BIT_0_ON &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;600&lt;br /&gt;
#define BIT_0_OFF &amp;nbsp;&amp;nbsp;&amp;nbsp;600&lt;br /&gt;
&lt;br /&gt;
#define IR_PIN A0&lt;br /&gt;
&lt;br /&gt;
int cmdTime = 0;&lt;br /&gt;
&lt;br /&gt;
void setup() {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;pinMode(IR_PIN, OUTPUT);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
void loop() {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;sendCmd(0x490);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;delay(1000);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
void sendCmd(int cmd) {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;for (int i = 0; i &amp;lt; 3; i++) {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;sendCmdOnce(cmd, i);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;delay(45 - cmdTime / 1000);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
void sendCmdOnce(int cmd, int last) {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;cmdTime = 0;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;cli(); &amp;nbsp;// Disable interrupts so our timings can be accurate&lt;br /&gt;
&amp;nbsp;&amp;nbsp;sendHeader();&lt;br /&gt;
&amp;nbsp;&amp;nbsp;for (int i = BITS - 1; i &amp;gt;= 0; i--) {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if ((cmd &amp;amp; (1 &amp;lt;&amp;lt; i)) == 0) {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;sendBit0();&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;} else {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;sendBit1();&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;
&amp;nbsp;&amp;nbsp;}&lt;br /&gt;
&amp;nbsp;&amp;nbsp;sei(); &amp;nbsp;// Enable interrupts&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
void sendHeader() {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;sendHigh(HEADER_ON);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;sendLow(HEADER_OFF);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
void sendBit1() {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;sendHigh(BIT_1_ON);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;sendLow(BIT_1_OFF);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
void sendBit0() {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;sendHigh(BIT_0_ON);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;sendLow(BIT_0_OFF);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
void sendHigh(int time) {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;cmdTime += time;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;while (time &amp;gt; 0) {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;digitalWrite(IR_PIN, HIGH); &amp;nbsp;// sets the pin high&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;delayMicroseconds(10); &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;// sleep for 13 us (3us delay for pin high)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;digitalWrite(IR_PIN, LOW); &amp;nbsp;&amp;nbsp;// sets the pin low&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;delayMicroseconds(9); &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;// sleep for 12 us (3 us delay for pin low)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;time -= 25;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
void sendLow(int time) {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;cmdTime += time;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;while (time &amp;gt; 0) {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;digitalWrite(IR_PIN, LOW); &amp;nbsp;&amp;nbsp;// sets the pin low&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;delayMicroseconds(10); &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;// sleep for 13 us (3us delay for pin low)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;digitalWrite(IR_PIN, LOW); &amp;nbsp;&amp;nbsp;// sets the pin low&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;delayMicroseconds(9); &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;// sleep for 12 us (3 us delay for pin low)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;time -= 25;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;}&lt;br /&gt;
}&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Please forgive my bad programming practices (global variables, confusing naming styles for my defines etc), I did it over a lazy Saturday ;). The setup() prepares the IR emitter to output. The loop() keeps sending the same volume up signal (0x490) over and over every second. So if you point the IR emitter to your TV you will see the volume go up every second. I was very excited when all this just worked! Just to make sure, I looked at the IR emitter PIN voltage on my oscilloscope and everything looks like it is in order.

&lt;br /&gt;
&lt;br /&gt;
&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-9qqLfZIFJtQ/TpbCY_679bI/AAAAAAAAEsY/RoAxFOfQO3U/s1600/emitter.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" height="156" src="http://4.bp.blogspot.com/-9qqLfZIFJtQ/TpbCY_679bI/AAAAAAAAEsY/RoAxFOfQO3U/s400/emitter.png" width="400" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;Singal repeating every 45ms&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-vti6b_rjKms/TpbC35HWuPI/AAAAAAAAEsg/BkG7o87wssY/s1600/emitter_signal.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" height="158" src="http://4.bp.blogspot.com/-vti6b_rjKms/TpbC35HWuPI/AAAAAAAAEsg/BkG7o87wssY/s400/emitter_signal.png" width="400" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;Up close of 0x490 signal (inverted)&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/32430925-3279736594419601596?l=chandan-pitta.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/GQlMUdKhSULXmTzgEJqfAe62aX8/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/GQlMUdKhSULXmTzgEJqfAe62aX8/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/GQlMUdKhSULXmTzgEJqfAe62aX8/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/GQlMUdKhSULXmTzgEJqfAe62aX8/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/MyThoughtsInE-text/~4/pHgT7WGAQxw" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://chandan-pitta.blogspot.com/feeds/3279736594419601596/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=32430925&amp;postID=3279736594419601596" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/32430925/posts/default/3279736594419601596?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/32430925/posts/default/3279736594419601596?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/MyThoughtsInE-text/~3/pHgT7WGAQxw/induinox-ir-emitter.html" title="InduinoX: IR Emitter" /><author><name>Chandan Pitta</name><uri>https://profiles.google.com/108073397456181759055</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh5.googleusercontent.com/-wYryPSd3yss/AAAAAAAAAAI/AAAAAAAAEgc/kTrWHJtpxUg/s512-c/photo.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://4.bp.blogspot.com/-9qqLfZIFJtQ/TpbCY_679bI/AAAAAAAAEsY/RoAxFOfQO3U/s72-c/emitter.png" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://chandan-pitta.blogspot.com/2011/10/induinox-ir-emitter.html</feedburner:origLink></entry><entry gd:etag="W/&quot;A0QHQH84eyp7ImA9WhdbE0k.&quot;"><id>tag:blogger.com,1999:blog-32430925.post-1379654856531707846</id><published>2011-10-11T08:58:00.000-07:00</published><updated>2011-10-11T09:08:51.133-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-10-11T09:08:51.133-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="arduino" /><category scheme="http://www.blogger.com/atom/ns#" term="ir remote" /><category scheme="http://www.blogger.com/atom/ns#" term="ir receiver" /><category scheme="http://www.blogger.com/atom/ns#" term="picoscope" /><title>InduinoX: IR receiver</title><content type="html">&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;From my &lt;a href="http://chandan-pitta.blogspot.com/2011/10/ir-remotes.html"&gt;previous post&lt;/a&gt;, you probably understood how IR remotes work in general. Now lets take a look at how we can read the signals coming from various remotes that you might have.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Fortunately for us the InduinoX board comes with an IR receiver. And the good news is that&amp;nbsp;&lt;a href="http://www.arduino.cc/playground/Code/InfraredReceivers"&gt;some one already wrote the code&lt;/a&gt;&amp;nbsp;to read IR signal from arduino! Just copy the code from&amp;nbsp;&lt;a href="http://www.arduino.cc/playground/Code/InfraredReceivers"&gt;http://www.arduino.cc/playground/Code/InfraredReceivers&lt;/a&gt;,&amp;nbsp;replace the value of IRpin from 2 to A1, because on InduinoX, the IR receiver is connected to analog pin 1. Compile and upload the code to InduinoX.&lt;br /&gt;
&lt;br /&gt;
The code basically sets up the serial port to 115200 baud rate, then sets up timers (read &lt;a href="http://www.arcfn.com/2009/07/secrets-of-arduino-pwm.html"&gt;this excellent tutorial&lt;/a&gt; on PWMs on arduino), finally the code waits on the IR receive pin for the signal to change (the signal changes when a button on a remote is pressed pointing to the IR receiver). Then the code keeps track of the time it takes for the signal to change from high to low and low to high. At the end of the signal transitions the code prints the timing information. The output looks like&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;&lt;span class="Apple-style-span" style="background-color: white; color: #222222;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;0&lt;span style="white-space: pre-wrap;"&gt; &lt;/span&gt;0&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;2476&lt;span style="white-space: pre-wrap;"&gt; &lt;/span&gt;0&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;2476&lt;span style="white-space: pre-wrap;"&gt; &lt;/span&gt;1&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;3000&lt;span style="white-space: pre-wrap;"&gt; &lt;/span&gt;1&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;3000&lt;span style="white-space: pre-wrap;"&gt; &lt;/span&gt;0&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;3664&lt;span style="white-space: pre-wrap;"&gt; &lt;/span&gt;0&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;3664&lt;span style="white-space: pre-wrap;"&gt; &lt;/span&gt;1&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;4204&lt;span style="white-space: pre-wrap;"&gt; &lt;/span&gt;1&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;4204&lt;span style="white-space: pre-wrap;"&gt; &lt;/span&gt;0&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;5472&lt;span style="white-space: pre-wrap;"&gt; &lt;/span&gt;0&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;5472&lt;span style="white-space: pre-wrap;"&gt; &lt;/span&gt;1&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;:&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;Save the output to a file. The output can be used by &lt;a href="http://www.gnuplot.info/"&gt;gnuplot&lt;/a&gt; to display the graph of the signal. Make sure you have gnuplot installed on your machine. I used these commands&lt;/span&gt;&lt;/div&gt;
&lt;span class="Apple-style-span" style="background-color: white;"&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div style="color: #222222;"&gt;
&lt;span class="Apple-style-span" style="background-color: white;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;$ gnuplot&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="background-color: white; font-family: 'Courier New', Courier, monospace;"&gt;set yrange [-1:2]&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="background-color: white; font-family: 'Courier New', Courier, monospace;"&gt;plot &amp;nbsp;"/home/chandanp/temp/vol_up.&lt;/span&gt;&lt;wbr style="background-color: white; font-family: 'Courier New', Courier, monospace;"&gt;&lt;/wbr&gt;&lt;span class="Apple-style-span" style="background-color: white; font-family: 'Courier New', Courier, monospace;"&gt;txt" with lines title 'signal'&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span class="Apple-style-span" style="background-color: white;"&gt;And my output looks like this&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;
&lt;/div&gt;
&lt;div class="separator" style="clear: both; color: #222222; font-family: inherit; text-align: center;"&gt;
&lt;span class="Apple-style-span" style="background-color: white;"&gt;&lt;a href="http://2.bp.blogspot.com/-hzNzfy9wPxM/TpRfI6pQqWI/AAAAAAAAEr4/1v1hYAYRScw/s1600/gnu_plot.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="227" src="http://2.bp.blogspot.com/-hzNzfy9wPxM/TpRfI6pQqWI/AAAAAAAAEr4/1v1hYAYRScw/s400/gnu_plot.png" width="400" /&gt;&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span class="Apple-style-span" style="background-color: white;"&gt;
&lt;/span&gt;&lt;span class="Apple-style-span" style="background-color: white; color: #222222; font-family: inherit;"&gt;&lt;/span&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="background-color: white; color: #222222; font-family: inherit;"&gt;&lt;span class="Apple-style-span" style="background-color: white; color: #222222;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span class="Apple-style-span" style="background-color: white; color: #222222; font-family: inherit;"&gt;
&lt;/span&gt;&lt;span class="Apple-style-span" style="background-color: white; color: #222222; font-family: inherit;"&gt;Notice how the signal repeats itself 2 times and then there is a partial signal at the end.&amp;nbsp;&lt;/span&gt;&lt;span class="Apple-style-span" style="background-color: white; color: #222222; font-family: inherit;"&gt;If you happen to have an&amp;nbsp;oscilloscope, you can use the probe on the IR receiver data out pin to see the output on the scope. I have a &lt;a href="http://www.picotech.com/ultracompact-oscilloscopes.html"&gt;picoscope 2205&lt;/a&gt;&amp;nbsp;(perhaps a blog post on that later) and the output on the scope looks like this&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="color: #222222;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://2.bp.blogspot.com/-gciJExmhOVM/TpRjJlIRAII/AAAAAAAAEsI/gqK5-pM2_eg/s1600/receiver.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="156" src="http://2.bp.blogspot.com/-gciJExmhOVM/TpRjJlIRAII/AAAAAAAAEsI/gqK5-pM2_eg/s400/receiver.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="color: #222222;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="color: #222222;"&gt;Since the signal repeats itself every 45ms, here is a closer look at the signal.&lt;/span&gt;&lt;span class="Apple-style-span" style="background-color: white;"&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="background-color: white;"&gt;&lt;span class="Apple-style-span" style="color: #222222; font-family: inherit;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span class="Apple-style-span" style="background-color: white;"&gt;
&lt;/span&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;span class="Apple-style-span" style="background-color: white;"&gt;&lt;a href="http://4.bp.blogspot.com/-xoN2_eIeVg8/TpRhU3h9ekI/AAAAAAAAEsA/Qas1H1-ORg8/s1600/receiver_signal.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;&lt;img border="0" height="158" src="http://4.bp.blogspot.com/-xoN2_eIeVg8/TpRhU3h9ekI/AAAAAAAAEsA/Qas1H1-ORg8/s400/receiver_signal.png" width="400" /&gt;&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span class="Apple-style-span" style="background-color: white;"&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="background-color: white;"&gt;&lt;span class="Apple-style-span" style="color: #222222;"&gt;Notice that the signal is inverted. Knowing that 0 is represented by 600ms of high and 600 ms of low and a 1 is represented by 1200ms of high and 600ms of low signal&amp;nbsp;(see my previous blog post if you don't know how I arrived at these numbers), the code for volume up on my remote control is 0x490 (0100 1001 0000). In my next blog post, I will show you how I was able to change the volume on my TV by sending the signal 0x490 from InduinoX and pointing it at my TV!&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span class="Apple-style-span" style="background-color: white;"&gt;
&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/32430925-1379654856531707846?l=chandan-pitta.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/8HtzZJG3a19j57AMQHUId-AfYA0/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/8HtzZJG3a19j57AMQHUId-AfYA0/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/8HtzZJG3a19j57AMQHUId-AfYA0/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/8HtzZJG3a19j57AMQHUId-AfYA0/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/MyThoughtsInE-text/~4/NxCRwGOaEZU" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://chandan-pitta.blogspot.com/feeds/1379654856531707846/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=32430925&amp;postID=1379654856531707846" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/32430925/posts/default/1379654856531707846?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/32430925/posts/default/1379654856531707846?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/MyThoughtsInE-text/~3/NxCRwGOaEZU/induinox-ir-receiver.html" title="InduinoX: IR receiver" /><author><name>Chandan Pitta</name><uri>https://profiles.google.com/108073397456181759055</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh5.googleusercontent.com/-wYryPSd3yss/AAAAAAAAAAI/AAAAAAAAEgc/kTrWHJtpxUg/s512-c/photo.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://2.bp.blogspot.com/-hzNzfy9wPxM/TpRfI6pQqWI/AAAAAAAAEr4/1v1hYAYRScw/s72-c/gnu_plot.png" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://chandan-pitta.blogspot.com/2011/10/induinox-ir-receiver.html</feedburner:origLink></entry><entry gd:etag="W/&quot;AkMBRX86eip7ImA9WhdbE0k.&quot;"><id>tag:blogger.com,1999:blog-32430925.post-1435736489567338165</id><published>2011-10-06T07:22:00.000-07:00</published><updated>2011-10-11T08:54:14.112-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-10-11T08:54:14.112-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="arduino" /><category scheme="http://www.blogger.com/atom/ns#" term="sony remote protocol" /><category scheme="http://www.blogger.com/atom/ns#" term="ir remote" /><category scheme="http://www.blogger.com/atom/ns#" term="ir receiver" /><title>IR remotes</title><content type="html">&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
As part of my&amp;nbsp;&lt;a href="http://chandan-pitta.blogspot.com/2011/09/purchase-experience-with-simple-labs.html"&gt;home automation project&lt;/a&gt;, I also wanted to control my home entertainment system. The controller can be a web interface or an app on android phone, or even a universal remote. Which means, I have to be able to send IR signals from the arduino board that my TV, amplifier and set-top box can understand. For this I will first have to read the signal coming from the remotes, store the various signals and replay them from the arduino board depending on my needs.&lt;br /&gt;
&lt;br /&gt;
Before going too far into the details of receiving and sending IR signals, it would help to understand how a remote control actually works. There is already a lot of material on the internet on how remotes work. So I will try to keep it short and simple.&lt;br /&gt;
&lt;br /&gt;
The IR transmission from remote to your device works on a really simple protocol. The transmitter which is just an LED that emits light in the infrared spectrum, pulses the light in a quick succession and the receiver which is a phototransistor, converts the light signal back to electric pulses. Now to transmit information, the transmitter should send a bunch of 0s and 1s. Normally one would expect (at least I thought), a 1 would be represented by the LED being on and 0 would be represented by the LED being off. However all the data would then have to start with a 1 because only then will the receiver be able to start "listening" to the data.&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://4.bp.blogspot.com/-O_WN3VoJ-rk/To2nhrl8q2I/AAAAAAAAEqg/q-c49loD-V0/s1600/Screenshot-4.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://4.bp.blogspot.com/-O_WN3VoJ-rk/To2nhrl8q2I/AAAAAAAAEqg/q-c49loD-V0/s1600/Screenshot-4.png" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;/div&gt;
One way to solve the dilemma of data always having to start with 1, is to have some kind of start signal (the header), to let the receiver know that the data is about to start, and that it should prepare for listening to the data.&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://2.bp.blogspot.com/-WYx-_b8KSdM/To2oYB2F_DI/AAAAAAAAEqk/Y7XFhzLgUf8/s1600/Screenshot-5.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://2.bp.blogspot.com/-WYx-_b8KSdM/To2oYB2F_DI/AAAAAAAAEqk/Y7XFhzLgUf8/s1600/Screenshot-5.png" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
Now what happens if there are more than 1 consecutive 0s or 1s? If we know that the pulse width is certain milliseconds then we can identify the consecutive 1s or 0s. But the problem however is the timing. The receiver's and the transmitter's timers should be perfectly synchronized. Otherwise 4 consecutive 1's from the transmitter could be mistaken for only 3 consecutive 1s, if the timers drift a little bit.&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://2.bp.blogspot.com/-vz1T6yDzpwk/To2p_zRpOkI/AAAAAAAAEqo/G9etSyOVbvo/s1600/Screenshot-6.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://2.bp.blogspot.com/-vz1T6yDzpwk/To2p_zRpOkI/AAAAAAAAEqo/G9etSyOVbvo/s1600/Screenshot-6.png" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
So to solve the problem, the IR transmitters and receivers actually use a combination of high and low to represent either a 1 or 0. The 1 is usually represented by longer high and smaller low. While a 0 is represented by smaller high and low. For example in the following drawing the 1 is represented by 1200 milliseconds of high and 600 milliseconds of low. A 0 is represented by 600 ms of high and 600 ms of low. The header is represented by 2400 ms of high and 600 ms of low.&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://2.bp.blogspot.com/-NDTf_GDAEBU/To21xcctCTI/AAAAAAAAEqw/tri4mkRTJm0/s1600/Screenshot-9.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="61" src="http://2.bp.blogspot.com/-NDTf_GDAEBU/To21xcctCTI/AAAAAAAAEqw/tri4mkRTJm0/s400/Screenshot-9.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
This is the Sony protocol, used by all Sony remotes. Other remotes may have slightly different timings for 1s and 0s, but that is generally how most remotes work. Now there is just one more twist. The IR signal is finally modulated with a high frequency signal, usually between 38kHz and 40kHz. An IR signal modulated with 40kHz looks like this.&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://4.bp.blogspot.com/-OnaFA-SVKTA/To24iS4-UaI/AAAAAAAAEq0/FYYeFioUIOw/s1600/Screenshot-10.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="55" src="http://4.bp.blogspot.com/-OnaFA-SVKTA/To24iS4-UaI/AAAAAAAAEq0/FYYeFioUIOw/s400/Screenshot-10.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
Finally, most remotes repeat the same signal at least 2 times. The sony protocol specified that it should be repeated at least 3 times, and the signal should repeat every 45ms.&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://2.bp.blogspot.com/-00vnsP8k5cA/TpRj7c2h7OI/AAAAAAAAEsQ/a503Zvs-ups/s1600/receiver.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="156" src="http://2.bp.blogspot.com/-00vnsP8k5cA/TpRj7c2h7OI/AAAAAAAAEsQ/a503Zvs-ups/s400/receiver.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
That is all we need to know to get things started with automating home entertainment systems!&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/32430925-1435736489567338165?l=chandan-pitta.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/ePViVNn7OCXJ_S4tD5GnrSW4bjI/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/ePViVNn7OCXJ_S4tD5GnrSW4bjI/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/ePViVNn7OCXJ_S4tD5GnrSW4bjI/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/ePViVNn7OCXJ_S4tD5GnrSW4bjI/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/MyThoughtsInE-text/~4/jCB0mN9cogg" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://chandan-pitta.blogspot.com/feeds/1435736489567338165/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=32430925&amp;postID=1435736489567338165" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/32430925/posts/default/1435736489567338165?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/32430925/posts/default/1435736489567338165?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/MyThoughtsInE-text/~3/jCB0mN9cogg/ir-remotes.html" title="IR remotes" /><author><name>Chandan Pitta</name><uri>https://profiles.google.com/108073397456181759055</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh5.googleusercontent.com/-wYryPSd3yss/AAAAAAAAAAI/AAAAAAAAEgc/kTrWHJtpxUg/s512-c/photo.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://4.bp.blogspot.com/-O_WN3VoJ-rk/To2nhrl8q2I/AAAAAAAAEqg/q-c49loD-V0/s72-c/Screenshot-4.png" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://chandan-pitta.blogspot.com/2011/10/ir-remotes.html</feedburner:origLink></entry><entry gd:etag="W/&quot;A04DQHc9fyp7ImA9WhdUFk8.&quot;"><id>tag:blogger.com,1999:blog-32430925.post-5552779324442770613</id><published>2011-10-03T01:19:00.000-07:00</published><updated>2011-10-03T01:19:31.967-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-10-03T01:19:31.967-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="ldr" /><category scheme="http://www.blogger.com/atom/ns#" term="electronics" /><category scheme="http://www.blogger.com/atom/ns#" term="arduino" /><category scheme="http://www.blogger.com/atom/ns#" term="home automation" /><category scheme="http://www.blogger.com/atom/ns#" term="lcd" /><category scheme="http://www.blogger.com/atom/ns#" term="induinox" /><title>InduinoX: Interfacing with the LDR</title><content type="html">&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
Now that I got my &lt;a href="http://chandan-pitta.blogspot.com/2011/09/induinox-interfacing-with-lcd.html"&gt;LCD display to work with the arduino board&lt;/a&gt;, I wanted to use it to show something useful. Since I needed to detect the ambient light for my &lt;a href="http://chandan-pitta.blogspot.com/2011/09/purchase-experience-with-simple-labs.html"&gt;home automation project&lt;/a&gt;, I decided to display the amount of light coming into a room using the&amp;nbsp;light dependent resistor (LDR) that comes with the InduinoX board. Later I will use the LDR reading to determine whether I have to turn on the lights in the room or not.&lt;br /&gt;
&lt;br /&gt;
&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-hj7MFUJaBDk/ToloxV_QQXI/AAAAAAAAEqA/3-rcOh_Pfyg/s1600/LDR.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" height="108" src="http://2.bp.blogspot.com/-hj7MFUJaBDk/ToloxV_QQXI/AAAAAAAAEqA/3-rcOh_Pfyg/s200/LDR.jpg" width="200" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;Typical LDR (Source:&amp;nbsp;http://www.induino.com/wiki/index.php?title=File:LDR.jpg)&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
The LDR's output is connected to analog pin 3. The voltage as read from pin 3 is inversely proportional to the light incident on it. The analog input is connected to a 10 bit analog to digital converter (ADC). Hence the values range from 0 (at 0V) to 1023 (at 5V). The analog pins can be referenced in the code using A0 (for analog input 0) to A5. For more information on analog inputs, check out&amp;nbsp;&lt;a href="http://www.arduino.cc/en/Tutorial/AnalogInputPins"&gt;http://www.arduino.cc/en/Tutorial/AnalogInputPins&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-family: inherit;"&gt;Now to get to the coding part&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;#include &amp;lt;LiquidCrystal.h&amp;gt;&lt;/span&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;const int LDR_PIN = 3;&lt;/span&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;LiquidCrystal lcd(13, 12, 11, 10, 9, 8);&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;br /&gt;void setup() {&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; lcd.begin(16, 2);&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;}&lt;/span&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;void loop() {&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; int ldrReading = analogRead(LDR_PIN);&lt;/span&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; // LDR resistance is inversly proportional to the light&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; ldrReading = 1023 - ldrReading;&lt;/span&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; // Clear screen on LCD&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; lcd.clear();&lt;/span&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; // Print a message to LCD&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; lcd.print("lux: ");&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; lcd.print(ldrReading);&lt;/span&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; delay(1000);&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
The code first sets up the LCD display. And in the loop(), keeps reading pin 3 every second, converts it to light intensity from 0 (completely dark) to 1023 (full light) and displays the value on the LCD display. Note that although I print the value as "Lux: X", the value is not really the luminance.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
A few images of the setup under various lighting conditions&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-0bJkcU2jndA/Tolt8aXTPbI/AAAAAAAAEqE/gO-WA9s8uVM/s1600/IMG_3164.JPG" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" height="223" src="http://3.bp.blogspot.com/-0bJkcU2jndA/Tolt8aXTPbI/AAAAAAAAEqE/gO-WA9s8uVM/s400/IMG_3164.JPG" width="400" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;Under ambient light during day time&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-2-2b7cdQPOY/ToluDKFVd-I/AAAAAAAAEqI/UqhODA3SKgw/s1600/IMG_3165.JPG" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" height="223" src="http://1.bp.blogspot.com/-2-2b7cdQPOY/ToluDKFVd-I/AAAAAAAAEqI/UqhODA3SKgw/s400/IMG_3165.JPG" width="400" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;When the LDR is blocked with a paper&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-8rqBwX3cmus/ToluHnW8WSI/AAAAAAAAEqM/CbpFqJ4GKXU/s1600/IMG_3166.JPG" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" height="223" src="http://1.bp.blogspot.com/-8rqBwX3cmus/ToluHnW8WSI/AAAAAAAAEqM/CbpFqJ4GKXU/s400/IMG_3166.JPG" width="400" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;Under florescent lighting&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
&lt;/div&gt;
&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/32430925-5552779324442770613?l=chandan-pitta.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/MPV-ncEeqrOewqqphcIZMZSiDPs/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/MPV-ncEeqrOewqqphcIZMZSiDPs/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/MPV-ncEeqrOewqqphcIZMZSiDPs/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/MPV-ncEeqrOewqqphcIZMZSiDPs/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/MyThoughtsInE-text/~4/HuQbkxZCV2g" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://chandan-pitta.blogspot.com/feeds/5552779324442770613/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=32430925&amp;postID=5552779324442770613" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/32430925/posts/default/5552779324442770613?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/32430925/posts/default/5552779324442770613?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/MyThoughtsInE-text/~3/HuQbkxZCV2g/induinox-interfacing-with-ldr.html" title="InduinoX: Interfacing with the LDR" /><author><name>Chandan Pitta</name><uri>https://profiles.google.com/108073397456181759055</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh5.googleusercontent.com/-wYryPSd3yss/AAAAAAAAAAI/AAAAAAAAEgc/kTrWHJtpxUg/s512-c/photo.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://2.bp.blogspot.com/-hj7MFUJaBDk/ToloxV_QQXI/AAAAAAAAEqA/3-rcOh_Pfyg/s72-c/LDR.jpg" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://chandan-pitta.blogspot.com/2011/10/induinox-interfacing-with-ldr.html</feedburner:origLink></entry><entry gd:etag="W/&quot;D0AARXY7eCp7ImA9WhdUE0k.&quot;"><id>tag:blogger.com,1999:blog-32430925.post-399626540748080977</id><published>2011-09-29T09:03:00.000-07:00</published><updated>2011-09-29T18:22:24.800-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-09-29T18:22:24.800-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="arduino" /><category scheme="http://www.blogger.com/atom/ns#" term="probots" /><category scheme="http://www.blogger.com/atom/ns#" term="relays" /><category scheme="http://www.blogger.com/atom/ns#" term="wireless relay" /><category scheme="http://www.blogger.com/atom/ns#" term="transmitter" /><category scheme="http://www.blogger.com/atom/ns#" term="receiver" /><title>Purchase experience with Probot</title><content type="html">&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
I have recently &lt;a href="http://chandan-pitta.blogspot.com/2011/09/purchase-experience-with-simple-labs.html"&gt;posted my purchase experience with Simple Labs&lt;/a&gt;. This post is the continuation of that. That same day I ordered these components from &lt;a href="http://www.probots.co.in/"&gt;www.probots.co.in&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;ul style="text-align: left;"&gt;
&lt;li&gt;&lt;a href="http://probots.co.in/index.php?main_page=product_info&amp;amp;cPath=22&amp;amp;products_id=344"&gt;4 channel wireless relay board&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://probots.co.in/index.php?main_page=product_info&amp;amp;cPath=51&amp;amp;products_id=162"&gt;Power supply for relay&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://probots.co.in/index.php?main_page=product_info&amp;amp;cPath=51&amp;amp;products_id=323"&gt;Power supply for transmitter&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
The 4 port relay board will turn on/off any lights and fans connected to them. And the on/off state of these relays is controlled from the transmitter. The transmitter and receiver talk over a 433 MHz frequency in their own protocol.&lt;br /&gt;
&lt;br /&gt;
The transmitter controls the relays by the way of 4 physical buttons or by a&amp;nbsp;micro controller&amp;nbsp;like the arduino board. There are 5 pins on the transmitter (one for each of the relays and one ground) which should be connected to the arduino board. When a relay pin is connected to ground, the relay on the receiver turns on. When the relay pin is open, the relay is off.&lt;br /&gt;
&lt;br /&gt;
The relay requires a 12V DC supply and the transmitter requires a 5V DC supply, which also I purchased. Make sure the power supply connectors have a positive potential in the center pin. The transmitter and receiver are supposed to work over a 50 m range when they are not in line of sight. That is more than my requirement.&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://3.bp.blogspot.com/-sLkHgBU6VPA/ToUZsu-24iI/AAAAAAAAEp8/FSxVjz0aYxE/s1600/IMG_3210.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="223" src="http://3.bp.blogspot.com/-sLkHgBU6VPA/ToUZsu-24iI/AAAAAAAAEp8/FSxVjz0aYxE/s400/IMG_3210.JPG" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
The purchase experience on probots.co.in is not bad, but it was not as easy as Simple Labs. After checking out my shopping cart, I had to do a fund transfer for the cost of components + shipping and then send the confirmation number, along with screenshot of my fund transfer transaction to probots email. I found this a bit cumbersome. The shipping was also not done the same day. Instead it took 4 business days for me to receive the package as opposed to 1 days for a purchase from Simple Labs. Overall I rate the purchase experience as average.&lt;/div&gt;
&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/32430925-399626540748080977?l=chandan-pitta.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/iG74ad5466p4-J-yxVAKd7ila10/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/iG74ad5466p4-J-yxVAKd7ila10/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/iG74ad5466p4-J-yxVAKd7ila10/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/iG74ad5466p4-J-yxVAKd7ila10/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/MyThoughtsInE-text/~4/Wcj8Hp1_dAo" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://chandan-pitta.blogspot.com/feeds/399626540748080977/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=32430925&amp;postID=399626540748080977" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/32430925/posts/default/399626540748080977?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/32430925/posts/default/399626540748080977?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/MyThoughtsInE-text/~3/Wcj8Hp1_dAo/purchase-experience-with-probot.html" title="Purchase experience with Probot" /><author><name>Chandan Pitta</name><uri>https://profiles.google.com/108073397456181759055</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh5.googleusercontent.com/-wYryPSd3yss/AAAAAAAAAAI/AAAAAAAAEgc/kTrWHJtpxUg/s512-c/photo.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://3.bp.blogspot.com/-sLkHgBU6VPA/ToUZsu-24iI/AAAAAAAAEp8/FSxVjz0aYxE/s72-c/IMG_3210.JPG" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://chandan-pitta.blogspot.com/2011/09/purchase-experience-with-probot.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CUQFQn8_cCp7ImA9WhdUEkw.&quot;"><id>tag:blogger.com,1999:blog-32430925.post-2960537261312668623</id><published>2011-09-28T00:23:00.000-07:00</published><updated>2011-09-28T05:35:13.148-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-09-28T05:35:13.148-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="electronics" /><category scheme="http://www.blogger.com/atom/ns#" term="arduino" /><category scheme="http://www.blogger.com/atom/ns#" term="home automation" /><category scheme="http://www.blogger.com/atom/ns#" term="lcd" /><title>InduinoX: Interfacing with LCD</title><content type="html">&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
After my quick &lt;a href="http://chandan-pitta.blogspot.com/2011/09/induinox-blinking-leds.html"&gt;&lt;i&gt;&lt;b&gt;Hello World&lt;/b&gt;&lt;/i&gt; app&lt;/a&gt;, I became a bit more&amp;nbsp;adventurous&amp;nbsp;and decided to interface with the LCD screen that was part of the basic kit from Simple Labs (see &lt;a href="http://chandan-pitta.blogspot.com/2011/09/purchase-experience-with-simple-labs.html"&gt;this post&lt;/a&gt; for more details). Fortunately, arduino has a library called LiquidCrystal to interface with LCD displays that are driven by Hitachi HD44780 compatible drivers. All you have to do is add a &lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;#include &amp;lt;LiquidCrystal.h&amp;gt;&lt;/span&gt; in your code to start using the library.&lt;br /&gt;
&lt;br /&gt;
But before going into the coding part, I had to first make the proper connections from the LCD display to the arduino board. I looked up the &lt;a href="http://www.dfrobot.com/image/data/FIT0127/datasheet.pdf"&gt;datasheet&lt;/a&gt; for my LCD display, but found a much simpler connection diagram over at&amp;nbsp;&lt;a href="http://www.arduino.cc/en/Tutorial/LiquidCrystal"&gt;http://www.arduino.cc/en/Tutorial/LiquidCrystal&lt;/a&gt;. I did not make the exact connections like in the diagram. This is what I did&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;b&gt;LCD &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Arduino&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;PIN 1 (GND) &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;GND&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;PIN 2 (Vcc) &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;+5V&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;PIN 3 (Contrast adjustment) &amp;nbsp; &amp;nbsp;Voltage divider (see below)&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;PIN 4 (Register select) &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Digital PIN 13&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;PIN 5 (R/W signal) &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; GND&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;PIN 6 (Enable signal) &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Digital PIN 12&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;PIN 7 (Data bus line)&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;PIN 8 (Data bus line)&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;PIN 9 (Data bus line)&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;PIN 10 (Data bus line)&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;PIN 11 (Data bus line) &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Digital PIN 11&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;PIN 12 (Data bus line) &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Digital PIN 10&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;PIN 13 (Data bus line) &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Digital PIN 9&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;PIN 14 (Data bus line) &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Digital PIN 8&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;PIN 15&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;PIN 16&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
Pins 7, 8, 9, 10, 15 and 16 are not connected to the arduino board. Pin 3 was supposed to be connected to a 10K pot, but since I did not have a pot, I had to do a voltage divider circuit. I tried out 1K, 10K divider circuit, with output of the 1K ohm resistor connected to pin 3. This gave me the correct contrast! Although the LCD display has 8 data lines it can be driven with only 4 lines with a lower refresh rate and the arduino library can communicate over the 4 lines. Now that the connections are done, back to programming. &amp;nbsp;Here is the code&lt;br /&gt;
&lt;span class="Apple-style-span" style="background-color: white; color: #222222; font-family: 'Courier New', Courier, monospace; font-size: 13px;"&gt;&lt;br /&gt;#include &amp;lt;LiquidCrystal.h&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="background-color: white; color: #222222; font-family: 'Courier New', Courier, monospace; font-size: 13px;"&gt;LiquidCrystal lcd(13, 12, 11, 10, 9, 8);&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="background-color: white; color: #222222; font-family: 'Courier New', Courier, monospace; font-size: 13px;"&gt;&lt;br /&gt;void setup() {&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="background-color: white; color: #222222; font-size: 13px;"&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; // Setup LCD's number of columns and rows&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; lcd.begin(16, 2);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; // Print a message to LCD&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; lcd.print("hello");&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;// a function which executes again and again&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;void loop() {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;div style="font-family: arial, sans-serif;"&gt;
&lt;br /&gt;&lt;/div&gt;
Very simple app that displays "hello" on the LCD screen.&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://2.bp.blogspot.com/-cNVvwn0l7tA/ToLK4TaldoI/AAAAAAAAEp4/Ufb2hnGj4Zc/s1600/IMG_3168.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="223" src="http://2.bp.blogspot.com/-cNVvwn0l7tA/ToLK4TaldoI/AAAAAAAAEp4/Ufb2hnGj4Zc/s400/IMG_3168.JPG" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
If you want the backlight of the LCD screen to turn on, connect pin 15 to +5V with a limiting resistor and pin 16 to ground.&lt;/div&gt;
&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/32430925-2960537261312668623?l=chandan-pitta.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/bMcLWC7UDLMBEGBDqG6KAo1S6tk/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/bMcLWC7UDLMBEGBDqG6KAo1S6tk/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/bMcLWC7UDLMBEGBDqG6KAo1S6tk/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/bMcLWC7UDLMBEGBDqG6KAo1S6tk/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/MyThoughtsInE-text/~4/cQGgbUFS-lE" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://chandan-pitta.blogspot.com/feeds/2960537261312668623/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=32430925&amp;postID=2960537261312668623" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/32430925/posts/default/2960537261312668623?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/32430925/posts/default/2960537261312668623?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/MyThoughtsInE-text/~3/cQGgbUFS-lE/induinox-interfacing-with-lcd.html" title="InduinoX: Interfacing with LCD" /><author><name>Chandan Pitta</name><uri>https://profiles.google.com/108073397456181759055</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh5.googleusercontent.com/-wYryPSd3yss/AAAAAAAAAAI/AAAAAAAAEgc/kTrWHJtpxUg/s512-c/photo.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://2.bp.blogspot.com/-cNVvwn0l7tA/ToLK4TaldoI/AAAAAAAAEp4/Ufb2hnGj4Zc/s72-c/IMG_3168.JPG" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://chandan-pitta.blogspot.com/2011/09/induinox-interfacing-with-lcd.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DU8GQ3Y5fSp7ImA9WhdUEEw.&quot;"><id>tag:blogger.com,1999:blog-32430925.post-5770803140724171273</id><published>2011-09-25T23:07:00.000-07:00</published><updated>2011-09-25T23:17:02.825-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-09-25T23:17:02.825-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="electronics" /><category scheme="http://www.blogger.com/atom/ns#" term="arduino" /><category scheme="http://www.blogger.com/atom/ns#" term="leds" /><title>InduinoX: Blinking LEDs</title><content type="html">&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
&lt;span style="font-family: inherit;"&gt;Having received my &lt;a href="http://chandan-pitta.blogspot.com/2011/09/purchase-experience-with-simple-labs.html"&gt;arduino and basic components kit earlier last week&lt;/a&gt;, I sat out to write my first arduino program. A &lt;i&gt;&lt;b&gt;hello world&lt;/b&gt;&lt;/i&gt; of sorts. I started out by installing the &lt;b&gt;arduino&lt;/b&gt; package in Kubuntu. What you get from the package is a simple IDE which can compile and upload the code to the arduino board. For installing the IDE on other flavors of linux, head on over to the &lt;a href="http://www.arduino.cc/playground/Learning/Linux"&gt;arduino site&lt;/a&gt;.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
I connected the InduinoX board to my laptop using a USB cable. Selected the correct board type i&lt;span style="font-family: inherit;"&gt;n the IDE using&lt;span style="background-color: white; line-height: 19px; text-align: justify;"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="background-color: white; line-height: 19px; text-align: justify;"&gt;&lt;i&gt;&lt;b&gt;Tools --&amp;gt; Board --&amp;gt; Arduino Deceimila, Duemilanove, or Nano W/ ATmega 168&lt;/b&gt;&lt;/i&gt;&lt;/span&gt;. Next select the correct USB to use fr&lt;span style="font-family: inherit;"&gt;om&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span style="background-color: white; line-height: 19px; text-align: justify;"&gt;&lt;span style="font-family: inherit;"&gt;&lt;b&gt;&lt;i&gt;Tools --&amp;gt; Serial Port&lt;/i&gt;&lt;/b&gt;. A&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: inherit;"&gt;nd finally wrote these first lines &lt;/span&gt;of arduino code :)&lt;br /&gt;
&lt;br /&gt;
&lt;span style="background-color: white; color: #222222; font-family: 'Courier New', Courier, monospace; font-size: 13px; text-align: -webkit-auto;"&gt;void setup() {&lt;/span&gt;&lt;br /&gt;
&lt;div style="background-color: white; color: #222222; font-size: 13px; text-align: -webkit-auto;"&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; pinMode(11, OUTPUT); &amp;nbsp;// Prepare red LED for output&lt;/span&gt;&lt;/div&gt;
&lt;div style="background-color: white; color: #222222; font-size: 13px; text-align: -webkit-auto;"&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; pinMode(12, OUTPUT); &amp;nbsp;&lt;/span&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;// Prepare blue LED for output&lt;/span&gt;&lt;/div&gt;
&lt;div style="background-color: white; color: #222222; font-size: 13px; text-align: -webkit-auto;"&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; pinMode(13, OUTPUT); &amp;nbsp;&lt;/span&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;// Prepare white LED for output&lt;/span&gt;&lt;/div&gt;
&lt;div style="background-color: white; color: #222222; font-size: 13px; text-align: -webkit-auto;"&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;div style="background-color: white; color: #222222; font-size: 13px; text-align: -webkit-auto;"&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style="background-color: white; color: #222222; font-size: 13px; text-align: -webkit-auto;"&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;// a function which executes again and again&lt;/span&gt;&lt;/div&gt;
&lt;div style="background-color: white; color: #222222; font-size: 13px; text-align: -webkit-auto;"&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;void loop() {&lt;/span&gt;&lt;/div&gt;
&lt;div style="background-color: white; color: #222222; font-size: 13px; text-align: -webkit-auto;"&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; redLight(HIGH); &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;// Turn on red LED&lt;/span&gt;&lt;/div&gt;
&lt;div style="background-color: white; color: #222222; font-size: 13px; text-align: -webkit-auto;"&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; delay(100); &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;// Wait a few moments&lt;/span&gt;&lt;/div&gt;
&lt;div style="background-color: white; color: #222222; font-size: 13px; text-align: -webkit-auto;"&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style="background-color: white; color: #222222; font-size: 13px; text-align: -webkit-auto;"&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; redLight(LOW); &amp;nbsp; &amp;nbsp; // Turn off red LED&lt;/span&gt;&lt;/div&gt;
&lt;div style="background-color: white; color: #222222; font-size: 13px; text-align: -webkit-auto;"&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; blueLight(HIGH); &amp;nbsp; // Turn on blue LED&lt;/span&gt;&lt;/div&gt;
&lt;div style="background-color: white; color: #222222; font-size: 13px; text-align: -webkit-auto;"&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; delay(100); &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;// Wait a few moments&lt;/span&gt;&lt;/div&gt;
&lt;div style="background-color: white; color: #222222; font-size: 13px; text-align: -webkit-auto;"&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div style="background-color: white; color: #222222; font-size: 13px; text-align: -webkit-auto;"&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; blueLight(LOW); &amp;nbsp; &amp;nbsp;// Turn off blue LED&lt;/span&gt;&lt;/div&gt;
&lt;div style="background-color: white; color: #222222; font-size: 13px; text-align: -webkit-auto;"&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; whiteLight(HIGH); &amp;nbsp;// Turn on white LED&lt;/span&gt;&lt;/div&gt;
&lt;div style="background-color: white; color: #222222; font-size: 13px; text-align: -webkit-auto;"&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; delay(100); &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;// Wait a few moments&lt;/span&gt;&lt;/div&gt;
&lt;div style="background-color: white; color: #222222; font-size: 13px; text-align: -webkit-auto;"&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div style="background-color: white; color: #222222; font-size: 13px; text-align: -webkit-auto;"&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; whiteLight(LOW); &amp;nbsp; // Turn off white LED&lt;/span&gt;&lt;/div&gt;
&lt;div style="background-color: white; color: #222222; font-size: 13px; text-align: -webkit-auto;"&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;div style="background-color: white; color: #222222; font-size: 13px; text-align: -webkit-auto;"&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style="background-color: white; color: #222222; font-size: 13px; text-align: -webkit-auto;"&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;void redLight(int status) {&lt;/span&gt;&lt;/div&gt;
&lt;div style="background-color: white; color: #222222; font-size: 13px; text-align: -webkit-auto;"&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; digitalWrite(11, status);&lt;/span&gt;&lt;/div&gt;
&lt;div style="background-color: white; color: #222222; font-size: 13px; text-align: -webkit-auto;"&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;div style="background-color: white; color: #222222; font-size: 13px; text-align: -webkit-auto;"&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style="background-color: white; color: #222222; font-size: 13px; text-align: -webkit-auto;"&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;void blueLight(int status) {&lt;/span&gt;&lt;/div&gt;
&lt;div style="background-color: white; color: #222222; font-size: 13px; text-align: -webkit-auto;"&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; digitalWrite(12, status);&lt;/span&gt;&lt;/div&gt;
&lt;div style="background-color: white; color: #222222; font-size: 13px; text-align: -webkit-auto;"&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;div style="background-color: white; color: #222222; font-size: 13px; text-align: -webkit-auto;"&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style="background-color: white; color: #222222; font-size: 13px; text-align: -webkit-auto;"&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;void whiteLight(int status) {&lt;/span&gt;&lt;/div&gt;
&lt;div style="background-color: white; color: #222222; font-size: 13px; text-align: -webkit-auto;"&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; digitalWrite(13, status);&lt;/span&gt;&lt;/div&gt;
&lt;div style="background-color: white; color: #222222; font-size: 13px; text-align: -webkit-auto;"&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;div style="background-color: white; color: #222222; font-family: arial, sans-serif; font-size: 13px; text-align: -webkit-auto;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="background-color: white; color: #222222; text-align: -webkit-auto;"&gt;
&lt;span style="font-family: inherit;"&gt;A successful compile and upload later, the LEDs on the InduinoX board started blinking. Yay!!! To know which LED is connected to which pin, take a look at &lt;a href="http://www.induino.com/wiki/index.php?title=Induino#LEDs"&gt;this page&lt;/a&gt;. Make sure the jumpers above the LEDs are in the right position.&lt;/span&gt;&lt;/div&gt;
&lt;div style="background-color: white; color: #222222; text-align: -webkit-auto;"&gt;
&lt;span style="font-family: inherit;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://1.bp.blogspot.com/-A3XrYur9gLE/ToAV1pBCniI/AAAAAAAAEpw/TpdIHPAUImc/s1600/IMG_3169.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;span style="font-family: inherit;"&gt;&lt;img border="0" height="223" src="http://1.bp.blogspot.com/-A3XrYur9gLE/ToAV1pBCniI/AAAAAAAAEpw/TpdIHPAUImc/s400/IMG_3169.JPG" width="400" /&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style="background-color: white; color: #222222; text-align: -webkit-auto;"&gt;
&lt;span style="font-family: inherit;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://4.bp.blogspot.com/-eQwBEM-VqwI/ToAV79feqQI/AAAAAAAAEp0/yDWbJEghqOQ/s1600/IMG_3170.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;span style="font-family: inherit;"&gt;&lt;img border="0" height="223" src="http://4.bp.blogspot.com/-eQwBEM-VqwI/ToAV79feqQI/AAAAAAAAEp0/yDWbJEghqOQ/s400/IMG_3170.JPG" width="400" /&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style="background-color: white; color: #222222; text-align: -webkit-auto;"&gt;
&lt;span style="font-family: inherit;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style="background-color: white; color: #222222; text-align: -webkit-auto;"&gt;
&lt;span style="font-family: inherit;"&gt;More updates in my next post.&lt;/span&gt;&lt;/div&gt;
&lt;div style="background-color: white; color: #222222; font-family: arial, sans-serif; font-size: 13px; text-align: -webkit-auto;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/32430925-5770803140724171273?l=chandan-pitta.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/c00U4hSHGlwvdLUgZOl4nfnVv-4/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/c00U4hSHGlwvdLUgZOl4nfnVv-4/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/c00U4hSHGlwvdLUgZOl4nfnVv-4/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/c00U4hSHGlwvdLUgZOl4nfnVv-4/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/MyThoughtsInE-text/~4/6bPKgADsL_M" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://chandan-pitta.blogspot.com/feeds/5770803140724171273/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=32430925&amp;postID=5770803140724171273" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/32430925/posts/default/5770803140724171273?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/32430925/posts/default/5770803140724171273?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/MyThoughtsInE-text/~3/6bPKgADsL_M/induinox-blinking-leds.html" title="InduinoX: Blinking LEDs" /><author><name>Chandan Pitta</name><uri>https://profiles.google.com/108073397456181759055</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh5.googleusercontent.com/-wYryPSd3yss/AAAAAAAAAAI/AAAAAAAAEgc/kTrWHJtpxUg/s512-c/photo.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://1.bp.blogspot.com/-A3XrYur9gLE/ToAV1pBCniI/AAAAAAAAEpw/TpdIHPAUImc/s72-c/IMG_3169.JPG" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://chandan-pitta.blogspot.com/2011/09/induinox-blinking-leds.html</feedburner:origLink></entry><entry gd:etag="W/&quot;C08NQXg7fip7ImA9WhdUE0w.&quot;"><id>tag:blogger.com,1999:blog-32430925.post-5644391990147355669</id><published>2011-09-23T00:07:00.000-07:00</published><updated>2011-09-29T08:58:10.606-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-09-29T08:58:10.606-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="electronics" /><category scheme="http://www.blogger.com/atom/ns#" term="arduino" /><category scheme="http://www.blogger.com/atom/ns#" term="home automation" /><category scheme="http://www.blogger.com/atom/ns#" term="simple labs" /><category scheme="http://www.blogger.com/atom/ns#" term="sensors" /><title>Purchase experience with Simple Labs</title><content type="html">&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
I have been having this itch to work on a home automation project for a long time. And finally the day has come to&amp;nbsp;scratch&amp;nbsp;the itch. I have been putting off this idea for a while and it is high time I did something about it. So as a first step I at least wanted to get the basic electronic components. Perhaps staring them long enough would finally motivate me to do the project. I wanted to start off on a very simple setup.&lt;br /&gt;
&lt;br /&gt;
Basically, get a proximity sensor to detect if there are people in the room, talk to a light sensor and see if we need to turn on the lights, talk to a temperature sensor to see if we need to turn on the fan and do the necessary based on the sensors' response. To interface with these sensors I wanted to use an arduino board, which I have been wanting for a while now. The list comes down to&lt;br /&gt;
&lt;ol&gt;
&lt;li&gt;Arduino board&lt;/li&gt;
&lt;li&gt;Proximity, light and temperature sensors&lt;/li&gt;
&lt;li&gt;Relays to turn on/off lights and fans&lt;/li&gt;
&lt;/ol&gt;
I searched for the stuff online and found these 2 online stores (in India) that met my&amp;nbsp;requirements.&lt;br /&gt;
&lt;ul style="text-align: left;"&gt;
&lt;li&gt;&lt;a href="http://www.simplelabs.co.in/"&gt;Simple Labs&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://probots.co.in/"&gt;Probots&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;div&gt;
I would have preferred to use Simple Labs for all my components because of the simpler purchase flow, but&amp;nbsp;unfortunately&amp;nbsp;I could not find any relays on Simple Labs. Anyway long story short, I ordered an Indian version of the arduino board called &lt;a href="http://www.simplelabs.co.in/content/induinox-low-cost-arduino-usb-clone-board"&gt;InduinoX&lt;/a&gt;&amp;nbsp;and a &lt;a href="http://www.simplelabs.co.in/content/quick-start-kit-arduino"&gt;quick start kit&lt;/a&gt;. I ordered it on Wednesday afternoon, the whole process was simple. I got an email in a couple hours that the package was dispatched through courier. I got the package the very next day! I really loved my shopping experience on Simple Labs. Recommend it strongly. Here are the contents of the package for reference.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://4.bp.blogspot.com/-g7QeS8xYuNA/Tnwu4beL22I/AAAAAAAAElQ/4hrw6BN1WOU/s1600/simplelabs.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="300" src="http://4.bp.blogspot.com/-g7QeS8xYuNA/Tnwu4beL22I/AAAAAAAAElQ/4hrw6BN1WOU/s400/simplelabs.jpg" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
I also ordered the relays from Probots the same day, but did not receive the package yet. So more about that purchase experience in my next blog.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/32430925-5644391990147355669?l=chandan-pitta.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/EVclOc3qLX41i2cMr5blFryjY1Y/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/EVclOc3qLX41i2cMr5blFryjY1Y/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/EVclOc3qLX41i2cMr5blFryjY1Y/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/EVclOc3qLX41i2cMr5blFryjY1Y/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/MyThoughtsInE-text/~4/Vw-6K8ttoqs" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://chandan-pitta.blogspot.com/feeds/5644391990147355669/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=32430925&amp;postID=5644391990147355669" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/32430925/posts/default/5644391990147355669?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/32430925/posts/default/5644391990147355669?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/MyThoughtsInE-text/~3/Vw-6K8ttoqs/purchase-experience-with-simple-labs.html" title="Purchase experience with Simple Labs" /><author><name>Chandan Pitta</name><uri>https://profiles.google.com/108073397456181759055</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh5.googleusercontent.com/-wYryPSd3yss/AAAAAAAAAAI/AAAAAAAAEgc/kTrWHJtpxUg/s512-c/photo.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://4.bp.blogspot.com/-g7QeS8xYuNA/Tnwu4beL22I/AAAAAAAAElQ/4hrw6BN1WOU/s72-c/simplelabs.jpg" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://chandan-pitta.blogspot.com/2011/09/purchase-experience-with-simple-labs.html</feedburner:origLink></entry><entry gd:etag="W/&quot;D04AQ3g9fyp7ImA9WxFQEE8.&quot;"><id>tag:blogger.com,1999:blog-32430925.post-3236250719896556380</id><published>2010-05-04T19:19:00.000-07:00</published><updated>2010-05-04T19:19:02.667-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-05-04T19:19:02.667-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="gentoo" /><category scheme="http://www.blogger.com/atom/ns#" term="lucid lynx" /><category scheme="http://www.blogger.com/atom/ns#" term="kubuntu" /><title>Gentoo -&gt; Kubuntu</title><content type="html">For many years Gentoo has been my favorite Linux distro and it still is. I used Redhat, Slackware and Fedora for a few years before that. Just installing Gentoo is such a learning experience. Although installing a software is as simple as doing "emerge X", configuring it is a bit more involved and requires you to dig up config files and editing them. No fancy GUI to help you. Which is the best part about it. I can learn how things work in Linux. Another reason I preferred having Gentoo over other distros is because all the packages are compiled for my machine. Which means all the executables make the best use of all the instructions and features of my processor and what not. But the main reason I use Gentoo is because I can compile the Linux kernel to my taste. Tweaking every bit and compiling only the drivers that I need. I almost never compile anything as a module. Everything is in the bzImage. All these tweaking always made my computer run super fast.&lt;br /&gt;
&lt;br /&gt;
While all this is good and well, I always felt a lack of proper integration of various pieces in Gentoo. To get any kind of eye candy (pre KDE 4.3 days), I had to install a compositing window manager (also known by various other names such as beryl, compiz and compiz-fusions which were forks of one another and such), and a window decorator such as emerald. Then had to configure various animations in compiz and install proper themes for emerald. At the end replace KWin with compiz. All this was tricky and time consuming. I love learning how things work internally but this is getting to be a bit too much. Why do I have to invest so much time to just get the fancy animations and eye candy? I was also noticing something else. The computers are becoming faster and faster and the difference of performance between Gentoo and other distros is becoming smaller and smaller, to the point that all the tweaking is not giving me any advantage.&lt;br /&gt;
&lt;br /&gt;
Moreover I now own a core i7 laptop. It is so extremely fast that nothing really matters anymore. I have been watching Ubuntu for a while and looking forward to their new release -- Lucid Lynx. They are claiming fast boot times and the UI looks really nice too. I decided to give it a try. Since I am a KDE guy and never really liked Gnome, I went with Kubuntu. I have to say it is really good! The installation process, installing packages etc was a breeze. And even better was that the defaults that these packages come with is very good. For example in Gentoo I would have to configure the global USE flag and package level USE flags to get the right stuff (like encoders/decoder for mplayer etc).&lt;br /&gt;
&lt;br /&gt;
It is not to say that the process was not without hiccups. I initially used i386 iso and I started seeing oom-killer kill ureadahead (which makes booting so fast in kubuntu) and plymouth (the boot splash). That was not nice. I Googled about this issue and found nothing. I had a hunch that it could be because of 32-bit kernels having trouble addressing memory beyond 1GB (the low and high mem issue). So I decided to go with 64-bit iso and the problem went away :). Now I have a few more issues to resolve before I am completely happy. For example installing proprietary nvidia drivers made me lose the splash screen which I loved. The integrated mic is not working for some reason. Could it be pulse issue? I have to fix all these minor things, but for now I am a happy camper :).&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/32430925-3236250719896556380?l=chandan-pitta.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/w6Zzn5SOkKXU3pGg2or2dSI5uxk/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/w6Zzn5SOkKXU3pGg2or2dSI5uxk/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/w6Zzn5SOkKXU3pGg2or2dSI5uxk/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/w6Zzn5SOkKXU3pGg2or2dSI5uxk/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/MyThoughtsInE-text/~4/a0Tiy5ZzQU8" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://chandan-pitta.blogspot.com/feeds/3236250719896556380/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=32430925&amp;postID=3236250719896556380" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/32430925/posts/default/3236250719896556380?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/32430925/posts/default/3236250719896556380?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/MyThoughtsInE-text/~3/a0Tiy5ZzQU8/gentoo-kubuntu.html" title="Gentoo -&gt; Kubuntu" /><author><name>Chandan Pitta</name><uri>https://profiles.google.com/108073397456181759055</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh5.googleusercontent.com/-wYryPSd3yss/AAAAAAAAAAI/AAAAAAAAEgc/kTrWHJtpxUg/s512-c/photo.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://chandan-pitta.blogspot.com/2010/05/gentoo-kubuntu.html</feedburner:origLink></entry><entry gd:etag="W/&quot;Ck4ER3w9fip7ImA9WxFWFko.&quot;"><id>tag:blogger.com,1999:blog-32430925.post-6949498232603790009</id><published>2010-03-18T21:50:00.000-07:00</published><updated>2010-06-04T10:01:46.266-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-06-04T10:01:46.266-07:00</app:edited><title>XBMC / Boxee remote control android app</title><content type="html">I have been writing a few android apps over weekends at home and during 20% time at Google. However I never actually released any of them in the android market mainly because they were quick and dirty apps that fit my needs but perhaps would not be appealing to the general public. One such app that I quickly wrote over a couple of weekends is a XBMC remote. &lt;br /&gt;
&lt;br /&gt;
The media center that I use at home is XBMC and I have always wanted to have more control and faster access to my media. Using my remote to navigate through the menus is not as fast. Especially when I wanted to queue a lot of music it is very slow. So I wrote this nice little app called "XBMC remote" for my android phone to control XBMC from anywhere :).&lt;br /&gt;
&lt;br /&gt;
Give it a try. Search for "xbmc" in android market and install it if you use XBMC as your media center.&lt;br /&gt;
&lt;br /&gt;
When you first launch the app you will start with this screen.&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_JnVl6JF1MWk/S6L_SOqeNLI/AAAAAAAAD_c/EvTOn1rbUww/s1600-h/device5.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://3.bp.blogspot.com/_JnVl6JF1MWk/S6L_SOqeNLI/AAAAAAAAD_c/EvTOn1rbUww/s320/device5.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
You will have to setup your web server address, username and password (if required) by clicking on Menu and then Preference.&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_JnVl6JF1MWk/S6L_WZYiXvI/AAAAAAAAD_k/jxeWZ1-C-U8/s1600-h/device6.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://4.bp.blogspot.com/_JnVl6JF1MWk/S6L_WZYiXvI/AAAAAAAAD_k/jxeWZ1-C-U8/s320/device6.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
Once you entered all the information, you can click on any of the icons on the top or bottom. The image below explains what happens when you click on the various icons.&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/_JnVl6JF1MWk/S6L_a30pasI/AAAAAAAAD_s/XI2ei4pgS1Q/s1600-h/device2_bubble.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="336" src="http://1.bp.blogspot.com/_JnVl6JF1MWk/S6L_a30pasI/AAAAAAAAD_s/XI2ei4pgS1Q/s400/device2_bubble.jpg" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
If you click on the top right icon, you will be able to control XBMC screen directly. Here is the screenshot.&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_JnVl6JF1MWk/TAkkUc2PLeI/AAAAAAAAECE/u4x1bQFbGtE/s1600/device.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://4.bp.blogspot.com/_JnVl6JF1MWk/TAkkUc2PLeI/AAAAAAAAECE/u4x1bQFbGtE/s320/device.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;br /&gt;
There you can control playback and basic navigation. Clicking on the bottom right icon will show you what is playing on your XBMC. One more screenshot&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/_JnVl6JF1MWk/TAkxYPLJl_I/AAAAAAAAECM/238VRhkfc78/s1600/device1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://1.bp.blogspot.com/_JnVl6JF1MWk/TAkxYPLJl_I/AAAAAAAAECM/238VRhkfc78/s320/device1.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;br /&gt;
The bottom three icons will take you to video, music and photo playlists. The screenshot below shows a music playlist.&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_JnVl6JF1MWk/S6MBN51_b0I/AAAAAAAAEAE/uF8cO_A-rV0/s1600-h/device4.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://4.bp.blogspot.com/_JnVl6JF1MWk/S6MBN51_b0I/AAAAAAAAEAE/uF8cO_A-rV0/s320/device4.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
You can delete some items from the list by clicking on the delete icon on the left of each icon. Hope you will try it out. Let me know about any bugs or feature requests.&lt;br /&gt;
&lt;br /&gt;
I found out (after a comment from one of my friends) that it also works with Boxee (which is a fork of XBMC)! There are some problems with Boxee, but at least there is some basic functionality.&lt;br /&gt;
&lt;br /&gt;
Some references:&lt;br /&gt;
&lt;a href="http://www.androidzoom.com/android_applications/tools/xbmc-remote_fpkj.html"&gt;http://www.androidzoom.com/android_applications/tools/xbmc-remote_fpkj.html&lt;/a&gt;&lt;br /&gt;
&lt;a href="http://www.androidpit.com/en/android/market/apps/app/com.pitta.chandan.xbmcremote/XBMC-remote"&gt;http://www.androidpit.com/en/android/market/apps/app/com.pitta.chandan.xbmcremote/XBMC-remote&lt;/a&gt;&lt;br /&gt;
&lt;a href="http://www.androlib.com/android.application.com-pitta-chandan-xbmcremote-tjDC.aspx"&gt;http://www.androlib.com/android.application.com-pitta-chandan-xbmcremote-tjDC.aspx&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/32430925-6949498232603790009?l=chandan-pitta.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/lLfsvv2ylvaeM-X3S-CYbuKEOQE/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/lLfsvv2ylvaeM-X3S-CYbuKEOQE/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/lLfsvv2ylvaeM-X3S-CYbuKEOQE/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/lLfsvv2ylvaeM-X3S-CYbuKEOQE/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/MyThoughtsInE-text/~4/0Z-UXCvho14" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://chandan-pitta.blogspot.com/feeds/6949498232603790009/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=32430925&amp;postID=6949498232603790009" title="14 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/32430925/posts/default/6949498232603790009?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/32430925/posts/default/6949498232603790009?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/MyThoughtsInE-text/~3/0Z-UXCvho14/xbmc-remote-android-app.html" title="XBMC / Boxee remote control android app" /><author><name>Chandan Pitta</name><uri>https://profiles.google.com/108073397456181759055</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh5.googleusercontent.com/-wYryPSd3yss/AAAAAAAAAAI/AAAAAAAAEgc/kTrWHJtpxUg/s512-c/photo.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://3.bp.blogspot.com/_JnVl6JF1MWk/S6L_SOqeNLI/AAAAAAAAD_c/EvTOn1rbUww/s72-c/device5.png" height="72" width="72" /><thr:total>14</thr:total><feedburner:origLink>http://chandan-pitta.blogspot.com/2010/03/xbmc-remote-android-app.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CkAHQ3c9cSp7ImA9WxBQF00.&quot;"><id>tag:blogger.com,1999:blog-32430925.post-5409173939068198907</id><published>2010-01-16T19:58:00.000-08:00</published><updated>2010-01-16T19:58:52.969-08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-01-16T19:58:52.969-08:00</app:edited><title>What Darwin Never Knew: DNA</title><content type="html">I just finished watching one of the best PBS NOVA episodes - "What Darwin Never Knew". It is exceptionally good. I was finally able to understand a little about DNA - the building blocks of all living creatures. In this episode they explain how evolution is happening and why there are so many species and why even animals from the same species look so different. How complex DNA is and what a gene is. It still did not answer all my questions but got pretty close. Here is one part I found on youtube, but please watch all parts. It is very good.&lt;br /&gt;
&lt;br /&gt;
&lt;object height="340" width="560"&gt;&lt;param name="movie" value="http://www.youtube.com/v/pbyp17FT0SA&amp;hl=en_US&amp;fs=1&amp;"&gt;&lt;/param&gt;&lt;param name="allowFullScreen" value="true"&gt;&lt;/param&gt;&lt;param name="allowscriptaccess" value="always"&gt;&lt;/param&gt;&lt;embed src="http://www.youtube.com/v/pbyp17FT0SA&amp;hl=en_US&amp;fs=1&amp;" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="560" height="340"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;br /&gt;
&lt;br /&gt;
So now I know that DNA is a very large sequence and it contains genetic instructions to synthesize various parts of a living creature. In simple layman terms there are three kinds of genes identified so far&lt;br /&gt;
&lt;ol&gt;&lt;li&gt;Genes that actually are used to create stuff. These are the sequences used to synthesize proteins and other things - the building blocks&lt;/li&gt;
&lt;li&gt;Genes that simply act as switches which can be on or off. When on the "stuff" creating genes are used to create the stuff, when the switches are off the "stuff" is not created. The show provides an example of fruit flies. Why some of them have black spots on the wings while others don't. But have the same genes that makes the spots, but in some the switch is turned off&lt;/li&gt;
&lt;li&gt;Genes that boss the switch genes. These are the ones that turn the switch genes on and off at various times. An example of this is the same bird species with same genes that creates the beak with the same switch genes, except the boss genes are different. So the switch genes are turned on at different times and the beaks of the birds are different (short and thick beak vs long and thin).&lt;/li&gt;
&lt;/ol&gt;&lt;div&gt;There is much more interesting stuff in there. However after seeing the show I still have a few questions. So the messenger RNA are created based on whether the switch is on or off. But how does that happen? Will the enzyme responsible for creating mRNA look at the switch? How does it "look"? Do the enzymes have sites that only lock on to the switch genes that are on? And then something happens from there on to make the enzyme use the genes to synthesize the mRNA or whatever? This means that the location of the switch genes should be close to the stuff making genes that they are controlling right?&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;Another question is how do the boss genes turn on and off the switches? What is the difference between an "on" gene and "off" gene? Probably the sequence. Then does it mean that the boss genes some how change the switch genes? I though a gene is an immutable entity. How can it change? Also how does the boss genes instruct the switch genes to change? Does it attract an enzyme of something to change the switch genes?&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;All these questions make me think I should probably study genetics or bio-engineering or something.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/32430925-5409173939068198907?l=chandan-pitta.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/HCFJ9Vi7VVol_Mtvvsk45cBsM1M/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/HCFJ9Vi7VVol_Mtvvsk45cBsM1M/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/HCFJ9Vi7VVol_Mtvvsk45cBsM1M/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/HCFJ9Vi7VVol_Mtvvsk45cBsM1M/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/MyThoughtsInE-text/~4/sZeXyJPJlZk" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://chandan-pitta.blogspot.com/feeds/5409173939068198907/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=32430925&amp;postID=5409173939068198907" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/32430925/posts/default/5409173939068198907?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/32430925/posts/default/5409173939068198907?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/MyThoughtsInE-text/~3/sZeXyJPJlZk/what-darwin-never-knew-dna.html" title="What Darwin Never Knew: DNA" /><author><name>Chandan Pitta</name><uri>https://profiles.google.com/108073397456181759055</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh5.googleusercontent.com/-wYryPSd3yss/AAAAAAAAAAI/AAAAAAAAEgc/kTrWHJtpxUg/s512-c/photo.jpg" /></author><thr:total>1</thr:total><feedburner:origLink>http://chandan-pitta.blogspot.com/2010/01/what-darwin-never-knew-dna.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DE4HQXoyeCp7ImA9WxBQFUU.&quot;"><id>tag:blogger.com,1999:blog-32430925.post-6261486839961485812</id><published>2010-01-15T12:19:00.000-08:00</published><updated>2010-01-15T12:22:10.490-08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-01-15T12:22:10.490-08:00</app:edited><title>Fun with grep and sed</title><content type="html">At work we have several java files that have javadocs with links that are not hyperlinked with &lt;a href="http://www.blogger.com/post-create.g?blogID=32430925"&gt;&lt;/a&gt;. So I wanted to covert the links to hyperlinks. We wanted to convert only links that start with "Automates ", followed by one or more links that ends with a number. Example "Automates http://something/12345 and http://something/67890 but not http://something/54321". I wanted to do the conversion with one line of a bash command (trying to avoid writing the bash script). While tackling the problem I learnt a few things that I want to share and record here for myself to look back again in future when I forget.&lt;br /&gt;
&lt;br /&gt;
To start with I needed to find all the files containing "Automates http://". I just wanted the filenames containing that string. And so comes &lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;b&gt;grep&lt;/b&gt;&lt;/span&gt;&lt;b&gt; &lt;/b&gt;to the rescue. With &lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;b&gt;-l&lt;/b&gt;&lt;/span&gt; switch to list just the filenames instead of all the lines that match.&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;b&gt;grep -R -l "Automates http://" *&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Then it is time to replace the links with &amp;lt;a href=link&amp;gt;link&amp;lt;/a&amp;gt;&amp;nbsp;only for those lines containing "Automated http://". For this I want the line number of every line of every file that contained it. Getting the file number and line number is easy with &lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;b&gt;grep&lt;/b&gt;&lt;/span&gt;. To get the filename use &lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;b&gt;-H&lt;/b&gt;&lt;/span&gt; switch and to get the line number use &lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;b&gt;-n&lt;/b&gt;&lt;/span&gt; switch. Here is an example&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;b&gt;grep -R -H -n "Automates http://" *&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
The output of the above command looks something like this&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;b&gt;/home/chandanp/temp/temp.java:73: &amp;nbsp;/** Automates http://something/353571 */&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
To replace the link with hyperlink we can used &lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;b&gt;sed&lt;/b&gt;&lt;/span&gt;. All we need is the filename, the line number and the string to replace. And use &lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;b&gt;sed&lt;/b&gt;&lt;/span&gt;&lt;b&gt; &lt;/b&gt;like so&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;b&gt;sed -i '936s|\(http.*[0-9]\)|&amp;lt;a href="\1"&amp;gt;\1&amp;lt;/a&amp;gt;|g' Filename.java&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Where &lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;b&gt;936 &lt;/b&gt;&lt;/span&gt;is the line number I want to change and &lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;b&gt;Filename.java&lt;/b&gt;&lt;/span&gt; is the filename I want to edit. The &lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;b&gt;-i&lt;/b&gt;&lt;/span&gt; option edits the file in place. The more complicated part is the regex matching. Basically anything that matches the regex inside a &lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;b&gt;\(&lt;/b&gt;&lt;/span&gt; and &lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;b&gt;\)&lt;/b&gt;&lt;/span&gt; will be stored in a buffer. The buffer number is the number of the matching &lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;b&gt;\(\)&lt;/b&gt;&lt;/span&gt;. So in the example above, the first buffer is the string that matches&amp;nbsp;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;b&gt;\(http.*[0-9]\)&lt;span style="font-family: 'Times New Roman'; font-weight: normal;"&gt;. Which is basically any link that ends with a number. To recall the buffer we use &lt;/span&gt;\1&lt;span style="font-family: 'Times New Roman'; font-weight: normal;"&gt;. Which means: use the value that matches the first parenthesis pair. So in the &lt;/span&gt;sed &lt;span style="font-family: 'Times New Roman'; font-weight: normal;"&gt;the replaced string will be &lt;/span&gt;&amp;lt;a href="link"&amp;gt;link&amp;lt;/a&amp;gt;&lt;/b&gt;&lt;span style="font-family: 'Times New Roman';"&gt;, where link is the string that matches&amp;nbsp;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;b&gt;\(http.*[0-9]\)&lt;span style="font-family: 'Times New Roman'; font-weight: normal;"&gt;. Here is an example of the change&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span style="font-family: 'Times New Roman';"&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;b&gt;&lt;span style="font-family: 'Times New Roman'; font-weight: normal;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;b&gt;/** Automates &amp;lt;a href="&lt;span style="font-weight: normal;"&gt;&lt;b&gt;http://something/353571&lt;/b&gt;&lt;/span&gt;"&amp;gt;&lt;span style="font-weight: normal;"&gt;&lt;b&gt;http://something/353571&lt;/b&gt;&lt;/span&gt;&amp;lt;/a&amp;gt; */&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Notice another thing with the way I used &lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;b&gt;sed&lt;/b&gt;&lt;/span&gt;'s replace command above. I used &lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;b&gt;s|match|replace&lt;/b&gt;&lt;/span&gt; instead of the usual &lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;b&gt;s/match/replace&lt;/b&gt;&lt;/span&gt;. What many people don't know is that once can use any character after s instead of the usual &lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;b&gt;/&lt;/b&gt;&lt;/span&gt;. So you could even do &lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;b&gt;s#match#replace&lt;/b&gt;&lt;/span&gt; too if you want. I used the pipe symbol.&lt;br /&gt;
&lt;br /&gt;
Now that we can replace each individual line of each file we somehow have combine the previous &lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;b&gt;grep&lt;/b&gt;&lt;/span&gt; output with this &lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;b&gt;sed&lt;/b&gt;&lt;/span&gt; command. That was tricky. First we need to break up the output of the &lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;b&gt;grep&lt;/b&gt;&lt;/span&gt;&lt;b&gt; &lt;/b&gt;command to individual filename and line numbers and then give that to &lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;b&gt;sed&lt;/b&gt;&lt;/span&gt;. Well &lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;b&gt;xargs, cut&lt;/b&gt;&lt;/span&gt;&amp;nbsp;and &lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;b&gt;sed&lt;/b&gt;&lt;/span&gt; to the rescue. We use the fact that the filename and line number are delimited by &lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;b&gt;:&lt;/b&gt;&lt;/span&gt; and play some tricks&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;b&gt;grep -R -l "Automates http://" * | xargs -I{} grep -H -n "Automates http://" {} | cut -f-2 -d: | sed "s/\(.*\):\(.*\)/filename is \1 and line number is \2/"&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Basically all it says is that take the output from the first &lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;b&gt;grep&lt;/b&gt;&lt;/span&gt; which prints out the filename containing "Automates http://" and pipe it to &lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;b&gt;xargs &lt;/b&gt;&lt;/span&gt;which takes the filename and gives it to another grep that prints &lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;b&gt;filename:line_number:matched_sting&lt;/b&gt;&lt;/span&gt; and pipe that information to &lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;b&gt;cut &lt;/b&gt;&lt;/span&gt;which prints the first 2 tokens that are delimited by &lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;:&lt;/span&gt;. We need to do the cut because the matched string also has &lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;b&gt;:&lt;/b&gt;&lt;/span&gt; which means we don't want &lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;b&gt;sed&lt;/b&gt;&lt;/span&gt; to use that part of information in the matching. Then we pipe the information from the cut to another sed to print the filename and line number. Here is the output after various pipes&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;b&gt;$ grep -R -l "Automates http://" *&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;temp.java&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;b&gt;$ grep -R -l "Automates http://" * | xargs -I{} grep -H -n "Automates http://" {}&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;temp.java:73: &amp;nbsp;/** Automates http://something/353571 */&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;temp.java:936: &amp;nbsp;/** Automates http://something/336439 and http://something/336438 */&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;b&gt;$ grep -R -l "Automates http://" * | xargs -I{} grep -H -n "Automates http://" {} | cut -f-2 -d:&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;temp.java:73&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;temp.java:936&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;b&gt;$ grep -R -l "Automates http://" * | xargs -I{} grep -H -n "Automates http://" {} | cut -f-2 -d: | sed "s/\(.*\):\(.*\)/filename is \1 and line number is \2/"&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;filename is temp.java and line number is 73&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;filename is temp.java and line number is 936&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
The final piece of puzzle is to make output from the last sed into a command and then run it. So instead an output like &lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;filename is temp.java and line number is 73&lt;/span&gt;, we just need &lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;b&gt;sed -i '73s|\(http.*[0-9]\)|&amp;lt;a href="\1"&amp;gt;\1&amp;lt;/a&amp;gt;|g' temp.java&lt;/b&gt;&lt;/span&gt;. So here is the command to do just that (very complicated with lots of backslashes and quotes but I did not know any better :).&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;b&gt;$ grep -R -l "Automates http://" * | xargs -I{} grep -H -n "Automates http://" {} | cut -f-2 -d: | sed "s/\(.*\):\(.*\)/sed -i \\\'\2s|\"\\\(\"http.*[0-9]\"\\\)\"|\&amp;lt;a href=\"\\\1\"\&amp;gt;\"\\\1\"\&amp;lt;\/a\&amp;gt;|\\\' \1/"&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;sed -i \'73s|"\("http.*[0-9]"\)"|&amp;lt;a href="\1"&amp;gt;"\1"&amp;lt;/a&amp;gt;|\' temp.java&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;sed -i \'936s|"\("http.*[0-9]"\)"|&amp;lt;a href="\1"&amp;gt;"\1"&amp;lt;/a&amp;gt;|\' temp.java&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Then we need to execute that command using bash. Like so&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;b&gt;grep -R -l "Automates http://" * | xargs -I{} grep -H -n "Automates http://" {} | cut -f-2 -d: | sed "s/\(.*\):\(.*\)/sed -i \\\'\2s|\"\\\(\"http.*[0-9]\"\\\)\"|\&amp;lt;a href=\"\\\1\"\&amp;gt;\"\\\1\"\&amp;lt;\/a\&amp;gt;|\\\' \1/" | xargs -I{} bash -v -c "{}"&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Ah finally. But there is one problem however. When there are multiple links in the same line, sed matches all of the links and creates a weird output like this:&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;b&gt;Automates &amp;lt;a href=http://something/336439 and http://something/336438&amp;gt;http://something/336439 and http://something/336438&amp;lt;/a&amp;gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
I still don't have good solution for that. Since I have just a few of these lines I fixed them quickly using tkdiff. But anyone know how to solve it?&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/32430925-6261486839961485812?l=chandan-pitta.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/nGyINDhcNoIpg2_TJAMUX7AwQhs/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/nGyINDhcNoIpg2_TJAMUX7AwQhs/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/nGyINDhcNoIpg2_TJAMUX7AwQhs/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/nGyINDhcNoIpg2_TJAMUX7AwQhs/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/MyThoughtsInE-text/~4/r8_vFv0kcjc" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://chandan-pitta.blogspot.com/feeds/6261486839961485812/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=32430925&amp;postID=6261486839961485812" title="2 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/32430925/posts/default/6261486839961485812?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/32430925/posts/default/6261486839961485812?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/MyThoughtsInE-text/~3/r8_vFv0kcjc/fun-with-grep-and-sed.html" title="Fun with grep and sed" /><author><name>Chandan Pitta</name><uri>https://profiles.google.com/108073397456181759055</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh5.googleusercontent.com/-wYryPSd3yss/AAAAAAAAAAI/AAAAAAAAEgc/kTrWHJtpxUg/s512-c/photo.jpg" /></author><thr:total>2</thr:total><feedburner:origLink>http://chandan-pitta.blogspot.com/2010/01/fun-with-grep-and-sed.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DkcERX4-cCp7ImA9WxBQE0w.&quot;"><id>tag:blogger.com,1999:blog-32430925.post-1904624805883144357</id><published>2010-01-12T08:33:00.000-08:00</published><updated>2010-01-12T08:33:24.058-08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-01-12T08:33:24.058-08:00</app:edited><title>Attesting General Power of Attorney in SF</title><content type="html">Recently I had to go through the motions of getting a General Power of Attorney (GPA) document attested in San Francisco. I am an Indian by birth. My parents were trying to buy a house back in India for me. Since I did not want to travel to India they needed a GPA so that they can act on my behalf to sign all the documents required to buy the house. The problem however is that they needed it urgently because the seller lives in UK and wants to get all the things done quickly so he can go back.&lt;br /&gt;
&lt;br /&gt;
My parents send me a GPA document that they obtained from a lawyer. This is a document that will give the power to my parents to buy the said property in the document on my behalf. The lawyer said that I will have to get the document attested at an Indian Consulate in USA. The closest one for me is in SF and I can drive there in about an hour from where I live. So I though it will be like a day's work to get all the things done.&lt;br /&gt;
&lt;br /&gt;
I looked up at their &lt;a href="http://www.cgisf.org/"&gt;website&lt;/a&gt;&amp;nbsp;for the procedure to attest GPA. I found the&lt;a href="http://www.cgisf.org/misc/misc_pa.html"&gt; page I was looking for&lt;/a&gt;&amp;nbsp;and the process seems simple enough. These are the things I need:&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;Complete Miscellaneous Services Application&lt;/li&gt;
&lt;li&gt;Attach all previous passports in original&lt;/li&gt;
&lt;li&gt;Photo copies of first 5 and last 2 pages of current passport&lt;/li&gt;
&lt;li&gt;Current passport&lt;/li&gt;
&lt;li&gt;Photo copy of a valid visa&lt;/li&gt;
&lt;li&gt;Proof of status: original green card/visa/EAD. For me it is a valid visa&lt;/li&gt;
&lt;li&gt;Proof of residence: Drivers License/Electricity/Water/Telephone bills/lease agreement. For me it is driver's license.&lt;/li&gt;
&lt;li&gt;Photo copies of proof of status and proof of residence above&lt;/li&gt;
&lt;li&gt;Original &lt;b&gt;apostilled&lt;/b&gt; Power of Attorney to be attested&lt;/li&gt;
&lt;li&gt;Photo copy of &lt;b&gt;apostilled&lt;/b&gt; Power of Attorney document&lt;/li&gt;
&lt;li&gt;Paste a photo in Miscellaneous Services Application&lt;/li&gt;
&lt;li&gt;Paste a photo on Power of Attorney document&lt;/li&gt;
&lt;li&gt;Sign Miscellaneous document&lt;/li&gt;
&lt;li&gt;Pay $20 for fees using money order / cachier's check or debit card ($3 extra). Debit card for me&lt;/li&gt;
&lt;/ul&gt;I got everything right except for apostilling the document. I got myself photographed. Pasted one in the GPA and another on the application and drove for more than an hour in traffic to reach the SF indian consulate only to find that I need to get the GPA apostilled. I did not know what it was and how it was supposed to be done. So I just skipped the step and went to the consulate. After standing in line for an hour the lady at the counter was kind enough to walk me through the whole process. She told me that first I should get the GPA notarized by a notary public after signing the document in front of the notary. Then I should send the GPA along with self addressed envelope to Secretary of State, California to get the document apostilled. Once they send the document back to me I will have to bring the documents to Indian consulate for attestation.&lt;br /&gt;
&lt;br /&gt;
If I send the documents via mail to Secretary of State in Sacremento, it will be too late for me to send them to India. So I called up&amp;nbsp;Secretary of State, CA to ask how long it will take if I walked in. By the way you can find all the details at &lt;a href="http://sos.ca.gov/"&gt;http://sos.ca.gov&lt;/a&gt;. Contact phone for notary public is &lt;a href="http://www.sos.ca.gov/contacts.htm#notary"&gt;here&lt;/a&gt;. The lady on the phone said that by mail the turn around time is 1 day exclusive of the mail service time. And if I walked in it will be over in about 15 minutes. They just require the notarized document.&lt;br /&gt;
&lt;br /&gt;
Great. That is easy. But there is just one thing. I wanted to finish all this in one day. So I had some planning to do. First it takes 2 hours to drive to Sacremento from where I live. And another 2 hours from Sacremento to SF where I will get the final attestation. The consulate closes at 12 pm. While the Secretary of State opens at 8 am.&lt;br /&gt;
&lt;br /&gt;
The next day I started at 6am and drove to Sacremento. It was exactly 8am by the time I was in the Secretary of State. Finding the notary public office was easy and I got the document apostilled in about 15 minutes. Then I started off to SF for another 2 hour drive. I got the apostilled document photo copied at an office max in SF. It was 10:30am before I stepped into the consulate. At this point it was just a matter of time. I was in the line for an hour and then everything flew by quickly. She took the documents and the payment and asked me to return at 4pm to pick up the documents. I drove to work at 12pm and returned back to SF at 4pm. Everything was ready for me. Took the attested documents, drove back to work and then home late in the night.&lt;br /&gt;
&lt;br /&gt;
Two days and 450 miles later I have all things done! That one day was tiring with 350 miles logged. End of the day the whole process is not that complicated. I was lucky to be close to Sacremento and SF. But for others who are not so lucky it will take more time. So please make sure you have enough time.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/32430925-1904624805883144357?l=chandan-pitta.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/BJoelptMY_4OpDcDi5z7A8Gn8Gk/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/BJoelptMY_4OpDcDi5z7A8Gn8Gk/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/BJoelptMY_4OpDcDi5z7A8Gn8Gk/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/BJoelptMY_4OpDcDi5z7A8Gn8Gk/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/MyThoughtsInE-text/~4/jzxJGPfx9GM" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://chandan-pitta.blogspot.com/feeds/1904624805883144357/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=32430925&amp;postID=1904624805883144357" title="131 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/32430925/posts/default/1904624805883144357?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/32430925/posts/default/1904624805883144357?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/MyThoughtsInE-text/~3/jzxJGPfx9GM/attesting-general-power-of-attorney-in.html" title="Attesting General Power of Attorney in SF" /><author><name>Chandan Pitta</name><uri>https://profiles.google.com/108073397456181759055</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh5.googleusercontent.com/-wYryPSd3yss/AAAAAAAAAAI/AAAAAAAAEgc/kTrWHJtpxUg/s512-c/photo.jpg" /></author><thr:total>131</thr:total><feedburner:origLink>http://chandan-pitta.blogspot.com/2010/01/attesting-general-power-of-attorney-in.html</feedburner:origLink></entry><entry gd:etag="W/&quot;Dk4HQXo4cCp7ImA9WxBSGEo.&quot;"><id>tag:blogger.com,1999:blog-32430925.post-3481618047525041213</id><published>2009-12-26T16:48:00.000-08:00</published><updated>2009-12-26T16:48:50.438-08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-12-26T16:48:50.438-08:00</app:edited><title>How To: MusicMagicMixer</title><content type="html">Another duplicate mp3 finder is MusicMagicMixer. I liked this one for speed and simple UI. On launching the application you will be provided with a dialog to select the media you like to scan.&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/_JnVl6JF1MWk/Szao19YZ7pI/AAAAAAAAD3k/8jfUeBtB-ys/s1600-h/snapshot15.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="306" src="http://1.bp.blogspot.com/_JnVl6JF1MWk/Szao19YZ7pI/AAAAAAAAD3k/8jfUeBtB-ys/s320/snapshot15.png" width="320" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;&lt;br /&gt;
After selecting the directory containing the media it will start scanning the files.&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_JnVl6JF1MWk/SzapG8kzPbI/AAAAAAAAD3s/FGHb_5vWSpc/s1600-h/snapshot16.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://3.bp.blogspot.com/_JnVl6JF1MWk/SzapG8kzPbI/AAAAAAAAD3s/FGHb_5vWSpc/s320/snapshot16.png" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;&lt;br /&gt;
And once that is done the application will start processing the files to create audio fingerprints immediately.&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/_JnVl6JF1MWk/SzapuU1XdKI/AAAAAAAAD30/xpRZhg0qU58/s1600-h/snapshot17.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://1.bp.blogspot.com/_JnVl6JF1MWk/SzapuU1XdKI/AAAAAAAAD30/xpRZhg0qU58/s320/snapshot17.png" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;&lt;br /&gt;
The good thing is that the processing is very fast. In about 20 minutes it was able to finish processing all of the 578 files. However the bad news is that it is not as good as &lt;a href="http://chandan-pitta.blogspot.com/2009/12/how-to-dump3.html"&gt;DuMP3&lt;/a&gt; when finding duplicates. It found none from the 578 files.&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/_JnVl6JF1MWk/SzatmES9ofI/AAAAAAAAD38/FkXzJFdofL4/s1600-h/snapshot18.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="222" src="http://2.bp.blogspot.com/_JnVl6JF1MWk/SzatmES9ofI/AAAAAAAAD38/FkXzJFdofL4/s320/snapshot18.png" width="320" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/_JnVl6JF1MWk/Szatqhra17I/AAAAAAAAD4E/bB-_OqPfTt0/s1600-h/snapshot19.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://1.bp.blogspot.com/_JnVl6JF1MWk/Szatqhra17I/AAAAAAAAD4E/bB-_OqPfTt0/s320/snapshot19.png" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;&lt;br /&gt;
So you either have a fast but not accurate software or accurate but slow software. The choice is yours :). But for me I still like the MusicMagicMixer. It did find duplicates in the previous run which I deleted and so now it is showing empty duplicates. And then &amp;nbsp;DuMP3 could find a few more. I don't know if there is a better software that will find all the duplicates much faster. The search continues...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/32430925-3481618047525041213?l=chandan-pitta.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/9tCps_L-WRv54QWpD9jSUXQmNmg/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/9tCps_L-WRv54QWpD9jSUXQmNmg/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/9tCps_L-WRv54QWpD9jSUXQmNmg/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/9tCps_L-WRv54QWpD9jSUXQmNmg/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/MyThoughtsInE-text/~4/9fWOU_teTGA" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://chandan-pitta.blogspot.com/feeds/3481618047525041213/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=32430925&amp;postID=3481618047525041213" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/32430925/posts/default/3481618047525041213?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/32430925/posts/default/3481618047525041213?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/MyThoughtsInE-text/~3/9fWOU_teTGA/how-to-musicmagicmixer.html" title="How To: MusicMagicMixer" /><author><name>Chandan Pitta</name><uri>https://profiles.google.com/108073397456181759055</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh5.googleusercontent.com/-wYryPSd3yss/AAAAAAAAAAI/AAAAAAAAEgc/kTrWHJtpxUg/s512-c/photo.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://1.bp.blogspot.com/_JnVl6JF1MWk/Szao19YZ7pI/AAAAAAAAD3k/8jfUeBtB-ys/s72-c/snapshot15.png" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://chandan-pitta.blogspot.com/2009/12/how-to-musicmagicmixer.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CUcHRng5cSp7ImA9WxBSGEo.&quot;"><id>tag:blogger.com,1999:blog-32430925.post-6550753557967734326</id><published>2009-12-26T16:17:00.000-08:00</published><updated>2009-12-26T16:17:17.629-08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-12-26T16:17:17.629-08:00</app:edited><title>How To: DuMP3</title><content type="html">After searching for some mp3 &lt;a href="http://chandan-pitta.blogspot.com/2009/12/are-there-some-good-duplicate-mp3.html"&gt;duplicate finders for Linux&lt;/a&gt; I finally found two good applications. One of them is DuMP3. In this blog post I will walk through the steps showing screenshots and measuring the performance.&lt;br /&gt;
&lt;br /&gt;
Upon launching the application you will see the following window on your screen.&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_JnVl6JF1MWk/SzVrPKWElXI/AAAAAAAAD20/wL3sUjNuHLo/s1600-h/snapshot9.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://4.bp.blogspot.com/_JnVl6JF1MWk/SzVrPKWElXI/AAAAAAAAD20/wL3sUjNuHLo/s400/snapshot9.png" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;&lt;br /&gt;
A very simple and clean interface. On the left side you will have to select the files that you want to compare and add them into the right pane. In my case all my collection is in one place which I added as shown below&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/_JnVl6JF1MWk/SzVrmyyfscI/AAAAAAAAD3E/XA_27P3L1bo/s1600-h/snapshot10.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://2.bp.blogspot.com/_JnVl6JF1MWk/SzVrmyyfscI/AAAAAAAAD3E/XA_27P3L1bo/s400/snapshot10.png" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;&lt;br /&gt;
Once you press the "Next" button the software will scan all the media in the directories that you selected in your right pane and it will make a list of file extensions that are contained in the directories. These will be shown in the following screen&amp;nbsp;where you can select the file formats that you want to compare.&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_JnVl6JF1MWk/SzVrkcya8FI/AAAAAAAAD28/9sufByFwgDk/s1600-h/snapshot11.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://3.bp.blogspot.com/_JnVl6JF1MWk/SzVrkcya8FI/AAAAAAAAD28/9sufByFwgDk/s400/snapshot11.png" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;&lt;br /&gt;
Seems like the software can find duplicates of images as well. That is neat! Anyway I just want audio de-duplication so I selected mp3, ogg and flac&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/_JnVl6JF1MWk/SzVslviTVTI/AAAAAAAAD3M/18EP7CJDbWg/s1600-h/snapshot12.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://1.bp.blogspot.com/_JnVl6JF1MWk/SzVslviTVTI/AAAAAAAAD3M/18EP7CJDbWg/s400/snapshot12.png" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;&lt;br /&gt;
Pressing "Next" will take you to a screen where you can tweak the comparison algorithm. I left the default values because I did not know how to tweak them yet.&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_JnVl6JF1MWk/SzVtIYuyYwI/AAAAAAAAD3U/ucW4_QrV10I/s1600-h/snapshot13.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://3.bp.blogspot.com/_JnVl6JF1MWk/SzVtIYuyYwI/AAAAAAAAD3U/ucW4_QrV10I/s400/snapshot13.png" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;&lt;br /&gt;
When you are done changing the parameters, just press Next and the software should start scanning your collection. The software seems to be able to use multiple threads to make fingerprints for some audio files but not all. Or so it seems. For the first 130 files or so I saw that the software was using 50% of all 8 CPUs (4 real and 4 virtual due to Intel's HT) of my core i7 processor. But then after a while a strange thing happened. The scanning switched from multi-threaded to single threaded for some reason! That was very unfortunate. This is what is happening with DuMP3 everytime I use. Why would it not use all the processors when it is capable of it? May be only some formats lend to multi-threaded processing? What formats are these? Anyway this is so slow that it is totally unusable. I just ran in on a sample of about 500 files and it took 24 hours so far, yet it could only scan 475 files.&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_JnVl6JF1MWk/Szalt_WQUCI/AAAAAAAAD3c/-mtNT4LuWhg/s1600-h/snapshot14.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://4.bp.blogspot.com/_JnVl6JF1MWk/Szalt_WQUCI/AAAAAAAAD3c/-mtNT4LuWhg/s400/snapshot14.png" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;&lt;br /&gt;
However it seems like it has done a good job at finding duplicate files. Still I cannot use it. I wish I knew what was wrong.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/32430925-6550753557967734326?l=chandan-pitta.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/YP_KbBmrho5uU5ND53FFQjSVdyo/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/YP_KbBmrho5uU5ND53FFQjSVdyo/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/YP_KbBmrho5uU5ND53FFQjSVdyo/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/YP_KbBmrho5uU5ND53FFQjSVdyo/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/MyThoughtsInE-text/~4/xhAyuePGDcM" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://chandan-pitta.blogspot.com/feeds/6550753557967734326/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=32430925&amp;postID=6550753557967734326" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/32430925/posts/default/6550753557967734326?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/32430925/posts/default/6550753557967734326?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/MyThoughtsInE-text/~3/xhAyuePGDcM/how-to-dump3.html" title="How To: DuMP3" /><author><name>Chandan Pitta</name><uri>https://profiles.google.com/108073397456181759055</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh5.googleusercontent.com/-wYryPSd3yss/AAAAAAAAAAI/AAAAAAAAEgc/kTrWHJtpxUg/s512-c/photo.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://4.bp.blogspot.com/_JnVl6JF1MWk/SzVrPKWElXI/AAAAAAAAD20/wL3sUjNuHLo/s72-c/snapshot9.png" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://chandan-pitta.blogspot.com/2009/12/how-to-dump3.html</feedburner:origLink></entry><entry gd:etag="W/&quot;Ck8GR3c-fSp7ImA9WxBSFkU.&quot;"><id>tag:blogger.com,1999:blog-32430925.post-2752069113096140499</id><published>2009-12-24T10:53:00.000-08:00</published><updated>2009-12-24T10:53:46.955-08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-12-24T10:53:46.955-08:00</app:edited><title>Are there some good duplicate mp3 finders?</title><content type="html">I have a very large music collection. Some of them are duplicates and remixes. I wanted to clean up my collection of duplicates. Being a Linux user and also cheap I wanted to search for a free software for Linux that would scan through my collection and identify duplicates. Only after searching the net for such a software did I find out how difficult it is to get something like that for Linux. A lot of the software is not free, but more importantly they are not available for Linux.&lt;br /&gt;
&lt;br /&gt;
I finally found a few that were either written in java or python and so are platform independent in a way. Of those I found only two applications worthwhile and easy to use (has an easy to understand GUI interface). One of them is called DuMP3 and another is called MusicMagicMixer, both of which are written in java or have parts of java code. I am intentionally not providing links to these applications because they will become broken links pretty quickly. You can do a search for them on your favorite search engine.&lt;br /&gt;
&lt;br /&gt;
Of these two applications I found MusicMagicMixer to be better. Both in terms of interface and performance. DuMP3 is very slow. I did not compare how well they find duplicates because I could not get DuMP3 to ever complete scanning. It starts out slow and then becomes even slower as it processes more and more files. Not sure why. May be I should search for the latest version and try that. Here is a screenshot of DuMP3.&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_JnVl6JF1MWk/SzO1_PaV4zI/AAAAAAAAD2k/FIpeT3vPEKM/s1600-h/snapshot7.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://3.bp.blogspot.com/_JnVl6JF1MWk/SzO1_PaV4zI/AAAAAAAAD2k/FIpeT3vPEKM/s400/snapshot7.png" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;&lt;br /&gt;
MusicMagicMixer performed much better. I did not time it but I think it was able to create one fingerprint per minute. So each music file took about a minute to be scanned. The nice thing about MusicMagicMixer is that you can run a webserver and using your browser you can look at the duplicate songs. Here is a screenshot of the app running.&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_JnVl6JF1MWk/SzO3H4ErstI/AAAAAAAAD2s/xTrOyz67E6s/s1600-h/snapshot8.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://4.bp.blogspot.com/_JnVl6JF1MWk/SzO3H4ErstI/AAAAAAAAD2s/xTrOyz67E6s/s400/snapshot8.png" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;&lt;br /&gt;
I will write a little bit more about how to use each of the two applications in my next couple of blogs. But for now I am happy that I was able to find some software that can find duplicates for my music collection and that works on Linux and is free!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/32430925-2752069113096140499?l=chandan-pitta.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/fSzYl0NeoGAd15CrVAqY58DrdCM/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/fSzYl0NeoGAd15CrVAqY58DrdCM/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/fSzYl0NeoGAd15CrVAqY58DrdCM/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/fSzYl0NeoGAd15CrVAqY58DrdCM/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/MyThoughtsInE-text/~4/udywVlSeIGY" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://chandan-pitta.blogspot.com/feeds/2752069113096140499/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=32430925&amp;postID=2752069113096140499" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/32430925/posts/default/2752069113096140499?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/32430925/posts/default/2752069113096140499?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/MyThoughtsInE-text/~3/udywVlSeIGY/are-there-some-good-duplicate-mp3.html" title="Are there some good duplicate mp3 finders?" /><author><name>Chandan Pitta</name><uri>https://profiles.google.com/108073397456181759055</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh5.googleusercontent.com/-wYryPSd3yss/AAAAAAAAAAI/AAAAAAAAEgc/kTrWHJtpxUg/s512-c/photo.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://3.bp.blogspot.com/_JnVl6JF1MWk/SzO1_PaV4zI/AAAAAAAAD2k/FIpeT3vPEKM/s72-c/snapshot7.png" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://chandan-pitta.blogspot.com/2009/12/are-there-some-good-duplicate-mp3.html</feedburner:origLink></entry><entry gd:etag="W/&quot;D04GRnYzeCp7ImA9WxBTFEw.&quot;"><id>tag:blogger.com,1999:blog-32430925.post-752475662029455938</id><published>2009-12-09T19:32:00.000-08:00</published><updated>2009-12-09T19:32:07.880-08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-12-09T19:32:07.880-08:00</app:edited><title>Boxee box?</title><content type="html">How about that? Just as I was looking for some HTPCs there are more and more options available. The Boxee box looks very nice and very different from any HTPC cases I have seen so far.&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://media.lunch.com/d/d7/242042.png?2" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="270" src="http://media.lunch.com/d/d7/242042.png?2" width="400" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://media.lunch.com/d/d7/242043.png?2" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="281" src="http://media.lunch.com/d/d7/242043.png?2" width="400" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;&lt;br /&gt;
More details over at &lt;a href="http://www.boxee.tv/box"&gt;http://www.boxee.tv/box&lt;/a&gt;. I wonder why Boxee went with d-link. What ever the reasons it does sport RF remote control, S/PDIF, RCA audio outputs, HDMI, SD, USB, WiFi, and Ethernet. All this fits into a really small package. Just look at the size along side of a coke can.&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://blog.boxee.tv/wp-content/uploads/2009/12/IMG_3755-300x225.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="300" src="http://blog.boxee.tv/wp-content/uploads/2009/12/IMG_3755-300x225.jpg" width="400" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;&lt;br /&gt;
It will be interesting to see how thing will go with Boxee. Hulu created so many problems to Boxee and it jumped over all the hoops. It is time for some payback. The interface also looks neat. The Boxee media center is a fork of xbmc so we know it is powerful, well done and will play a lot of media formats.&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://media.lunch.com/d/d7/242044.png?2" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="250" src="http://media.lunch.com/d/d7/242044.png?2" width="400" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;&lt;br /&gt;
Waiting for its release...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/32430925-752475662029455938?l=chandan-pitta.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/OXAIbrrDuqGoFnqWZVg7rN0YcDs/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/OXAIbrrDuqGoFnqWZVg7rN0YcDs/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/OXAIbrrDuqGoFnqWZVg7rN0YcDs/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/OXAIbrrDuqGoFnqWZVg7rN0YcDs/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/MyThoughtsInE-text/~4/ODwwcXTOODM" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://chandan-pitta.blogspot.com/feeds/752475662029455938/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=32430925&amp;postID=752475662029455938" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/32430925/posts/default/752475662029455938?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/32430925/posts/default/752475662029455938?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/MyThoughtsInE-text/~3/ODwwcXTOODM/boxee-box.html" title="Boxee box?" /><author><name>Chandan Pitta</name><uri>https://profiles.google.com/108073397456181759055</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh5.googleusercontent.com/-wYryPSd3yss/AAAAAAAAAAI/AAAAAAAAEgc/kTrWHJtpxUg/s512-c/photo.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://chandan-pitta.blogspot.com/2009/12/boxee-box.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CUIBRHc9fSp7ImA9WxBTEkk.&quot;"><id>tag:blogger.com,1999:blog-32430925.post-4161461241117665358</id><published>2009-12-07T19:39:00.000-08:00</published><updated>2009-12-07T19:39:15.965-08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-12-07T19:39:15.965-08:00</app:edited><title>ION platform with PCI slot</title><content type="html">As explained in my &lt;a href="http://chandan-pitta.blogspot.com/2009/11/nvidia-ion-for-htpc.html"&gt;previous blog&lt;/a&gt;, I needed an ION platform with a PCI slot. The slot will hold my already existing TV tuner card. I searched for a nvidia ION motherboard with a PCI slot. I could only &lt;a href="http://www.newegg.com/Product/Product.aspx?Item=N82E16813131408"&gt;find one in newegg&lt;/a&gt;. At $160 it is pretty cheap too!&lt;br /&gt;
&lt;br /&gt;
Now I need a case to enclose it. I found &lt;a href="http://www.newegg.com/Product/Product.aspx?Item=N82E16811154091"&gt;this case&lt;/a&gt;. It is not the best, but will do for now. The reason for going with this case is because I wanted it to be compact and at the same time should be able to house 2 3.5" hard drives and a 5.25" blu-ray drive. The case is small at 11.80" x 8.70" x 5.1". The cost of this case is $40.&lt;br /&gt;
&lt;br /&gt;
Next up, I need a couple of memory sticks. I am not planning to remove the memory sticks from my desktop PC and put them here because I want to sell the old desktop in a proper working condition. It will have everything except for the TV tuner card. I think 1 GB should be sufficient for the small HTPC especially since it will run linux. A quick search produced results with 1 GB memory sticks costing about $25.&lt;br /&gt;
&lt;br /&gt;
Finally I need a 1TB hard drive. A decent western digital hard drive can be had for about $85. So that completes the HTPC. I am not planning on purchasing additional hard drive or blu-ray/DVD drive at this point simply because I don't need them yet.&lt;br /&gt;
&lt;br /&gt;
The total cost of the HTPC comes to about $310. Not bad at all. With shipping and taxes it still will not be more than $350. I am not sure when I will buy it, but it is on my list of things to buy...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/32430925-4161461241117665358?l=chandan-pitta.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/Itx6rkQT6_6mItdQ6IrpJziknL4/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/Itx6rkQT6_6mItdQ6IrpJziknL4/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/Itx6rkQT6_6mItdQ6IrpJziknL4/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/Itx6rkQT6_6mItdQ6IrpJziknL4/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/MyThoughtsInE-text/~4/7Al08XSwXpk" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://chandan-pitta.blogspot.com/feeds/4161461241117665358/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=32430925&amp;postID=4161461241117665358" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/32430925/posts/default/4161461241117665358?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/32430925/posts/default/4161461241117665358?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/MyThoughtsInE-text/~3/7Al08XSwXpk/ion-platform-with-pci-slot.html" title="ION platform with PCI slot" /><author><name>Chandan Pitta</name><uri>https://profiles.google.com/108073397456181759055</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh5.googleusercontent.com/-wYryPSd3yss/AAAAAAAAAAI/AAAAAAAAEgc/kTrWHJtpxUg/s512-c/photo.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://chandan-pitta.blogspot.com/2009/12/ion-platform-with-pci-slot.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DE8FQX0yeip7ImA9WxNaFkk.&quot;"><id>tag:blogger.com,1999:blog-32430925.post-1729269868297398377</id><published>2009-11-30T21:53:00.000-08:00</published><updated>2009-11-30T21:53:30.392-08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-11-30T21:53:30.392-08:00</app:edited><title>nVidia ION for HTPC</title><content type="html">This is an exciting time for buying HTPC devices. They come in really small sizes, they are efficient and yet can playback 1080p video and boot in under 30 seconds. The most exciting hardware (for me anyway) is the ION platform from nVidia. These are tiny motherboard and CPU combos that do wonders considering their size and power usage. I had my eye on &lt;a href="http://www.newegg.com/Product/Product.aspx?Item=N82E16856158007&amp;amp;cm_re=ion_330-_-56-158-007-_-Product"&gt;this one&lt;/a&gt; for a while now. It looks great and for once I can put my HTPC in front of everyone in the living room. But there are a couple of reasons I keep reconsidering. First the bare bones HTPC has a small 2.5" 320 GB hard drive. Well I guess that is what gives it the small size. And the second reason is that it does not have a PCI slot. The tv tuner card I have sits in a PCI slot. Of course I can buy the latest and greatest USB tv tuner card, but I have my reasons to not to.&lt;br /&gt;
&lt;br /&gt;
I have painstakingly configured my PCI tv tuner card in Gentoo (my favorite OS). When I brought the tuner card the drivers were still buggy and you had to use the latest kernel and even then there would be problems. Luckily I use Gentoo so using the latest kernel is no big deal. And since I compile the kernel from scratch I can modify the kernel source code too. And I did just that. I had to tune a few parameters in the v4l driver for my tuner card. Then I had to hack around with mplayer to get everything right. Anyway that was back in the day. The linux drivers have improved a lot since then. At least for the old tuner card that I have, I didn't need to modify the latest kernel anymore. Things just work now.&lt;br /&gt;
&lt;br /&gt;
Yet I don't want to part with the PCI card and go for a USB tuner, because I think the latest tuners will still not be supported by linux yet and I will have to invest a lot of time to get it to work again. And I don't want that. So my next best option would be to use an ION platform that has a PCI slot. That means I will have to build the HTPC from scratch which is fun for me except that it might not look as nice on the exterior. I will probably have to hide it again. At least I will save some on my electric bill if nothing. Running a full desktop PC 24/7 with 4 hard drives and a lot of power hungry components like the very powerful graphics card is not helping my bills :). So in my next post I will try to find an alternative to the barebones ION HTPC and perhaps I will have better luck.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/32430925-1729269868297398377?l=chandan-pitta.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/36MJAZJmo3WacRouMsmnQdLfVYM/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/36MJAZJmo3WacRouMsmnQdLfVYM/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/36MJAZJmo3WacRouMsmnQdLfVYM/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/36MJAZJmo3WacRouMsmnQdLfVYM/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/MyThoughtsInE-text/~4/0kXcNEwCJmw" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://chandan-pitta.blogspot.com/feeds/1729269868297398377/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=32430925&amp;postID=1729269868297398377" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/32430925/posts/default/1729269868297398377?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/32430925/posts/default/1729269868297398377?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/MyThoughtsInE-text/~3/0kXcNEwCJmw/nvidia-ion-for-htpc.html" title="nVidia ION for HTPC" /><author><name>Chandan Pitta</name><uri>https://profiles.google.com/108073397456181759055</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh5.googleusercontent.com/-wYryPSd3yss/AAAAAAAAAAI/AAAAAAAAEgc/kTrWHJtpxUg/s512-c/photo.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://chandan-pitta.blogspot.com/2009/11/nvidia-ion-for-htpc.html</feedburner:origLink></entry><entry gd:etag="W/&quot;AkcGQH4-fyp7ImA9WxNaEko.&quot;"><id>tag:blogger.com,1999:blog-32430925.post-6446240370582446309</id><published>2009-11-26T15:27:00.000-08:00</published><updated>2009-11-26T15:27:01.057-08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-11-26T15:27:01.057-08:00</app:edited><title>My HTPC</title><content type="html">I have my eye on a new HTPC, but what does my current one look like? Here it is.&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_JnVl6JF1MWk/Sw8LNFSJBfI/AAAAAAAACHk/DJjICQpi4bM/s1600/IMG_0913.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://3.bp.blogspot.com/_JnVl6JF1MWk/Sw8LNFSJBfI/AAAAAAAACHk/DJjICQpi4bM/s400/IMG_0913.JPG" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;&lt;br /&gt;
The desktop PC that acts as my apache, mysql, samba, vnc, nx, xbmc and mythtv servers. In addition it is a media player. I have to hide it behind my TV because it looks so big and ugly. But it serves me well. Even while running 24/7 for the past two and a half years, I never had a single problem. It has 2 fans, one to cool the processor and one at the back to blow the air out of the case. The fan at the back sometimes would not run after a restart and I have to kick start it by spinning the fan with my hand and it will continue to run. For this reason and also to keep the PC much cooler I have left one side of the desktop open.&lt;br /&gt;
&lt;br /&gt;
This is how my media center running xbmc looks like from the front.&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_JnVl6JF1MWk/Sw8MGHjWzUI/AAAAAAAACHs/3WVkUkqVd2s/s1600/IMG_0917.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://4.bp.blogspot.com/_JnVl6JF1MWk/Sw8MGHjWzUI/AAAAAAAACHs/3WVkUkqVd2s/s400/IMG_0917.JPG" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;&lt;br /&gt;
And here is the vnc viewer connected to my HTPC showing off mythtv tv guide.&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_JnVl6JF1MWk/Sw8Nezp_opI/AAAAAAAACH0/cUVpejxF3-U/s1600/snapshot6.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://4.bp.blogspot.com/_JnVl6JF1MWk/Sw8Nezp_opI/AAAAAAAACH0/cUVpejxF3-U/s400/snapshot6.png" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;&lt;br /&gt;
You can see the gkrellm running on the left side showing all the vital stats like cpu, gpu, hard drive temperature, memory, cpu, hard disk, network usage etc. All in one place. Next up my future HTPC wishlist.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/32430925-6446240370582446309?l=chandan-pitta.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/plyifhuF6lTlkGUqpZawHyKx1n4/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/plyifhuF6lTlkGUqpZawHyKx1n4/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/plyifhuF6lTlkGUqpZawHyKx1n4/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/plyifhuF6lTlkGUqpZawHyKx1n4/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/MyThoughtsInE-text/~4/sunpHFdWyms" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://chandan-pitta.blogspot.com/feeds/6446240370582446309/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=32430925&amp;postID=6446240370582446309" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/32430925/posts/default/6446240370582446309?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/32430925/posts/default/6446240370582446309?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/MyThoughtsInE-text/~3/sunpHFdWyms/my-htpc.html" title="My HTPC" /><author><name>Chandan Pitta</name><uri>https://profiles.google.com/108073397456181759055</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh5.googleusercontent.com/-wYryPSd3yss/AAAAAAAAAAI/AAAAAAAAEgc/kTrWHJtpxUg/s512-c/photo.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://3.bp.blogspot.com/_JnVl6JF1MWk/Sw8LNFSJBfI/AAAAAAAACHk/DJjICQpi4bM/s72-c/IMG_0913.JPG" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://chandan-pitta.blogspot.com/2009/11/my-htpc.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DUYHRn0-eip7ImA9WxNaEUw.&quot;"><id>tag:blogger.com,1999:blog-32430925.post-5391498055204285494</id><published>2009-11-24T18:45:00.000-08:00</published><updated>2009-11-24T18:45:37.352-08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-11-24T18:45:37.352-08:00</app:edited><title>The new HTPCs are so tempting</title><content type="html">It has been a while since I blogged here. Got very busy. But I am hoping to restart. We will see how it goes.&lt;br /&gt;
&lt;br /&gt;
Today's topic is HTPC. There are some really wonderful HTPCs coming out these days. I wish I could buy all of them :). I have an old HTPC now. You can barely call it a HTPC. It is simply a desktop that I filled up with a lot of hard disks. It has an AM2 motherboard capable of 6 channel surround sound with AMD X2 3600+ processor and nvidia 9800 GT GPU. The GPU is way too powerful than required for a HTPC I know, but it was also my gaming machine for a while. Crammed into all the spaces are 4 hard disks with 250 GB each. I also have a kworld pci ATSC/QAM tuner for all my digital tv recording needs. It was so much fun when I built it more than a couple of years ago.&lt;br /&gt;
&lt;br /&gt;
For the software I used freevo as my media center software. It would record shows too. So I did not need anything else. It was very configurable and everything is in python and most importantly it can playback media using various media players. Of course mplayer handled every kind of media for me. The advantage with this kind of setup is that I need not wait for freevo to pick up the new mplayer code. As soon as I install a new version of mplayer, freevo would start using it. However freevo looked so '90s when it came to graphics and UI design. So I switched to xbmc.&lt;br /&gt;
&lt;br /&gt;
Now xbmc is my favorite media player. It is beautiful and all the animations and skins are a treat to the eyes. But it does not record live tv. So for that I installed mythtv and setup the backend to record live tv. A crobjob faithfully downloads EPG every night. I configure everything in mythtv using the web interface. Easy! The best thing about xbmc is that it uses nvidia's vdpau for decoding and rendering my videos. I love this feature. Of course freevo could also do it too because mplayer can render using vdpau. Anyway the point is that now all the work is offloaded to the GPU and so the CPU is not as taxed.&lt;br /&gt;
&lt;br /&gt;
This and the fact that hard drives with lots of space are dirt cheap brings me to the idea of using a much much lighter setup. What if there is a small low power device that has a nvidia GPU and a low power CPU with just one 1 TB hard drive, has 6 channel analog and a digital audio output and a PCI slot for my tv tuber card? That would be awesome and then I would not have to hide my dirty HTPC behind my LCD TV.&lt;br /&gt;
&lt;br /&gt;
I have my eyes on such a setup. More tomorrow though.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/32430925-5391498055204285494?l=chandan-pitta.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/VcBg1WrJUhiZNPm08WqBT8nRxzg/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/VcBg1WrJUhiZNPm08WqBT8nRxzg/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/VcBg1WrJUhiZNPm08WqBT8nRxzg/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/VcBg1WrJUhiZNPm08WqBT8nRxzg/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/MyThoughtsInE-text/~4/Faa92whmN1w" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://chandan-pitta.blogspot.com/feeds/5391498055204285494/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=32430925&amp;postID=5391498055204285494" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/32430925/posts/default/5391498055204285494?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/32430925/posts/default/5391498055204285494?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/MyThoughtsInE-text/~3/Faa92whmN1w/new-htpcs-are-so-tempting.html" title="The new HTPCs are so tempting" /><author><name>Chandan Pitta</name><uri>https://profiles.google.com/108073397456181759055</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh5.googleusercontent.com/-wYryPSd3yss/AAAAAAAAAAI/AAAAAAAAEgc/kTrWHJtpxUg/s512-c/photo.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://chandan-pitta.blogspot.com/2009/11/new-htpcs-are-so-tempting.html</feedburner:origLink></entry></feed>

