{"id":2639,"date":"2023-07-21T14:03:16","date_gmt":"2023-07-21T13:03:16","guid":{"rendered":"https:\/\/ibex.tech\/resources\/?p=2639"},"modified":"2023-08-15T19:31:57","modified_gmt":"2023-08-15T18:31:57","slug":"hc-05","status":"publish","type":"post","link":"https:\/\/ibex.tech\/resources\/geek-area\/communications\/bluetooth-communications\/bluetooth-modules\/hc-05","title":{"rendered":"HC-05 Bluetooth module"},"content":{"rendered":"\n<p>The HC-05 is widely used as a cheap simple just works transparent Bluetooth serial link. It can be configured to be host or slave, which means you can use two of them to create a paired link that passes your UART comms over Bluetooth.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Parts<\/h4>\n\n\n\n<p><a rel=\"noreferrer noopener\" href=\"https:\/\/thepihut.com\/products\/hc-05-bluetooth-module\" target=\"_blank\">HC-05 Bluetooth Serial Transceiver<\/a>, you want the HC-05 that is mounted to the 6 pin breakout\/interfacing board like in this picture:<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/arduino-developer.com\/arduino\/wp-content\/uploads\/hc-05-bluetooth-module-300x140.png\" alt=\"\" class=\"wp-image-716\"\/><\/figure>\n\n\n\n<h5 class=\"wp-block-heading\">HC-05 vs HC-06<\/h5>\n\n\n\n<p>The HC-06 is a 4 pin slave on only variant, whereas the HC-05 can be configured to be a master or slave Bluetooth device. Most of whats detailed here also applies to the HC-06.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Using the HC-05 to wirelessly program an Arduino<\/h4>\n\n\n\n<p>See our <a rel=\"noreferrer noopener\" href=\"https:\/\/arduino-developer.com\/arduino\/hardware\/programmers\/wireless-programming\/bluetooth-wireless-arduino-programming-using-the-hc-05\" target=\"_blank\">other page over here<\/a>.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">HC-05 pins<\/h4>\n\n\n\n<h5 class=\"wp-block-heading\">Power and IO Pins<\/h5>\n\n\n\n<p>Power with 3.3V to 6V.<\/p>\n\n\n\n<p>An onboard voltage regulator converts Vin to 3.3V to power the HC05. This means that IO signals are 3.3V, not 5V. When connecting to a 5V Arduino, signal inputs into the HC-05 must have their voltage dropped (e.g. using a 1K2 + 2K2 resistors potential divider).<\/p>\n\n\n\n<p>Note that because the HC-05 has its own voltage regulator, there may be signal voltage differences to another 3.3V device you connect to it. If powering the HC-05 with 3V3 this will be even more relevant because the voltage regulator in the HC-05 will cause some voltage drop. Using a series resistor on each signal (e.g. 100R) to interface signals to another 3.3V device is good practice.<\/p>\n\n\n\n<h5 class=\"wp-block-heading\">STATE pin<\/h5>\n\n\n\n<p>Default usage is that this pin goes high when a connection is made (can be connected to a LED for instance). However, we re-configure it to go low when a connection is made and connect it via a series capacitor so that it gives a brief reset pulse to the Arduino RESET pin when a connection is made (the Arduino software starts its programming operation).<\/p>\n\n\n\n<p>This works because Bluetooth does not maintain a constant connection even though it remains \u201cpaired\u201d. It only remains connected when data is actively being sent or received, otherwise the connection automatically terminates. When you hit the upload button, your computer will initiate a connection, when the upload is done and all data is sent, the connection will be automatically terminated. The same happens when you open a serial monitor. The connection will remain active until you close the serial monitor, then it will automatically terminate.<\/p>\n\n\n\n<h5 class=\"wp-block-heading\">EN<\/h5>\n\n\n\n<p>This is connected to the push button (it\u2019s not the voltage regulator enable pin as shown on some schematics).<\/p>\n\n\n\n<h5 class=\"wp-block-heading\">PIO11 (Key) \/ Push Button<\/h5>\n\n\n\n<p>Pulled low on the HC-05 breakdown board, but tied high when the push button on the board is held.<\/p>\n\n\n\n<p>When the HC-05 is powered on with PIO11 pulled high it enters its special command mode and will accept AT commands.<\/p>\n\n\n\n<p>When the HC-05 is powered on with PIO11 pulled low it enters its default running mode.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">LED<\/h4>\n\n\n\n<p>Fast flash \u2013 HC-05 is in running mode, ready to connect<\/p>\n\n\n\n<p>Slow flash (approx 2 secs) \u2013 HC-05 is in config mode (will accept AT commands).<\/p>\n\n\n\n<p>2 flashes every few seconds \u2013 linked to remote device (transparent serial bridge).<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Design Notes<\/h4>\n\n\n\n<p><a rel=\"noreferrer noopener\" href=\"https:\/\/cdn.shopify.com\/s\/files\/1\/0176\/3274\/files\/HC05_DS.pdf?v=1611923854\" target=\"_blank\">HC05 datasheet<\/a><\/p>\n\n\n\n<p><a rel=\"noreferrer noopener\" href=\"https:\/\/techbitar.weebly.com\/uploads\/2\/0\/3\/1\/20316977\/hc-05_at_commands_1.pdf\" target=\"_blank\">HC-05 AT Commands<\/a><\/p>\n\n\n\n<p>The HC-05 incorporates a low drop out voltage regulator, so it can be powered from 3.3V to 6V. Its signals are 3.3V though. Here&#8217;s a schematic we came across:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/ibex.tech\/resources\/wp-content\/uploads\/sites\/3\/hc-05-schematic.png\"><img loading=\"lazy\" decoding=\"async\" width=\"412\" height=\"238\" src=\"https:\/\/ibex.tech\/resources\/wp-content\/uploads\/sites\/3\/hc-05-schematic.png\" alt=\"\" class=\"wp-image-2641\" srcset=\"https:\/\/ibex.tech\/resources\/wp-content\/uploads\/sites\/3\/hc-05-schematic.png 412w, https:\/\/ibex.tech\/resources\/wp-content\/uploads\/sites\/3\/hc-05-schematic-300x173.png 300w, https:\/\/ibex.tech\/resources\/wp-content\/uploads\/sites\/3\/hc-05-schematic-60x35.png 60w, https:\/\/ibex.tech\/resources\/wp-content\/uploads\/sites\/3\/hc-05-schematic-150x87.png 150w\" sizes=\"auto, (max-width: 412px) 100vw, 412px\" \/><\/a><\/figure>\n\n\n\n<p><em>Note the EN pin is wrong on this schematic, it&#8217;s actually connected to POI11 \/ the push button.<\/em><\/p>\n\n\n\n<p>This means if you are using it with a 5V Arduino, you&#8217;ll need a 1K2+2K2 potential divider on the Arduino TX pin to the HC-05 to lower its voltage and make it compatible with the HC-05. The Arduino RX pin will be fine to directly connect as long as it will accept a low input voltage as a high state (the Uno does for instance), otherwise you&#8217;ll need to <a rel=\"noreferrer noopener\" href=\"https:\/\/ibex.tech\/resources\/geek-area\/electronics\/interfacing\/interfacing-busses\" target=\"_blank\">boost the voltage up to 5V &#8211; see here<\/a>.<\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>The HC-05 is widely used as a cheap simple just works transparent Bluetooth serial link. It can be configured to be host or slave, which means you can use two of them to create a paired link that passes your UART comms over Bluetooth. Parts HC-05 Bluetooth Serial Transceiver, you want the HC-05 that is [&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-2639","post","type-post","status-publish","format-standard","hentry","category-bluetooth-modules"],"_links":{"self":[{"href":"https:\/\/ibex.tech\/resources\/wp-json\/wp\/v2\/posts\/2639","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=2639"}],"version-history":[{"count":12,"href":"https:\/\/ibex.tech\/resources\/wp-json\/wp\/v2\/posts\/2639\/revisions"}],"predecessor-version":[{"id":2735,"href":"https:\/\/ibex.tech\/resources\/wp-json\/wp\/v2\/posts\/2639\/revisions\/2735"}],"wp:attachment":[{"href":"https:\/\/ibex.tech\/resources\/wp-json\/wp\/v2\/media?parent=2639"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ibex.tech\/resources\/wp-json\/wp\/v2\/categories?post=2639"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ibex.tech\/resources\/wp-json\/wp\/v2\/tags?post=2639"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}