Two Arduino boards via Bluetooth

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:

I also found this 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

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:

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

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.

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


[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.