Bluetooth controlled RC Robot

Table of Contents

1. About Arduino / Raspberry Pi :

2. Architecture of Arduino / Raspberry Pi :

3. Kit details:

4. Project Statement:

5. Details of the project:

6. Conclusion :

1.About Arduino UNO:

Arduino is a single-board microcontroller to make applications more interactive with its surroundings . Arduino Uno is a microcontroller based on the ATMEGA328 .

It has 14 digital input/output pins in which 6 can be used as PWM outputs, a 16 MHz ceramic resonator, an ICSP header, a USB connection, 6 analog inputs, a power jack and a reset button.

Features :

  • It has an easy USB interface
  • It has more hardware features like timers, external and internal interrupts, PWM pins and multiple sleep modes.
  • It is an open source design 
  • 16 MHz clock
  • Has a feature of built-in voltage regulation
  • 32 KB of flash memory for storing your code
  • A button to reset the program on the chip
  • Different sensor’s friendly 
  • Easy user-friendly IDE to implement 

Applications:

IOT has application in every field of world ,which can be seen by concept of industry 4.0 , These are the main fields :

  • Intelligent factory
  • Medical field
  • Home automation 
  • Supply chain

It can also be used in fun ways :

2. Architecture of Arduino / Raspberry Pi :

Generally, the Arduino board processor uses the Harvard architecture and it has two separate memories, they are program code & program data. The data is stored in the data memory & the code is stored in the flash memory.

Working:

1. The data is uploaded via the  usb port . The data is decoded and then the instructions are sent to the IR  and it decodes the instructions on the same clock pulse.

2. On the next clock pulse the next set of instructions are loaded in the IR.

3. In general purpose registers the registers are of 8-bit but there are 3 16-bit registers also.

a. 8-bit registers are used to store data for normal calculations and results.

b. 16-bit registers are used to store data of timer counters in 2 different registers. Eg. X-low & X-high. They are fast, and are used to store specific hardware functions.

4. EEPROM stores data permanently even if the power is cut out. Programming inside an EEPROM  is slow.

5. Interrupt Unit checks whether there is an interrupt for the execution of instruction to be executed in ISR (Interrupt Service Routine).

6. Serial Peripheral Interface (SPI) is an interface bus commonly used to send data between microcontrollers and small peripherals such as Camera, Display, SD cards, etc. It uses separate clock and data lines, along with a select line to choose the device you wish to talk to.

7.Watchdog timer is used to detect and recover from MCU malfunctioning.

8. Analog comparator compares the input values on the positive and negative pin, when the value of positive pin is higher the output is set.

9. Status and control is used to control the flow of execution of commands by checking other blocks inside the CPU at regular intervals.

10. ALU (Arithmetic and Logical unit)The high performance AVR ALU operates in direct connection with all the 32 general purpose working registers. Within a single clock cycle, arithmetic operations b/w general purpose registers are executed. The ALU operations are divided into 3 main categories – arithmetic, logical and bit-function.

11. I/O pins The digital inputs and outputs (digital I/O) on the Arduino are what allow you to connect the Arduino sensors, actuators, and other ICs. Learning how to use them will allow you to use the Arduino to do some really useful things, such as reading switch inputs, lighting indicators, and controlling relay outputs.

  • Digital read pin reads the given digital values to the pin.
  • Digital writing pin is used to write the digital value of the pin.
  • Analog write and read pins are used to write, read the analog values of the pin.
  • Reset pin to reset the board to the default values.
  • Ground pin to give out ground to the devices.
  • VCC pins(5 V & 3.3 V) to give power to the devices.
  • Pin mode pin to set the pin to the I/O mode.

3. Kit details:

1.Car chassis 

2. Arduino UNO:

3. L298 motor drive

4. Hc-05 bluetooth module

5. two batteries 

6. Jumper Wires

7. Electrical instruments ( Solder wire and iron )

8. mobile with bluetooth

4. Project Statement:

Bluetooth Controlled Robot Car

5. Details of the project:

Construction:

  1. We constructed the Frame/chassis of the vehicle from the car chassis we got. Join the left side motor wires together as: red wire –> red wire and black wire –> black wire. Join motors on right side together as: red wire –> red wire and black wire –> black wire
  1. We had to solder all Motors ,as they were loosely connected.
  1. Connecting batteries in series . Try to use voltage <12 , otherwise components might get heated .
  1.  We then connected the Motors into Motor Drive.Join the red and black terminal of motors on each side, to the motor drive outputs.
  1. We then connected Motor Drive to Arduino.Then join the four control pins of motor drive to the arduino 9th, 10th, 11th and 12th pin socket.
  1. We then added bluetooth module to Arduino.join BT module to arduino as: VCC –> 5V and GND –> GND
  1. We then connected the motor drive to the battery .Connect the motor drive’s power input socket, to the positive and negative terminal of the battery. also connect the negative terminal of battery to GND of arduino
  1. We took code from github and then modified it and then uploaded it back to github , as the original code had some bugs .Please click on code!

Code

int led = 7;char t;
 
void setup() {

pinMode(led, OUTPUT);     
pinMode(9,OUTPUT);   //left motors forward
pinMode(10,OUTPUT);   //left motors reverse
pinMode(11,OUTPUT);   //right motors forward
pinMode(12,OUTPUT);   //right motors reverse
Serial.begin(9600);
 
}
 
void loop() {
 
digitalWrite(led, HIGH);   // turn the LED on (HIGH is the voltage level)
delay(1000);               // wait for a second
digitalWrite(led, LOW);    // turn the LED off by making the voltage LOW
delay(1000);
 
if(Serial.available()){
 
  t = Serial.read();
  Serial.println(t);
}
 
if(t == '1'){            //move forward(all motors rotate in forward direction)
  digitalWrite(9,HIGH);
  digitalWrite(10,LOW);
  digitalWrite(11,HIGH);
  digitalWrite(12,LOW);
}
 
else if(t == '2'){      //move reverse (all motors rotate in reverse direction)
  digitalWrite(9,LOW);
  digitalWrite(10,HIGH);
  digitalWrite(11,LOW);
  digitalWrite(12,HIGH);
}
 
else if(t == '3'){      //turn right (left side motors rotate in forward direction, right side motors doesn't rotate)
  digitalWrite(9,LOW);
  digitalWrite(10,LOW);
  digitalWrite(11,HIGH);
  digitalWrite(12,LOW);
}
 
else if(t == '4'){      //turn left (right side motors rotate in forward direction, left side motors doesn't rotate)
  digitalWrite(9,HIGH);
  digitalWrite(10,LOW);
  digitalWrite(11,LOW);
  digitalWrite(12,LOW);
}
 
else if(t == '5'){      //STOP (all motors stop)
  digitalWrite(9,LOW);
  digitalWrite(10,LOW);
  digitalWrite(11,LOW);
  digitalWrite(12,LOW);
}
delay(100);
}

After uploading disconnect arduino from pc , Now connect Rx of Hc-05 to Tx of arduino and Tx of Hc-05 to Rx of arduino.

  1. We used ArduinoBLueControl to pair with bluetooth module. Pair the HC-05 Bluetooth module with your smartphone. Enter password 1234. ( if it does not work try 0000 ).

6.Conclusion :

  1. Microprocessor :Is an IC , which has CPU inside them .These microprocessors don’t have RAM, ROM, and other peripheral on the chip. A system designer has to add them externally to make them functional. 

example:Intel 8080 processor 

  1. MicroControllers: has a CPU, in addition with a fixed amount of RAM, ROM and other peripherals all embedded on a single chip. It is also called a mini computer.

example:Atmel AT89

MicroprocessorMicrocontroller
ApplicationIt used where intensive processing is required. It is used in personal computers, laptops, mobiles, video games, etc.It used where the task is fixed and predefined. It is used in the washing machine, alarm, etc.
StructureIt has only the CPU in the chip. Other devices like I/O port, memory, and timer are connected externally.CPU, Memory, I/O port and all other devices are connected on the single chip.
Clock speedThe clock speed of the microprocessor is high. It is in terms of the GHz. It ranges between 1 GHz to 4 GHz.The clock speed of the microcontroller is less. It is in terms of the MHz. it ranges between 1 MHz to 300 MHz.
RAMThe volatile memory (RAM) for the microprocessor is in the range of the 512 MB to 32 GB.The volatile memory (RAM) for the microcontroller is in the range of 2 KB to 256 KB.
ROMThe hard disk (ROM) for the microprocessor is in the range of the 128 GB to 2 TB.The hard drive or flash memory (ROM) is in the range of the 32 KB to 2 MB.
CostThe cost of the microprocessor is high compared to the microcontroller.It is cheaper.
Power consumptionThe power consumption for the microprocessor is high.The power consumption for the microcontroller is less.
SizeThe overall size of the system is large.The overall size of the system is small.

followed this tutorial

Advertisement

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s