need help on how to program hc-05 bluetooth shield

guys can you help me on my problem on program codes
i have 2 bluetooth module on shield (hc-05) and 2 arduino
i need to pair the to bluetooth , to do that i need to set 1 bt to master mode but i dunno how im so confused because it my bluetooth is on the shield , i just put them on top of arduino and their pins are connected ,i confused if what pin mode should i use to set them to master ,pls teach or guide me on how to set the bluetooth shield to master :frowning: :frowning: :o

bt shield on top of arduino.jpg

It doesn't look like a good choice of bluetooth, but maybe the supplier can help with some data on it. To get it to work as master, you need to go into AT mode. I believe part of this procedure is to ground pin 34, but I can't see an obvious way to do that here without a soldering iron. You would expect a button switch to do this. You would also expect to see a swag of jumpers so that you can select the pins for Tx/Rx. Since there are none, I guess you should assume it only uses hardware serial D0,D1 as marked, which isn't such a bad thing anyway.

You might find some help here for Arduino<>Arduino comms.

Nick_Pyner:
It doesn't look like a good choice of bluetooth, but maybe the supplier can help with some data on it. To get it to work as master, you need to go into AT mode. I believe part of this procedure is to ground pin 34, but I can't see an obvious way to do that here without a soldering iron. You would expect a button switch to do this. You would also expect to see a swag of jumpers so that you can select the pins for Tx/Rx. Since there are none, I guess you should assume it only uses hardware serial D0,D1 as marked, which isn't such a bad thing anyway.

You might find some help here for Arduino<>Arduino comms.

Phillipe Cantin: HC-05 Bluetooth link with zero code

thanks for helping me bro, yes there is a switch on the bluetooth shield near the red led and green led, on the switch it says hc-05 and hc-06 , i always set it on hc-05. is d0 and d1 is the rx,tx that i can see on the shield?
can you pls teach how can i go to at mode :frowning: if theres a code or anything :frowning:

i bought these 2 bluetooth shield and 2 arduino
http://www.e-gizmo.com/KIT/BLUETOOTH%20SHIELD.html
http://www.e-gizmo.com/KIT/Gizduino.html
i want to connect the two bluetooth and pair them, if theyre disconnected an alarm will trigger ,i cant set the bluetooth to master mode :confused: i dunno which code i will use im so confused because of the shield of the bluetooth , most of the tutorials i have read dont use shield on theyre bluetooth , T.T i found one tutorials that has same goal as mine, http://www.elab.ph/forum/index.php?topic=36823.0 but the problem is they dont use arduino on setting theyre bluetooth shield to master and i think the bluetooth shield theyre using is different version than mine?

rmtc:
thanks for helping me bro, yes there is a switch on the bluetooth shield near the red led and green led, on the switch it says hc-05 and hc-06 , i always set it on hc-05.

I can hardly believe what I'm reading here. What you are telling me is that that switch is for the convenience of the manufacturer, not your convenience. In the meantime they give you nothing to make your life easier, and it does rather suggest that they never expected to sell many. I would be glad to hear where you got it from. Leave it on HC-05 as you suggest.

is d0 and d1 is the rx,tx that i can see on the shield?

Yes, they are the normal hardware serial pins for Uno and Mega, i.e. the shield will work fine on both.

can you pls teach how can i go to at mode :frowning: if theres a code or anything :frowning:

I'm afraid I have no idea of the proper way to set this up for AT mode. Hence, at the risk of sounding flippant, my best advice is to ditch it and get a proper module, made by somebody who knows what they are doing. But you really need to check out the manufacturer on this as there is a faint possibility that they aren't as stupid as I think they are, and the module is already set up as master!

The best basic AT mode procedure I know of is here

http://www.martyncurrey.com/arduino-with-hc-05-bluetooth-module-at-mode/

Currey is a bit of an AT-mode eminence gris on this forum, and Cantin is sure to have stuff on this as well. For the really basic stuff, you might find the following background notes useful

http://homepages.ihug.com.au/~npyner/Arduino/GUIDE_2BT.pdf
http://homepages.ihug.com.au/~npyner/Arduino/BT_2_WAY.ino

but it does not cover AT made for HC-05, or Arduino<>Arduino comms.

Nick_Pyner:
I can hardly believe what I'm reading here. What you are telling me is that that switch is for the convenience of the manufacturer, not your convenience. In the meantime they give you nothing to make your life easier, and it does rather suggest that they never expected to sell many. I would be glad to hear where you got it from. Leave it on HC-05 as you suggest.

Yes, they are the normal hardware serial pins for Uno and Mega, i.e. the shield will work fine on both.

I'm afraid I have no idea of the proper way to set this up for AT mode. Hence, at the risk of sounding flippant, my best advice is to ditch it and get a proper module, made by somebody who knows what they are doing. But you really need to check out the manufacturer on this as there is a faint possibility that they aren't as stupid as I think they are, and the module is already set up as master!

The best basic AT mode procedure I know of is here

Arduino with HC-05 (ZS-040) Bluetooth module – AT MODE – Martyn Currey

Currey is a bit of an AT-mode eminence gris on this forum, and Cantin is sure to have stuff on this as well. For the really basic stuff, you might find the following background notes useful

http://homepages.ihug.com.au/~npyner/Arduino/GUIDE_2BT.pdf
http://homepages.ihug.com.au/~npyner/Arduino/BT_2_WAY.ino

but it does not cover AT made for HC-05, or Arduino<>Arduino comms.

i really appreciate your help sir,thanks for the explanation , i message the company where i buy the kits they aks me if i put jumper wires on the pin mode ?what was that mean ,sorry im noob :frowning:

why the serial monitor keeps giving me unknown symbols :confused:

rmtc:
they aks me if i put jumper wires on the pin mode ?what was that mean ,sorry im noob :frowning:

I can only guess that you put a jumper on the pins marked S4. I can't see another way to do it. There may be a track from pin 34 on the other side of the board that might confirm this. The supplier should be a lot more forthcoming.

I think this board is an expensive mistake but, if you persevere with it, you will be OK!

I think the code in the picture is complete and confusing junk and I don't understand how it can work with your shield. I say this because it calls for Bluetooth on pins 2,3. Maybe the device really does use software serial on 2,3 despite the marks on the board. Clearly, there is nothing wrong with the monitor settings. Maybe the Bluetooth is not set to 38400, so try altering the code to

BTserial.begin(9600);

which is the "usual default"

I ask again where this came from?

Nick_Pyner:
I can only guess that you put a jumper on the pins marked S4. I can't see another way to do it. There may be a track from pin 34 on the other side of the board that might confirm this. The supplier should be a lot more forthcoming.

I think this board is an expensive mistake but, if you persevere with it, you will be OK!

I think the code in the picture is complete and confusing junk and I don't understand how it can work with your shield. I say this because it calls for Bluetooth on pins 2,3. Maybe the device really does use software serial on 2,3 despite the marks on the board. Clearly, there is nothing wrong with the monitor settings. Maybe the Bluetooth is not set to 38400, so try altering the code to

BTserial.begin(9600);

which is the "usual default"

I ask again where this came from?

http://www.e-gizmo.com/
this is where i bought it

rmtc:
http://www.e-gizmo.com/
this is where i bought it

Note

  1. a good data sheet is available from that site, probably all you are going to get

  2. It appears from that that setup for AT-mode is a jumper on the pins S4. There appears to be a solder blob at J1, which completes the circuit.

  3. The comms lines from the green module go to pins 0,1 as assumed and marked. The Tx line is through a level shifter which is that little black thingy nearby.

  4. This means the shield runs on hardware serial only. Getting it to run on Software serial involves some pretty hot brutal work, is unwarranted, and not a good idea.

  5. This means the software you are using is junk. I won't ask where it came from, but appropriate code for hardware serial is in the above link. This should get you started, although you may have to change the baud rate to 38400