Circuit and working
The project consists of two pairs of Arduino and Bluetooth HC-05 modules, one of which is used in the transmitter unit and the other in the receiver unit. The Bluetooth module on the transmitter side is configured as master, while the module on the receiver side is configured as slave. The author’s prototypes for the transmitter unit and the receiver unit are shown in Figs 1 and 2, respectively.
Fig. 1: Author’s prototype of transmitter unit
Fig. 2: Author’s prototype of receiver unit
Circuit diagram of the transmitter unit is shown in Fig. 3. The prototype uses six pushbuttons/switches (S1 through S6), which are connected to the Arduino board (Board1) using jumper wires. All these switches are used to control the motors for different movements of the robot. The HC-05 Bluetooth module (BT1) is also connected to Board1 as shown in Fig. 3.
Fig. 3: Circuit diagram of transmitter unit
Circuit diagram of the receiver unit is shown in Fig. 4. It consists of Arduino board (Board2), HC-05 Bluetooth module (BT2), six 12V, 1CO relays (RL1 through RL6), three DC motors (M1, M2 and M3), six relay driver transistors 2N2222 (T1 through T6) and a few other components. The author’s prototype uses a 4-channel relay card for the robot’s right and left wheels and a 2-channel relay card to drive the motor for lifting the object. BT2 is connected to Board2 using jumper wires. All the relay cards are connected to Board2.
Fig. 4: Circuit diagram of receiver unit
The relay card should be made as per your requirement. In this tutorial, circuit is used to drive a robot using DC motors. So two relays are used to run a motor in both directions.
Switches S1 through S6 in the transmitter unit work as the remote control buttons, which send digital signals to the receiver unit through Board1 and BT1.
The signals from the transmitter unit are received by BT2 in the receiver unit and forwarded to Board2 for processing. Since relay boards are connected to digital output pins of Board2, the relay energises or de-energises as per the status of signals available on digital output pins.
Relays at the receiver side are used to drive the motors in the desired directions through Arduino Board2. Relay drivers include the combination of a transistor and a diode as shown in Fig. 4. You can use higher-power-rating relays for driving heavy DC motors. In the prototype, the author has used 12V DC, 8-pin JQX-30F power relays by removing sugar-cube PCB relays from the relay cards. Proper combination of relays and contacts makes the motors run in the desired directions.
Pairing of Bluetooth modules
HC-05 modules of the transmitter and the receiver are to be paired first before using them in the project. The process to configure the HC-05 modules is explained below.
To pair two HC-05 modules, you need an Arduino board and a USB-to-UART adaptor like CP2102 converter. An HC-05 module can be configured to work either in slave or master mode.
Configuring slave module. Connections between HC-05 and Arduino are shown below:
|HC-05 (BT2)||Arduino (Board 2)|
In order to enter ‘attention’ (AT) command mode of HC-05, a null program is required in the Arduino board. (AT commands are Hayes command set commonly used in modem and serial communications.) The key pin of HC-05 must be connected to 3.3V in order to enter AT command mode.
After proper connections, check the baud rate of your HC-05 module. Configure the baud rate to 38400. Upload the following null program to Arduino board:
After uploading the program, start ‘Serial Monitor’ in Arduino IDE. Select ‘Both NL & CR’ and ‘Baud rate as 38400’ in ‘Serial Monitor’ window.
To know details of the current HC-05 device, just type AT+NAME in the edit box in ‘Serial Monitor.’ To change the device to the desired name, say, Tej Patel, type AT+NAME= Tej Patel
To change password of the module, enter the following command:
where ***** can be any character string, say, efy12
To configure the module in slave mode, type AT+ROLE=0
Every Bluetooth module has its own address. To know the current device address, type AT+ADDR
Here, the address is 98d3:31:305f7b
Replace colons with commas as given below:
And note down this address because you will need this later on while configuring the master module (BT1). Now, you may disconnect the power and remove the key pin from the module.