Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
bluetooth-serial [2021/02/21 21:18]
127.0.0.1 external edit
bluetooth-serial [2021/02/22 16:47] (current)
Line 15: Line 15:
 You can also use a BLE (Bluetooth Low Energy) or BT4.0 device like the HC-10, but you will need a comms device that talks BLE/BT4.0 and not many computers do (a recent-model Apple Macbook Pro/Air will be able to, my recent-model HP doesn't), so by sticking to the HC-05 you can be sure of being compatible with the majority of devices.  You can also use a BLE (Bluetooth Low Energy) or BT4.0 device like the HC-10, but you will need a comms device that talks BLE/BT4.0 and not many computers do (a recent-model Apple Macbook Pro/Air will be able to, my recent-model HP doesn't), so by sticking to the HC-05 you can be sure of being compatible with the majority of devices. 
  
-{{/external/https.web.archive.org.web.20161013235353im.http.gd1.alicdn.com.bao.uploaded.i1.14767031049461097.t1rryxxzxkxxxxxxxx.0.item.pic.jpg.400x400.jpg.webp}}+{{//external/https.web.archive.org.web.20161013235353im.http.gd1.alicdn.com.bao.uploaded.i1.14767031049461097.t1rryxxzxkxxxxxxxx.0.item.pic.jpg.400x400.jpg.webp}}
  
-I prefer the CZ over the JY for a few reasons â€“ it is really small, it is really well made, it has the KEY (P34, state pin) already broken out and it does level shifting of all the pins back to the 3.3V required by the HC module, unlike some of the other breakouts.+I prefer the CZ over the JY for a few reasons €“ it is really small, it is really well made, it has the KEY (P34, state pin) already broken out and it does level shifting of all the pins back to the 3.3V required by the HC module, unlike some of the other breakouts.
  
 Of course, some of the US manufacturers make some great boards with superior features and wonderful quality control, but that comes at a price - personally I like paying $4 for a bluetooth module, rather than $25-30. Of course, some of the US manufacturers make some great boards with superior features and wonderful quality control, but that comes at a price - personally I like paying $4 for a bluetooth module, rather than $25-30.
Line 38: Line 38:
 GND to HC-05 GND  GND to HC-05 GND 
 5V to HC-05 VCC  5V to HC-05 VCC 
-5v to HC-05 KEY or HC-05 P34 -  adding a signal (or voltage) to this pin when you power it on puts the HC-05 in command mode, where you can program the features. Some manufacturers break P34 out on the breakout board, but leave the pin un-soldered, some wire it all up just like the CZ, some wire other pins… if they haven’t wired it, you will need to hold a signal high to P34 while you power cycle the HC-05 to get it into command mode. Once you have it in command mode, you can remove the signal â€“ it will stay in command mode until reset or power-cycle the module.+5v to HC-05 KEY or HC-05 P34 -  adding a signal (or voltage) to this pin when you power it on puts the HC-05 in command mode, where you can program the features. Some manufacturers break P34 out on the breakout board, but leave the pin un-soldered, some wire it all up just like the CZ, some wire other pins€¦ if they haven€™t wired it, you will need to hold a signal high to P34 while you power cycle the HC-05 to get it into command mode. Once you have it in command mode, you can remove the signal €“ it will stay in command mode until reset or power-cycle the module.
  
 === Arduino sketch: to program the HC-05 === Arduino sketch: to program the HC-05
Line 81: Line 81:
 Connect/power on the Arduino, load the Arduino IDE and load the sketch above. Connect/power on the Arduino, load the Arduino IDE and load the sketch above.
  
-Recycle the Arduino and the HC05 should initialise and slowly flash its LED â€“ this indicates it is in Command Mode.+Recycle the Arduino and the HC05 should initialise and slowly flash its LED €“ this indicates it is in Command Mode.
  
 Bring up the Arduino IDE serial monitor and set to 9600+CR+LF Bring up the Arduino IDE serial monitor and set to 9600+CR+LF
Line 92: Line 92:
 Connection mode: Connect to the Bluetooth device specified Connection mode: Connect to the Bluetooth device specified
 Transmission rate: 38,400 bps; Stop bit: 1 bit; Parity bit: None. Transmission rate: 38,400 bps; Stop bit: 1 bit; Parity bit: None.
-Passkey: â€œ1234” +Passkey: €œ1234€ 
-Device name: â€œH-C-2010-06-01” (or some variant depending on what is programmed in the firmware).//+Device name: €œH-C-2010-06-01€ (or some variant depending on what is programmed in the firmware).//
  
 The first thing to do is to ensure the module is set to factory defaults, using the AT+ORGL command. The first thing to do is to ensure the module is set to factory defaults, using the AT+ORGL command.
Line 102: Line 102:
 Change the device name: AT+NAME=Smoothie (or anything you like: KillR3D, MyPrinter, Arthur, KZ223398 - the module don't care. Change the device name: AT+NAME=Smoothie (or anything you like: KillR3D, MyPrinter, Arthur, KZ223398 - the module don't care.
  
-You can also change the pairing key if you want, either for easier access or for privacy â€“ my Macbook defaults to 0000, but the HC-05 defaults to 1234. To make it publicly accessible, give it a pin of 0000: AT+PSWD=0000 - to make it secure, pick any 4-digits that you will remember.+You can also change the pairing key if you want, either for easier access or for privacy €“ my Macbook defaults to 0000, but the HC-05 defaults to 1234. To make it publicly accessible, give it a pin of 0000: AT+PSWD=0000 - to make it secure, pick any 4-digits that you will remember.
  
 <code> <code>