Hey Guys, Newb here, actually I don’t even qualify as a newb, I more like a newb-1 at this point. I was wondering if someone could basically hold my hand and walk me through this step by step. I am using the following hardware: Arduino Nano 368 MPU-Bluetooth HC-06 module bought from Amazon http://www.amazon.com/gp/product/B0093XAV4U/ref=oh_details_o07_s00_i03?ie=UTF8&psc=1 GY-251 MPU6050 Accelerometer module, ordered from Amazon http://www.amazon.com/gp/product/B008BOPN40/ref=oh_details_o07_s00_i07?ie=UTF8&psc=1 Here are my problems: 1. The Bluetooth comes up as COM 8 on my PC. And it won’t let me change it to COM 9 in my settings, I am using windows 7. In Arduino IDE it only comes up as COM9 available and there is no option for COM 8. 2. For wiring I followed the tutorials exactly, so I think this is okay. The nano has 2 grounds and the Bluetooth module is hooked up to one and the accelerometer is hooked up to the other. I have the accelerometer board plugged into the 3.3v pin on the nano and the Bluetooth board plugged into the 5v pin on the nano. At least one LED on each of the boards is currently blinking or on, so they are getting power. I am using a 5V cell phone power bank to power the nano through the mini usb slot. 3. When I open the serial monitor, nothing happens, if I try and type a command, it just freezes. 4. I am using the sketch found at http://playground.arduino.cc/Main/MPU-6050, it uploads fine over normal serial. Any help at this point is very appreciated. I read some tutorials and they mention something about configuring the accelerometer, do I need to load something on that first? If so how? My goal for now is just to have a wireless accelerometer sending data to my PC using the Arduino nano and the modules I mentioned above. Thanks in advance for the help, I am pulling my hair out on this one! Sincerely, Sam
Could you provided the code your using?
I don't know about Nano, but the 5v phone charger is probably a mistake. It may not be the cause of your current problem but it will be the cause of another very soon. Get a proper 9v supply.
I'm, not going to read all that code, but the absence of anything at line 40 suggests you are using hardware serial, i.e. pins 0,1 for RxTx, which is right and proper. In that event, are you sure that the USB cable is disconnected while you attempt bluetooth comms?
You are right in that the flashing LED suggests power, but that is all you have done.
I suggest you forget about the accelerometer and properly address the bluetooth. Here is some background
You should use Putty or Realterm instead of the serial monitor, and make sure the bluetooth module is wired properly. Tx to Rx and Rx to Tx.
Thanks for the replies. The bluetooth seems to be working fine. I have it wired correctly, reversed RX/TX pins. I can give it a command through the serial monitor and have it turn the LED on and off, or make it blink, I can't seem to upload a new sketch over bluetooth though, I read that this should be possible. Why is 5v power supply going to be bad? Isn't that the same voltage as the USB?
Take the file attached below and use it to replace the existing one in your arduino folder and it will improve your arduino IDE to bluetooth compatibility.
rxtxSerial.dll (96.1 KB)
If you're trying to use the bluetooth to upload a new sketch, you will need to source a pin on the module to use as a DTR which will reset the arduino when you hit the upload button. Then it will accept a sketch.
That makes sense. Umm. How do I source a pin? Just hook 2 together?
Depends on the pinout of your BT module. You have to use an available pin as your DTR pin. Your answer might be here... http://forum.arduino.cc/index.php?topic=218049.0
The only pin that might work just says Key next to it. I am using the hc-06 bluetooth module.
My bad. My frustration clouds my vision. State is on there too. Will that work or do I have to send it some code too? Oh and thanks for all the replies so far! You guys have been a great help!
SteveRogers: Why is 5v power supply going to be bad? Isn't that the same voltage as the USB?
Using a phone charger is a common path to strife. I recognise that Nanos are different and you can put 5v on pin 27. You are assuming that the charger is delivering a smooth 5v but a rough 4.5v will actually charge a 3.7v battery . Therefore you need to ensure that it is delivering what you think it is delivering.
So far this makes sense. The only thing I can't figure out is how to send an AT command. Do I do that through the serial monitor?
I hooked up the DTR pins but I can't seem to enter an AT command. Anyone?
The at commands are entered from the serial monitor. You have to load a sketch that you can use for the purpose of changing the default setting with the at commands.
A link to a complete written tutorial, video, and sketch for you to enter the AT commands is in the forum thread I linked you to earlier. Here it is --> http://www.techbitar.com/modify-the-hc-05-bluetooth-module-defaults-using-at-commands.html
Load this sketch and open the serial monitor with the module connected.
You will enter this command:
It should respond with "OK"
That's it you're done. The state pin should go low whenever a connection is established now. This will act as your DTR.
I have one of these so I can program my digital RGB LED strip outside from my chair inside. http://www.adafruit.com/products/1588