Bluetooth Technology
Bluetooth Technology
PLAY A GAME
PLAY A GAME
GAME!!
PLAY A GAME
GROUP 1 GAME!!
RLEWSESSI TOINAINCMMUCO
GROUP 2
TOLOEHUTB DULMOE
GROUP 3
PARNIIG NOICCONNTE
GROUP 4
AATDD ISNMORTAIMS
BLUETOOTH TECHNOLOGY
Learning Objectives:
1. Define Bluetooth Technology
2. Pin outs of Bluetooth Module; and
3. Construct a Circuit Connection with Arduino Code using
Bluetooth Module and Arduino Uno:
What is Bluetooth?
What is Bluetooth?
What is Bluetooth?
What is Bluetooth?
What is Bluetooth?
What is Bluetooth?
What is Bluetooth?
What is Bluetooth?
What is Bluetooth?
Types of Bluetooth Modules
Types of Bluetooth Modules
Components of Bluetooth Module
Pin out of Bluetooth Module
HC - 05 Wiring Diagram with Arduino Uno
HC - 05 Wiring Diagram with Arduino Uno
Sample Code of Bluetooth RC Car using
L293D Motor Driver(Blue)
#include <AFMotor.h>
char command;
void setup()
{
Serial.begin(9600); //Set the baud rate to your Bluetooth
module.
}
Cont..Sample Code of Bluetooth RC Car
using L293D Motor Driver(Blue)
void loop(){
if(Serial.available() > 0){
command = Serial.read();
Stop(); //initialize with motors stoped
//Change pin mode only if new command is different from previous.
//Serial.println(command);
switch(command){
case 'F':
forward();
break;
case 'B':
back();
break;
case 'L':
left();
break;
case 'R':
right();
break;
}
}
}
Cont..Sample Code of Bluetooth RC Car
using L293D Motor Driver(Blue)
void forward()
{
motor1.setSpeed(255); //Define maximum velocity
motor1.run(FORWARD); //rotate the motor clockwise
motor2.setSpeed(255); //Define maximum velocity
motor2.run(FORWARD); //rotate the motor clockwise
motor3.setSpeed(255);//Define maximum velocity
motor3.run(FORWARD); //rotate the motor clockwise
motor4.setSpeed(255);//Define maximum velocity
motor4.run(FORWARD); //rotate the motor clockwise
}
void back()
{
motor1.setSpeed(255); //Define maximum velocity
motor1.run(BACKWARD); //rotate the motor anti-clockwise
motor2.setSpeed(255); //Define maximum velocity
motor2.run(BACKWARD); //rotate the motor anti-clockwise
motor3.setSpeed(255); //Define maximum velocity
motor3.run(BACKWARD); //rotate the motor anti-clockwise
motor4.setSpeed(255); //Define maximum velocity
motor4.run(BACKWARD); //rotate the motor anti-clockwise
}
Cont..Sample Code of Bluetooth RC Car
using L293D Motor Driver(Blue)
void left()
{
motor1.setSpeed(255); //Define maximum velocity
motor1.run(BACKWARD); //rotate the motor anti-clockwise
motor2.setSpeed(255); //Define maximum velocity
motor2.run(BACKWARD); //rotate the motor anti-clockwise
motor3.setSpeed(255); //Define maximum velocity
motor3.run(FORWARD); //rotate the motor clockwise
motor4.setSpeed(255); //Define maximum velocity
motor4.run(FORWARD); //rotate the motor clockwise
}
void right()
{
motor1.setSpeed(255); //Define maximum velocity
motor1.run(FORWARD); //rotate the motor clockwise
motor2.setSpeed(255); //Define maximum velocity
motor2.run(FORWARD); //rotate the motor clockwise
motor3.setSpeed(255); //Define maximum velocity
motor3.run(BACKWARD); //rotate the motor anti-clockwise
motor4.setSpeed(255); //Define maximum velocity
motor4.run(BACKWARD); //rotate the motor anti-clockwise
}
Cont..Sample Code of Bluetooth RC Car
using L293D Motor Driver(Blue)
void Stop()
{
motor1.setSpeed(0); //Define minimum velocity
motor1.run(RELEASE); //stop the motor when release the button
motor2.setSpeed(0); //Define minimum velocity
motor2.run(RELEASE); //rotate the motor clockwise
motor3.setSpeed(0); //Define minimum velocity
motor3.run(RELEASE); //stop the motor when release the button
motor4.setSpeed(0); //Define minimum velocity
motor4.run(RELEASE); //stop the motor when release the button
}
Pin out of Bluetooth Module
Advantages and Disadvantages
THE END.
SEATWORK / ASSIGNMENT
Deadline: April 8, 2024