{"id":1720,"date":"2018-07-23T10:45:01","date_gmt":"2018-07-23T17:45:01","guid":{"rendered":"http:\/\/www.donluc.com\/?p=1720"},"modified":"2018-07-23T10:45:01","modified_gmt":"2018-07-23T17:45:01","slug":"project-7-rgb-lcd-shield-line-sensor-breakout-mk07","status":"publish","type":"post","link":"https:\/\/www.donluc.com\/?p=1720","title":{"rendered":"Project #7: RGB LCD Shield \u2013 Line Sensor Breakout \u2013 Mk07"},"content":{"rendered":"<p><a href=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2018\/07\/DonLuc1807Mk11a.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2018\/07\/DonLuc1807Mk11a.png\" alt=\"\" width=\"720\" height=\"571\" class=\"alignnone size-full wp-image-1721\" srcset=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2018\/07\/DonLuc1807Mk11a.png 720w, https:\/\/www.donluc.com\/wp-content\/uploads\/2018\/07\/DonLuc1807Mk11a-300x238.png 300w\" sizes=\"auto, (max-width: 720px) 100vw, 720px\" \/><\/a><\/p>\n<p><a href=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2018\/07\/DonLuc1807Mk11b.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2018\/07\/DonLuc1807Mk11b.png\" alt=\"\" width=\"720\" height=\"571\" class=\"alignnone size-full wp-image-1722\" srcset=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2018\/07\/DonLuc1807Mk11b.png 720w, https:\/\/www.donluc.com\/wp-content\/uploads\/2018\/07\/DonLuc1807Mk11b-300x238.png 300w\" sizes=\"auto, (max-width: 720px) 100vw, 720px\" \/><\/a><\/p>\n<p><a href=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2018\/07\/DonLuc1807Mk11c.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2018\/07\/DonLuc1807Mk11c.png\" alt=\"\" width=\"720\" height=\"540\" class=\"alignnone size-full wp-image-1723\" srcset=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2018\/07\/DonLuc1807Mk11c.png 720w, https:\/\/www.donluc.com\/wp-content\/uploads\/2018\/07\/DonLuc1807Mk11c-300x225.png 300w\" sizes=\"auto, (max-width: 720px) 100vw, 720px\" \/><\/a><\/p>\n<p><a href=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2018\/07\/DonLuc1807Mk11d.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2018\/07\/DonLuc1807Mk11d.png\" alt=\"\" width=\"720\" height=\"540\" class=\"alignnone size-full wp-image-1724\" srcset=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2018\/07\/DonLuc1807Mk11d.png 720w, https:\/\/www.donluc.com\/wp-content\/uploads\/2018\/07\/DonLuc1807Mk11d-300x225.png 300w\" sizes=\"auto, (max-width: 720px) 100vw, 720px\" \/><\/a><\/p>\n<p><a href=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2018\/07\/DonLuc1807Mk11e.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2018\/07\/DonLuc1807Mk11e.png\" alt=\"\" width=\"720\" height=\"540\" class=\"alignnone size-full wp-image-1725\" srcset=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2018\/07\/DonLuc1807Mk11e.png 720w, https:\/\/www.donluc.com\/wp-content\/uploads\/2018\/07\/DonLuc1807Mk11e-300x225.png 300w\" sizes=\"auto, (max-width: 720px) 100vw, 720px\" \/><\/a><\/p>\n<div style=\"width: 720px;\" class=\"wp-video\"><video class=\"wp-video-shortcode\" id=\"video-1720-1\" width=\"720\" height=\"406\" preload=\"metadata\" controls=\"controls\"><source type=\"video\/mp4\" src=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2018\/07\/DonLuc1807Mk11.mp4?_=1\" \/><a href=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2018\/07\/DonLuc1807Mk11.mp4\">https:\/\/www.donluc.com\/wp-content\/uploads\/2018\/07\/DonLuc1807Mk11.mp4<\/a><\/video><\/div>\n<p><strong>Line Sensor Breakout &#8211; QRE1113 (Analog)<\/strong><\/p>\n<p><strong>Description<\/strong><\/p>\n<p>This version of the QRE1113 breakout board features an easy-to-use analog output, which will vary depending on the amount of IR light reflected back to the sensor. This tiny board is perfect for line sensing applications and can be used in both 3.3V and 5V systems.<\/p>\n<p>The board\u2019s QRE1113 IR reflectance sensor is comprised of two parts &#8211; an IR emitting LED and an IR sensitive phototransistor. When you apply power to the VCC and GND pins the IR LED inside the sensor will illuminate. A 100 Ohm resistor is on-board and placed in series with the LED to limit current. A 10k Ohm resistor pulls the output pin high, but when the light from the LED is reflected back onto the phototransistor the output will begin to go lower. The more IR light sensed by the phototransistor, the lower the output voltage of the breakout board.<\/p>\n<p>These sensors are widely used in line following robots &#8211; white surfaces reflect much more light than black, so, when directed towards a white surface, the voltage output will be lower than that on a black surface.<\/p>\n<p>The power input and analog output pins are brought out to a 3-pin, 0.1&#8243; pitch header. The board also has a single mounting hole if you want to screw the board onto something.<\/p>\n<p><strong>Features<\/strong><\/p>\n<p>* 5VDC operating voltage<br \/>\n* 25mA supply current<br \/>\n* Optimal sensing distance: 0.125&#8243; (3mm)<br \/>\n* 0.30 x 0.55 \u201c (7.62 x 13.97 mm)<\/p>\n<p><strong>Common Reflectance Sensor<\/strong><\/p>\n<p>The QRE1113 is a common reflectance sensor often used in robotic line followers. The sensor works by shining an IR LED down and seeing how much of that light bounces back using a phototransistor. Because dark colors will bounce back less of the light, the sensor can be used to tell the difference between white and black areas. So an array of these can be used to help a robot determine where a dark line is on the ground so it can follow it. But they can also be used to determine proximity under an inch.<\/p>\n<p>The an analog input on your microcontroller but still need an analog reading of how much light was reflected. It does this by allowing you to charge a capacitor on the board, and then timing how long it takes to discharge. The more light that is reflected, the less time it takes to discharge the capacitor. Hooking the QRE1113 to your Arduino is very simple. It just needs power (5V), ground, and an analog pin.<\/p>\n<p><strong>DonLuc1807Mk11<\/strong><\/p>\n<p>1 x RGB LCD Shield 16\u00d72 Character Display<br \/>\n1 x Arduino UNO &#8211; R3<br \/>\n1 x ProtoScrewShield<br \/>\n1 x Line Sensor Breakout &#8211; QRE1113 (Analog)<br \/>\n3 x Jumper Wires 6&#8243; M\/M<br \/>\n1 x Half-Size Breadboard<\/p>\n<p><strong>Arduino UNO<\/strong><\/p>\n<p>CRS &#8211; Analog 0<br \/>\nGND &#8211; GND<br \/>\nVIN &#8211; +5V<\/p>\n<p><strong>DonLuc1807Mk11p.ino<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"default\" data-enlighter-title=\"DonLuc1807Mk11p.ino\">\r\n\/\/ ***** Don Luc *****\r\n\/\/ Software Version Information\r\n\/\/ Project #7: RGB LCD Shield \u2013 Line Sensor Breakout \u2013 Mk07\r\n\/\/ 7-11\r\n\/\/ DonLuc1807Mk10p 7-11\r\n\/\/ RGB LCD Shield\r\n\/\/ QRE1113 (Analog)\r\n\r\n\/\/ include the library code:\r\n#include &lt;Adafruit_MCP23017.h&gt;\r\n#include &lt;Adafruit_RGBLCDShield.h&gt;\r\n\r\nAdafruit_RGBLCDShield RGBLCDShield = Adafruit_RGBLCDShield();\r\n#define GREEN 0x2\r\n\r\n\/\/ Seven-Segment Display\r\nint iQRE1113 = A0;       \/\/ iQRE1113\r\nint iQRE1113Value = 0;   \/\/ iQRE1113Value\r\n\r\nvoid loop() \r\n{\r\n\r\n  \/\/ QRE1113 (Analog)\r\n  isCRS();\r\n\r\n  delay(2000);\r\n  \r\n  \/\/ Clear\r\n  RGBLCDShield.clear();\r\n  \r\n}\r\n<\/pre>\n<p><strong>getSeven.ino<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"default\" data-enlighter-title=\"getSeven.ino\">\r\n\/\/ Line Sensor Breakout - QRE1113\r\nvoid isCRS()\r\n{\r\n\r\n  \/\/ Display\r\n  \/\/ Set the cursor to column 0, line 0  \r\n  RGBLCDShield.setCursor(0,0);\r\n  RGBLCDShield.print(&quot;QRE1113 (Analog)&quot;);       \/\/ Line Sensor Breakout - QRE1113\r\n\r\n  iQRE1113Value = analogRead(iQRE1113);\r\n  \r\n  \/\/ Set the cursor to column 0, line 1\r\n  RGBLCDShield.setCursor(0, 1); \r\n  RGBLCDShield.print(&quot;iQRE1113 = &quot;);            \/\/ iQRE1113\r\n  RGBLCDShield.print( iQRE1113Value );          \/\/ iQRE1113Value\r\n\r\n}\r\n<\/pre>\n<p><strong>setup.ino<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"default\" data-enlighter-title=\"setup.ino\">\r\n\/\/ Setup\r\nvoid setup() \r\n{\r\n\r\n  \/\/ set up the LCD&#039;s number of columns and rows: \r\n  RGBLCDShield.begin(16, 2);\r\n  RGBLCDShield.setBacklight(GREEN);\r\n  \r\n  \/\/ Display\r\n  \/\/ Set the cursor to column 0, line 0  \r\n  RGBLCDShield.setCursor(0,0);  \r\n  RGBLCDShield.print(&quot;Don Luc&quot;);           \/\/ Don luc\r\n  \/\/ Set the cursor to column 0, line 1\r\n  RGBLCDShield.setCursor(0, 1);\r\n  RGBLCDShield.print(&quot;QRE1113 (Analog)&quot;);  \/\/ Seven-Segment Display\r\n  delay(5000);\r\n\r\n  \/\/ Clear\r\n  RGBLCDShield.clear();\r\n \r\n}\r\n<\/pre>\n<p><strong>Don Luc<\/strong><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Line Sensor Breakout &#8211; QRE1113 (Analog) Description This version of the QRE1113 breakout board features an easy-to-use analog output, which will vary depending on the amount of IR light reflected back to the sensor. This tiny board is perfect for line sensing applications and can be used in both 3.3V and 5V systems. The board\u2019s &#8230; <a title=\"Project #7: RGB LCD Shield \u2013 Line Sensor Breakout \u2013 Mk07\" class=\"read-more\" href=\"https:\/\/www.donluc.com\/?p=1720\" aria-label=\"Read more about Project #7: RGB LCD Shield \u2013 Line Sensor Breakout \u2013 Mk07\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[71,47,50,38,59,5,58,10,43],"tags":[],"class_list":["post-1720","post","type-post","status-publish","format-standard","hentry","category-rgb-lcd-shield","category-adafruit","category-arduino","category-digitalelectronics","category-fritzing","category-microcontrollers","category-arduino-programming","category-projects","category-sparkfun"],"_links":{"self":[{"href":"https:\/\/www.donluc.com\/index.php?rest_route=\/wp\/v2\/posts\/1720","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.donluc.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.donluc.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.donluc.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.donluc.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1720"}],"version-history":[{"count":2,"href":"https:\/\/www.donluc.com\/index.php?rest_route=\/wp\/v2\/posts\/1720\/revisions"}],"predecessor-version":[{"id":4778,"href":"https:\/\/www.donluc.com\/index.php?rest_route=\/wp\/v2\/posts\/1720\/revisions\/4778"}],"wp:attachment":[{"href":"https:\/\/www.donluc.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1720"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.donluc.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1720"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.donluc.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1720"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}