Tuesday, March 5, 2024

Password-Protected Bluetooth Remote Control

Tej Vijaykumar Patel is an electronics hobbyist with keen interest in robotics and automation

- Advertisement -

Power the module again. Slave module (BT2) is ready to use now.

Configuring master module

For this, you need a CP2102 converter (USB-to-UART) and also a terminal software. The author used a Tera Term software, which can be downloaded freely and easily from the Internet.

You need the following wiring connections between HC-05 module and CP2102 converter:

- Advertisement -
HC-05 (BT1) CP2102
Vcc +5V
Tx Rx
Rx Tx
Key 3.3V


After the connection, plug-in CP2102 module to USB port of your PC. Open Tera Term software from your PC and proceed as follows:

Step 1

Select ‘Serial’ option, followed by the COM port on which the CP2102 converter is connected

Step 2

Select Setup->Serial Port->Baudrate->38400

The default baud rate for HC-05 is 38400 for command mode

Step 3

Under the setup menu, select terminal as ‘CR+LF’ for Transmit. Also tick the local echo. Thus you can see whatever you have typed or entered in the window

Step 4

Type ‘AT+RMAAD’ to remove all the previously connected devices.
Set the password same as for slave by typing the following commands in the edit window of Tera Term:
AT+ROLE=1. Here ‘1’ is for master mode
AT+CMODE=1 allows the module to connect to any address
AT+INIT. Type this command to initiate serial port. If you find error 17, don’t worry, it means you have already started SPP
AT+INQ. Type this to find devices near master module. After a while, you will get a list of the devices. To pair with the slave module, type:
AT+LINK=“the address with commas”
Here, AT+LINK=98d3,31,305f7b

Master module (BT1) is configured now.

Switch on both the BT1 and BT2 modules and see the status LEDs on both slave and master modules. Both modules should automatically connect to each other. If both LEDs start blinking twice in a second simultaneously, both devices are connected to each other and will remember each other even after their power is turned off.

Now the setup is complete and the wireless remote is ready to use.

Software program

Three programs (HC-05_config.slave.ino, TX-rem-cont.ino and RX-rem-cont.ino) are used in this project.

HC-05_config.slave.ino is used to configure Bluetooth slave module, TX-rem-cont.ino is used for transmitter Arduino and RX-rem-cont.ino is used for receiver Arduino.

You need Arduino IDE software to compile and upload these codes into their respective Arduino boards.

Main functions of Arduino codes are explained below:

pinMode( )

Configures the specified pin to behave either as an input or an output. See digital pin descriptions for detailed pin functionalities.

digitalWrite( )

If the pin is configured as an OUTPUT with pinMode( ), its voltage will be set to the corresponding value: 5V (or 3.3V on 3.3V boards) for HIGH, 0V (ground) for LOW.

digitalRead( )

Reads the value from a specified digital pin, either HIGH or LOW.

available( )

Gets the number of bytes (characters) available for reading from the serial port. This is the data that has already arrived and is stored in the serial receive buffer (which holds 64 bytes). available() inherits from the Stream utility class.

begin( )

Sets the data rate in bits per second (baud) for serial data transmission. For communicating with the computer, use one of these rates: 300, 600, 1200, 2400, 4800, 9600, 14400, 19200, 28800, 38400, 57600 or 115200. You can, however, specify other rates. For example, to communicate over digital pins 0 and 1 of Arduino that requires a particular baud rate.

println( )

Prints data to the serial port as human-readable ASCII text followed by a carriage return character.

parts list

Download source code

Construction and testing

A PCB layout of the transmitter unit is shown in Fig. 5 and its components layout in Fig. 6. Similarly, PCB layout of the receiver unit is shown in Fig. 7 and its components layout in Fig. 8.

PCB layout of the transmitter unit

Fig. 5: PCB layout of transmitter unit

Component layout of the transmitter unit

Fig. 7: Components layout for the PCB in Fig 5

PCB layout of the receiver unit

Fig. 7: PCB layout of receiver unit

Component layout of the receiver unit

Fig. 8: Components layout for the PCB in Fig. 7

Download PCB and component layout PDFs: click here

Use two 50rpm DC motors for the wheels of the robot, one for right wheel and the other for left wheel. A castor wheel can be used as front wheel of the robot. Use another 50rpm DC motor for the object-lifting arm.

Connect 9V battery to both transmitter and receiver units. Connect 12V battery for the DC motors in the receiver unit.

Switch on both the transmitter and receiver units. If status LEDs of both BT1 and BT2 start blinking twice every second simultaneously, that means both devices are connected to each other. Now you can press any switch on the transmitter unit to control the robot. Switch S6 is used for lifting or cutting the object. Switches S1 through S5 are used for various movements of the robot.



Electronics News

Truly Innovative Tech

MOst Popular Videos

Electronics Components