Arduino/C3/Robot-Control-using-Bluetooth/English-timed

From Script | Spoken-Tutorial
Jump to: navigation, search
Time Narration
00:01 Welcome to the spoken tutorial on Robot Control using Bluetooth.
00:06 In this tutorial, we will learn about:
00:09 Bluetooth Communication
00:11 HC-05 Bluetooth Module and
00:14 Controlling a Robot using an Android application
00:19 To follow this tutorial, you should have basic knowledge of:

Electronics and C or C++ programming language

00:29 To record this tutorial, I am using:
00:32 Ubuntu Linux 16.04 OS
00:36 Arduino UNO board
00:38 Arduino IDE and Android Phone
00:43 We require few external components:
00:47 HC-05 Bluetooth Module
00:50 L293D IC
00:54 We have learnt about the L293D Motor Driver IC in the earlier tutorial.
01:00 9V Battery with Connector
01:03 9Volts-1Ampere Adapter
01:06 Bluetooth communication is a wireless technology.
01:10 It is used to transfer data between different electronic devices.
01:15 It supports data, audio transmission with a range of 7 to 8 meters.
01:21 It is specially designed for short range wireless data communication.
01:26 In this tutorial we will use the HC-05 Bluetooth module.
01:32 This module has two operating modes, namely Data Mode and AT Command Mode.
01:40 In Data Mode, it can send and receive data from other Bluetooth devices.
01:46 We will be using the Data Mode in our tutorial.
01:50 AT Command mode is used when you want to change the setting of the Bluetooth module.
01:56 For example, to change the Baud Rate we can use AT Command Mode
02:01 This is the assembled Robot.
02:05 We have already installed an app called Car Bluetooth RC on Android phone.
02:11 This app will control the movement of the Robot.
02:15 Now we will see how to control the Robot via Bluetooth.
02:20 Let us see the circuit connection in detail.
02:24 Do the actual connection with your hardware as explained here.
02:28 Connect the Arduino board to your computer using Arduino USB cable.
02:34 The 5Volt pin of the Arduino is connected to the 5Volt pin of the HC-05 module.
02:42 The ground pin of the Arduino is connected to the ground pin of the HC 05 module.
02:49 The Rx pin of the Bluetooth module is connected to the Tx pin of Arduino.
02:55 The Tx pin of the Bluetooth module is connected to the Rx pin of Arduino.
03:01 Now, note the blinking of LED in the Bluetooth module.
03:06 This indicates that your Bluetooth module is switched ON.
03:10 Next do the below connections as explained.
03:14 Pin 16 of L293D IC is connected to 5Volt pin of Arduino.
03:22 Pins 4,5,12,13 of the L293D IC are connected to the ground terminal.
03:32 Pins 1,2,7 of L293D IC are connected to pins 6,3,5 of Arduino respectively.
03:45 Pins 9,10,15 of L293D IC are connected to pins 11,10,9 of Arduino respectively.
03:57 One DC motor is connected to pin 3 and 6 of L293D IC.
04:05 The other DC motor is connected to pin 11 and 14 of L293D IC.
04:13 Note: You have to connect the DC motors of the assembled Robot as shown in figure.
04:21 Recall that we have soldered a red and black wire to the wire leads of the motors.
04:29 We require a separate power source for running the DC motors.
04:34 We will use a 9V battery to power the DC motors as Arduino gives only 5Volt output.
04:43 Positive terminal of the 9V battery is connected to pin 8 of L293D IC.
04:52 The negative terminal of the battery is connected to the ground pin of the Arduino.
04:59 These are all the connections you must do to perform the tasks shown in this tutorial.
05:07 Now place the breadboard and Arduino setup on the chassis.
05:12 This is how I have done the setup of my Robot.
05:16 Now we will write the program in Arduino IDE for the working of the Robot.
05:21 The files used in this tutorial are available in the Code Files link on this tutorial page.
05:28 Please download and extract them. Make a copy and then use them while practising
05:35 Open the Arduino IDE.
05:37 Type the code as shown.
05:41 These are the variables assigned for the pins on the Arduino connected to L293D IC.
05:50 The variable serialA is used to store the input character received by Bluetooth.
05:57 Type the code as shown in the void setup function.
06:02 Serial dot begin function is used to make the Arduino ready to serially exchange messages.
06:10 The messages are exchanged at 9600 baud rate.
06:15 We will use the function pinMode to configure the pins to OUTPUT mode.
06:21 Now we will write the code for the void loop.
06:25 The void loop function will move the Robot in forward, backward, right and left directions.
06:33 Bluetooth module checks for commands given from the Android app.
06:38 These lines of code make the robot move in the forward direction.
06:43 These lines of code make the robot turn in the left direction.
06:48 These lines of code make the robot turn in the right direction.
06:53 These lines of code make the robot move in a backward direction.
06:58 Our program is ready now.
07:02 Click on the Compile button to verify your program.
07:05 After compiling, a pop-up window will open to save the current program.
07:10 I will save it as Bluetooth underscore Robot.
07:14 Click on the Save button to save the program.
07:18 Before uploading the program, you must remove the Rx and Tx wires connected to Arduino.
07:26 Now click on the Upload button to upload the current program on Arduino.
07:33 When you have successfully uploaded the program reconnect the Rx and Tx wires to the Arduino.
07:42 Now, remove the Arduino’s USB cable from your computer.
07:47 For demonstration purpose, I have connected a 9Volt 1 Amphere adapter to run the Robot.
07:53 It is connected at the Arduino jack available here.
07:58 You can use a power bank or a battery instead, to power the Arduino.
08:03 Next, we will use the app and test the working of the Robot.
08:09 Take the Android phone in which you have downloaded the Car Bluetooth RC app.
08:16 Let us configure the Bluetooth in your Android phone.
08:20 Go to the Settings option on your phone.
08:23 Open the Bluetooth section.
08:26 Turn ON your phone’s Bluetooth.
08:30 Search for nearby devices.
08:34 You will find HC 05 as one of the options in the list.
08:40 Click on the HC 05 option. It will ask for a password.
08:47 The default password for this Bluetooth module is 1234. Type the password.
08:55 In some cases, the password of the Bluetooth module will be 0000.
09:02 Now, your mobile is connected to the HC-05 Bluetooth module.
09:08 You can now observe a different blinking pattern of the LED in the Bluetooth module.
09:14 Turn OFF your phone’s Bluetooth.
09:17 Now, open the Car Bluetooth RC app in your phone.
09:23 The app will prompt to turn ON your phone’s Bluetooth.
09:27 Click on Allow to Continue.
09:30 On the top left corner of your phone, click on the arrow.
09:34 Find the HC 05 option and click on it.
09:39 You can see a message as Connected OK.
09:43 It indicates that your phone is now connected to the HC 05 Bluetooth Module.
09:49 Now, it is ready to control the Robot.
09:53 Let us observe the working of the Robot.
09:57 When I press the forward button in the app, we can see the Robot moves in the forward direction.
10:04 When I press the backward button, the Robot moves in the backward direction.
10:09 To turn the Robot towards the right hand side, press the right button in the app.
10:14 The right side motor stops rotating and the left side motor continues to rotate.
10:20 This way the Robot turns to the right side.
10:24 Likewise, the Robot will move to the left direction when you press the left button.
10:30 Thus, we can control the movement of the Robot using bBluetooth communication.
10:36 This brings us to the end of this tutorial. Let us summarize.
10:41 In this tutorial, we learnt:

Bluetooth Communication, HC 05 Bluetooth Module and Controlling a Robot using an Android application

10:54 The video at the following link summarizes the Spoken Tutorial project.

Please download and watch it.

11:02 The Spoken Tutorial Project Tea conducts workshops and gives certificates.

For more details, please write to us.

11:11 Please post your timed queries in this forum.
11:15 The Spoken Tutorial project is funded by MHRD, Government of India.
11:21 This tutorial has been contributed by FOSSEE and Spoken Tutorial Project, IIT Bombay.

And this is Saurabh signing off. Thanks for watching.

Contributors and Content Editors

PoojaMoolya