<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://community.element14.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>How to Control a LEGO Mindstorms kit with AI and Raspberry Pi 5 -- Episode 657</title><link>https://community.element14.com/challenges-projects/element14-presents/project-videos/w/documents/71833/how-to-control-a-lego-mindstorms-kit-with-ai-and-raspberry-pi-5----episode-657</link><description /><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>How to Control a LEGO Mindstorms kit with AI and Raspberry Pi 5 -- Episode 657</title><link>https://community.element14.com/challenges-projects/element14-presents/project-videos/w/documents/71833/how-to-control-a-lego-mindstorms-kit-with-ai-and-raspberry-pi-5----episode-657</link><pubDate>Thu, 27 Jun 2024 15:09:55 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:e2ca945a-0abd-43ad-9ee3-5fbffab3a563</guid><dc:creator>vivekvelusamy</dc:creator><comments>https://community.element14.com/challenges-projects/element14-presents/project-videos/w/documents/71833/how-to-control-a-lego-mindstorms-kit-with-ai-and-raspberry-pi-5----episode-657#comments</comments><description>Current Revision posted to Documents by vivekvelusamy on 6/27/2024 3:09:55 PM&lt;br /&gt;
&lt;p&gt;&lt;span class="TextRun SCXW260443923 BCX0" lang="EN-GB" data-contrast="auto"&gt;&lt;span class="NormalTextRun SCXW260443923 BCX0"&gt;In this episode, Andy West takes us on a journey to modernize a classic LEGO Mindstorms kit from 1998 using the latest Raspberry Pi 5. Follow along as Andy transforms this vintage toy into an AI-powered trash sorting robot. &lt;/span&gt;&lt;span class="NormalTextRun SCXW260443923 BCX0"&gt;Let&amp;rsquo;s&lt;/span&gt;&lt;span class="NormalTextRun SCXW260443923 BCX0"&gt; dive into the project!&lt;/span&gt;&lt;/span&gt;&lt;span class="EOP SCXW260443923 BCX0"&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;h2 id="mcetoc_1i1cq106q0"&gt;&lt;span class="EOP SCXW260443923 BCX0"&gt;Watch the Video:&lt;/span&gt;&lt;/h2&gt;
&lt;p&gt;&lt;span class="EOP SCXW260443923 BCX0"&gt;&lt;a href="https://www.youtube.com/watch?v=UqUG2VUFsrg"&gt;www.youtube.com/watch&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span data-contrast="none"&gt;&lt;a href="#downloads" data-e14adj="t"&gt;Downloads and Links&lt;/a&gt; | &lt;a href="#BOM" data-e14adj="t"&gt;Bill of Material&lt;/a&gt; | &lt;a href="#discussion" data-e14adj="t"&gt;Discussion&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;
&lt;h2 id="mcetoc_1i1cq2qed1"&gt;&lt;span data-contrast="none"&gt;What do we Have Here?&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/h2&gt;
&lt;p&gt;&lt;span data-contrast="auto"&gt;Andy kicks off the episode with the discovery of a never-used LEGO Mindstorms Robotics kit from the late &amp;#39;90s. Originally designed for Windows 95 and requiring a serial port for programming, this kit seemed destined for obsolescence. However, Andy sees its potential as a perfect STEM-related project for his kids. If only he can bring it up to date!&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;img alt="image" style="max-height:360px;max-width:640px;"  src="/cfs-file/__key/communityserver-wikis-components-files/00-00-00-03-81/Episode-657-_2D00_-Lego-Mindstorms_5F00_V1.00_5F00_00_5F00_29_5F00_12.Still003.bmp" /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;h2 id="mcetoc_1i1cq32782"&gt;&lt;span data-contrast="none"&gt;Modernizing the LEGO Mindstorms Kit&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/h2&gt;
&lt;p&gt;&lt;span data-contrast="auto"&gt;The first step in this modernization project involves connecting the infra-red tower from the kit to a Raspberry Pi, which supports USB to serial communication right out of the box. Andy replaces the outdated software with a web-based graphical programming interface, enabling real-time robot control. Further enhancement will include a camera to use with image-identification machine learning / artificial intelligence or some other vision API and then build a robot out of the LEGO parts.&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;img loading="lazy" alt="image" style="max-height:360px;max-width:640px;"  src="/cfs-file/__key/communityserver-wikis-components-files/00-00-00-03-81/Episode-657-_2D00_-Lego-Mindstorms_5F00_V1.00_5F00_01_5F00_07_5F00_00.Still004.bmp" /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;h2 id="mcetoc_1i1cq3bgq3"&gt;&lt;span data-contrast="none"&gt;Hardware Challenges and Solutions&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/h2&gt;
&lt;p&gt;&lt;span data-contrast="auto"&gt;Upon examining the kit, Andy finds the wires for the motors and sensors in poor condition, with insulation disintegrating. He replaces the cables and carefully cleans the components to ensure everything is in working order. Andy then tests the restored components with the original programmable brick, confirming their functionality.&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;img loading="lazy" alt="image" style="max-height:360px;max-width:640px;"  src="/cfs-file/__key/communityserver-wikis-components-files/00-00-00-03-81/Episode-657-_2D00_-Lego-Mindstorms_5F00_V1.00_5F00_01_5F00_38_5F00_18.Still005.bmp" /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;h2 id="mcetoc_1i1cq3j3v4"&gt;&lt;span data-contrast="none"&gt;Programming with Raspberry Pi&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/h2&gt;
&lt;p&gt;&lt;span data-contrast="auto"&gt;Instead of the original Windows 95 software, Andy uses a Raspberry Pi with a USB to serial adapter. He installs the operating system on the Raspberry Pi and sets up NQC (Not Quite C), a C-like language for programming the Mindstorms computer. With the firmware uploaded successfully, it&amp;rsquo;s time to create a modern programming environment.&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;img loading="lazy" alt="image" style="max-height:360px;max-width:640px;"  src="/cfs-file/__key/communityserver-wikis-components-files/00-00-00-03-81/Episode-657-_2D00_-Lego-Mindstorms_5F00_V1.00_5F00_03_5F00_19_5F00_07.Still007.bmp" /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;h2 id="mcetoc_1i1cq3q0i5"&gt;&lt;span data-contrast="none"&gt;Creating a Web-Based Programming Interface&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/h2&gt;
&lt;p&gt;&lt;span data-contrast="auto"&gt;Andy uses Google&amp;#39;s Blockly library to build a web-based graphical programming environment like Scratch, aimed at making coding accessible for kids. This custom application, named &amp;ldquo;Block Storms&amp;rdquo;, allows users to drag and drop blocks to create Python code for controlling the LEGO motors and sensors.&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;h2 id="mcetoc_1i1cq41b26"&gt;&lt;span data-contrast="none"&gt;Adding AI Capabilities&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/h2&gt;
&lt;p&gt;&lt;span data-contrast="auto"&gt;To add intelligence to the robot, Andy connects a Pi camera to the Raspberry Pi and integrates it with GPT-4 or another vision API. This setup enables the robot to capture images and classify them as trash or recycling using AI.&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;h2 id="mcetoc_1i1cq488f7"&gt;&lt;span data-contrast="none"&gt;Building the Trash Sorting Robot&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/h2&gt;
&lt;p&gt;&lt;span data-contrast="auto"&gt;Andy combines LEGO parts and 3D-printed components to build the trash sorting robot. He uses a touch sensor as a button to activate the camera, which takes a picture and sends it to GPT-4 for classification. The robot then sorts the item into the correct bin based on the AI&amp;rsquo;s response.&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;img loading="lazy" alt="image" style="max-height:360px;max-width:640px;"  src="/cfs-file/__key/communityserver-wikis-components-files/00-00-00-03-81/Episode-657-_2D00_-Lego-Mindstorms_5F00_V1.00_5F00_13_5F00_36_5F00_13.Still012.bmp" /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span data-contrast="auto"&gt;After several successful tests, Andy&amp;rsquo;s trash sorting robot proves to be an effective and educational project. Have you ever revived an old toy or device with modern electronics? Share your experiences in the comments below.&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;h2 id="mcetoc_1i1cq4ugg8"&gt;&lt;span&gt;Downloads and Links:&amp;nbsp;&lt;a id="downloads" rel="noopener noreferrer nofollow" target="_blank" data-e14adj="t"&gt;&lt;/a&gt;&lt;/span&gt;&lt;/h2&gt;
&lt;ul&gt;
&lt;li data-leveltext="-" data-font="Aptos" data-listid="2" data-aria-posinset="0" data-aria-level="1"&gt;&lt;a href="/challenges-projects/element14-presents/m/files/149555" data-e14adj="t"&gt;&lt;strong&gt;Download Code and CAD Files!&lt;/strong&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li data-leveltext="-" data-font="Aptos" data-listid="2" data-aria-posinset="0" data-aria-level="1"&gt;&lt;strong&gt;NQC (Not Quite C): &lt;/strong&gt;&lt;a href="https://bricxcc.sourceforge.net/nqc" rel="noopener noreferrer nofollow" target="_blank" data-e14adj="t"&gt;&lt;span data-contrast="none"&gt;https://bricxcc.sourceforge.net/nqc&lt;/span&gt;&lt;/a&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;ul&gt;
&lt;li data-leveltext="-" data-font="Aptos" data-listid="2" data-aria-posinset="1" data-aria-level="1"&gt;&lt;strong&gt;Google&amp;rsquo;s Blockly: &lt;/strong&gt;&lt;a href="https://developers.google.com/blockly" rel="noopener noreferrer nofollow" target="_blank" data-e14adj="t"&gt;&lt;span data-contrast="none"&gt;https://developers.google.com/blockly&lt;/span&gt;&lt;/a&gt;&lt;span data-contrast="auto"&gt;&amp;nbsp;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/li&gt;
&lt;li data-leveltext="-" data-font="Aptos" data-listid="2" data-aria-posinset="1" data-aria-level="1"&gt;&lt;span&gt;&lt;strong&gt;Github Repo:&lt;/strong&gt;&amp;nbsp;&lt;a href="https://github.com/andy-west/lego-ai-robot" rel="noopener noreferrer nofollow" target="_blank" data-e14adj="t"&gt;https://github.com/andy-west/lego-ai-robot&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="mcetoc_1i1cqm19l1"&gt;Bill of Material:&amp;nbsp;&lt;a id="BOM" rel="noopener noreferrer nofollow" target="_blank" data-e14adj="t"&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;table class="e14-product-bom-main"&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;th&gt;Product Name&lt;/th&gt;
&lt;th&gt;Manufacturer&lt;/th&gt;
&lt;th&gt;Quantity&lt;/th&gt;
&lt;th&gt;&lt;a id="e14-product-link-979a6" data-at-areainteracted="rte-content" data-at-type="click" data-at-link-type="button" href="https://referral.element14.com/OrderCodeView?fsku=4255998&amp;nsku=81AK1346&amp;COM=e14c-noscript&amp;CMP=e14c-noscript&amp;osetc=e14-noscript-tracking-loss" data-at-label="PRODUCT_POPUP_OPEN"class="e14-embedded e14_shopping-cart-far e14-button" onclick="event.preventDefault();e14.func.displayProduct(e14.meta.user.country, this, 'embedded-link', e14.func.getProductLinkJSON('979a6'));" data-farnell="4255998" data-newark="81AK1346" data-comoverride="" data-cmpoverride="" data-cpc="" data-avnetemea="" data-avnetema="" data-avnetasia="" &gt;Buy Kit&lt;/a&gt; &lt;/th&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;RASPBERRY-PI RPI5-4GB-SINGLE&lt;/td&gt;
&lt;td&gt;RASPBERRY-PI&lt;/td&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;&lt;a id="e14-product-link-5dd0c" data-at-areainteracted="rte-content" data-at-type="click" data-at-link-type="button" href="https://referral.element14.com/OrderCodeView?fsku=4255998&amp;nsku=81AK1346&amp;COM=e14c-noscript&amp;CMP=e14c-noscript&amp;osetc=e14-noscript-tracking-loss" data-at-label="PRODUCT_POPUP_OPEN"class="e14-embedded e14_shopping-cart-far e14-button" onclick="event.preventDefault();e14.func.displayProduct(e14.meta.user.country, this, 'embedded-link', e14.func.getProductLinkJSON('5dd0c'));" data-farnell="4255998" data-newark="81AK1346" data-comoverride="" data-cmpoverride="" data-cpc="" data-avnetemea="" data-avnetema="" data-avnetasia="" &gt;Buy Now&lt;/a&gt; &lt;/td&gt;
&lt;/tr&gt;
&lt;tr class="xs-hide"&gt;
&lt;td&gt;&amp;nbsp;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h2 id="mcetoc_1i1cqmkog2"&gt;Additional Parts:&lt;/h2&gt;
&lt;table&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;span&gt;Flexible, 24-gauge 2-pin silicone ribbon cable, stranded tinned copper wire&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;LEGO Mindstorms Robotics Kit&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;div style="background:#ffffff;border:1px solid #dadada;margin:0;padding:14px 16px 16px 18px;position:relative;vertical-align:top;"&gt;
&lt;div style="display:inline-block;float:left;height:150px;padding:0px 25px 8px 0px;"&gt;&lt;a href="/challengesprojects/element14-presents/" data-e14adj="t"&gt;&lt;img loading="lazy" alt="element14 presents" src="/e14/assets/legacy/2018/e14PresentsJune818.png" width="180px" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style="display:inline-block;vertical-align:top;width:70%;"&gt;&lt;br /&gt;
&lt;p style="margin:0;"&gt;&lt;span&gt;&lt;a class="jivecontainerTT-hover-container jive-link-community-small" href="/challengesprojects/element14-presents/" data-e14adj="t"&gt;element14 presents&lt;/a&gt;&lt;/span&gt;&amp;nbsp; &lt;strong&gt;|&lt;/strong&gt;&amp;nbsp; &lt;a class="jive-link-wiki-small" href="/challengesprojects/element14-presents/vcp-program/w/documents/3724/vcp-biography-andy-west" data-e14adj="t"&gt;About Andy West&lt;/a&gt; &lt;strong&gt;|&lt;/strong&gt;&amp;nbsp; &lt;a class="jivecontainerTT-hover-container jive-link-community-small" href="/challengesprojects/element14-presents/project-videos/" data-e14adj="t"&gt;Project Videos&lt;/a&gt;&amp;nbsp;&lt;a id="discussion" rel="noopener noreferrer nofollow" target="_blank" data-e14adj="t"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p style="margin:0;"&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;

&lt;div style="font-size: 90%;"&gt;Tags: python programming, Blockly programming, Educational robotics, raspberry pi 5, USB to serial adapter, AI vision API, e14p_AW, raspberry pi projects, Pi camera module, AI Robot, Machine learning robotics, stem education, Vintage tech revival, Trash sorting robot, diy electronics, friday_release, LEGO Mindstorms&lt;/div&gt;
</description></item><item><title>How to Control a LEGO Mindstorms kit with AI and Raspberry Pi 5 -- Episode 657</title><link>https://community.element14.com/challenges-projects/element14-presents/project-videos/w/documents/71833/how-to-control-a-lego-mindstorms-kit-with-ai-and-raspberry-pi-5----episode-657/revision/6</link><pubDate>Thu, 27 Jun 2024 15:09:55 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:e2ca945a-0abd-43ad-9ee3-5fbffab3a563</guid><dc:creator>tariq.ahmad</dc:creator><comments>https://community.element14.com/challenges-projects/element14-presents/project-videos/w/documents/71833/how-to-control-a-lego-mindstorms-kit-with-ai-and-raspberry-pi-5----episode-657#comments</comments><description>Revision 6 posted to Documents by tariq.ahmad on 6/27/2024 3:09:55 PM&lt;br /&gt;
&lt;p&gt;&lt;span class="TextRun SCXW260443923 BCX0" lang="EN-GB" data-contrast="auto"&gt;&lt;span class="NormalTextRun SCXW260443923 BCX0"&gt;In this episode, Andy West takes us on a journey to modernize a classic LEGO Mindstorms kit from 1998 using the latest Raspberry Pi 5. Follow along as Andy transforms this vintage toy into an AI-powered trash sorting robot. &lt;/span&gt;&lt;span class="NormalTextRun SCXW260443923 BCX0"&gt;Let&amp;rsquo;s&lt;/span&gt;&lt;span class="NormalTextRun SCXW260443923 BCX0"&gt; dive into the project!&lt;/span&gt;&lt;/span&gt;&lt;span class="EOP SCXW260443923 BCX0"&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;h2 id="mcetoc_1i1cq106q0"&gt;&lt;span class="EOP SCXW260443923 BCX0"&gt;Watch the Video:&lt;/span&gt;&lt;/h2&gt;
&lt;p&gt;&lt;span class="EOP SCXW260443923 BCX0"&gt;&lt;a href="https://www.youtube.com/watch?v=UqUG2VUFsrg"&gt;www.youtube.com/watch&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span data-contrast="none"&gt;&lt;a href="#downloads" data-e14adj="t"&gt;Downloads and Links&lt;/a&gt; | &lt;a href="#BOM" data-e14adj="t"&gt;Bill of Material&lt;/a&gt; | &lt;a href="#discussion" data-e14adj="t"&gt;Discussion&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;
&lt;h2 id="mcetoc_1i1cq2qed1"&gt;&lt;span data-contrast="none"&gt;What do we Have Here?&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/h2&gt;
&lt;p&gt;&lt;span data-contrast="auto"&gt;Andy kicks off the episode with the discovery of a never-used LEGO Mindstorms Robotics kit from the late &amp;#39;90s. Originally designed for Windows 95 and requiring a serial port for programming, this kit seemed destined for obsolescence. However, Andy sees its potential as a perfect STEM-related project for his kids. If only he can bring it up to date!&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;img alt="image" style="max-height:360px;max-width:640px;"  src="/cfs-file/__key/communityserver-wikis-components-files/00-00-00-04-35/Episode-657-_2D00_-Lego-Mindstorms_5F00_V1.00_5F00_00_5F00_29_5F00_12.Still003.bmp" /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;h2 id="mcetoc_1i1cq32782"&gt;&lt;span data-contrast="none"&gt;Modernizing the LEGO Mindstorms Kit&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/h2&gt;
&lt;p&gt;&lt;span data-contrast="auto"&gt;The first step in this modernization project involves connecting the infra-red tower from the kit to a Raspberry Pi, which supports USB to serial communication right out of the box. Andy replaces the outdated software with a web-based graphical programming interface, enabling real-time robot control. Further enhancement will include a camera to use with image-identification machine learning / artificial intelligence or some other vision API and then build a robot out of the LEGO parts.&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;img loading="lazy" alt="image" style="max-height:360px;max-width:640px;"  src="/cfs-file/__key/communityserver-wikis-components-files/00-00-00-04-35/Episode-657-_2D00_-Lego-Mindstorms_5F00_V1.00_5F00_01_5F00_07_5F00_00.Still004.bmp" /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;h2 id="mcetoc_1i1cq3bgq3"&gt;&lt;span data-contrast="none"&gt;Hardware Challenges and Solutions&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/h2&gt;
&lt;p&gt;&lt;span data-contrast="auto"&gt;Upon examining the kit, Andy finds the wires for the motors and sensors in poor condition, with insulation disintegrating. He replaces the cables and carefully cleans the components to ensure everything is in working order. Andy then tests the restored components with the original programmable brick, confirming their functionality.&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;img loading="lazy" alt="image" style="max-height:360px;max-width:640px;"  src="/cfs-file/__key/communityserver-wikis-components-files/00-00-00-04-35/Episode-657-_2D00_-Lego-Mindstorms_5F00_V1.00_5F00_01_5F00_38_5F00_18.Still005.bmp" /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;h2 id="mcetoc_1i1cq3j3v4"&gt;&lt;span data-contrast="none"&gt;Programming with Raspberry Pi&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/h2&gt;
&lt;p&gt;&lt;span data-contrast="auto"&gt;Instead of the original Windows 95 software, Andy uses a Raspberry Pi with a USB to serial adapter. He installs the operating system on the Raspberry Pi and sets up NQC (Not Quite C), a C-like language for programming the Mindstorms computer. With the firmware uploaded successfully, it&amp;rsquo;s time to create a modern programming environment.&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;img loading="lazy" alt="image" style="max-height:360px;max-width:640px;"  src="/cfs-file/__key/communityserver-wikis-components-files/00-00-00-04-35/Episode-657-_2D00_-Lego-Mindstorms_5F00_V1.00_5F00_03_5F00_19_5F00_07.Still007.bmp" /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;h2 id="mcetoc_1i1cq3q0i5"&gt;&lt;span data-contrast="none"&gt;Creating a Web-Based Programming Interface&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/h2&gt;
&lt;p&gt;&lt;span data-contrast="auto"&gt;Andy uses Google&amp;#39;s Blockly library to build a web-based graphical programming environment like Scratch, aimed at making coding accessible for kids. This custom application, named &amp;ldquo;Block Storms&amp;rdquo;, allows users to drag and drop blocks to create Python code for controlling the LEGO motors and sensors.&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;h2 id="mcetoc_1i1cq41b26"&gt;&lt;span data-contrast="none"&gt;Adding AI Capabilities&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/h2&gt;
&lt;p&gt;&lt;span data-contrast="auto"&gt;To add intelligence to the robot, Andy connects a Pi camera to the Raspberry Pi and integrates it with GPT-4 or another vision API. This setup enables the robot to capture images and classify them as trash or recycling using AI.&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;h2 id="mcetoc_1i1cq488f7"&gt;&lt;span data-contrast="none"&gt;Building the Trash Sorting Robot&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/h2&gt;
&lt;p&gt;&lt;span data-contrast="auto"&gt;Andy combines LEGO parts and 3D-printed components to build the trash sorting robot. He uses a touch sensor as a button to activate the camera, which takes a picture and sends it to GPT-4 for classification. The robot then sorts the item into the correct bin based on the AI&amp;rsquo;s response.&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;img loading="lazy" alt="image" style="max-height:360px;max-width:640px;"  src="/cfs-file/__key/communityserver-wikis-components-files/00-00-00-04-35/Episode-657-_2D00_-Lego-Mindstorms_5F00_V1.00_5F00_13_5F00_36_5F00_13.Still012.bmp" /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span data-contrast="auto"&gt;After several successful tests, Andy&amp;rsquo;s trash sorting robot proves to be an effective and educational project. Have you ever revived an old toy or device with modern electronics? Share your experiences in the comments below.&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;h2 id="mcetoc_1i1cq4ugg8"&gt;&lt;span&gt;Downloads and Links:&amp;nbsp;&lt;a id="downloads" rel="noopener noreferrer nofollow" target="_blank" data-e14adj="t"&gt;&lt;/a&gt;&lt;/span&gt;&lt;/h2&gt;
&lt;ul&gt;
&lt;li data-leveltext="-" data-font="Aptos" data-listid="2" data-aria-posinset="0" data-aria-level="1"&gt;&lt;a href="/challenges-projects/element14-presents/m/files/149555" data-e14adj="t"&gt;&lt;strong&gt;Download Code and CAD Files!&lt;/strong&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li data-leveltext="-" data-font="Aptos" data-listid="2" data-aria-posinset="0" data-aria-level="1"&gt;&lt;strong&gt;NQC (Not Quite C): &lt;/strong&gt;&lt;a href="https://bricxcc.sourceforge.net/nqc" rel="noopener noreferrer nofollow" target="_blank" data-e14adj="t"&gt;&lt;span data-contrast="none"&gt;https://bricxcc.sourceforge.net/nqc&lt;/span&gt;&lt;/a&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;ul&gt;
&lt;li data-leveltext="-" data-font="Aptos" data-listid="2" data-aria-posinset="1" data-aria-level="1"&gt;&lt;strong&gt;Google&amp;rsquo;s Blockly: &lt;/strong&gt;&lt;a href="https://developers.google.com/blockly" rel="noopener noreferrer nofollow" target="_blank" data-e14adj="t"&gt;&lt;span data-contrast="none"&gt;https://developers.google.com/blockly&lt;/span&gt;&lt;/a&gt;&lt;span data-contrast="auto"&gt;&amp;nbsp;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/li&gt;
&lt;li data-leveltext="-" data-font="Aptos" data-listid="2" data-aria-posinset="1" data-aria-level="1"&gt;&lt;span&gt;&lt;strong&gt;Github Repo:&lt;/strong&gt;&amp;nbsp;&lt;a href="https://github.com/andy-west/lego-ai-robot" rel="noopener noreferrer nofollow" target="_blank" data-e14adj="t"&gt;https://github.com/andy-west/lego-ai-robot&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="mcetoc_1i1cqm19l1"&gt;Bill of Material:&amp;nbsp;&lt;a id="BOM" rel="noopener noreferrer nofollow" target="_blank" data-e14adj="t"&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;table class="e14-product-bom-main"&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;th&gt;Product Name&lt;/th&gt;
&lt;th&gt;Manufacturer&lt;/th&gt;
&lt;th&gt;Quantity&lt;/th&gt;
&lt;th&gt;&lt;a id="e14-product-link-87af1" data-at-areainteracted="rte-content" data-at-type="click" data-at-link-type="button" href="https://referral.element14.com/OrderCodeView?fsku=4255998&amp;nsku=81AK1346&amp;COM=e14c-noscript&amp;CMP=e14c-noscript&amp;osetc=e14-noscript-tracking-loss" data-at-label="PRODUCT_POPUP_OPEN"class="e14-embedded e14_shopping-cart-far e14-button" onclick="event.preventDefault();e14.func.displayProduct(e14.meta.user.country, this, 'embedded-link', e14.func.getProductLinkJSON('87af1'));" data-farnell="4255998" data-newark="81AK1346" data-comoverride="" data-cmpoverride="" data-cpc="" data-avnetemea="" data-avnetema="" data-avnetasia="" &gt;Buy Kit&lt;/a&gt; &lt;/th&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;RASPBERRY-PI RPI5-4GB-SINGLE&lt;/td&gt;
&lt;td&gt;RASPBERRY-PI&lt;/td&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;&lt;a id="e14-product-link-aab76" data-at-areainteracted="rte-content" data-at-type="click" data-at-link-type="button" href="https://referral.element14.com/OrderCodeView?fsku=4255998&amp;nsku=81AK1346&amp;COM=e14c-noscript&amp;CMP=e14c-noscript&amp;osetc=e14-noscript-tracking-loss" data-at-label="PRODUCT_POPUP_OPEN"class="e14-embedded e14_shopping-cart-far e14-button" onclick="event.preventDefault();e14.func.displayProduct(e14.meta.user.country, this, 'embedded-link', e14.func.getProductLinkJSON('aab76'));" data-farnell="4255998" data-newark="81AK1346" data-comoverride="" data-cmpoverride="" data-cpc="" data-avnetemea="" data-avnetema="" data-avnetasia="" &gt;Buy Now&lt;/a&gt; &lt;/td&gt;
&lt;/tr&gt;
&lt;tr class="xs-hide"&gt;
&lt;td&gt;&amp;nbsp;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h2 id="mcetoc_1i1cqmkog2"&gt;Additional Parts:&lt;/h2&gt;
&lt;table&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;span&gt;Flexible, 24-gauge 2-pin silicone ribbon cable, stranded tinned copper wire&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;LEGO Mindstorms Robotics Kit&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;div style="background:#ffffff;border:1px solid #dadada;margin:0;padding:14px 16px 16px 18px;position:relative;vertical-align:top;"&gt;
&lt;div style="display:inline-block;float:left;height:150px;padding:0px 25px 8px 0px;"&gt;&lt;a href="/challengesprojects/element14-presents/" data-e14adj="t"&gt;&lt;img loading="lazy" alt="element14 presents" src="/e14/assets/legacy/2018/e14PresentsJune818.png" width="180px" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style="display:inline-block;vertical-align:top;width:70%;"&gt;&lt;br /&gt;
&lt;p style="margin:0;"&gt;&lt;span&gt;&lt;a class="jivecontainerTT-hover-container jive-link-community-small" href="/challengesprojects/element14-presents/" data-e14adj="t"&gt;element14 presents&lt;/a&gt;&lt;/span&gt;&amp;nbsp; &lt;strong&gt;|&lt;/strong&gt;&amp;nbsp; &lt;a class="jive-link-wiki-small" href="/challengesprojects/element14-presents/vcp-program/w/documents/3724/vcp-biography-andy-west" data-e14adj="t"&gt;About Andy West&lt;/a&gt; &lt;strong&gt;|&lt;/strong&gt;&amp;nbsp; &lt;a class="jivecontainerTT-hover-container jive-link-community-small" href="/challengesprojects/element14-presents/project-videos/" data-e14adj="t"&gt;Project Videos&lt;/a&gt;&amp;nbsp;&lt;a id="discussion" rel="noopener noreferrer nofollow" target="_blank" data-e14adj="t"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p style="margin:0;"&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;

&lt;div style="font-size: 90%;"&gt;Tags: python programming, Blockly programming, Educational robotics, raspberry pi 5, USB to serial adapter, AI vision API, e14p_AW, raspberry pi projects, Pi camera module, AI Robot, Machine learning robotics, stem education, Vintage tech revival, Trash sorting robot, diy electronics, friday_release, LEGO Mindstorms&lt;/div&gt;
</description></item><item><title>Making 90s Lego Mindstorms Robotics Kit Work with a Raspberry Pi 5 -- Episode 657</title><link>https://community.element14.com/challenges-projects/element14-presents/project-videos/w/documents/71833/how-to-control-a-lego-mindstorms-kit-with-ai-and-raspberry-pi-5----episode-657/revision/5</link><pubDate>Thu, 27 Jun 2024 12:50:37 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:e2ca945a-0abd-43ad-9ee3-5fbffab3a563</guid><dc:creator>cstanton</dc:creator><comments>https://community.element14.com/challenges-projects/element14-presents/project-videos/w/documents/71833/how-to-control-a-lego-mindstorms-kit-with-ai-and-raspberry-pi-5----episode-657#comments</comments><description>Revision 5 posted to Documents by cstanton on 6/27/2024 12:50:37 PM&lt;br /&gt;
&lt;p&gt;&lt;span class="TextRun SCXW260443923 BCX0" lang="EN-GB" data-contrast="auto"&gt;&lt;span class="NormalTextRun SCXW260443923 BCX0"&gt;In this episode, Andy West takes us on a journey to modernize a classic LEGO Mindstorms kit from 1998 using the latest Raspberry Pi 5. Follow along as Andy transforms this vintage toy into an AI-powered trash sorting robot. &lt;/span&gt;&lt;span class="NormalTextRun SCXW260443923 BCX0"&gt;Let&amp;rsquo;s&lt;/span&gt;&lt;span class="NormalTextRun SCXW260443923 BCX0"&gt; dive into the project!&lt;/span&gt;&lt;/span&gt;&lt;span class="EOP SCXW260443923 BCX0"&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;h2 id="mcetoc_1i1cq106q0"&gt;&lt;span class="EOP SCXW260443923 BCX0"&gt;Watch the Video:&lt;/span&gt;&lt;/h2&gt;
&lt;p&gt;&lt;span class="EOP SCXW260443923 BCX0"&gt;&lt;a href="https://www.youtube.com/watch?v=UqUG2VUFsrg"&gt;www.youtube.com/watch&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span data-contrast="none"&gt;&lt;a href="#downloads" data-e14adj="t"&gt;Downloads and Links&lt;/a&gt; | &lt;a href="#BOM" data-e14adj="t"&gt;Bill of Material&lt;/a&gt; | &lt;a href="#discussion" data-e14adj="t"&gt;Discussion&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;
&lt;h2 id="mcetoc_1i1cq2qed1"&gt;&lt;span data-contrast="none"&gt;What do we Have Here?&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/h2&gt;
&lt;p&gt;&lt;span data-contrast="auto"&gt;Andy kicks off the episode with the discovery of a never-used LEGO Mindstorms Robotics kit from the late &amp;#39;90s. Originally designed for Windows 95 and requiring a serial port for programming, this kit seemed destined for obsolescence. However, Andy sees its potential as a perfect STEM-related project for his kids. If only he can bring it up to date!&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;img alt="image" style="max-height:360px;max-width:640px;"  src="/cfs-file/__key/communityserver-wikis-components-files/00-00-00-04-35/Episode-657-_2D00_-Lego-Mindstorms_5F00_V1.00_5F00_00_5F00_29_5F00_12.Still003.bmp" /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;h2 id="mcetoc_1i1cq32782"&gt;&lt;span data-contrast="none"&gt;Modernizing the LEGO Mindstorms Kit&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/h2&gt;
&lt;p&gt;&lt;span data-contrast="auto"&gt;The first step in this modernization project involves connecting the infra-red tower from the kit to a Raspberry Pi, which supports USB to serial communication right out of the box. Andy replaces the outdated software with a web-based graphical programming interface, enabling real-time robot control. Further enhancement will include a camera to use with image-identification machine learning / artificial intelligence or some other vision API and then build a robot out of the LEGO parts.&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;img loading="lazy" alt="image" style="max-height:360px;max-width:640px;"  src="/cfs-file/__key/communityserver-wikis-components-files/00-00-00-04-35/Episode-657-_2D00_-Lego-Mindstorms_5F00_V1.00_5F00_01_5F00_07_5F00_00.Still004.bmp" /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;h2 id="mcetoc_1i1cq3bgq3"&gt;&lt;span data-contrast="none"&gt;Hardware Challenges and Solutions&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/h2&gt;
&lt;p&gt;&lt;span data-contrast="auto"&gt;Upon examining the kit, Andy finds the wires for the motors and sensors in poor condition, with insulation disintegrating. He replaces the cables and carefully cleans the components to ensure everything is in working order. Andy then tests the restored components with the original programmable brick, confirming their functionality.&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;img loading="lazy" alt="image" style="max-height:360px;max-width:640px;"  src="/cfs-file/__key/communityserver-wikis-components-files/00-00-00-04-35/Episode-657-_2D00_-Lego-Mindstorms_5F00_V1.00_5F00_01_5F00_38_5F00_18.Still005.bmp" /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;h2 id="mcetoc_1i1cq3j3v4"&gt;&lt;span data-contrast="none"&gt;Programming with Raspberry Pi&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/h2&gt;
&lt;p&gt;&lt;span data-contrast="auto"&gt;Instead of the original Windows 95 software, Andy uses a Raspberry Pi with a USB to serial adapter. He installs the operating system on the Raspberry Pi and sets up NQC (Not Quite C), a C-like language for programming the Mindstorms computer. With the firmware uploaded successfully, it&amp;rsquo;s time to create a modern programming environment.&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;img loading="lazy" alt="image" style="max-height:360px;max-width:640px;"  src="/cfs-file/__key/communityserver-wikis-components-files/00-00-00-04-35/Episode-657-_2D00_-Lego-Mindstorms_5F00_V1.00_5F00_03_5F00_19_5F00_07.Still007.bmp" /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;h2 id="mcetoc_1i1cq3q0i5"&gt;&lt;span data-contrast="none"&gt;Creating a Web-Based Programming Interface&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/h2&gt;
&lt;p&gt;&lt;span data-contrast="auto"&gt;Andy uses Google&amp;#39;s Blockly library to build a web-based graphical programming environment like Scratch, aimed at making coding accessible for kids. This custom application, named &amp;ldquo;Block Storms&amp;rdquo;, allows users to drag and drop blocks to create Python code for controlling the LEGO motors and sensors.&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;h2 id="mcetoc_1i1cq41b26"&gt;&lt;span data-contrast="none"&gt;Adding AI Capabilities&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/h2&gt;
&lt;p&gt;&lt;span data-contrast="auto"&gt;To add intelligence to the robot, Andy connects a Pi camera to the Raspberry Pi and integrates it with GPT-4 or another vision API. This setup enables the robot to capture images and classify them as trash or recycling using AI.&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;h2 id="mcetoc_1i1cq488f7"&gt;&lt;span data-contrast="none"&gt;Building the Trash Sorting Robot&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/h2&gt;
&lt;p&gt;&lt;span data-contrast="auto"&gt;Andy combines LEGO parts and 3D-printed components to build the trash sorting robot. He uses a touch sensor as a button to activate the camera, which takes a picture and sends it to GPT-4 for classification. The robot then sorts the item into the correct bin based on the AI&amp;rsquo;s response.&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;img loading="lazy" alt="image" style="max-height:360px;max-width:640px;"  src="/cfs-file/__key/communityserver-wikis-components-files/00-00-00-04-35/Episode-657-_2D00_-Lego-Mindstorms_5F00_V1.00_5F00_13_5F00_36_5F00_13.Still012.bmp" /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span data-contrast="auto"&gt;After several successful tests, Andy&amp;rsquo;s trash sorting robot proves to be an effective and educational project. Have you ever revived an old toy or device with modern electronics? Share your experiences in the comments below.&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;h2 id="mcetoc_1i1cq4ugg8"&gt;&lt;span&gt;Downloads and Links:&amp;nbsp;&lt;a id="downloads" rel="noopener noreferrer nofollow" target="_blank" data-e14adj="t"&gt;&lt;/a&gt;&lt;/span&gt;&lt;/h2&gt;
&lt;ul&gt;
&lt;li data-leveltext="-" data-font="Aptos" data-listid="2" data-aria-posinset="0" data-aria-level="1"&gt;&lt;a href="/challenges-projects/element14-presents/m/files/149555" data-e14adj="t"&gt;&lt;strong&gt;Download Code and CAD Files!&lt;/strong&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li data-leveltext="-" data-font="Aptos" data-listid="2" data-aria-posinset="0" data-aria-level="1"&gt;&lt;strong&gt;NQC (Not Quite C): &lt;/strong&gt;&lt;a href="https://bricxcc.sourceforge.net/nqc" rel="noopener noreferrer nofollow" target="_blank" data-e14adj="t"&gt;&lt;span data-contrast="none"&gt;https://bricxcc.sourceforge.net/nqc&lt;/span&gt;&lt;/a&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;ul&gt;
&lt;li data-leveltext="-" data-font="Aptos" data-listid="2" data-aria-posinset="1" data-aria-level="1"&gt;&lt;strong&gt;Google&amp;rsquo;s Blockly: &lt;/strong&gt;&lt;a href="https://developers.google.com/blockly" rel="noopener noreferrer nofollow" target="_blank" data-e14adj="t"&gt;&lt;span data-contrast="none"&gt;https://developers.google.com/blockly&lt;/span&gt;&lt;/a&gt;&lt;span data-contrast="auto"&gt;&amp;nbsp;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/li&gt;
&lt;li data-leveltext="-" data-font="Aptos" data-listid="2" data-aria-posinset="1" data-aria-level="1"&gt;&lt;span&gt;&lt;strong&gt;Github Repo:&lt;/strong&gt;&amp;nbsp;&lt;a href="https://github.com/andy-west/lego-ai-robot" rel="noopener noreferrer nofollow" target="_blank" data-e14adj="t"&gt;https://github.com/andy-west/lego-ai-robot&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="mcetoc_1i1cqm19l1"&gt;Bill of Material:&amp;nbsp;&lt;a id="BOM" rel="noopener noreferrer nofollow" target="_blank" data-e14adj="t"&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;table class="e14-product-bom-main"&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;th&gt;Product Name&lt;/th&gt;
&lt;th&gt;Manufacturer&lt;/th&gt;
&lt;th&gt;Quantity&lt;/th&gt;
&lt;th&gt;&lt;a id="e14-product-link-bfb90" data-at-areainteracted="rte-content" data-at-type="click" data-at-link-type="button" href="https://referral.element14.com/OrderCodeView?fsku=4255998&amp;nsku=81AK1346&amp;COM=e14c-noscript&amp;CMP=e14c-noscript&amp;osetc=e14-noscript-tracking-loss" data-at-label="PRODUCT_POPUP_OPEN"class="e14-embedded e14_shopping-cart-far e14-button" onclick="event.preventDefault();e14.func.displayProduct(e14.meta.user.country, this, 'embedded-link', e14.func.getProductLinkJSON('bfb90'));" data-farnell="4255998" data-newark="81AK1346" data-comoverride="" data-cmpoverride="" data-cpc="" data-avnetemea="" data-avnetema="" data-avnetasia="" &gt;Buy Kit&lt;/a&gt; &lt;/th&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;RASPBERRY-PI RPI5-4GB-SINGLE&lt;/td&gt;
&lt;td&gt;RASPBERRY-PI&lt;/td&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;&lt;a id="e14-product-link-45f05" data-at-areainteracted="rte-content" data-at-type="click" data-at-link-type="button" href="https://referral.element14.com/OrderCodeView?fsku=4255998&amp;nsku=81AK1346&amp;COM=e14c-noscript&amp;CMP=e14c-noscript&amp;osetc=e14-noscript-tracking-loss" data-at-label="PRODUCT_POPUP_OPEN"class="e14-embedded e14_shopping-cart-far e14-button" onclick="event.preventDefault();e14.func.displayProduct(e14.meta.user.country, this, 'embedded-link', e14.func.getProductLinkJSON('45f05'));" data-farnell="4255998" data-newark="81AK1346" data-comoverride="" data-cmpoverride="" data-cpc="" data-avnetemea="" data-avnetema="" data-avnetasia="" &gt;Buy Now&lt;/a&gt; &lt;/td&gt;
&lt;/tr&gt;
&lt;tr class="xs-hide"&gt;
&lt;td&gt;&amp;nbsp;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h2 id="mcetoc_1i1cqmkog2"&gt;Additional Parts:&lt;/h2&gt;
&lt;table&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;span&gt;Flexible, 24-gauge 2-pin silicone ribbon cable, stranded tinned copper wire&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;LEGO Mindstorms Robotics Kit&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;div style="background:#ffffff;border:1px solid #dadada;margin:0;padding:14px 16px 16px 18px;position:relative;vertical-align:top;"&gt;
&lt;div style="display:inline-block;float:left;height:150px;padding:0px 25px 8px 0px;"&gt;&lt;a href="/challengesprojects/element14-presents/" data-e14adj="t"&gt;&lt;img loading="lazy" alt="element14 presents" src="/e14/assets/legacy/2018/e14PresentsJune818.png" width="180px" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style="display:inline-block;vertical-align:top;width:70%;"&gt;&lt;br /&gt;
&lt;p style="margin:0;"&gt;&lt;span&gt;&lt;a class="jivecontainerTT-hover-container jive-link-community-small" href="/challengesprojects/element14-presents/" data-e14adj="t"&gt;element14 presents&lt;/a&gt;&lt;/span&gt;&amp;nbsp; &lt;strong&gt;|&lt;/strong&gt;&amp;nbsp; &lt;a class="jive-link-wiki-small" href="/challengesprojects/element14-presents/vcp-program/w/documents/3724/vcp-biography-andy-west" data-e14adj="t"&gt;About Andy West&lt;/a&gt; &lt;strong&gt;|&lt;/strong&gt;&amp;nbsp; &lt;a class="jivecontainerTT-hover-container jive-link-community-small" href="/challengesprojects/element14-presents/project-videos/" data-e14adj="t"&gt;Project Videos&lt;/a&gt;&amp;nbsp;&lt;a id="discussion" rel="noopener noreferrer nofollow" target="_blank" data-e14adj="t"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p style="margin:0;"&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;

&lt;div style="font-size: 90%;"&gt;Tags: python programming, Blockly programming, Educational robotics, raspberry pi 5, USB to serial adapter, AI vision API, e14p_AW, raspberry pi projects, Pi camera module, AI Robot, Machine learning robotics, stem education, Vintage tech revival, Trash sorting robot, diy electronics, friday_release, LEGO Mindstorms&lt;/div&gt;
</description></item><item><title>Making 90s Lego Mindstorms Robotics Kit Work with a Raspberry Pi 5 -- Episode 657</title><link>https://community.element14.com/challenges-projects/element14-presents/project-videos/w/documents/71833/how-to-control-a-lego-mindstorms-kit-with-ai-and-raspberry-pi-5----episode-657/revision/4</link><pubDate>Thu, 27 Jun 2024 12:47:56 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:e2ca945a-0abd-43ad-9ee3-5fbffab3a563</guid><dc:creator>tariq.ahmad</dc:creator><comments>https://community.element14.com/challenges-projects/element14-presents/project-videos/w/documents/71833/how-to-control-a-lego-mindstorms-kit-with-ai-and-raspberry-pi-5----episode-657#comments</comments><description>Revision 4 posted to Documents by tariq.ahmad on 6/27/2024 12:47:56 PM&lt;br /&gt;
&lt;p&gt;&lt;span class="TextRun SCXW260443923 BCX0" lang="EN-GB" data-contrast="auto"&gt;&lt;span class="NormalTextRun SCXW260443923 BCX0"&gt;In this episode, Andy West takes us on a journey to modernize a classic LEGO Mindstorms kit from 1998 using the latest Raspberry Pi 5. Follow along as Andy transforms this vintage toy into an AI-powered trash sorting robot. &lt;/span&gt;&lt;span class="NormalTextRun SCXW260443923 BCX0"&gt;Let&amp;rsquo;s&lt;/span&gt;&lt;span class="NormalTextRun SCXW260443923 BCX0"&gt; dive into the project!&lt;/span&gt;&lt;/span&gt;&lt;span class="EOP SCXW260443923 BCX0"&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;h2 id="mcetoc_1i1cq106q0"&gt;&lt;span class="EOP SCXW260443923 BCX0"&gt;Watch the Video:&lt;/span&gt;&lt;/h2&gt;
&lt;p&gt;&lt;span class="EOP SCXW260443923 BCX0"&gt;&lt;a href="https://www.youtube.com/watch?v=UqUG2VUFsrg"&gt;www.youtube.com/watch&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span data-contrast="none"&gt;&lt;a href="#downloads" data-e14adj="t"&gt;Downloads and Links&lt;/a&gt; | &lt;a href="#BOM" data-e14adj="t"&gt;Bill of Material&lt;/a&gt; | &lt;a href="#discussion" data-e14adj="t"&gt;Discussion&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;
&lt;h2 id="mcetoc_1i1cq2qed1"&gt;&lt;span data-contrast="none"&gt;What do we Have Here?&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/h2&gt;
&lt;p&gt;&lt;span data-contrast="auto"&gt;Andy kicks off the episode with the discovery of a never-used LEGO Mindstorms Robotics kit from the late &amp;#39;90s. Originally designed for Windows 95 and requiring a serial port for programming, this kit seemed destined for obsolescence. However, Andy sees its potential as a perfect STEM-related project for his kids. If only he can bring it up to date!&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;img alt="image" style="max-height:360px;max-width:640px;"  src="/cfs-file/__key/communityserver-wikis-components-files/00-00-00-04-35/Episode-657-_2D00_-Lego-Mindstorms_5F00_V1.00_5F00_00_5F00_29_5F00_12.Still003.bmp" /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;h2 id="mcetoc_1i1cq32782"&gt;&lt;span data-contrast="none"&gt;Modernizing the LEGO Mindstorms Kit&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/h2&gt;
&lt;p&gt;&lt;span data-contrast="auto"&gt;The first step in this modernization project involves connecting the infra-red tower from the kit to a Raspberry Pi, which supports USB to serial communication right out of the box. Andy replaces the outdated software with a web-based graphical programming interface, enabling real-time robot control. Further enhancement will include a camera to use with image-identification machine learning / artificial intelligence or some other vision API and then build a robot out of the LEGO parts.&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;img loading="lazy" alt="image" style="max-height:360px;max-width:640px;"  src="/cfs-file/__key/communityserver-wikis-components-files/00-00-00-04-35/Episode-657-_2D00_-Lego-Mindstorms_5F00_V1.00_5F00_01_5F00_07_5F00_00.Still004.bmp" /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;h2 id="mcetoc_1i1cq3bgq3"&gt;&lt;span data-contrast="none"&gt;Hardware Challenges and Solutions&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/h2&gt;
&lt;p&gt;&lt;span data-contrast="auto"&gt;Upon examining the kit, Andy finds the wires for the motors and sensors in poor condition, with insulation disintegrating. He replaces the cables and carefully cleans the components to ensure everything is in working order. Andy then tests the restored components with the original programmable brick, confirming their functionality.&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;img loading="lazy" alt="image" style="max-height:360px;max-width:640px;"  src="/cfs-file/__key/communityserver-wikis-components-files/00-00-00-04-35/Episode-657-_2D00_-Lego-Mindstorms_5F00_V1.00_5F00_01_5F00_38_5F00_18.Still005.bmp" /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;h2 id="mcetoc_1i1cq3j3v4"&gt;&lt;span data-contrast="none"&gt;Programming with Raspberry Pi&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/h2&gt;
&lt;p&gt;&lt;span data-contrast="auto"&gt;Instead of the original Windows 95 software, Andy uses a Raspberry Pi with a USB to serial adapter. He installs the operating system on the Raspberry Pi and sets up NQC (Not Quite C), a C-like language for programming the Mindstorms computer. With the firmware uploaded successfully, it&amp;rsquo;s time to create a modern programming environment.&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;img loading="lazy" alt="image" style="max-height:360px;max-width:640px;"  src="/cfs-file/__key/communityserver-wikis-components-files/00-00-00-04-35/Episode-657-_2D00_-Lego-Mindstorms_5F00_V1.00_5F00_03_5F00_19_5F00_07.Still007.bmp" /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;h2 id="mcetoc_1i1cq3q0i5"&gt;&lt;span data-contrast="none"&gt;Creating a Web-Based Programming Interface&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/h2&gt;
&lt;p&gt;&lt;span data-contrast="auto"&gt;Andy uses Google&amp;#39;s Blockly library to build a web-based graphical programming environment like Scratch, aimed at making coding accessible for kids. This custom application, named &amp;ldquo;Block Storms&amp;rdquo;, allows users to drag and drop blocks to create Python code for controlling the LEGO motors and sensors.&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;h2 id="mcetoc_1i1cq41b26"&gt;&lt;span data-contrast="none"&gt;Adding AI Capabilities&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/h2&gt;
&lt;p&gt;&lt;span data-contrast="auto"&gt;To add intelligence to the robot, Andy connects a Pi camera to the Raspberry Pi and integrates it with GPT-4 or another vision API. This setup enables the robot to capture images and classify them as trash or recycling using AI.&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;h2 id="mcetoc_1i1cq488f7"&gt;&lt;span data-contrast="none"&gt;Building the Trash Sorting Robot&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/h2&gt;
&lt;p&gt;&lt;span data-contrast="auto"&gt;Andy combines LEGO parts and 3D-printed components to build the trash sorting robot. He uses a touch sensor as a button to activate the camera, which takes a picture and sends it to GPT-4 for classification. The robot then sorts the item into the correct bin based on the AI&amp;rsquo;s response.&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;img loading="lazy" alt="image" style="max-height:360px;max-width:640px;"  src="/cfs-file/__key/communityserver-wikis-components-files/00-00-00-04-35/Episode-657-_2D00_-Lego-Mindstorms_5F00_V1.00_5F00_13_5F00_36_5F00_13.Still012.bmp" /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span data-contrast="auto"&gt;After several successful tests, Andy&amp;rsquo;s trash sorting robot proves to be an effective and educational project. Have you ever revived an old toy or device with modern electronics? Share your experiences in the comments below.&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;h2 id="mcetoc_1i1cq4ugg8"&gt;&lt;span&gt;Downloads and Links:&amp;nbsp;&lt;a id="downloads" rel="noopener noreferrer nofollow" target="_blank" data-e14adj="t"&gt;&lt;/a&gt;&lt;/span&gt;&lt;/h2&gt;
&lt;ul&gt;
&lt;li data-leveltext="-" data-font="Aptos" data-listid="2" data-aria-posinset="0" data-aria-level="1"&gt;&lt;a href="/challenges-projects/element14-presents/m/files/149555" data-e14adj="t"&gt;&lt;strong&gt;Download Code and CAD Files!&lt;/strong&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li data-leveltext="-" data-font="Aptos" data-listid="2" data-aria-posinset="0" data-aria-level="1"&gt;&lt;strong&gt;NQC (Not Quite C): &lt;/strong&gt;&lt;a href="https://bricxcc.sourceforge.net/nqc" rel="noopener noreferrer nofollow" target="_blank" data-e14adj="t"&gt;&lt;span data-contrast="none"&gt;https://bricxcc.sourceforge.net/nqc&lt;/span&gt;&lt;/a&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;ul&gt;
&lt;li data-leveltext="-" data-font="Aptos" data-listid="2" data-aria-posinset="1" data-aria-level="1"&gt;&lt;strong&gt;Google&amp;rsquo;s Blockly: &lt;/strong&gt;&lt;a href="https://developers.google.com/blockly" rel="noopener noreferrer nofollow" target="_blank" data-e14adj="t"&gt;&lt;span data-contrast="none"&gt;https://developers.google.com/blockly&lt;/span&gt;&lt;/a&gt;&lt;span data-contrast="auto"&gt;&amp;nbsp;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="mcetoc_1i1cqm19l1"&gt;Bill of Material:&amp;nbsp;&lt;a id="BOM" rel="noopener noreferrer nofollow" target="_blank" data-e14adj="t"&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;table class="e14-product-bom-main"&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;th&gt;Product Name&lt;/th&gt;
&lt;th&gt;Manufacturer&lt;/th&gt;
&lt;th&gt;Quantity&lt;/th&gt;
&lt;th&gt;&lt;a id="e14-product-link-50847" data-at-areainteracted="rte-content" data-at-type="click" data-at-link-type="button" href="https://referral.element14.com/OrderCodeView?fsku=4255998&amp;nsku=81AK1346&amp;COM=e14c-noscript&amp;CMP=e14c-noscript&amp;osetc=e14-noscript-tracking-loss" data-at-label="PRODUCT_POPUP_OPEN"class="e14-embedded e14_shopping-cart-far e14-button" onclick="event.preventDefault();e14.func.displayProduct(e14.meta.user.country, this, 'embedded-link', e14.func.getProductLinkJSON('50847'));" data-farnell="4255998" data-newark="81AK1346" data-comoverride="" data-cmpoverride="" data-cpc="" data-avnetemea="" data-avnetema="" data-avnetasia="" &gt;Buy Kit&lt;/a&gt; &lt;/th&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;RASPBERRY-PI RPI5-4GB-SINGLE&lt;/td&gt;
&lt;td&gt;RASPBERRY-PI&lt;/td&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;&lt;a id="e14-product-link-a1be6" data-at-areainteracted="rte-content" data-at-type="click" data-at-link-type="button" href="https://referral.element14.com/OrderCodeView?fsku=4255998&amp;nsku=81AK1346&amp;COM=e14c-noscript&amp;CMP=e14c-noscript&amp;osetc=e14-noscript-tracking-loss" data-at-label="PRODUCT_POPUP_OPEN"class="e14-embedded e14_shopping-cart-far e14-button" onclick="event.preventDefault();e14.func.displayProduct(e14.meta.user.country, this, 'embedded-link', e14.func.getProductLinkJSON('a1be6'));" data-farnell="4255998" data-newark="81AK1346" data-comoverride="" data-cmpoverride="" data-cpc="" data-avnetemea="" data-avnetema="" data-avnetasia="" &gt;Buy Now&lt;/a&gt; &lt;/td&gt;
&lt;/tr&gt;
&lt;tr class="xs-hide"&gt;
&lt;td&gt;&amp;nbsp;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h2 id="mcetoc_1i1cqmkog2"&gt;Additional Parts:&lt;/h2&gt;
&lt;table&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;span&gt;Flexible, 24-gauge 2-pin silicone ribbon cable, stranded tinned copper wire&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;LEGO Mindstorms Robotics Kit&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;div style="background:#ffffff;border:1px solid #dadada;margin:0;padding:14px 16px 16px 18px;position:relative;vertical-align:top;"&gt;
&lt;div style="display:inline-block;float:left;height:150px;padding:0px 25px 8px 0px;"&gt;&lt;a href="/challengesprojects/element14-presents/" data-e14adj="t"&gt;&lt;img loading="lazy" alt="element14 presents" src="/e14/assets/legacy/2018/e14PresentsJune818.png" width="180px" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style="display:inline-block;vertical-align:top;width:70%;"&gt;&lt;br /&gt;
&lt;p style="margin:0;"&gt;&lt;span&gt;&lt;a class="jivecontainerTT-hover-container jive-link-community-small" href="/challengesprojects/element14-presents/" data-e14adj="t"&gt;element14 presents&lt;/a&gt;&lt;/span&gt;&amp;nbsp; &lt;strong&gt;|&lt;/strong&gt;&amp;nbsp; &lt;a class="jive-link-wiki-small" href="/challengesprojects/element14-presents/vcp-program/w/documents/3724/vcp-biography-andy-west" data-e14adj="t"&gt;About Andy West&lt;/a&gt; &lt;strong&gt;|&lt;/strong&gt;&amp;nbsp; &lt;a class="jivecontainerTT-hover-container jive-link-community-small" href="/challengesprojects/element14-presents/project-videos/" data-e14adj="t"&gt;Project Videos&lt;/a&gt;&amp;nbsp;&lt;a id="discussion" rel="noopener noreferrer nofollow" target="_blank" data-e14adj="t"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p style="margin:0;"&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;

&lt;div style="font-size: 90%;"&gt;Tags: python programming, Blockly programming, Educational robotics, raspberry pi 5, USB to serial adapter, AI vision API, e14p_AW, raspberry pi projects, Pi camera module, AI Robot, Machine learning robotics, stem education, Vintage tech revival, Trash sorting robot, diy electronics, friday_release, LEGO Mindstorms&lt;/div&gt;
</description></item><item><title>Making 90s Lego Mindstorms Robotics Kit Work with a Raspberry Pi 5 -- Episode 657</title><link>https://community.element14.com/challenges-projects/element14-presents/project-videos/w/documents/71833/how-to-control-a-lego-mindstorms-kit-with-ai-and-raspberry-pi-5----episode-657/revision/3</link><pubDate>Thu, 27 Jun 2024 12:45:20 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:e2ca945a-0abd-43ad-9ee3-5fbffab3a563</guid><dc:creator>tariq.ahmad</dc:creator><comments>https://community.element14.com/challenges-projects/element14-presents/project-videos/w/documents/71833/how-to-control-a-lego-mindstorms-kit-with-ai-and-raspberry-pi-5----episode-657#comments</comments><description>Revision 3 posted to Documents by tariq.ahmad on 6/27/2024 12:45:20 PM&lt;br /&gt;
&lt;p&gt;&lt;span class="TextRun SCXW260443923 BCX0" lang="EN-GB" data-contrast="auto"&gt;&lt;span class="NormalTextRun SCXW260443923 BCX0"&gt;In this episode, Andy West takes us on a journey to modernize a classic LEGO Mindstorms kit from 1998 using the latest Raspberry Pi 5. Follow along as Andy transforms this vintage toy into an AI-powered trash sorting robot. &lt;/span&gt;&lt;span class="NormalTextRun SCXW260443923 BCX0"&gt;Let&amp;rsquo;s&lt;/span&gt;&lt;span class="NormalTextRun SCXW260443923 BCX0"&gt; dive into the project!&lt;/span&gt;&lt;/span&gt;&lt;span class="EOP SCXW260443923 BCX0"&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;h2 id="mcetoc_1i1cq106q0"&gt;&lt;span class="EOP SCXW260443923 BCX0"&gt;Watch the Video:&lt;/span&gt;&lt;/h2&gt;
&lt;p&gt;&lt;span class="EOP SCXW260443923 BCX0"&gt;&lt;a href="https://www.youtube.com/watch?v=UqUG2VUFsrg"&gt;www.youtube.com/watch&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span data-contrast="none"&gt;&lt;a href="#downloads" data-e14adj="t"&gt;Downloads and Links&lt;/a&gt; | &lt;a href="#BOM" data-e14adj="t"&gt;Bill of Material&lt;/a&gt; | &lt;a href="#discussion" data-e14adj="t"&gt;Discussion&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;
&lt;h2 id="mcetoc_1i1cq2qed1"&gt;&lt;span data-contrast="none"&gt;What do we Have Here?&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/h2&gt;
&lt;p&gt;&lt;span data-contrast="auto"&gt;Andy kicks off the episode with the discovery of a never-used LEGO Mindstorms Robotics kit from the late &amp;#39;90s. Originally designed for Windows 95 and requiring a serial port for programming, this kit seemed destined for obsolescence. However, Andy sees its potential as a perfect STEM-related project for his kids. If only he can bring it up to date!&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;img alt="image" style="max-height:360px;max-width:640px;"  src="/cfs-file/__key/communityserver-wikis-components-files/00-00-00-04-35/Episode-657-_2D00_-Lego-Mindstorms_5F00_V1.00_5F00_00_5F00_29_5F00_12.Still003.bmp" /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;h2 id="mcetoc_1i1cq32782"&gt;&lt;span data-contrast="none"&gt;Modernizing the LEGO Mindstorms Kit&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/h2&gt;
&lt;p&gt;&lt;span data-contrast="auto"&gt;The first step in this modernization project involves connecting the infra-red tower from the kit to a Raspberry Pi, which supports USB to serial communication right out of the box. Andy replaces the outdated software with a web-based graphical programming interface, enabling real-time robot control. Further enhancement will include a camera to use with image-identification machine learning / artificial intelligence or some other vision API and then build a robot out of the LEGO parts.&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;img loading="lazy" alt="image" style="max-height:360px;max-width:640px;"  src="/cfs-file/__key/communityserver-wikis-components-files/00-00-00-04-35/Episode-657-_2D00_-Lego-Mindstorms_5F00_V1.00_5F00_01_5F00_07_5F00_00.Still004.bmp" /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;h2 id="mcetoc_1i1cq3bgq3"&gt;&lt;span data-contrast="none"&gt;Hardware Challenges and Solutions&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/h2&gt;
&lt;p&gt;&lt;span data-contrast="auto"&gt;Upon examining the kit, Andy finds the wires for the motors and sensors in poor condition, with insulation disintegrating. He replaces the cables and carefully cleans the components to ensure everything is in working order. Andy then tests the restored components with the original programmable brick, confirming their functionality.&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;img loading="lazy" alt="image" style="max-height:360px;max-width:640px;"  src="/cfs-file/__key/communityserver-wikis-components-files/00-00-00-04-35/Episode-657-_2D00_-Lego-Mindstorms_5F00_V1.00_5F00_01_5F00_38_5F00_18.Still005.bmp" /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;h2 id="mcetoc_1i1cq3j3v4"&gt;&lt;span data-contrast="none"&gt;Programming with Raspberry Pi&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/h2&gt;
&lt;p&gt;&lt;span data-contrast="auto"&gt;Instead of the original Windows 95 software, Andy uses a Raspberry Pi with a USB to serial adapter. He installs the operating system on the Raspberry Pi and sets up NQC (Not Quite C), a C-like language for programming the Mindstorms computer. With the firmware uploaded successfully, it&amp;rsquo;s time to create a modern programming environment.&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;img loading="lazy" alt="image" style="max-height:360px;max-width:640px;"  src="/cfs-file/__key/communityserver-wikis-components-files/00-00-00-04-35/Episode-657-_2D00_-Lego-Mindstorms_5F00_V1.00_5F00_03_5F00_19_5F00_07.Still007.bmp" /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;h2 id="mcetoc_1i1cq3q0i5"&gt;&lt;span data-contrast="none"&gt;Creating a Web-Based Programming Interface&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/h2&gt;
&lt;p&gt;&lt;span data-contrast="auto"&gt;Andy uses Google&amp;#39;s Blockly library to build a web-based graphical programming environment like Scratch, aimed at making coding accessible for kids. This custom application, named &amp;ldquo;Block Storms&amp;rdquo;, allows users to drag and drop blocks to create Python code for controlling the LEGO motors and sensors.&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;h2 id="mcetoc_1i1cq41b26"&gt;&lt;span data-contrast="none"&gt;Adding AI Capabilities&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/h2&gt;
&lt;p&gt;&lt;span data-contrast="auto"&gt;To add intelligence to the robot, Andy connects a Pi camera to the Raspberry Pi and integrates it with GPT-4 or another vision API. This setup enables the robot to capture images and classify them as trash or recycling using AI.&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;h2 id="mcetoc_1i1cq488f7"&gt;&lt;span data-contrast="none"&gt;Building the Trash Sorting Robot&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/h2&gt;
&lt;p&gt;&lt;span data-contrast="auto"&gt;Andy combines LEGO parts and 3D-printed components to build the trash sorting robot. He uses a touch sensor as a button to activate the camera, which takes a picture and sends it to GPT-4 for classification. The robot then sorts the item into the correct bin based on the AI&amp;rsquo;s response.&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;img loading="lazy" alt="image" style="max-height:360px;max-width:640px;"  src="/cfs-file/__key/communityserver-wikis-components-files/00-00-00-04-35/Episode-657-_2D00_-Lego-Mindstorms_5F00_V1.00_5F00_13_5F00_36_5F00_13.Still012.bmp" /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span data-contrast="auto"&gt;After several successful tests, Andy&amp;rsquo;s trash sorting robot proves to be an effective and educational project. Have you ever revived an old toy or device with modern electronics? Share your experiences in the comments below.&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;h2 id="mcetoc_1i1cq4ugg8"&gt;&lt;span&gt;Downloads and Links:&amp;nbsp;&lt;a id="downloads" rel="noopener noreferrer nofollow" target="_blank" data-e14adj="t"&gt;&lt;/a&gt;&lt;/span&gt;&lt;/h2&gt;
&lt;ul&gt;
&lt;li data-leveltext="-" data-font="Aptos" data-listid="2" data-aria-posinset="0" data-aria-level="1"&gt;&lt;strong&gt;Download Code and CAD Files!&lt;/strong&gt;&lt;/li&gt;
&lt;li data-leveltext="-" data-font="Aptos" data-listid="2" data-aria-posinset="0" data-aria-level="1"&gt;&lt;strong&gt;NQC (Not Quite C): &lt;/strong&gt;&lt;a href="https://bricxcc.sourceforge.net/nqc" rel="noopener noreferrer nofollow" target="_blank" data-e14adj="t"&gt;&lt;span data-contrast="none"&gt;https://bricxcc.sourceforge.net/nqc&lt;/span&gt;&lt;/a&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;ul&gt;
&lt;li data-leveltext="-" data-font="Aptos" data-listid="2" data-aria-posinset="1" data-aria-level="1"&gt;&lt;strong&gt;Google&amp;rsquo;s Blockly: &lt;/strong&gt;&lt;a href="https://developers.google.com/blockly" rel="noopener noreferrer nofollow" target="_blank" data-e14adj="t"&gt;&lt;span data-contrast="none"&gt;https://developers.google.com/blockly&lt;/span&gt;&lt;/a&gt;&lt;span data-contrast="auto"&gt;&amp;nbsp;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="mcetoc_1i1cqm19l1"&gt;Bill of Material:&amp;nbsp;&lt;a id="BOM" rel="noopener noreferrer nofollow" target="_blank" data-e14adj="t"&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;table class="e14-product-bom-main"&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;th&gt;Product Name&lt;/th&gt;
&lt;th&gt;Manufacturer&lt;/th&gt;
&lt;th&gt;Quantity&lt;/th&gt;
&lt;th&gt;&lt;a id="e14-product-link-ce6fa" data-at-areainteracted="rte-content" data-at-type="click" data-at-link-type="button" href="https://referral.element14.com/OrderCodeView?fsku=4255998&amp;nsku=81AK1346&amp;COM=e14c-noscript&amp;CMP=e14c-noscript&amp;osetc=e14-noscript-tracking-loss" data-at-label="PRODUCT_POPUP_OPEN"class="e14-embedded e14_shopping-cart-far e14-button" onclick="event.preventDefault();e14.func.displayProduct(e14.meta.user.country, this, 'embedded-link', e14.func.getProductLinkJSON('ce6fa'));" data-farnell="4255998" data-newark="81AK1346" data-comoverride="" data-cmpoverride="" data-cpc="" data-avnetemea="" data-avnetema="" data-avnetasia="" &gt;Buy Kit&lt;/a&gt; &lt;/th&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;RASPBERRY-PI RPI5-4GB-SINGLE&lt;/td&gt;
&lt;td&gt;RASPBERRY-PI&lt;/td&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;&lt;a id="e14-product-link-b3dad" data-at-areainteracted="rte-content" data-at-type="click" data-at-link-type="button" href="https://referral.element14.com/OrderCodeView?fsku=4255998&amp;nsku=81AK1346&amp;COM=e14c-noscript&amp;CMP=e14c-noscript&amp;osetc=e14-noscript-tracking-loss" data-at-label="PRODUCT_POPUP_OPEN"class="e14-embedded e14_shopping-cart-far e14-button" onclick="event.preventDefault();e14.func.displayProduct(e14.meta.user.country, this, 'embedded-link', e14.func.getProductLinkJSON('b3dad'));" data-farnell="4255998" data-newark="81AK1346" data-comoverride="" data-cmpoverride="" data-cpc="" data-avnetemea="" data-avnetema="" data-avnetasia="" &gt;Buy Now&lt;/a&gt; &lt;/td&gt;
&lt;/tr&gt;
&lt;tr class="xs-hide"&gt;
&lt;td&gt;&amp;nbsp;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h2 id="mcetoc_1i1cqmkog2"&gt;Additional Parts:&lt;/h2&gt;
&lt;table&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;span&gt;Flexible, 24-gauge 2-pin silicone ribbon cable, stranded tinned copper wire&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;LEGO Mindstorms Robotics Kit&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;div style="background:#ffffff;border:1px solid #dadada;margin:0;padding:14px 16px 16px 18px;position:relative;vertical-align:top;"&gt;
&lt;div style="display:inline-block;float:left;height:150px;padding:0px 25px 8px 0px;"&gt;&lt;a href="/challengesprojects/element14-presents/" data-e14adj="t"&gt;&lt;img loading="lazy" alt="element14 presents" src="/e14/assets/legacy/2018/e14PresentsJune818.png" width="180px" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style="display:inline-block;vertical-align:top;width:70%;"&gt;&lt;br /&gt;
&lt;p style="margin:0;"&gt;&lt;span&gt;&lt;a class="jivecontainerTT-hover-container jive-link-community-small" href="/challengesprojects/element14-presents/" data-e14adj="t"&gt;element14 presents&lt;/a&gt;&lt;/span&gt;&amp;nbsp; &lt;strong&gt;|&lt;/strong&gt;&amp;nbsp; &lt;a class="jive-link-wiki-small" href="/challengesprojects/element14-presents/vcp-program/w/documents/3724/vcp-biography-andy-west" data-e14adj="t"&gt;About Andy West&lt;/a&gt; &lt;strong&gt;|&lt;/strong&gt;&amp;nbsp; &lt;a class="jivecontainerTT-hover-container jive-link-community-small" href="/challengesprojects/element14-presents/project-videos/" data-e14adj="t"&gt;Project Videos&lt;/a&gt;&amp;nbsp;&lt;a id="discussion" rel="noopener noreferrer nofollow" target="_blank" data-e14adj="t"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p style="margin:0;"&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;

&lt;div style="font-size: 90%;"&gt;Tags: python programming, Blockly programming, Educational robotics, raspberry pi 5, USB to serial adapter, AI vision API, e14p_AW, raspberry pi projects, Pi camera module, AI Robot, Machine learning robotics, stem education, Vintage tech revival, Trash sorting robot, diy electronics, friday_release, LEGO Mindstorms&lt;/div&gt;
</description></item><item><title>Making 90s Lego Mindstorms Robotics Kit Work with a Raspberry Pi 5 -- Episode 657</title><link>https://community.element14.com/challenges-projects/element14-presents/project-videos/w/documents/71833/how-to-control-a-lego-mindstorms-kit-with-ai-and-raspberry-pi-5----episode-657/revision/2</link><pubDate>Thu, 27 Jun 2024 12:39:04 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:e2ca945a-0abd-43ad-9ee3-5fbffab3a563</guid><dc:creator>tariq.ahmad</dc:creator><comments>https://community.element14.com/challenges-projects/element14-presents/project-videos/w/documents/71833/how-to-control-a-lego-mindstorms-kit-with-ai-and-raspberry-pi-5----episode-657#comments</comments><description>Revision 2 posted to Documents by tariq.ahmad on 6/27/2024 12:39:04 PM&lt;br /&gt;
&lt;p&gt;&lt;span class="TextRun SCXW260443923 BCX0" lang="EN-GB" data-contrast="auto"&gt;&lt;span class="NormalTextRun SCXW260443923 BCX0"&gt;In this episode, Andy West takes us on a journey to modernize a classic LEGO Mindstorms kit from 1998 using the latest Raspberry Pi 5. Follow along as Andy transforms this vintage toy into an AI-powered trash sorting robot. &lt;/span&gt;&lt;span class="NormalTextRun SCXW260443923 BCX0"&gt;Let&amp;rsquo;s&lt;/span&gt;&lt;span class="NormalTextRun SCXW260443923 BCX0"&gt; dive into the project!&lt;/span&gt;&lt;/span&gt;&lt;span class="EOP SCXW260443923 BCX0"&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;h2 id="mcetoc_1i1cq106q0"&gt;&lt;span class="EOP SCXW260443923 BCX0"&gt;Watch the Video:&lt;/span&gt;&lt;/h2&gt;
&lt;p&gt;&lt;span class="EOP SCXW260443923 BCX0"&gt;&lt;a href="https://www.youtube.com/watch?v=UqUG2VUFsrg"&gt;www.youtube.com/watch&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;
&lt;h2 id="mcetoc_1i1cq2qed1"&gt;&lt;span data-contrast="none"&gt;What do we Have Here?&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/h2&gt;
&lt;p&gt;&lt;span data-contrast="auto"&gt;Andy kicks off the episode with the discovery of a never-used LEGO Mindstorms Robotics kit from the late &amp;#39;90s. Originally designed for Windows 95 and requiring a serial port for programming, this kit seemed destined for obsolescence. However, Andy sees its potential as a perfect STEM-related project for his kids. If only he can bring it up to date!&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;img alt="image" style="max-height:360px;max-width:640px;"  src="/cfs-file/__key/communityserver-wikis-components-files/00-00-00-04-35/Episode-657-_2D00_-Lego-Mindstorms_5F00_V1.00_5F00_00_5F00_29_5F00_12.Still003.bmp" /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;h2 id="mcetoc_1i1cq32782"&gt;&lt;span data-contrast="none"&gt;Modernizing the LEGO Mindstorms Kit&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/h2&gt;
&lt;p&gt;&lt;span data-contrast="auto"&gt;The first step in this modernization project involves connecting the infra-red tower from the kit to a Raspberry Pi, which supports USB to serial communication right out of the box. Andy replaces the outdated software with a web-based graphical programming interface, enabling real-time robot control. Further enhancement will include a camera to use with image-identification machine learning / artificial intelligence or some other vision API and then build a robot out of the LEGO parts.&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;img loading="lazy" alt="image" style="max-height:360px;max-width:640px;"  src="/cfs-file/__key/communityserver-wikis-components-files/00-00-00-04-35/Episode-657-_2D00_-Lego-Mindstorms_5F00_V1.00_5F00_01_5F00_07_5F00_00.Still004.bmp" /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;h2 id="mcetoc_1i1cq3bgq3"&gt;&lt;span data-contrast="none"&gt;Hardware Challenges and Solutions&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/h2&gt;
&lt;p&gt;&lt;span data-contrast="auto"&gt;Upon examining the kit, Andy finds the wires for the motors and sensors in poor condition, with insulation disintegrating. He replaces the cables and carefully cleans the components to ensure everything is in working order. Andy then tests the restored components with the original programmable brick, confirming their functionality.&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;img loading="lazy" alt="image" style="max-height:360px;max-width:640px;"  src="/cfs-file/__key/communityserver-wikis-components-files/00-00-00-04-35/Episode-657-_2D00_-Lego-Mindstorms_5F00_V1.00_5F00_01_5F00_38_5F00_18.Still005.bmp" /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;h2 id="mcetoc_1i1cq3j3v4"&gt;&lt;span data-contrast="none"&gt;Programming with Raspberry Pi&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/h2&gt;
&lt;p&gt;&lt;span data-contrast="auto"&gt;Instead of the original Windows 95 software, Andy uses a Raspberry Pi with a USB to serial adapter. He installs the operating system on the Raspberry Pi and sets up NQC (Not Quite C), a C-like language for programming the Mindstorms computer. With the firmware uploaded successfully, it&amp;rsquo;s time to create a modern programming environment.&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;img loading="lazy" alt="image" style="max-height:360px;max-width:640px;"  src="/cfs-file/__key/communityserver-wikis-components-files/00-00-00-04-35/Episode-657-_2D00_-Lego-Mindstorms_5F00_V1.00_5F00_03_5F00_19_5F00_07.Still007.bmp" /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;h2 id="mcetoc_1i1cq3q0i5"&gt;&lt;span data-contrast="none"&gt;Creating a Web-Based Programming Interface&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/h2&gt;
&lt;p&gt;&lt;span data-contrast="auto"&gt;Andy uses Google&amp;#39;s Blockly library to build a web-based graphical programming environment like Scratch, aimed at making coding accessible for kids. This custom application, named &amp;ldquo;Block Storms&amp;rdquo;, allows users to drag and drop blocks to create Python code for controlling the LEGO motors and sensors.&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;h2 id="mcetoc_1i1cq41b26"&gt;&lt;span data-contrast="none"&gt;Adding AI Capabilities&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/h2&gt;
&lt;p&gt;&lt;span data-contrast="auto"&gt;To add intelligence to the robot, Andy connects a Pi camera to the Raspberry Pi and integrates it with GPT-4 or another vision API. This setup enables the robot to capture images and classify them as trash or recycling using AI.&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;h2 id="mcetoc_1i1cq488f7"&gt;&lt;span data-contrast="none"&gt;Building the Trash Sorting Robot&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/h2&gt;
&lt;p&gt;&lt;span data-contrast="auto"&gt;Andy combines LEGO parts and 3D-printed components to build the trash sorting robot. He uses a touch sensor as a button to activate the camera, which takes a picture and sends it to GPT-4 for classification. The robot then sorts the item into the correct bin based on the AI&amp;rsquo;s response.&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;img loading="lazy" alt="image" style="max-height:360px;max-width:640px;"  src="/cfs-file/__key/communityserver-wikis-components-files/00-00-00-04-35/Episode-657-_2D00_-Lego-Mindstorms_5F00_V1.00_5F00_13_5F00_36_5F00_13.Still012.bmp" /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span data-contrast="auto"&gt;After several successful tests, Andy&amp;rsquo;s trash sorting robot proves to be an effective and educational project. Have you ever revived an old toy or device with modern electronics? Share your experiences in the comments below.&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;h2 id="mcetoc_1i1cq4ugg8"&gt;&lt;span&gt;Downloads and Links:&lt;/span&gt;&lt;/h2&gt;
&lt;ul&gt;
&lt;li data-leveltext="-" data-font="Aptos" data-listid="2" data-aria-posinset="0" data-aria-level="1"&gt;&lt;strong&gt;NQC (Not Quite C): &lt;/strong&gt;&lt;a href="https://bricxcc.sourceforge.net/nqc" rel="noopener noreferrer nofollow" target="_blank" data-e14adj="t"&gt;&lt;span data-contrast="none"&gt;https://bricxcc.sourceforge.net/nqc&lt;/span&gt;&lt;/a&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;ul&gt;
&lt;li data-leveltext="-" data-font="Aptos" data-listid="2" data-aria-posinset="1" data-aria-level="1"&gt;&lt;strong&gt;Google&amp;rsquo;s Blockly: &lt;/strong&gt;&lt;a href="https://developers.google.com/blockly" rel="noopener noreferrer nofollow" target="_blank" data-e14adj="t"&gt;&lt;span data-contrast="none"&gt;https://developers.google.com/blockly&lt;/span&gt;&lt;/a&gt;&lt;span data-contrast="auto"&gt;&amp;nbsp;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="mcetoc_1i1cqm19l1"&gt;Bill of Material:&lt;/h2&gt;
&lt;h3 id="mcetoc_1i1cqleco0"&gt;&lt;/h3&gt;
&lt;table class="e14-product-bom-main"&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;th&gt;Product Name&lt;/th&gt;
&lt;th&gt;Manufacturer&lt;/th&gt;
&lt;th&gt;Quantity&lt;/th&gt;
&lt;th&gt;&lt;a id="e14-product-link-60665" data-at-areainteracted="rte-content" data-at-type="click" data-at-link-type="button" href="https://referral.element14.com/OrderCodeView?fsku=4255998&amp;nsku=81AK1346&amp;COM=e14c-noscript&amp;CMP=e14c-noscript&amp;osetc=e14-noscript-tracking-loss" data-at-label="PRODUCT_POPUP_OPEN"class="e14-embedded e14_shopping-cart-far e14-button" onclick="event.preventDefault();e14.func.displayProduct(e14.meta.user.country, this, 'embedded-link', e14.func.getProductLinkJSON('60665'));" data-farnell="4255998" data-newark="81AK1346" data-comoverride="" data-cmpoverride="" data-cpc="" data-avnetemea="" data-avnetema="" data-avnetasia="" &gt;Buy Kit&lt;/a&gt; &lt;/th&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;RASPBERRY-PI RPI5-4GB-SINGLE&lt;/td&gt;
&lt;td&gt;RASPBERRY-PI&lt;/td&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;&lt;a id="e14-product-link-c175e" data-at-areainteracted="rte-content" data-at-type="click" data-at-link-type="button" href="https://referral.element14.com/OrderCodeView?fsku=4255998&amp;nsku=81AK1346&amp;COM=e14c-noscript&amp;CMP=e14c-noscript&amp;osetc=e14-noscript-tracking-loss" data-at-label="PRODUCT_POPUP_OPEN"class="e14-embedded e14_shopping-cart-far e14-button" onclick="event.preventDefault();e14.func.displayProduct(e14.meta.user.country, this, 'embedded-link', e14.func.getProductLinkJSON('c175e'));" data-farnell="4255998" data-newark="81AK1346" data-comoverride="" data-cmpoverride="" data-cpc="" data-avnetemea="" data-avnetema="" data-avnetasia="" &gt;Buy Now&lt;/a&gt; &lt;/td&gt;
&lt;/tr&gt;
&lt;tr class="xs-hide"&gt;
&lt;td&gt;&amp;nbsp;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h2 id="mcetoc_1i1cqmkog2"&gt;Additional Parts:&lt;/h2&gt;
&lt;table&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;span&gt;Flexible, 24-gauge 2-pin silicone ribbon cable, stranded tinned copper wire&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;LEGO Mindstorms Robotics Kit&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span class="EOP SCXW260443923 BCX0"&gt;&lt;/span&gt;&lt;/p&gt;
&lt;div style="background:#ffffff;border:1px solid #dadada;margin:0;padding:14px 16px 16px 18px;position:relative;vertical-align:top;"&gt;
&lt;div style="display:inline-block;float:left;height:150px;padding:0px 25px 8px 0px;"&gt;&lt;a href="/challengesprojects/element14-presents/" data-e14adj="t"&gt;&lt;img loading="lazy" alt="element14 presents" src="/e14/assets/legacy/2018/e14PresentsJune818.png" width="180px" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style="display:inline-block;vertical-align:top;width:70%;"&gt;&lt;br /&gt;
&lt;p style="margin:0;"&gt;&lt;span&gt;&lt;a class="jivecontainerTT-hover-container jive-link-community-small" href="/challengesprojects/element14-presents/" data-e14adj="t"&gt;element14 presents&lt;/a&gt;&lt;/span&gt;&amp;nbsp; &lt;strong&gt;|&lt;/strong&gt;&amp;nbsp; &lt;a class="jive-link-wiki-small" href="/challengesprojects/element14-presents/vcp-program/w/documents/3724/vcp-biography-andy-west" data-e14adj="t"&gt;About Andy West&lt;/a&gt; &lt;strong&gt;|&lt;/strong&gt;&amp;nbsp; &lt;a class="jivecontainerTT-hover-container jive-link-community-small" href="/challengesprojects/element14-presents/project-videos/" data-e14adj="t"&gt;Project Videos&lt;/a&gt;&lt;/p&gt;
&lt;p style="margin:0;"&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;

&lt;div style="font-size: 90%;"&gt;Tags: python programming, Blockly programming, Educational robotics, raspberry pi 5, USB to serial adapter, AI vision API, e14p_AW, raspberry pi projects, Pi camera module, AI Robot, Machine learning robotics, stem education, Vintage tech revival, Trash sorting robot, diy electronics, friday_release, LEGO Mindstorms&lt;/div&gt;
</description></item><item><title>Making 90s Lego Mindstorms Robotics Kit Work with a Raspberry Pi 5 -- Episode 657</title><link>https://community.element14.com/challenges-projects/element14-presents/project-videos/w/documents/71833/how-to-control-a-lego-mindstorms-kit-with-ai-and-raspberry-pi-5----episode-657/revision/1</link><pubDate>Thu, 27 Jun 2024 12:20:20 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:e2ca945a-0abd-43ad-9ee3-5fbffab3a563</guid><dc:creator>tariq.ahmad</dc:creator><comments>https://community.element14.com/challenges-projects/element14-presents/project-videos/w/documents/71833/how-to-control-a-lego-mindstorms-kit-with-ai-and-raspberry-pi-5----episode-657#comments</comments><description>Revision 1 posted to Documents by tariq.ahmad on 6/27/2024 12:20:20 PM&lt;br /&gt;
&lt;p&gt;&lt;span class="TextRun SCXW260443923 BCX0" lang="EN-GB" data-contrast="auto"&gt;&lt;span class="NormalTextRun SCXW260443923 BCX0"&gt;In this episode, Andy West takes us on a journey to modernize a classic LEGO Mindstorms kit from 1998 using the latest Raspberry Pi 5. Follow along as Andy transforms this vintage toy into an AI-powered trash sorting robot. &lt;/span&gt;&lt;span class="NormalTextRun SCXW260443923 BCX0"&gt;Let&amp;rsquo;s&lt;/span&gt;&lt;span class="NormalTextRun SCXW260443923 BCX0"&gt; dive into the project!&lt;/span&gt;&lt;/span&gt;&lt;span class="EOP SCXW260443923 BCX0"&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;h2 id="mcetoc_1i1cq106q0"&gt;&lt;span class="EOP SCXW260443923 BCX0"&gt;Watch the Video:&lt;/span&gt;&lt;/h2&gt;
&lt;p&gt;&lt;span class="EOP SCXW260443923 BCX0"&gt;&lt;a href="https://www.youtube.com/watch?v=UqUG2VUFsrg"&gt;www.youtube.com/watch&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;
&lt;h2 id="mcetoc_1i1cq2qed1"&gt;&lt;span data-contrast="none"&gt;What do we Have Here?&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/h2&gt;
&lt;p&gt;&lt;span data-contrast="auto"&gt;Andy kicks off the episode with the discovery of a never-used LEGO Mindstorms Robotics kit from the late &amp;#39;90s. Originally designed for Windows 95 and requiring a serial port for programming, this kit seemed destined for obsolescence. However, Andy sees its potential as a perfect STEM-related project for his kids. If only he can bring it up to date!&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;h2 id="mcetoc_1i1cq32782"&gt;&lt;span data-contrast="none"&gt;Modernizing the LEGO Mindstorms Kit&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/h2&gt;
&lt;p&gt;&lt;span data-contrast="auto"&gt;The first step in this modernization project involves connecting the infra-red tower from the kit to a Raspberry Pi, which supports USB to serial communication right out of the box. Andy replaces the outdated software with a web-based graphical programming interface, enabling real-time robot control. Further enhancement will include a camera to use with image-identification machine learning / artificial intelligence or some other vision API and then build a robot out of the LEGO parts.&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;h2 id="mcetoc_1i1cq3bgq3"&gt;&lt;span data-contrast="none"&gt;Hardware Challenges and Solutions&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/h2&gt;
&lt;p&gt;&lt;span data-contrast="auto"&gt;Upon examining the kit, Andy finds the wires for the motors and sensors in poor condition, with insulation disintegrating. He replaces the cables and carefully cleans the components to ensure everything is in working order. Andy then tests the restored components with the original programmable brick, confirming their functionality.&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;h2 id="mcetoc_1i1cq3j3v4"&gt;&lt;span data-contrast="none"&gt;Programming with Raspberry Pi&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/h2&gt;
&lt;p&gt;&lt;span data-contrast="auto"&gt;Instead of the original Windows 95 software, Andy uses a Raspberry Pi with a USB to serial adapter. He installs the operating system on the Raspberry Pi and sets up NQC (Not Quite C), a C-like language for programming the Mindstorms computer. With the firmware uploaded successfully, it&amp;rsquo;s time to create a modern programming environment.&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;h2 id="mcetoc_1i1cq3q0i5"&gt;&lt;span data-contrast="none"&gt;Creating a Web-Based Programming Interface&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/h2&gt;
&lt;p&gt;&lt;span data-contrast="auto"&gt;Andy uses Google&amp;#39;s Blockly library to build a web-based graphical programming environment like Scratch, aimed at making coding accessible for kids. This custom application, named &amp;ldquo;Block Storms&amp;rdquo;, allows users to drag and drop blocks to create Python code for controlling the LEGO motors and sensors.&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;h2 id="mcetoc_1i1cq41b26"&gt;&lt;span data-contrast="none"&gt;Adding AI Capabilities&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/h2&gt;
&lt;p&gt;&lt;span data-contrast="auto"&gt;To add intelligence to the robot, Andy connects a Pi camera to the Raspberry Pi and integrates it with GPT-4 or another vision API. This setup enables the robot to capture images and classify them as trash or recycling using AI.&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;h2 id="mcetoc_1i1cq488f7"&gt;&lt;span data-contrast="none"&gt;Building the Trash Sorting Robot&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/h2&gt;
&lt;p&gt;&lt;span data-contrast="auto"&gt;Andy combines LEGO parts and 3D-printed components to build the trash sorting robot. He uses a touch sensor as a button to activate the camera, which takes a picture and sends it to GPT-4 for classification. The robot then sorts the item into the correct bin based on the AI&amp;rsquo;s response.&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span data-contrast="auto"&gt;After several successful tests, Andy&amp;rsquo;s trash sorting robot proves to be an effective and educational project. Have you ever revived an old toy or device with modern electronics? Share your experiences in the comments below.&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;h2 id="mcetoc_1i1cq4ugg8"&gt;&lt;span&gt;Downloads and Links:&lt;/span&gt;&lt;/h2&gt;
&lt;ul&gt;
&lt;li data-leveltext="-" data-font="Aptos" data-listid="2" data-aria-posinset="0" data-aria-level="1"&gt;&lt;strong&gt;NQC (Not Quite C): &lt;/strong&gt;&lt;a href="https://bricxcc.sourceforge.net/nqc" rel="noopener noreferrer nofollow" target="_blank" data-e14adj="t"&gt;&lt;span data-contrast="none"&gt;https://bricxcc.sourceforge.net/nqc&lt;/span&gt;&lt;/a&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;ul&gt;
&lt;li data-leveltext="-" data-font="Aptos" data-listid="2" data-aria-posinset="1" data-aria-level="1"&gt;&lt;strong&gt;Google&amp;rsquo;s Blockly: &lt;/strong&gt;&lt;a href="https://developers.google.com/blockly" rel="noopener noreferrer nofollow" target="_blank" data-e14adj="t"&gt;&lt;span data-contrast="none"&gt;https://developers.google.com/blockly&lt;/span&gt;&lt;/a&gt;&lt;span data-contrast="auto"&gt;&amp;nbsp;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span class="EOP SCXW260443923 BCX0"&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;
</description></item></channel></rss>