Pairing HC05 BT Module uisng Arduino MEGA 2560

SO, for about three weeks I have been trying to find a schematic and a sketch that will allow me to configure (pair) two HC-05 BT modules using two Arduino MEGA cards. Once I have them paired, I would like to be able to conduct a test to ensure they are talking to one another.

I have tried several sketches but nothing seems to work for me. The equipment I have are 2 HC-05 BT modules, 2 Arduino MEGA cards, 2 breadboards with jumpers and several various resistors (1K ohm, 2K ohm and more). I was suppose to have my project completed a week ago but cannot finish it without pairing the BT modules first. Any and all assistance will be more than appreciated.

Have you looked really hard?

Wire Serial1 - taking into account voltage adaptation to 3.3V for: Tx arduino → Rx BT. You should have read about this (arduino sends HIGH at 5v, BT module can only receive 3.3, although some are robust enough and won’t die if you send 5V but be careful, you can destroy your module)

Put USB cable to your MAC/PC.

Write a small program reading the Serial input from the console and sending that to Serial1 and reading from Serial1 and sending to Serial. You should have seen such programs in your search

In setup begin serial connections
Set baud rate for Serial to 115200
Set baud rate for Serial1 to 9600 (or if you know the BT default rate use that)

Upload your program, open the serial console, set baud rate to 115200, send CR/LF with each entry

Type AT in the serial console and see if you get OK back

If not, change Serial1 baud rate in setup() and re-upload until you get an answer (you need to find out at what rate the BT module is by default)

Once you get OK back then you are talking to your module. Use an AT command guide to configure your BT modules, one slave, one master, same baud rate, security as you wish, find their IDs,establish the pairing etc

Then connect them each on the two arduinos, on the master issue a pairing AT command. You are now good to go, both Serial1 ports are connected over BT.

Please share back (if you have further questions) how you physically wired everything and the code for the program above. I won’t answer further questions if you don’t show minimum work.

Why are you confusing people and wasting their time by posting on two threads at once?

lpetrowicz:
This is somewhat helpful but can you send me a diagram and a sketch please for the Arduino MEGA? I am so far behind on this project...seriously.

I have the code to make my program run once I get the two bluetooth modules paired.

for about three weeks I have been trying to find a schematic and a sketch

well you are there because you wrongly invested weeks trying to find a already fully crafted solution matching your needs versus investing that time to do the work, learn, experiment and do your homework, not rely on someone else's work...

Sorry - but do your part.

You have the high level view, you now need to dig into those concepts and stop loosing time. get to work, read simple examples about Serial lines, about bluetooth AT commands and get something done.

I am just lost and confused at this point.

Time for a synopsis, then. Describe, with a schematic, how the bluetooth device(s) is(are) connected to the Arduino. Post the code you do have. Describe your observations. Post links to the hardware you are using. Not the Mega, we know what a Mega is.