{"id":3124,"date":"2013-12-31T08:26:20","date_gmt":"2013-12-31T13:26:20","guid":{"rendered":"http:\/\/www.plastibots.com\/?p=3124"},"modified":"2017-05-27T06:22:10","modified_gmt":"2017-05-27T11:22:10","slug":"hc-06-bluetooth-module-getting-this-sucker-into-at-command-mode","status":"publish","type":"post","link":"https:\/\/www.plastibots.com\/index.php\/2013\/12\/31\/hc-06-bluetooth-module-getting-this-sucker-into-at-command-mode\/","title":{"rendered":"HC-06 Bluetooth Module &#8211; Getting this sucker into AT Command Mode"},"content":{"rendered":"<p><img loading=\"lazy\" decoding=\"async\" class=\" wp-image-3127 alignright\" style=\"margin: 3px 10px;\" title=\"JY-MCU HC-06 Bluetooth Module\" src=\"http:\/\/www.plastibots.com\/wordpress\/wp-content\/uploads\/2013\/12\/hc-06.png\" alt=\"hc-06\" width=\"227\" height=\"104\" srcset=\"https:\/\/www.plastibots.com\/wordpress\/wp-content\/uploads\/2013\/12\/hc-06.png 379w, https:\/\/www.plastibots.com\/wordpress\/wp-content\/uploads\/2013\/12\/hc-06-300x136.png 300w\" sizes=\"auto, (max-width: 227px) 100vw, 227px\" \/>After spending nearly 3 hours scouring the Web trying to find a way to configure my\u00a0<a title=\"Bluetooth Module\" href=\"http:\/\/www.banggood.com\/HC-06-Wireless-Bluetooth-Transceiver-RF-Main-Module-Serial-For-Arduino-p-80364.html?p=R90804949020201412E4\" target=\"_blank\">HC-06<\/a> Bluetooth module. \u00a0There are a lot of great tutorials out there. \u00a0Many of them refer to setting the key pin HIGH, or a combination of LOW then HIGH while powering on the module. \u00a0However, none of these approaches worked for the unit I have. \u00a0Read on to see how it can be done. \u00a0Oddly, I found the answer in the DX discussion forums related to this module. \u00a0Here&#8217;s the <a href=\"http:\/\/club.dx.com\/forums\/forums.dx\/threadid.1166641\" target=\"_blank\">thread<\/a>. \u00a0Read on for how I managed to get it working.<\/p>\n<p><!--more--><\/p>\n<p><strong><span style=\"font-size: 18px;\"><br class=\"none\" \/>The fluff &amp; Warning:<\/span><\/strong><\/p>\n<p>Before we start, I&#8217;ll throw this warning out there&#8230; \u00a0 Nearly all samples I&#8217;ve found, suggest that the connection (Arduino TX to BT RX) must be 3v3 as I&#8217;ve shown <a href=\"http:\/\/www.plastibots.com\/wordpress\/wp-content\/uploads\/2013\/03\/BluetoothHookupWeb.png\" target=\"_blank\">here<\/a>. \u00a0Although I now use this approach with <a href=\"http:\/\/www.plastibots.com\/index.php\/2013\/03\/07\/btbotcontrol\/\" target=\"_blank\">BT Bot Control<\/a>, it did not work for me when trying to set AT Commands. \u00a0As such, I decided to gamble on connecting the pin directly to D10 (5V when high) and it worked. \u00a0Also note that I&#8217;ve run this particular module for months with no 3v3 level shifting, and it has worked without issue. \u00a0If you &#8220;<em>try and fry<\/em>&#8221; your module and let out the black smoke, you&#8217;ve been warned.<\/p>\n<p><strong><span style=\"font-size: 18px;\">In case you need&#8230;<\/span><\/strong><\/p>\n<table>\n<tbody>\n<tr>\n<td>\n<p><figure id=\"attachment_4760\" aria-describedby=\"caption-attachment-4760\" style=\"width: 150px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/www.banggood.com\/HC-06-Wireless-Bluetooth-Transceiver-RF-Main-Module-Serial-For-Arduino-p-80364.html?p=R90804949020201412E4\" target=\"_blank\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-4760 size-thumbnail\" src=\"http:\/\/www.plastibots.com\/wordpress\/wp-content\/uploads\/2013\/12\/Capture-150x150.jpg\" alt=\"Product Link\" width=\"150\" height=\"150\" \/><\/a><figcaption id=\"caption-attachment-4760\" class=\"wp-caption-text\">HC-06 Bluetooth module. (you can also get the 05&#8217;s)<\/figcaption><\/figure><\/td>\n<td>\n<p><figure id=\"attachment_4761\" aria-describedby=\"caption-attachment-4761\" style=\"width: 150px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/www.banggood.com\/ATmega328P-Nano-V3-Controller-Board-Compatible-Arduino-p-940937.html?p=R90804949020201412E4\" target=\"_blank\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-4761 size-thumbnail\" src=\"http:\/\/www.plastibots.com\/wordpress\/wp-content\/uploads\/2013\/12\/Capture1-150x150.jpg\" alt=\"Product Link\" width=\"150\" height=\"150\" \/><\/a><figcaption id=\"caption-attachment-4761\" class=\"wp-caption-text\">Arduino Nano (you can also get packs of 3\/5).<\/figcaption><\/figure><\/td>\n<td>\n<p><figure id=\"attachment_4762\" aria-describedby=\"caption-attachment-4762\" style=\"width: 150px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/www.banggood.com\/10-Meter-Black-Silicone-Wire-Cable-10121416182022AWG-Flexible-Cable-p-1035780.html?p=R90804949020201412E4\" target=\"_blank\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-4762 size-thumbnail\" src=\"http:\/\/www.plastibots.com\/wordpress\/wp-content\/uploads\/2013\/12\/Capture2-150x150.jpg\" alt=\"Product Link\" width=\"150\" height=\"150\" \/><\/a><figcaption id=\"caption-attachment-4762\" class=\"wp-caption-text\">Dont forget the wire. This is quality silcone wire. Different sizes. Have some myself.<\/figcaption><\/figure><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><strong><span style=\"font-size: 18px;\">Update:<\/span><\/strong><\/p>\n<p>Based on some of the user comments, it might be wise to try the following:<\/p>\n<ul>\n<li>Use 3v3 level shifting to provide the correct voltage to the BT module.<\/li>\n<li>Pull the KEY PIN up as one user suggested to get AT\/comand function.<\/li>\n<\/ul>\n<p><strong><span style=\"font-size: 18px;\"><br class=\"none\" \/>Wiring<\/span><\/strong>:<\/p>\n<table border=\"0\" align=\"center\">\n<tbody>\n<tr>\n<td align=\"left\"><strong>Arduino to BT Module<\/strong><\/p>\n<p>GND &lt;&gt; GND<\/p>\n<p>5V to VCC (5V)<\/p>\n<p>D10 to TXD<\/p>\n<p>D11 to RXD<\/td>\n<td align=\"center\" valign=\"middle\"><a href=\"http:\/\/www.plastibots.com\/wordpress\/wp-content\/uploads\/2013\/12\/BluetoothHookupWeb.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-3125\" style=\"color: #333333; font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif; font-size: 12.727272033691406px; line-height: 19px;\" src=\"http:\/\/www.plastibots.com\/wordpress\/wp-content\/uploads\/2013\/12\/BluetoothHookupWeb.png\" alt=\"Nano \/ Uno Wiring for Command Mode\" width=\"456\" height=\"148\" srcset=\"https:\/\/www.plastibots.com\/wordpress\/wp-content\/uploads\/2013\/12\/BluetoothHookupWeb.png 1085w, https:\/\/www.plastibots.com\/wordpress\/wp-content\/uploads\/2013\/12\/BluetoothHookupWeb-300x97.png 300w, https:\/\/www.plastibots.com\/wordpress\/wp-content\/uploads\/2013\/12\/BluetoothHookupWeb-1024x331.png 1024w\" sizes=\"auto, (max-width: 456px) 100vw, 456px\" \/><\/a><\/p>\n<p><a href=\"http:\/\/www.plastibots.com\/wordpress\/wp-content\/uploads\/2013\/12\/BluetoothHookupWeb.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-3125\" style=\"color: #333333; font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif; font-size: 12.727272033691406px; line-height: 19px;\" src=\"http:\/\/www.plastibots.com\/wordpress\/wp-content\/uploads\/2013\/12\/BluetoothHookupWeb.png\" alt=\"Nano \/ Uno Wiring for Command Mode\" width=\"456\" height=\"148\" srcset=\"https:\/\/www.plastibots.com\/wordpress\/wp-content\/uploads\/2013\/12\/BluetoothHookupWeb.png 1085w, https:\/\/www.plastibots.com\/wordpress\/wp-content\/uploads\/2013\/12\/BluetoothHookupWeb-300x97.png 300w, https:\/\/www.plastibots.com\/wordpress\/wp-content\/uploads\/2013\/12\/BluetoothHookupWeb-1024x331.png 1024w\" sizes=\"auto, (max-width: 456px) 100vw, 456px\" \/><\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<\/p>\n<p><Center><a href=\"https:\/\/www.banggood.com\/collection-3498.html?utm_campaign=15hdpro&amp;utm_content=east&amp;p=R90804949020201412E4&amp;bid=34984&amp;utm_design=5\" target=\"_blank\"><img decoding=\"async\" src=\"http:\/\/img.banggood.com\/deals\/affiliate_member_banner\/2307ac1cfee5db3a5402aac9db25cc5d61.jpg\" \/><\/a><\/center><\/p>\n<p><strong><span style=\"font-size: 18px;\"><br \/>\nThe Sketch:<\/span><\/strong><\/p>\n<p>The void Setup() section carries a number of sample AT commands. \u00a0Un-comment the ones you need. \u00a0You can also find an AT Command reference <a title=\"here\" href=\"http:\/\/www.plastibots.com\/wordpress\/wp-content\/uploads\/2013\/12\/Bluetooth-Module-HC05.pdf\">here<\/a>\u00a0(but note it&#8217;s for the HC-05, but most should work). \u00a0Note: \u00a0If you change the baud, be sure to set the new baud for <em>mySerial<\/em> in the sketch for communicating to the unit. \u00a0The <em>Serial<\/em> baud should remain the same as it is used to display the responses in the Serial window.<\/p>\n<p>Here&#8217;s a excerpt from the sketch:<\/p>\n<pre>delay(1000);\r\nmySerial.print(\"AT\");\r\ndelay(1000);\r\nmySerial.print(\"AT+VERSION\");\r\ndelay(1000);\r\n\/\/mySerial.print(\"AT+PIN1234\"); \/\/ Set pin to 1234\r\n\/\/delay(1000);\r\nmySerial.print(\"AT+NAMEJY-MCU-HC06\"); \/\/ Set the name to JY-MCU-HC06\r\ndelay(1000);\r\nmySerial.print(\"AT+BAUD8\"); \/\/ Set baudrate to 115200\r\n\/\/mySerial.print(\"AT+BAUD4\"); \/\/ Set baudrate to 9600\r\ndelay(1000);\r\n<\/pre>\n<p>Demo Sketch: \u00a0<a href=\"http:\/\/www.plastibots.com\/wordpress\/wp-content\/uploads\/2013\/12\/HC_05BluetoothCommandMode_ino.zip\">JY-MCU HC-06 Command Mode &#8211; Arduino Sketch<br class=\"none\" \/><br class=\"none\" \/><\/a><\/p>\n<p><a href=\"http:\/\/m2.img.dxcdn.com\/CDDriver\/sku.121326.pdf\" target=\"_blank\">Reference Info<\/a>\u00a0 More <a href=\"http:\/\/www.instructables.com\/id\/Modify-The-HC-05-Bluetooth-Module-Defaults-Using-A\/\" target=\"_blank\">reference <\/a>(specific to the HC-05)<\/p>\n","protected":false},"excerpt":{"rendered":"<p>After spending nearly 3 hours scouring the Web trying to find a way to configure my\u00a0HC-06 Bluetooth module. \u00a0There are a lot of great tutorials out there. \u00a0Many of them refer to setting the key pin HIGH, or a combination of LOW then HIGH while powering on the module. \u00a0However, none of these approaches worked for the unit I have. \u00a0Read on to see how it can be done. \u00a0Oddly, I found the answer in &hellip; <a href=\"https:\/\/www.plastibots.com\/index.php\/2013\/12\/31\/hc-06-bluetooth-module-getting-this-sucker-into-at-command-mode\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":4,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[65,78],"tags":[64,90,133,88,89],"class_list":["post-3124","post","type-post","status-publish","format-standard","hentry","category-arduino-electronics","category-bluetooth","tag-arduino","tag-at-command","tag-bluetooth","tag-hc-06","tag-jy-mcu","has_no_thumb"],"aioseo_notices":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/pK41j-Oo","jetpack_sharing_enabled":true,"post_mailing_queue_ids":[],"_links":{"self":[{"href":"https:\/\/www.plastibots.com\/index.php\/wp-json\/wp\/v2\/posts\/3124","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.plastibots.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.plastibots.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.plastibots.com\/index.php\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/www.plastibots.com\/index.php\/wp-json\/wp\/v2\/comments?post=3124"}],"version-history":[{"count":0,"href":"https:\/\/www.plastibots.com\/index.php\/wp-json\/wp\/v2\/posts\/3124\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.plastibots.com\/index.php\/wp-json\/wp\/v2\/media?parent=3124"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.plastibots.com\/index.php\/wp-json\/wp\/v2\/categories?post=3124"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.plastibots.com\/index.php\/wp-json\/wp\/v2\/tags?post=3124"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}