0% found this document useful (0 votes)
193 views7 pages

Bluetooth RC Drift Car

This document describes the components and code for a Bluetooth controlled RC car. The key components are an Arduino UNO microcontroller, HC-05 Bluetooth module for wireless control, DC motors powered by an L298N H-bridge motor driver, and a servo motor to control steering. The Arduino code uses the Bluetooth data to control the motor speeds and servo position to drive the car forward, backward, turn and stop based on input commands.

Uploaded by

Abanob Hany
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
193 views7 pages

Bluetooth RC Drift Car

This document describes the components and code for a Bluetooth controlled RC car. The key components are an Arduino UNO microcontroller, HC-05 Bluetooth module for wireless control, DC motors powered by an L298N H-bridge motor driver, and a servo motor to control steering. The Arduino code uses the Bluetooth data to control the motor speeds and servo position to drive the car forward, backward, turn and stop based on input commands.

Uploaded by

Abanob Hany
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

Bluetooth Rc

Car

DECEMBER 29

Introduction to mechatronics project (MET111)


Abanoub hany 20180965
Mamoud ahmed azab 20180922

1
Circuit diagram

2
1st Arduino UNO

is a microcontroller board based on the ATmega328P. It has 14 digital input/output pins (of
which 6 can be used as PWM outputs), 6 analog inputs, a 16 MHz ceramic resonator, a USB
connection, a power jack, an ICSP header and a reset button. It contains everything needed to
support the microcontroller; simply connect it to a computer with a USB cable or power it with
a AC-to-DC adapter or battery to get started. You can tinker with your UNO without worrying
too much about doing something wrong, worst case scenario you can replace the chip for a few
dollars and start over again.

2nd HC-05 Bluetooth Module

HC-05 is a Bluetooth module which is designed for wireless comunication. This module can
be used in a master or slave configuration.

3rd A DC motor is defined as a class of electrical motors that convert direct current electrical
energy into mechanical energy.

4th Servo motors are great devices that can turn to a specified position.

Usually, they have a servo arm that can turn 180 degrees. Using the Arduino, we can tell a servo
to go to a specified position and it will go there. As simple as that!

Servo motors were first used in the Remote Control (RC) world, usually to control the steering of
RC cars or the flaps on a RC plane. With time, they found their uses in robotics, automation, and
of course, the Arduino world.

5th A H-bridge is an electronic circuit that switches the polarity of a voltage applied to a load.
These circuits are often used in robotics and other applications to allow DC motors to run
forwards or backwards. The name is derived from its common schematic diagram
representation, with four switching elements configured as the branches of a letter "H" and
the load connected as the cross-bar.

Most DC-to-AC converters (power inverters), most AC/AC converters, the DC-to-DC push–pull
converter, isolated DC-to-DC converter most motor controllers, and many other kinds of power
electronics use H bridges. In particular, a bipolar stepper motor is almost always driven by a
motor controller containing two H bridges.

3
Project code
#include <Servo.h>

const int motorA1 = 5; // L298N'in IN3

const int motorA2 = 6; // L298N'in IN1

const int motorB1 = 9; // L298N'in IN2

const int motorB2 = 10; // L298N'in IN4

Servo servo;

int durum;

int Hiz=255;

void setup() {

pinMode(motorA1, OUTPUT);

pinMode(motorA2, OUTPUT);

pinMode(motorB1, OUTPUT);

pinMode(motorB2, OUTPUT);

servo.attach(7);

int aciDegeri=45;

Serial.begin(9600);

void loop() {

if(Serial.available() > 0){

durum = Serial.read();

4
servo.write(45);

// Uygulamadan ayarlanabilen 3 hız seviyesi.(Değerler 0-255 arası)

if (durum == '1'){

Hiz=50;}

else if (durum == '2'){

Hiz=150;}

else if (durum == '3'){

Hiz=255;}

/******************** İleri *************************/

if (durum == 'F') {

analogWrite(motorA1, Hiz); analogWrite(motorA2, 0);

analogWrite(motorB1, Hiz); analogWrite(motorB2, 0);

/****************** İleri Sağ *********************/

else if (durum == 'I') {

analogWrite(motorA1,Hiz ); analogWrite(motorA2, 0);

analogWrite(motorB1,Hiz); analogWrite(motorB2, 0);

servo.write(90);

/****************** İleri Sol ********************/

else if (durum == 'G') {

analogWrite(motorA1, Hiz); analogWrite(motorA2, 0);

analogWrite(motorB1, Hiz); analogWrite(motorB2, 0);

servo.write(0);

/****************** Geri ****************************/

5
else if (durum == 'B') {

analogWrite(motorA1, 0); analogWrite(motorA2, Hiz);

analogWrite(motorB1, 0); analogWrite(motorB2, Hiz);

/******************* Geri Sağ **********************/

else if (durum == 'J') {

analogWrite(motorA1, 0); analogWrite(motorA2, Hiz);

analogWrite(motorB1, 0); analogWrite(motorB2, Hiz);

servo.write(90);

/******************* Geri Sol *********************/

else if (durum == 'H') {

analogWrite(motorA1, 0); analogWrite(motorA2, Hiz);

analogWrite(motorB1, 0); analogWrite(motorB2, Hiz);

servo.write(0);

/********************** Sağ *************************/

else if (durum == 'R') {

analogWrite(motorA1, 0); analogWrite(motorA2, 0);

analogWrite(motorB1, 0); analogWrite(motorB2, 0);

servo.write(90);

/*********************** Sol *************************/

else if (durum == 'L') {

analogWrite(motorA1, 0); analogWrite(motorA2, 0);

analogWrite(motorB1, 0); analogWrite(motorB2, 0);

servo.write(0);

/********************* Dur ************************/

6
else if (durum == 'S'){

analogWrite(motorA1, 0); analogWrite(motorA2, 0);

analogWrite(motorB1, 0); analogWrite(motorB2, 0);

You might also like