fbpx

COMPUTER CONTROLLED ROBOT

Computer Controlled Robot is Manually controlled by using the keyboard, Robot uses RF communication between the computer and robot. Data sent serially from computer(transmitter) to robot (Receiver), to perform the desired action. The robot performs an action only when the desired key is pressed and is inactive when the key is not pressed.

Block Diagram

CC2500

CC2500 RF Module is a Transreceiver module which provides easy to use RF communication at 2.4 GHz.RF Module can be used for applications that need two-way wireless data transmission. The range is about 30 meters. The computer will be connected to a CC2500 module to transmit data. The robot also has a CC2500 module to receive data from the computer. The address of both modules should match for the data transmission.

DIP Switch

RF module supports multiple baud rates (4800/9600/19200/38400) and multiple frequency channels(CH0/CH1/CH2/CH3). Baud Rate & frequency Channel Settings depend on DIP Switch Position.DIP switch number 1 & 2 are used to set the baud rate whereas DIP switch number 3 & 4 are used to select channel frequency. Baud Rate & Channel no. should be same at both transmitter & receiver on the CC2500 Module.

BAUD RATE

The rate at which the bits are transferred is called Baud Rate. For communicating with the computer we can use any one of these rates:300,600,1200,2400,4800,9600,14400,19200,28800,38400,57600,115200.In our Robot, we going to set the baud rate as 38400.

TERMINAL

A terminal is an interface in which one can type and execute text-based commands. A terminal is used to see the data that is transferred from the computer to the robot. A terminal is a simple serial port (COM) terminal emulation program. We going to use Bray’s terminal it has a lot of special features useful for communicating with microcontrollers.To view the data

  • Rescan the COM ports.
  • Select the Com port.
  • Select the Baud Rate as 38400.
  • Click on connect.

TTL Dongle

TTL enables communication between the computer and the device. It works on either 5v or 3.3v.

Required Components

  1. Bread Board.
  2. Connecting wires.
  3. Castor wheel.
  4. Robot Wheel.
  5. Robot Chassis.
  6. Motor Driver l293d.
  7. DC Geared motor.
  8. Arduino.
  9. Battery.
  10. LM7805.
  11. Switch.
  12. Capacitors 470uf & 100uf.
  13. RF transmitter and receiver.
  14. TTL dongle.

Logic Table

Pin Mapping

Between Arduino and L293D

Between Motor and L293D

Between Arduino And CC2500 

Circuit Diagram

Software Requirements

1.Arduino IDE

FLOW CHART 

Program

/*
MOTOR PIN DEFINITION
|ARDUINO PIN NO|
4 RIGHT_MOTOR_ONE_OUTPUT
5 RIGHT_IR_SENSOR_OUTPUT
6 LEFT_MOTOR_ONE_OUTPUT
7 LEFT_MOTOR_TWO_OUTPUT
*/
#define RIGHT_MOTOR_ONE 4
#define RIGHT_MOTOR_TWO 5
#define LEFT_MOTOR_ONE 6
#define LEFT_MOTOR_TWO 7

char Received_Data;

void setup() {
/* Motor pin configuration */
pinMode(RIGHT_MOTOR_ONE, OUTPUT);
pinMode(RIGHT_MOTOR_TWO, OUTPUT);
pinMode(LEFT_MOTOR_ONE, OUTPUT);
pinMode(LEFT_MOTOR_TWO, OUTPUT);

}

void loop()
{
if (Serial.available())
{
Received_Data = Serial.read();
/* IF RECEIVED DATA IS "S" STOP THE ROBOT*/
if (Received_Data == 'S')
{
STOP_ROBOT();
}
/* IF RECEIVED DATA IS "L" MOVE ROBOT TO LEFT */
else if (Received_Data == 'L')
{
MOVE_ROBOT_LEFT();
}
/* IF RECEIVED DATA IS "R" MOVE ROBOT TO RIGHT */
else if (Received_Data == 'R')
{
MOVE_ROBOT_RIGHT();
}
/* IF RECEIVED DATA IS "F" MOVE ROBOT FORWARD */
else if (Received_Data == 'F')
{
MOVE_ROBOT_FORWARD();
}
/* IF RECEIVED DATA IS "B" MOVE ROBOT FORWARD */
else if (Received_Data == 'B')
{
MOVE_ROBOT_REVERSE();
}
}
}

/* MOVE ROBOT FORWARD */
void MOVE_ROBOT_FORWARD()
{
digitalWrite(RIGHT_MOTOR_ONE, HIGH);
digitalWrite(RIGHT_MOTOR_TWO, LOW);
digitalWrite(LEFT_MOTOR_ONE, HIGH);
digitalWrite(LEFT_MOTOR_TWO, LOW);
}

/* MOVE ROBOT REVERSE */
void MOVE_ROBOT_REVERSE()
{
digitalWrite(RIGHT_MOTOR_ONE, LOW);
digitalWrite(RIGHT_MOTOR_TWO, HIGH);
digitalWrite(LEFT_MOTOR_ONE, LOW);
digitalWrite(LEFT_MOTOR_TWO, HIGH);
}

/* MOVE ROBOT LEFT */
void MOVE_ROBOT_LEFT()
{
digitalWrite(RIGHT_MOTOR_ONE, HIGH);
digitalWrite(RIGHT_MOTOR_TWO, LOW);
digitalWrite(LEFT_MOTOR_ONE, LOW);
digitalWrite(LEFT_MOTOR_TWO, HIGH);
}

/* MOVE ROBOT RIGHT */
void MOVE_ROBOT_RIGHT()
{
digitalWrite(RIGHT_MOTOR_ONE, LOW);
digitalWrite(RIGHT_MOTOR_TWO, HIGH);
digitalWrite(LEFT_MOTOR_ONE, HIGH);
digitalWrite(LEFT_MOTOR_TWO, LOW);
}

/* STOP ROBOT */
void STOP_ROBOT()
{
digitalWrite(RIGHT_MOTOR_ONE, LOW);
digitalWrite(RIGHT_MOTOR_TWO, LOW);
digitalWrite(LEFT_MOTOR_ONE, LOW);
digitalWrite(LEFT_MOTOR_TWO, LOW);
}


 

Leave a Reply

Your email address will not be published. Required fields are marked *