If you have been looking for an easy and inexpensive way to wirelessly integrate an Arduino and a BeagleBone Black (BBB), or Raspberry Pi (RPi) look no further, this tutorial will show you how!
What You Will Need
Why Change Speed?
The HC-06 has a default baud rate of 9600 bps. Since we will be running PyMata on the BBB to control the Arduino, we will need to change the speed of the HC-06 to 57600.
Wiring Up - Preparing to Program the HC-06
Wire the HC-06 as shown in the illustration above with the following temporary exceptions:
Make sure that you connect the HC-06 VCC pin to the 3.3 volt pin of the Arduino, since the HC-06 is a 3.3 volt device. Also, make sure that you create the voltage divider using the three 1k Ohm resistors. The divider is needed because Arduino output pins provide 5 volts and not the 3.3 volts the HC-06 require. If you were to connect the Arduino TxD pin to the HC-06 RxD pin without the divider, you might damage the HC-06.
Ready, Set, Program !
Others have written articles about programming the HC-06, and so as not to duplicate their fine efforts, here are 2 excellent links:
The first reference provides a link to a sketch that I used to program my HC-06.
Once the programming is complete and you are satisfied with its success, return the blue and yellow wires to their original positions as shown in the illustration. Also, disconnect the USB cable from the Arduino and power the Arduino with an external 9 volt power source. This is to prevent having a signal conflict between the USB interface and the HC-06 device for Arduino pins 0 and 1.