ELECTRICAL ENGINEERING DEPARTMENT
ACADEMIC SESSION: _____________
DEC50122 – EMBEDDED ROBOTIC
PRACTICAL WORK 5: BLUETOOTH/SERIEL MONITOR MOBILE ROBOT
CONTROLLER
PRACTICAL WORK
DATE :
LECTURER’S NAME:
GROUP NO. :
TOTAL
STUDENT ID & NAME : MARKS
(100%)
(1)
(2)
(3)
(4)
(5)
DATE SUBMIT : DATE RETURN :
1 LEARNING OUTCOMES (LO):
1. COMMUNICATION DURING PRACTICAL WORK BASED ON LAND
MOBILE ROBOT DESIGN
2 OBJECTIVE
Write a program to move the mobile robot.
Write a program so that mobile robot can communicate with Bluetooth and
serial monitor
3 THEORY
Bluetooth is a technology standard for electronic devices to communicate with
each other using short-range radio. Bluetooth was first developed by
Ericsson, it was intended to provide a cheap wireless support for mobile
devices communicating at close range and it was supposed to be a cable
replacement. Bluetooth devices can switch between 79 channels available in
the 2.4 GHz.
Bluetooth is based on a frequency hopping spread spectrum (FHSS)
modulation technique, where spread spectrum means a series of methods for
spreading radio signals over multiple frequencies, either simultaneously
(direct sequence) or in series (frequency hopping).
4 EQUIPMENT / TOOLS
i. Personal Computer
ii. Arduino IDE Software/ MPLAB X
iii. PIC/Arduino Micro controller
iv. Android Phone
v. Mobile robot kit/ wheel robot kit/differential drive kit
5 PROCEDURE
TASK
A) Using Bluetooth
a) Construct the circuit above.
b) Design a code that can make the robot move Forward, Reverse, Left, and Right.
c) The robot must being control by Mobile Phone trough Bluetooth module.
TASK
B) Using Serial Monitor
a) Construct the circuit above.
b) Design a code that can make the robot move Forward, Reverse, Left, and Right.
c) The robot must being control serial monitor using key board.
Code using Bluetooth and seriel Monitor
char t;
void setup() {
pinMode(4,OUTPUT); //left motors forward
pinMode(5,OUTPUT); //left motors reverse
pinMode(6,OUTPUT); //right motors forward
pinMode(7,OUTPUT); //right motors reverse
pinMode(13,OUTPUT); //Led
Serial.begin(9600);
void loop() {
if(Serial.available()){
t = Serial.read();
Serial.println(t);
}
if(t == 'F'){ //move forward(all motors rotate in forward direction)
digitalWrite(4,HIGH);
digitalWrite(6,HIGH);
}
else if(t == 'B'){ //move reverse (all motors rotate in reverse direction)
digitalWrite(5,HIGH);
digitalWrite(7,HIGH);
}
else if(t == 'L'){ //turn right (left side motors rotate in forward direction, right side motors doesn't rotate)
digitalWrite(6,HIGH);
}
else if(t == 'R'){ //turn left (right side motors rotate in forward direction, left side motors doesn't rotate)
digitalWrite(4,HIGH);
}
else if(t == 'W'){ //turn led on or off)
digitalWrite(13,HIGH);
}
else if(t == 'w'){
digitalWrite(13,LOW);
}
else if(t == 'S'){ //STOP (all motors stop)
digitalWrite(4,LOW);
digitalWrite(5,LOW);
digitalWrite(6,LOW);
digitalWrite(7,LOW);
}
delay(100);
}
6 RESULT
7 DISCUSSION
8 CONCLUSION