Go Down

Topic: Two Arduino boards via Bluetooth (Read 650 times) previous topic - next topic

binfazen

Hello, everyone.

I am starting an interesting project, where I need to make connection between two arduino boards via bluetooth. i am using bluetooth and arduino for the first time.

I am using:
1. Arduino Duemilanove, ATmega328;
2. Arduino Mega, ATmega 2560;
3. 2x HC-05 bluetooth modules: http://www.ebay.com/itm/310540196588?ssPageName=STRK:MEWNX:IT&_trksid=p3984.m1497.l2649

I also found this http://cu.rious.org/make/hc-05-bluetooth-with-arduino/ and tried to make a connection but with no luck. Maybe where are some problems in code? I am talking about PAIR, BIND, CMODE or other commands.

Maybe someone have an alternative code or useful advices? Maybe someone already have done this and could explain the details?
Any help would be appreciate.

Best regards,
Simas

spatula

Hi,
I think you should put many debug statements (Serial.print()) in the code, otherwise there are too many things that may go wrong and you'll never know.

First of all, however, how did you connect the modules to the Arduinos? From the picture I would say there is no exposed connection to the RESET or PIO11 pins of the module. Unless you made the connections yourself the code will not work, because it expects the module's RESET to be connected to the Arduino's pin5, and PIO11 to pin8. Additionally, if you have a Mega you cannot use SoftwareSerial on pins 6 and 7 (see this page: http://arduino.cc/en/Reference/SoftwareSerial.

Then there may be problems at the software level, but you should first make sure that the hardware is properly setup.

binfazen

Thanks for your replay. I didn't know about Mega's limitations of serial.

I manually soldered these two wires to Bluetooth module, so I can use them. Maybe you know something more about PAIR, BIND functions? I read manual, but I think I didn't get it right.

binfazen

I found my problem with connections. Now everything works fine :)

spatula

#4
Mar 31, 2013, 09:57 pm Last Edit: Mar 31, 2013, 10:11 pm by spatula Reason: 1
:)

[edit] Well I was also going to say that after the first successful pairing the devices should be capable of pairing again automatically, without repeating the commands seen in the code. That's just my supposition, however. The command set is much more complete than the one used by the devices I have, have fun.

Go Up