{"id":2712,"date":"2023-08-15T14:24:51","date_gmt":"2023-08-15T13:24:51","guid":{"rendered":"https:\/\/ibex.tech\/resources\/?p=2712"},"modified":"2023-08-15T15:32:36","modified_gmt":"2023-08-15T14:32:36","slug":"hc-06-configuration","status":"publish","type":"post","link":"https:\/\/ibex.tech\/resources\/geek-area\/communications\/bluetooth-communications\/bluetooth-modules\/hc-06-configuration","title":{"rendered":"HC-06 Configuration"},"content":{"rendered":"\n<p>The HC-06 is the slave only version of the HC-05. It can also be configured using AT commands. <\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Config settings<\/h4>\n\n\n\n<p>The config settings are non-volatile (they are remembered when power is lost).<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Sending config commands to the HC-06 using a PC using a USB to serial cable<\/h4>\n\n\n\n<p>You might want to do this so you can configure the HC-06 without using an Arduino, or even if you want to connect your computer to a remote HC-05 without using the computer\u2019s Bluetooth adapter for some reason.<\/p>\n\n\n\n<h5 class=\"wp-block-heading\">Parts<\/h5>\n\n\n\n<p><a href=\"https:\/\/thepihut.com\/products\/hc-06-bluetooth-module\" target=\"_blank\" rel=\"noreferrer noopener\">HC-06 Bluetooth Serial Transceiver<\/a><\/p>\n\n\n\n<p><a href=\"https:\/\/www.adafruit.com\/product\/4364\" target=\"_blank\" rel=\"noreferrer noopener\">FTDI Serial TTL-232 USB Type C Cable &#8211; 5V Power \/ 3.3V Logic<\/a> or <a rel=\"noreferrer noopener\" href=\"https:\/\/uk.rs-online.com\/web\/p\/development-tool-accessories\/0429303?gb=s\" target=\"_blank\">TTL-232R-3V3-WE FTDI USB to UART Cable<\/a><\/p>\n\n\n\n<h5 class=\"wp-block-heading\">Wiring<\/h5>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td><strong>TTL-232R \/ TTL-232R<\/strong><\/td><td><strong>Function<\/strong><\/td><td><strong>TC-0<\/strong>6<\/td><\/tr><tr><td>Black<\/td><td>GND<\/td><td>GND<\/td><\/tr><tr><td>Red<\/td><td>VCC<\/td><td>VCC<\/td><\/tr><tr><td>Yellow<\/td><td>RXD<\/td><td>TXD<\/td><\/tr><tr><td>Orange<\/td><td>TXD<\/td><td>RXD<\/td><\/tr><tr><td>Brown<\/td><td>CTS<\/td><td>Link CTS to RTS<\/td><\/tr><tr><td>Green<\/td><td>RTS<\/td><td>Link CTS to RTS<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>Configure your serial port \/ terminal software to use 9600-8-N-1 (baud 38400, 8-bit, no parity, 1 stop bit).<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Sending config commands to the HC-06 via an Arduino<\/h4>\n\n\n\n<p>E.g. connecting the TX and RX pin of the HC-06 to the TX and RX pins of the Arduino Uno TX and RX pins (don\u2019t connect the STATE pin for this).<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td>Arduino<\/td><td>HC-06<\/td><\/tr><tr><td>IO0<\/td><td>RX (connect via 1K2+2K2 potential divider)<\/td><\/tr><tr><td>IO1<\/td><td>TX (fine to connect directly to the Arduino Uno)<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>A 1K2+2K2 potential divider is required on the RX pin to shift the Arduino 5V TX pin down to 3.3V required by the HC-06 RX pin.<\/p>\n\n\n\n<p>Menu &gt; Tools &gt; Serial Monitor<\/p>\n\n\n\n<p>Line ending dropdown: \u201cBoth NL and CR\u201d &lt;&lt;Not sure on this, in our tests with a terminal application it didn&#8217;t accept \\r\\n &#8211; yet to try with the Arduino IDE.<\/p>\n\n\n\n<p>Baud dropdown: \u201c9600\u201d<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Programming the HC-06 using AT commands<\/h4>\n\n\n\n<p>The HC-06 Bluetooth module is permanently configured to be slave and is always in AT mode when not paired to any other device. So to configure it, make sure there is nothing that will attempt to pair with it when it appears and simply power it up.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Example commands you can use<\/h4>\n\n\n\n<h5 class=\"wp-block-heading\">Check it&#8217;s in AT command mode<\/h5>\n\n\n\n<p>AT<\/p>\n\n\n\n<p>(You should get the OK response)<\/p>\n\n\n\n<h5 class=\"wp-block-heading\">Return the HC05 to its default manufacture settings<\/h5>\n\n\n\n<p><em>You need to press and hold the push button when sending this one, as it causes the HC-05 to reset and it will exit config mode as it restarts without the button held<\/em>.<\/p>\n\n\n\n<p>AT+ORGL\\r\\n<\/p>\n\n\n\n<h5 class=\"wp-block-heading\">Change comms settings<\/h5>\n\n\n\n<p>AT+BAUD8<\/p>\n\n\n<p>The number sets the baud rate:<\/p>\n<p style=\"padding-left: 40px;\">1: 1200 baud<br \/>2: 2400 baud<br \/>3: 4800 baud<br \/>4: 9600 baud (default)<br \/>5: 19200 baud<br \/>6: 38400 baud<br \/>7: 57600 baud<br \/>8: 115200 baud<br \/>9: 230400 baud<br \/>A: 460800 baud<br \/>B: 921600 baud<br \/>C: 1382400 baud<\/p>\n\n\n<p>Note the baud rate changes immediately and is also used for AT mode. You&#8217;ll need to set your terminal program or Arduino IDE to use your new baud rate.<\/p>\n\n\n\n<h5 class=\"wp-block-heading\">Change device name from the default HC-05<\/h5>\n\n\n\n<p>AT+NAMEnewname<\/p>\n\n\n\n<p>You can use this to get the current name: AT+NAME<\/p>\n\n\n\n<h5 class=\"wp-block-heading\">Change default security code from 1234<\/h5>\n\n\n\n<p>AT+PIN5678<\/p>\n\n\n\n<h5 class=\"wp-block-heading\">Version<\/h5>\n\n\n\n<p>AT+VERSION<\/p>\n\n\n\n<h5 class=\"wp-block-heading\">Read Slave HC-05 Bluetooth address<\/h5>\n\n\n\n<p>There doesn&#8217;t appear to be an equivalent command to the HC-05 &#8220;AT+ADDR?&#8221; unfortunately, you&#8217;ll have to use your PC or phone to scan for it and get its MAC address.<\/p>\n\n\n\n<p><a rel=\"noreferrer noopener\" href=\"https:\/\/learn.adafruit.com\/bluefruit-le-connect\/ios-setup\" target=\"_blank\">BluefruitConnect<\/a> on the iPhone or android will do it.<\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>The HC-06 is the slave only version of the HC-05. It can also be configured using AT commands. Config settings The config settings are non-volatile (they are remembered when power is lost). Sending config commands to the HC-06 using a PC using a USB to serial cable You might want to do this so you [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[140],"tags":[],"class_list":["post-2712","post","type-post","status-publish","format-standard","hentry","category-bluetooth-modules"],"_links":{"self":[{"href":"https:\/\/ibex.tech\/resources\/wp-json\/wp\/v2\/posts\/2712","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ibex.tech\/resources\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ibex.tech\/resources\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ibex.tech\/resources\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ibex.tech\/resources\/wp-json\/wp\/v2\/comments?post=2712"}],"version-history":[{"count":9,"href":"https:\/\/ibex.tech\/resources\/wp-json\/wp\/v2\/posts\/2712\/revisions"}],"predecessor-version":[{"id":2732,"href":"https:\/\/ibex.tech\/resources\/wp-json\/wp\/v2\/posts\/2712\/revisions\/2732"}],"wp:attachment":[{"href":"https:\/\/ibex.tech\/resources\/wp-json\/wp\/v2\/media?parent=2712"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ibex.tech\/resources\/wp-json\/wp\/v2\/categories?post=2712"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ibex.tech\/resources\/wp-json\/wp\/v2\/tags?post=2712"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}