<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Lionel&#039;s Tetalab &#38; Co WIP &#187; distance sensor</title>
	<atom:link href="http://tetalab.org/lionel/tag/distance-sensor/feed/" rel="self" type="application/rss+xml" />
	<link>http://tetalab.org/lionel</link>
	<description>Just another Tetalab weblog</description>
	<lastBuildDate>Thu, 10 Jun 2010 19:26:30 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Arduino infrared distance sensor basic test</title>
		<link>http://tetalab.org/lionel/2010/01/18/arduino-infrared-distance-sensor-basic-test/</link>
		<comments>http://tetalab.org/lionel/2010/01/18/arduino-infrared-distance-sensor-basic-test/#comments</comments>
		<pubDate>Mon, 18 Jan 2010 11:52:40 +0000</pubDate>
		<dc:creator>lionel</dc:creator>
				<category><![CDATA[Arduino]]></category>
		<category><![CDATA[distance sensor]]></category>
		<category><![CDATA[infrared]]></category>
		<category><![CDATA[led]]></category>
		<category><![CDATA[SD 5410]]></category>
		<category><![CDATA[SE 5455]]></category>

		<guid isPermaLink="false">http://tetalab.org/lionel/?p=96</guid>
		<description><![CDATA[Hi folks,
Today, a very simple test to check the honeywell infrared emiter and receiver SE 5455-3 and SD 5410-2 capability as distance sensor.
I use the schematic from QTR-1A polulu reflectance sensor just changing the 150 ohm resistor with a 47 Ohm to match witch the SE 5455-3 specifications
Honeywell infrared led voltage is 1,7 V and [...]]]></description>
			<content:encoded><![CDATA[<p>Hi folks,</p>
<p>Today, a very simple test to check the honeywell infrared emiter and receiver <a href="http://www.datasheetarchive.com/pdf-datasheets/Datasheets-5/DSA-92637.pdf" target="_blank">SE 5455-3</a> and <a href="http://www.datasheetarchive.com/pdf-datasheets/Datasheets-305/74380.pdf" target="_blank">SD 5410-2</a> capability as distance sensor.</p>
<p>I use the schematic from <a href="http://www.pololu.com/catalog/product/958" target="_blank">QTR-1A polulu reflectance sensor</a> just changing the 150 ohm resistor with a 47 Ohm to match witch the SE 5455-3 specifications</p>
<p>Honeywell infrared led voltage is 1,7 V and current is 100 mA (!) so current limitation resistor should be :</p>
<p>( 5 &#8211; 1,7 ) / 0,100 = 33 Ohms instead of 150 Ohms, I put 47 ohms &#8217;cause i had this value directly avalaible <img src='http://tetalab.org/lionel/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<div id="attachment_97" class="wp-caption aligncenter" style="width: 240px"><a href="http://tetalab.org/lionel/files/2010/01/qtr1a-schem.png"><img class="size-full wp-image-97" title="QTR1-A schematic" src="http://tetalab.org/lionel/files/2010/01/qtr1a-schem.png" alt="QTR1-A schematic" width="230" height="300" /></a><p class="wp-caption-text">QTR1-A schematic</p></div>
<p>The breadboard wiring diagram is :</p>
<p style="text-align: center"><a href="http://tetalab.org/lionel/files/2010/01/Distance-sensor_bb.png"></a><a href="http://tetalab.org/lionel/files/2010/01/Distance-sensor_bb.png"><img class="aligncenter size-full wp-image-98" title="Distance sensor wiring diagram" src="http://tetalab.org/lionel/files/2010/01/Distance-sensor_bb.png" alt="Distance sensor wiring diagram" width="736" height="450" /></a></p>
<p style="text-align: left">It&#8217;s cleaner than reality&#8230;</p>
<p style="text-align: left"><a href="http://tetalab.org/lionel/files/2010/01/DSC06342.jpg"><img class="aligncenter size-large wp-image-110" title="DSC06342" src="http://tetalab.org/lionel/files/2010/01/DSC06342-1024x768.jpg" alt="" width="1024" height="768" /></a></p>
<p style="text-align: left">A red led (inside the paper tube) is used as PWM output visualisation on digital output 9, I used a led symbol as emiter and a transistor as receiver, by the way, it&#8217;s pretty much correct&#8230;</p>
<p style="text-align: left">The arduino code is coming from AnalogInOutSerial Arduino example and the sensor (used instead of the potentiometer) range adjusted to match with sensor output.</p>
<p style="text-align: left">
<pre><span style="color: #7e7e7e">/*</span>
<span style="color: #7e7e7e">  Analog input, analog output, serial output</span>
<span style="color: #7e7e7e"> </span>
<span style="color: #7e7e7e"> Reads an analog input pin, maps the result to a range from 0 to 255</span>
<span style="color: #7e7e7e"> and uses the result to set the pulsewidth modulation (PWM) of an output pin.</span>
<span style="color: #7e7e7e"> Also prints the results to the serial monitor.</span>
<span style="color: #7e7e7e"> </span>
<span style="color: #7e7e7e"> The circuit:</span>
<span style="color: #7e7e7e"> * potentiometer connected to analog pin 0.</span>
<span style="color: #7e7e7e">   Center pin of the potentiometer goes to the analog pin.</span>
<span style="color: #7e7e7e">   side pins of the potentiometer go to +5V and ground</span>
<span style="color: #7e7e7e"> * LED connected from digital pin 9 to ground</span>
<span style="color: #7e7e7e"> </span>
<span style="color: #7e7e7e"> created 29 Dec. 2008</span>
<span style="color: #7e7e7e"> by Tom Igoe</span>
<span style="color: #7e7e7e"> </span>
<span style="color: #7e7e7e"> */</span>

<span style="color: #7e7e7e">// These constants won't change.  They're used to give names</span>
<span style="color: #7e7e7e">// to the pins used:</span>
const <span style="color: #cc6600">int</span> analogInPin = 0;  <span style="color: #7e7e7e">// Analog input pin that the potentiometer is attached to</span>
const <span style="color: #cc6600">int</span> analogOutPin = 9; <span style="color: #7e7e7e">// Analog output pin that the LED is attached to</span>

<span style="color: #cc6600">int</span> sensorValue = 0;        <span style="color: #7e7e7e">// value read from the pot</span>
<span style="color: #cc6600">int</span> outputValue = 0;        <span style="color: #7e7e7e">// value output to the PWM (analog out)</span>

<span style="color: #cc6600">void</span> <span style="color: #cc6600"><strong>setup</strong></span>() {
  <span style="color: #7e7e7e">// initialize serial communications at 9600 bps:</span>
  <span style="color: #cc6600">Serial</span>.<span style="color: #cc6600">begin</span>(9600);
}

<span style="color: #cc6600">void</span> <span style="color: #cc6600"><strong>loop</strong></span>() {
  <span style="color: #7e7e7e">// read the analog in value:</span>
  sensorValue = <span style="color: #cc6600">analogRead</span>(analogInPin);
  <span style="color: #7e7e7e">// map it to the range of the analog out:</span>
  outputValue = <span style="color: #cc6600">map</span>(sensorValue, 150, 900, 0, 255);
  <span style="color: #7e7e7e">// change the analog out value:</span>
  <span style="color: #cc6600">analogWrite</span>(analogOutPin, outputValue);           

  <span style="color: #7e7e7e">// print the results to the serial monitor:</span>
  <span style="color: #cc6600">Serial</span>.<span style="color: #cc6600">print</span>(<span style="color: #006699">"sensor = "</span> );
  <span style="color: #cc6600">Serial</span>.<span style="color: #cc6600">print</span>(sensorValue);
  <span style="color: #cc6600">Serial</span>.<span style="color: #cc6600">print</span>(<span style="color: #006699">"\t output = "</span>);
  <span style="color: #cc6600">Serial</span>.<span style="color: #cc6600">println</span>(outputValue);   

  <span style="color: #7e7e7e">// wait 10 milliseconds before the next loop</span>
  <span style="color: #7e7e7e">// for the analog-to-digital converter to settle</span>
  <span style="color: #7e7e7e">// after the last reading:</span>
  <span style="color: #cc6600">delay</span>(10);
}</pre>
<p style="text-align: left">And not really explicit but for your eyes only :</p>
<p style="text-align: left"><a href="http://vimeo.com/8813034">Arduino infrared distance sensor test</a></p>
<p style="text-align: left">And the corresponding terminal snapshot</p>
<p style="text-align: left">
<div id="attachment_106" class="wp-caption aligncenter" style="width: 564px"><a href="http://tetalab.org/lionel/files/2010/01/snapterminal.png"><img class="size-full wp-image-106" title="snapterminal" src="http://tetalab.org/lionel/files/2010/01/snapterminal.png" alt="Terminal Snapshot" width="554" height="330" /></a><p class="wp-caption-text">Terminal Snapshot</p></div>
<p>As this, the honeywell emiter and receiver seem to be ok to measure distance between  2 and 10 cm from their built in lenses.</p>
<p>This range could be certainly extended using optical system like external lenses. In case I give a try on this, I&#8217;ll keep you in touch <img src='http://tetalab.org/lionel/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://tetalab.org/lionel/2010/01/18/arduino-infrared-distance-sensor-basic-test/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>