ROBOTIC
TUTORIALS.COM

Popular Tutorial

Click on the image interested  to know what they are, how to do them and more...
Scroll down to check out to specific topic of tutorials on Electronics and Robotics.
Swarm Robots - ( Based on Bluetooth Mesh Topology)
1

Items Required


 PRODUCT NAME  QUANTITY
 Arduino  2 Buy Now
 Bluetooth (HC-05)  2 or more (Depending on number of Slave devices you need)   Buy Now
 IR Sensors  2 Buy Now
 Male - Female Jumper wires  15 Buy Now
Auton Shield  2

2

Component specification

SPduino:
 


Bluetooth(HC-05):

 
Auton Shield : 





3

Configuring the Bluetooth Module

SLAVE ROLE :
To configure the HC-05 as the slave role. Do the AT commands after entering your BT into the AT command mode.

[ Remember:
You should upload a program with Empty Void Setup and Void Loop function and then open your Serial Monitor to perform the AT Commands
NOTE :
 During AT Command modes, the TX of Bluetooth should be connected to TX of Arduino and RX of HC-05 should be connected with the RX f the Arduino ]


FUNCTION   COMMAND  RESPONSE  PARAMETER
 Test   AT  OK  None
 Restore Default  AT+ORGL  OK  None
 Name  AT+NAME ?  OK  HC-05(Default)
 Mode  AT+CMODE=0  OK  0- To Connect to specific BT address
 1- To connect to any nearby open BT
 Role Perform  AT+ROLE ?  OK  0 - Slave  , 1 - Master
 Role Assign  AT+ROLE=0  OK  Work as Slave to Connect with the Master device
 To know Address  AT+ADDR ?  OK  2015:43:234567 ( Will Vary for every BT Module )
 Sync Speed  AT+UART =9600,0,0  OK  9600,0,0
(To Match with the Serial port of your computer)
 Ready to Pair  AT+INIT  OK  None 

After this is done, remember the address of your slave device.

MASTER ROLE :
Its time to configure the master devices. After following the below steps.


 FUNCTION  COMMAND  RESPONSE  PARAMETER
 Test  AT  OK  None
 Restore Default  AT + ORGL  OK  None
  Name  AT + NAME ?  OK  HC-05
(Default)
 Role Perform  AT + ROLE ?  OK  0-Slave
1-Master
 Role Assign  AT + ROLE=1  OK Work as Master to connect to Slave
 Sync Speed  AT + UART=9600,0,0  OK
38400,0,0
(Default)
 Ready to pair  AT + INIT  OK  None
 Connection Mode  AT + CMODE?  OK 0 - Connects to specified address
1 - Connects to any available address 
 Connecting AT + BIND <addr>  OK Type slave address to connect.
addr - Address of Slave


4

Interfacing Arduino with Bluetooth

Once both the Bluetooth modules are paired using AT commands, head on to the below steps ..

MASTER SIDE CONNECTION :
  1. Mount the Auton shield on top of the SPduino.
  2. Then Connect the IR sensors to the auton shield.
  3. Connect the Master Bluetooth to the Auton shield as shown in the image below.
  4. Then go ahead and upload the sample program given below.
  5. Connect the Motors to the pins according to what you have assigned in the Code. 
SLAVE SIDE CONNECTION :
  1. Mount the Auton shield on top of the SPduino.
  2. Since, Slave just performs the task depending on the input read from Bluetooth, we do not require any sensors . However, if yo want to increase the robustness of slave and wish to enhance the features, go ahead and add sensors. ( This might require you to change the program, if sensors are added to Slave device.)
  3. Connect the Slave Bluetooth to the Auton shield as shown in the image below.
  4. Then go ahead and upload the sample program given below. 
5

Sample Code

The Sample program for the Master and Slave Bluetooth devices are as given below...
HAPPY ROBOTING !!!
Home | Shop | Terms & Conditions | Privacy Policy | Disclaimer | Contact Us
Copyright © SP Robotic Works. All Rights Reserved.