{"id":4899,"date":"2026-06-24T09:06:10","date_gmt":"2026-06-24T16:06:10","guid":{"rendered":"https:\/\/www.donluc.com\/?p=4899"},"modified":"2026-06-24T09:06:10","modified_gmt":"2026-06-24T16:06:10","slug":"project-12-robotics-tcrt5000-mk40","status":"publish","type":"post","link":"https:\/\/www.donluc.com\/?p=4899","title":{"rendered":"Project #12: Robotics \u2013 TCRT5000 \u2013 Mk40"},"content":{"rendered":"<div style=\"width: 1200px;\" class=\"wp-video\"><video class=\"wp-video-shortcode\" id=\"video-4899-1\" width=\"1200\" height=\"675\" preload=\"metadata\" controls=\"controls\"><source type=\"video\/mp4\" src=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2026\/06\/DL2606Mk03W.mp4?_=1\" \/><a href=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2026\/06\/DL2606Mk03W.mp4\">https:\/\/www.donluc.com\/wp-content\/uploads\/2026\/06\/DL2606Mk03W.mp4<\/a><\/video><\/div>\n<p>&#8212;&#8212;<\/p>\n<p>#DonLucElectronics #DonLuc #TCRT5000 #Robotics #FireBeetle2ESP32E #ESP32 #Display #IoT #Project #Fritzing #Programming #Electronics #Microcontrollers #Consultant<\/p>\n<p>&#8212;&#8212;<\/p>\n<p><a href=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2026\/06\/DL2606Mk03a.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2026\/06\/DL2606Mk03a.jpg\" alt=\"TCRT5000\" width=\"720\" height=\"569\" class=\"alignnone size-full wp-image-4901\" srcset=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2026\/06\/DL2606Mk03a.jpg 720w, https:\/\/www.donluc.com\/wp-content\/uploads\/2026\/06\/DL2606Mk03a-300x237.jpg 300w\" sizes=\"auto, (max-width: 720px) 100vw, 720px\" \/><\/a><\/p>\n<p>&#8212;&#8212;<\/p>\n<p><a href=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2026\/06\/DL2606Mk03b.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2026\/06\/DL2606Mk03b.jpg\" alt=\"TCRT5000\" width=\"720\" height=\"480\" class=\"alignnone size-full wp-image-4902\" srcset=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2026\/06\/DL2606Mk03b.jpg 720w, https:\/\/www.donluc.com\/wp-content\/uploads\/2026\/06\/DL2606Mk03b-300x200.jpg 300w\" sizes=\"auto, (max-width: 720px) 100vw, 720px\" \/><\/a><\/p>\n<p>&#8212;&#8212;<\/p>\n<p><a href=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2026\/06\/DL2606Mk03c.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2026\/06\/DL2606Mk03c.jpg\" alt=\"TCRT5000\" width=\"720\" height=\"480\" class=\"alignnone size-full wp-image-4903\" srcset=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2026\/06\/DL2606Mk03c.jpg 720w, https:\/\/www.donluc.com\/wp-content\/uploads\/2026\/06\/DL2606Mk03c-300x200.jpg 300w\" sizes=\"auto, (max-width: 720px) 100vw, 720px\" \/><\/a><\/p>\n<p>&#8212;&#8212;<\/p>\n<p><strong>TCRT5000 Optical Infrared Line Follower<\/strong><\/p>\n<p>The TCRT5000 is an infrared optical sensor widely used as a line follower in mobile robots and proximity detection systems. It consists of an infrared emitter (IR LED) and a phototransistor receiver, housed in a single package. Its operation is based on the principle of reflection: the LED emits infrared light toward a surface, and the phototransistor detects the amount of light reflected. Light surfaces (such as white lines) reflect more light, while dark surfaces (such as black lines) absorb it, allowing the sensor to differentiate between the two. This capability makes it an essential tool for line-following robots, as it enables them to detect and follow paths marked on the ground.<\/p>\n<p>The TCRT5000 infrared optical sensor, commonly used as a line follower, has diverse applications in electronics and robotics projects. Its main uses include line-following robots, edge detection, speed or rotation measurement with encoders, and object or people counting.<\/p>\n<p><strong>DL2606Mk03<\/strong><\/p>\n<p>1 x DFRobot FireBeetle 2 ESP32-E<br \/>\n1 x Fermion: 3.5\u201d 480&#215;320 TFT LCD Capacitive<br \/>\n1 x GDL Line 10 CM<br \/>\n1 x TCRT5000 Optical Infrared Line Follower<br \/>\n1 x Gravity: IO Shield for FireBeetle 2<br \/>\n1 x Terminal Block Board for FireBeetle 2 ESP32-E IoT<br \/>\n1 x Lithium Ion Battery &#8211; 1000mAh<br \/>\n1 x USB 3.0 to Type-C Cable<\/p>\n<p>DL2606Mk03p<\/p>\n<p><strong>DL2606Mk03p.ino<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"arduino\" data-enlighter-title=\"\">\r\n\/****** Don Luc Electronics \u00a9 ******\r\nSoftware Version Information\r\nProject #12: Robotics \u2013 TCRT5000 \u2013 Mk40\r\n12-40\r\nDL2606Mk03p.ino\r\nDL2606k03\r\n1 x DFRobot FireBeetle 2 ESP32-E\r\n1 x Fermion: 3.5\u201d 480x320 TFT LCD Capacitive\r\n1 x GDL Line 10 CM\r\n1 x TCRT5000 Optical Infrared Line Follower\r\n1 x Gravity: IO Shield for FireBeetle 2\r\n1 x Terminal Block Board for FireBeetle 2 ESP32-E IoT\r\n1 x Lithium Ion Battery - 1000mAh\r\n1 x USB 3.0 to Type-C Cable\r\n*\/\r\n\r\n\/\/ Include the Library Code\r\n\/\/ EEPROM Library to Read and Write EEPROM with Unique ID for Unit\r\n#include &quot;EEPROM.h&quot;\r\n\/\/ DFRobot Display GDL API\r\n#include &lt;DFRobot_GDL.h&gt;\r\n\r\n\/\/ TCRT5000 Optical Infrared Line\r\nint iTCRT5000 = A0;\r\n\/\/ Value\r\nint iValue = 0;\r\n\/\/ Voltage\r\nfloat fVoltage;\r\n\/\/ Print \r\nString sPrint  = &quot;&quot;;\r\n\r\n\/\/ Defined ESP32\r\n#define TFT_DC  D2\r\n#define TFT_CS  D6\r\n#define TFT_RST D3\r\n\r\n\/*dc=*\/ \/*cs=*\/ \/*rst=*\/\r\n\/\/ DFRobot Display 320x480\r\nDFRobot_ILI9488_320x480_HW_SPI screen(TFT_DC, TFT_CS, TFT_RST);\r\n\r\n\/\/ Software Version Information\r\n\/\/ EEPROM Unique ID Information\r\n#define EEPROM_SIZE 64\r\nString uid = &quot;&quot;;\r\n\r\n\/\/ Software Version Information\r\nString sver = &quot;12-40&quot;;\r\n\r\nvoid loop() {\r\n  \r\n  \/\/ isTCRT5000\r\n  isTCRT5000();\r\n\r\n  \/\/ isDisplay TCRT5000\r\n  isDisplayTCRT5000();\r\n\r\n  \/\/ Delay 1 Second\r\n  delay( 1000 );\r\n\r\n}\r\n<\/pre>\n<p><strong>getDisplay.ino<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"arduino\" data-enlighter-title=\"\">\r\n\/\/ DFRobot Display 320x480\r\n\/\/ DFRobot Display 320x480 - UID\r\nvoid isDisplayUID(){\r\n\r\n  \/\/ DFRobot Display 320x480\r\n  \/\/ Text Display\r\n  \/\/ Text Wrap\r\n  screen.setTextWrap(false);\r\n  \/\/ Rotation\r\n  screen.setRotation(3);\r\n  \/\/ Fill Screen =&gt; black\r\n  screen.fillScreen(0x0000);\r\n  \/\/ Text Color =&gt; white\r\n  screen.setTextColor(0xffff);\r\n  \/\/ Font =&gt; Free Sans Bold 12pt\r\n  screen.setFont(&amp;FreeSansBold12pt7b);\r\n  \/\/ TextSize =&gt; 1.5\r\n  screen.setTextSize(1.5);\r\n  \/\/ Don Luc Electronics\r\n  screen.setCursor(0, 30);\r\n  screen.println(&quot;Don Luc Electronics&quot;);\r\n  \/\/ Tilt Switch\r\n  screen.setCursor(0, 60);\r\n  screen.println(&quot;TCRT5000 Optical Infrared Line Follower&quot;);\r\n  \/\/ Version\r\n  screen.setCursor(0, 90);\r\n  screen.println(&quot;Version&quot;);\r\n  screen.setCursor(0, 120);\r\n  screen.println( sver );\r\n  \/\/ EEPROM\r\n  screen.setCursor(0, 150);\r\n  screen.println(&quot;EEPROM&quot;);\r\n  screen.setCursor(0, 180);\r\n  screen.println( uid );\r\n\r\n}\r\n\/\/ isDisplay TCRT5000\r\nvoid isDisplayTCRT5000(){\r\n\r\n  \/\/ DFRobot Display 320x480\r\n  \/\/ Text Display\r\n  \/\/ Text Wrap\r\n  screen.setTextWrap(false);\r\n  \/\/ Rotation\r\n  screen.setRotation(3);\r\n  \/\/ Fill Screen =&gt; white\r\n  screen.fillScreen(0xffff);\r\n  \/\/ Text Color =&gt; blue\r\n  screen.setTextColor(0x001F);\r\n  \/\/ Font =&gt; Free Sans Bold 12pt\r\n  screen.setFont(&amp;FreeSansBold12pt7b);\r\n  \/\/ TextSize =&gt; 1.5\r\n  screen.setTextSize(1.5);\r\n  \/\/ Vibration Senso\r\n  screen.setCursor(0, 30);\r\n  screen.println(&quot;TCRT5000 Optical Infrared Line&quot;);\r\n  \/\/ Value\r\n  screen.setCursor(0, 70);\r\n  screen.println( &quot;Value&quot; );\r\n  screen.setCursor(0, 100);\r\n  screen.println( iValue );\r\n  \/\/ Voltage\r\n  screen.setCursor(0, 130);\r\n  screen.println( &quot;Voltage&quot; );\r\n  screen.setCursor(0, 160);\r\n  screen.println( fVoltage );\r\n  \/\/ Print\r\n  screen.setCursor(0, 190);\r\n  screen.println( &quot;Print&quot; );\r\n  screen.setCursor(0, 220);\r\n  screen.println( sPrint );\r\n  \r\n}\r\n<\/pre>\n<p><strong>getEEPROM.ino<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"arduino\" data-enlighter-title=\"\">\r\n\/\/ isUID EEPROM Unique ID\r\nvoid isUID()\r\n{\r\n  \r\n  \/\/ Is Unit ID\r\n  uid = &quot;&quot;;\r\n  for (int x = 0; x &lt; 7; x++)\r\n  {\r\n    uid = uid + char(EEPROM.read(x));\r\n  }\r\n  \r\n}\r\n<\/pre>\n<p><strong>getTCRT5000.ino<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"arduino\" data-enlighter-title=\"\">\r\n\/\/ TCRT5000 Optical Infrared Line\r\n\/\/ isTCRT5000\r\nvoid isTCRT5000(){\r\n\r\n  \/\/ isTCRT5000\r\n  iValue = analogRead( iTCRT5000 );\r\n\r\n  \/\/ Convert the analog reading (which goes from 0 - 4095) \r\n  \/\/ to a voltage (0 - 3.3V):\r\n  fVoltage = iValue * (3.3 \/ 4095.0);\r\n\r\n  \/\/ the lower the voltage, the brighter it is\r\n  if ((fVoltage &gt;= 0) &amp;&amp; (fVoltage &lt;= 0.4)) {\r\n    \r\n    sPrint = &quot;It is light&quot;;\r\n\r\n  } else if ((fVoltage &gt; 0.4) &amp;&amp; (fVoltage &lt;= 2)) {\r\n    \r\n    sPrint = &quot;Ot is bright&quot;;\r\n\r\n  } else {\r\n    \r\n    sPrint = &quot;It is dark&quot;;\r\n    \r\n  }\r\n\r\n}\r\n<\/pre>\n<p><strong>setup.ino<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"arduino\" data-enlighter-title=\"\">\r\n\/\/ Setup\r\nvoid setup()\r\n{\r\n \r\n  \/\/ Delay\r\n  delay( 100 );\r\n\r\n   \/\/ EEPROM Size\r\n  EEPROM.begin(EEPROM_SIZE);\r\n  \r\n  \/\/ EEPROM Unique ID\r\n  isUID();\r\n\r\n  \/\/ Delay\r\n  delay(100);\r\n\r\n  \/\/ DFRobot Display 320x480\r\n  screen.begin();\r\n\r\n  \/\/ Delay\r\n  delay( 100 );\r\n\r\n  \/\/ DFRobot Display 320x480 - UID\r\n  \/\/ Don Luc Electronics\r\n  \/\/ Version\r\n  \/\/ EEPROM\r\n  isDisplayUID();\r\n\r\n  \/\/ Wait for the sensor to heat up for 20 seconds\r\n  delay( 5000 );\r\n\r\n}\r\n<\/pre>\n<p>&#8212;&#8212;<\/p>\n<p><strong>Consultant, R&#038;D, Electronics, IoT, Teacher and Instructor<\/strong><\/p>\n<ul>\n<li>Programming Language<\/li>\n<li>Single-Board Microcontrollers (PIC, Arduino, Raspberry Pi, Arm, Silicon Labs, Espressif, Etc&#8230;)<\/li>\n<li>IoT<\/li>\n<li>Wireless (Radio Frequency, Bluetooth, WiFi, Etc&#8230;)<\/li>\n<li>Robotics<\/li>\n<li>Automation<\/li>\n<li>Camera and Video Capture Receiver Stationary, Wheel\/Tank , Underwater and UAV Vehicle<\/li>\n<li>Unmanned Vehicles Terrestrial,  Marine and UAV<\/li>\n<li>Machine Learning<\/li>\n<li>Artificial Intelligence (AI)<\/li>\n<li>RTOS<\/li>\n<li>Sensors, eHealth Sensors, Biosensor, and Biometric<\/li>\n<li>Research &#038; Development (R &#038; D)<\/li>\n<li>Consulting<\/li>\n<\/ul>\n<p><strong>Follow Us<\/strong><\/p>\n<p><strong>Luc Paquin \u2013 Curriculum Vitae &#8211; 2026<\/strong><br \/>\nhttps:\/\/www.donluc.com\/luc\/LucPaquinCVEng2026Mk01.pdf<br \/>\nhttps:\/\/www.donluc.com\/luc\/<\/p>\n<p><strong>Web:<\/strong> https:\/\/www.donluc.com\/<br \/>\n<strong>Web:<\/strong> https:\/\/www.jlpconsultants.com\/<br \/>\n<strong>Facebook:<\/strong> https:\/\/www.facebook.com\/neosteam.labs.9\/<br \/>\n<strong>YouTube:<\/strong> https:\/\/www.youtube.com\/@thesass2063<br \/>\n<strong>DFRobot:<\/strong> https:\/\/learn.dfrobot.com\/user-10186.html<br \/>\n<strong>TikTok:<\/strong> https:\/\/www.tiktok.com\/@luc.paquin8<br \/>\n<strong>Hackster:<\/strong> https:\/\/www.hackster.io\/luc-paquin<br \/>\n<strong>LinkedIn:<\/strong> https:\/\/www.linkedin.com\/in\/jlucpaquin\/<\/p>\n<p><strong>Don Luc<\/strong><\/p>\n","protected":false},"excerpt":{"rendered":"<p>&#8212;&#8212; #DonLucElectronics #DonLuc #TCRT5000 #Robotics #FireBeetle2ESP32E #ESP32 #Display #IoT #Project #Fritzing #Programming #Electronics #Microcontrollers #Consultant &#8212;&#8212; &#8212;&#8212; &#8212;&#8212; &#8212;&#8212; TCRT5000 Optical Infrared Line Follower The TCRT5000 is an infrared optical sensor widely used as a line follower in mobile robots and proximity detection systems. It consists of an infrared emitter (IR LED) and a phototransistor &#8230; <a title=\"Project #12: Robotics \u2013 TCRT5000 \u2013 Mk40\" class=\"read-more\" href=\"https:\/\/www.donluc.com\/?p=4899\" aria-label=\"Read more about Project #12: Robotics \u2013 TCRT5000 \u2013 Mk40\">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":[49,38],"tags":[6,92,102,4,320,87,19,83,85,24,9,84,27,95,429,33,34,108],"class_list":["post-4899","post","type-post","status-publish","format-standard","hentry","category-consultant","category-digitalelectronics","tag-arduino","tag-battery","tag-components","tag-consultant","tag-dfrobot","tag-display","tag-electronics","tag-esp32","tag-fritzing","tag-microcontroller","tag-programming","tag-programming-esp32","tag-projects-2","tag-robotic","tag-tcrt5000","tag-technology","tag-video-blog","tag-vlog"],"_links":{"self":[{"href":"https:\/\/www.donluc.com\/index.php?rest_route=\/wp\/v2\/posts\/4899","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=4899"}],"version-history":[{"count":1,"href":"https:\/\/www.donluc.com\/index.php?rest_route=\/wp\/v2\/posts\/4899\/revisions"}],"predecessor-version":[{"id":4904,"href":"https:\/\/www.donluc.com\/index.php?rest_route=\/wp\/v2\/posts\/4899\/revisions\/4904"}],"wp:attachment":[{"href":"https:\/\/www.donluc.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4899"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.donluc.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4899"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.donluc.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4899"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}