Arduino or Netduino: Adding Bluetooth using the JY-MCU HC-06 V1.XX

Finally got it to work.  Seriously, the voltage for the JY-MCU is REALLY 3.6 to 5.0 volts.  This means that the 3.3 lower voltage provided by the Arduino/Netduio board will be flaky, and what does flaky mean?  It means that it will randomly and infrequently, at least with the board I have.  In fact with 3.3 volts the flashy LED mode (waiting to connect) will flash but it won’t turn steady (paired).  So that was a waste of 4 hours trying to figure out what was wrong.

My troubleshooting is usually to start from the point that things didn’t work.  So I made sure the pins and everything were connected correctly.  I then simplified the circuit so that it was the simplest circuit possible.  Still not pairing and I had forgotten that the voltage was at 3.3 and not 5.0.  But then I noticed that the pairing would take longer than expected.

The blog that helped me out is found at: https://robotosh.blogspot.com/2012/07/arduino-jy-mcu-bluetooth.html (thank you!)

How did it help me out?  I just needed to get really simple, mainly because I am a pretty simple guy.  Also, I needed some code to get me started with the serial interface on the Arduino.  Let’s face it, I don’t have to use serial communications all that often.  Also, the HC-06 only accepts certain commands. If you want the full featured Bluetooth, you will have to pay a few dollars more to get the HC-05 which is full feature.

And as for Peli and his: “WiFI, Sam, use the Spark, well all I can say to you Peli is this: If I build my fishing pole sensor array, and I am out on a boat, just how will I use WiFi?”  Also, I have to get this Fishing Pole sensor built quickly so I can have an excuse to go fishing to test it out right?  With Bluetooth, if I use the HC-05 which is referred to as Master/Slave instead of the HC-06 which is referred to as a slave unit. But for now I have the HC-06

Oh well.  Keep it simple.  Connect the JY-MCU HC-06 to the Arduino, using this image from the URL: https://bit.ly/1umhmFo , and the diagram is generated using the tool: Fritzing.org, but I was too lazy to make one myself. 

board[1]

Now the code for the Arduino looks like, and there is a change from the source code, mainly because I want to add value and also to fix a small problem.  I added the reset code fort the counter as it appeared that there was a run on condition and the device would not pair.  I could be wrong, let me know if that is the case.  You do need to be careful of that in your Arduino design.  If the over run condition exists, turning power off won’t work, you either have to do a hard reset or reload the code.

Once you are paired successfully the blinking red LED will stop blinking.  If you lose connection it will start blinking again. 

 

int counter = 0;

void setup() {
    Serial.begin(9600);
}

void loop() {
    Serial.print("Arduino + Windows 8.1  = ");
    Serial.print(++counter);
    if (counter > 120)
    {
        counter = 0;
    }

    Serial.println(" times awesome");
    delay(1000);
}