{"id":4244,"date":"2025-01-05T09:25:31","date_gmt":"2025-01-05T17:25:31","guid":{"rendered":"https:\/\/www.donluc.com\/?p=4244"},"modified":"2025-01-05T09:25:31","modified_gmt":"2025-01-05T17:25:31","slug":"project-11-esp32-bluetooth-iot-mk12","status":"publish","type":"post","link":"https:\/\/www.donluc.com\/?p=4244","title":{"rendered":"Project #11: ESP32 &#8211; Bluetooth IoT &#8211; Mk12"},"content":{"rendered":"<div style=\"width: 720px;\" class=\"wp-video\"><video class=\"wp-video-shortcode\" id=\"video-4244-1\" width=\"720\" height=\"480\" preload=\"metadata\" controls=\"controls\"><source type=\"video\/mp4\" src=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2025\/01\/DL2501Mk01W.mp4?_=1\" \/><a href=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2025\/01\/DL2501Mk01W.mp4\">https:\/\/www.donluc.com\/wp-content\/uploads\/2025\/01\/DL2501Mk01W.mp4<\/a><\/video><\/div>\n<p>&#8212;&#8212;<\/p>\n<p>#DonLucElectronics #DonLuc #ESP32 #Bluetooth #Elecrow #DFRobot #Arduino #Project #Patreon #Electronics #Microcontrollers #IoT #Fritzing #Programming #Consultant<\/p>\n<p>&#8212;&#8212;<\/p>\n<p><a href=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2025\/01\/DL2501Mk01a.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2025\/01\/DL2501Mk01a.jpg\" alt=\"Bluetooth IoT\" width=\"720\" height=\"675\" class=\"alignnone size-full wp-image-4246\" srcset=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2025\/01\/DL2501Mk01a.jpg 720w, https:\/\/www.donluc.com\/wp-content\/uploads\/2025\/01\/DL2501Mk01a-300x281.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\/2025\/01\/DL2501Mk01b.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2025\/01\/DL2501Mk01b.jpg\" alt=\"Bluetooth IoT\" width=\"720\" height=\"480\" class=\"alignnone size-full wp-image-4247\" srcset=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2025\/01\/DL2501Mk01b.jpg 720w, https:\/\/www.donluc.com\/wp-content\/uploads\/2025\/01\/DL2501Mk01b-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\/2025\/01\/DL2501Mk01c.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2025\/01\/DL2501Mk01c.jpg\" alt=\"Bluetooth IoT\" width=\"720\" height=\"480\" class=\"alignnone size-full wp-image-4248\" srcset=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2025\/01\/DL2501Mk01c.jpg 720w, https:\/\/www.donluc.com\/wp-content\/uploads\/2025\/01\/DL2501Mk01c-300x200.jpg 300w\" sizes=\"auto, (max-width: 720px) 100vw, 720px\" \/><\/a><\/p>\n<p>&#8212;&#8212;<\/p>\n<p><strong>Bluetooth<\/strong><\/p>\n<p>Bluetooth is a short-range wireless technology standard that is used for exchanging data between fixed and mobile devices over short distances and building personal area networks. In the most widely used mode, transmission power is limited to 2.5 milliwatts, giving it a very short range of up to 10 metres. It employs UHF radio waves in the ISM bands, from 2.402 GHz to 2.48 GHz.<\/p>\n<p>You can pair all kinds of Bluetooth devices with your PC, including keyboards, mice, phones, speakers, IoT, and a whole lot more. To do this, your PC needs to have Bluetooth. Some PCs, such as laptops and tablets, have Bluetooth built in. If your PC doesn\u2019t, you can plug a USB Bluetooth adapter into the USB port on your PC to get it.<\/p>\n<p><strong>DL2501Mk01<\/strong><\/p>\n<p>1 x DFRobot FireBeetle 2 ESP32-E<br \/>\n1 x Fermion: 2.0&#8243; 320&#215;240 IPS TFT LCD<br \/>\n1 x GDL Line 10 CM<br \/>\n1 x Crowtail- Rotary Angle Sensor 2.0 &#8211; 10K Ohm<br \/>\n1 x Crowtail- LED 2.0 &#8211; Yellow<br \/>\n1 x Crowtail- LED 2.0 &#8211; Green<br \/>\n1 x Lithium Ion Battery &#8211; 1000mAh<br \/>\n1 x Switch<br \/>\n1 x Bluetooth Serial Terminal for Windows 10<br \/>\n1 x USB 3.1 Cable A to C<\/p>\n<p><strong>FireBeetle 2 ESP32-E<\/strong><\/p>\n<p>POT &#8211; A0<br \/>\nLEG &#8211; 16<br \/>\nLEY &#8211; 17<br \/>\nDC &#8211; D2<br \/>\nCS &#8211; D6<br \/>\nRST &#8211; D3<br \/>\nRX2 &#8211; Bluetooth<br \/>\nTX2 &#8211; Bluetooth<br \/>\nVIN &#8211; +3.3V<br \/>\nGND &#8211; GND<\/p>\n<p><strong>DL2501Mk01p<\/strong><\/p>\n<p><strong>DL2501Mk01p.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 #11: ESP32 - Bluetooth IoT - Mk12\r\n11-12\r\nDL2501Mk01p.ino\r\nDL2501Mk01\r\n1 x DFRobot FireBeetle 2 ESP32-E\r\n1 x Fermion: 2.0&quot; 320x240 IPS TFT LCD\r\n1 x GDL Line 10 CM\r\n1 x Crowtail- Rotary Angle Sensor 2.0 - 10K Ohm\r\n1 x Crowtail- LED 2.0 - Yellow\r\n1 x Crowtail- LED 2.0 - Green\r\n1 x Lithium Ion Battery - 1000mAh\r\n1 x Switch\r\n1 x Bluetooth Serial Terminal for Windows 10\r\n1 x USB 3.1 Cable A to C\r\n*\/\r\n\r\n\/\/ Include the Library Code\r\n\/\/ Arduino\r\n#include &lt;Arduino.h&gt;\r\n\/\/ Wire\r\n#include &lt;Wire.h&gt;\r\n\/\/ DFRobot Display GDL API\r\n#include &lt;DFRobot_GDL.h&gt;\r\n\/\/ Bluetooth Serial\r\n#include &quot;BluetoothSerial.h&quot;\r\n#if !defined(CONFIG_BT_ENABLED) || !defined(CONFIG_BLUEDROID_ENABLED)\r\n#error Bluetooth is not enabled! Please run `make menuconfig` to and enable it\r\n#endif\r\n\r\n\/\/ Bluetooth Serial\r\nBluetoothSerial SerialBT;\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 240x320\r\nDFRobot_ST7789_240x320_HW_SPI screen(TFT_DC, TFT_CS, TFT_RST);\r\n\r\n\/\/ Potentiometer\r\nint iPot = A0;\r\nint iPotVal = 0;\r\n\/\/ Change Your Threshold Here\r\nint Threshold = 2000;\r\n\/\/ Full String\r\nString FullString = &quot;&quot;;\r\n\r\n\/\/ LED Yellow\r\nint iLEDY = 17;\r\n\r\n\/\/ LED Green\r\nint iLEDG = 16;\r\n\r\n\/\/ Software Version Information\r\nString sver = &quot;11-12&quot;;\r\n\r\nvoid loop() {\r\n\r\n  \/\/ Potentiometer\r\n  isPotentiometer();\r\n\r\n  \/\/ Delay 2 Second\r\n  delay( 2000 );\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 240x320\r\n\/\/ DFRobot Display 240x320 - UID\r\nvoid isDisplayUID(){\r\n\r\n  \/\/ DFRobot Display 240x320\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 Mono 9pt\r\n  screen.setFont(&amp;FreeMono9pt7b);\r\n  \/\/ TextSize =&gt; 1.5\r\n  screen.setTextSize(1.5);\r\n  \/\/ DFRobot Display\r\n  screen.setCursor(0, 30);\r\n  screen.println(&quot;Don Luc Electronics&quot;);\r\n  \/\/ Don Luc Electronics\r\n  screen.setCursor(0, 60);\r\n  screen.println(&quot;DFRobot Display&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\r\n}\r\n\/\/ isDisplay Green\r\nvoid isDisplayG(){\r\n\r\n  \/\/ DFRobot Display 240x320\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 Mono 9pt\r\n  screen.setFont(&amp;FreeMono9pt7b);\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  \/\/ LED Yellow\r\n  screen.setCursor(0, 60);\r\n  screen.println(&quot;LED Green&quot;);\r\n  \/\/ Potentiometer Value\r\n  screen.setCursor(0, 90);\r\n  screen.println( iPotVal );\r\n\r\n}\r\n\/\/ isDisplay Yellow\r\nvoid isDisplayY(){\r\n\r\n  \/\/ DFRobot Display 240x320\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 Mono 9pt\r\n  screen.setFont(&amp;FreeMono9pt7b);\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  \/\/ LED Yellow\r\n  screen.setCursor(0, 60);\r\n  screen.println(&quot;LED Yellow&quot;);\r\n  \/\/ Potentiometer Value\r\n  screen.setCursor(0, 90);\r\n  screen.println( iPotVal );\r\n\r\n}\r\n<\/pre>\n<p><strong>getPotentiometer.ino<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"arduino\" data-enlighter-title=\"\">\r\n\/\/ Potentiometer\r\n\/\/ Potentiometer\r\nvoid isPotentiometer(){\r\n\r\n  \/\/ Connect Potentiometer to Analog 0\r\n  iPotVal = analogRead( iPot );\r\n\r\n  \/\/ Threshold\r\n  if (iPotVal &gt; Threshold) {\r\n\r\n    \/\/ LED Yellow\r\n    digitalWrite(iLEDY, LOW);\r\n    \/\/ isDisplay Green\r\n    isDisplayG();\r\n    \/\/ LED Green\r\n    digitalWrite(iLEDG, HIGH);\r\n    \/\/ FullString\r\n    FullString = &quot;LED Green = &quot; + String(iPotVal) + &quot;\\r\\n&quot;;\r\n  \r\n  }\r\n  else {\r\n    \r\n    \/\/ LED Green\r\n    digitalWrite(iLEDG, LOW);\r\n    \/\/ isDisplay Yellow\r\n    isDisplayY();\r\n    \/\/ LED Yellow\r\n    digitalWrite(iLEDY, HIGH);\r\n    \/\/ FullString\r\n    FullString = &quot;LED Yellow = &quot; + String(iPotVal) + &quot;\\r\\n&quot;;\r\n    \r\n  }\r\n\r\n  \/\/ FullString Bluetooth Serial + Serial\r\n  for(int i = 0; i &lt; FullString.length(); i++)\r\n  {\r\n\r\n    \/\/ Bluetooth Serial\r\n    SerialBT.write(FullString.c_str()[i]);\r\n    \/\/ Serial\r\n    Serial.write(FullString.c_str()[i]);\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  \/\/ Serial Begin\r\n  Serial.begin(115200);\r\n  Serial.println(&quot;Starting BLE work!&quot;);\r\n\r\n  \/\/ Bluetooth Serial\r\n  SerialBT.begin(&quot;Don Luc Electronics&quot;);\r\n  Serial.println(&quot;Bluetooth Started! Ready to pair...&quot;);\r\n  \r\n  \/\/ Delay\r\n  delay(100);\r\n\r\n  \/\/ DFRobot Display 240x320\r\n  screen.begin();\r\n\r\n  \/\/ Delay\r\n  delay(100);\r\n\r\n  \/\/ Initialize the LED Yellow\r\n  pinMode(iLEDY, OUTPUT);\r\n\r\n  \/\/ Initialize the LED Green\r\n  pinMode(iLEDG, OUTPUT);\r\n\r\n  \/\/ DFRobot Display 240x320 - UID\r\n  \/\/ Don Luc Electronics\r\n  \/\/ Version\r\n  isDisplayUID();\r\n\r\n  \/\/ Delay 5 Second\r\n  delay( 5000 );\r\n\r\n}\r\n<\/pre>\n<p>&#8212;&#8212;<\/p>\n<p><strong>People can contact us:<\/strong> https:\/\/www.donluc.com\/?page_id=1927<\/p>\n<p><strong>Electronics, IoT, Teacher, Instructor, R&#038;D and Consulting<\/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 and Underwater Vehicle<\/li>\n<li>Unmanned Vehicles Terrestrial and Marine<\/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; 2024<\/strong><br \/>\nhttps:\/\/www.donluc.com\/luc\/<\/p>\n<p><strong>Web:<\/strong> https:\/\/www.donluc.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>Twitter:<\/strong> https:\/\/twitter.com\/labs_steam<br \/>\n<strong>Pinterest:<\/strong> https:\/\/www.pinterest.com\/NeoSteamLabs\/<br \/>\n<strong>Instagram:<\/strong> https:\/\/www.instagram.com\/neosteamlabs\/<br \/>\n<strong>Patreon:<\/strong> https:\/\/patreon.com\/DonLucElectronics59<br \/>\n<strong>DFRobot:<\/strong> https:\/\/learn.dfrobot.com\/user-10186.html<br \/>\n<strong>Hackster.io:<\/strong> https:\/\/www.hackster.io\/neosteam-labs<br \/>\n<strong>Elecrow:<\/strong> https:\/\/www.elecrow.com\/share\/sharepj\/center\/no\/760816d385ebb1edc0732fd873bfbf13<br \/>\n<strong>TikTok:<\/strong> https:\/\/www.tiktok.com\/@luc.paquin8<br \/>\n<strong>Twitch:<\/strong> https:\/\/www.twitch.tv\/lucpaquin<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 #ESP32 #Bluetooth #Elecrow #DFRobot #Arduino #Project #Patreon #Electronics #Microcontrollers #IoT #Fritzing #Programming #Consultant &#8212;&#8212; &#8212;&#8212; &#8212;&#8212; &#8212;&#8212; Bluetooth Bluetooth is a short-range wireless technology standard that is used for exchanging data between fixed and mobile devices over short distances and building personal area networks. In the most widely used mode, transmission power &#8230; <a title=\"Project #11: ESP32 &#8211; Bluetooth IoT &#8211; Mk12\" class=\"read-more\" href=\"https:\/\/www.donluc.com\/?p=4244\" aria-label=\"Read more about Project #11: ESP32 &#8211; Bluetooth IoT &#8211; Mk12\">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":[81,50,49,317,38,368,80,59,115,5,138,287,58,82,10],"tags":[6,242,371,102,4,320,87,369,19,83,85,24,9,84,27,33,34,108],"class_list":["post-4244","post","type-post","status-publish","format-standard","hentry","category-esp32-project","category-arduino","category-consultant","category-dfrobot","category-digitalelectronics","category-elecrow","category-esp32","category-fritzing","category-e-mentor","category-microcontrollers","category-patreon","category-program","category-arduino-programming","category-program-esp32","category-projects","tag-arduino","tag-bluetooth","tag-bluetooth-iot","tag-components","tag-consultant","tag-dfrobot","tag-display","tag-elecrow","tag-electronics","tag-esp32","tag-fritzing","tag-microcontroller","tag-programming","tag-programming-esp32","tag-projects-2","tag-technology","tag-video-blog","tag-vlog"],"_links":{"self":[{"href":"https:\/\/www.donluc.com\/index.php?rest_route=\/wp\/v2\/posts\/4244","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=4244"}],"version-history":[{"count":1,"href":"https:\/\/www.donluc.com\/index.php?rest_route=\/wp\/v2\/posts\/4244\/revisions"}],"predecessor-version":[{"id":4249,"href":"https:\/\/www.donluc.com\/index.php?rest_route=\/wp\/v2\/posts\/4244\/revisions\/4249"}],"wp:attachment":[{"href":"https:\/\/www.donluc.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4244"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.donluc.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4244"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.donluc.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4244"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}