image1 image2 image3

HELLO I'M LiNuS|WELCOME TO MY PERSONAL BLOG|I LOVE TO DO CREATIVE THINGS|I PRESENT MY WORKS ON VLSI AND EMBEDDED

DC MOTOR CONTROLLED BY BLUETOOTH

 

DC MOTOR CONTROLLED BY BLUETOOTH
dc motor controlled by bluetooth

Components Needed

1. Arduino UNO/MEGA 2560

2. L293D IC [H-bridge]

3. HC-05 Bluetooth module

4. power bank

5. led & resistor

6. DC motor


About L293D IC:

The L293D is a 16 pin IC, with eight pins, on each side, dedicated to the controlling of a motor. 

There are 2 INPUT pins, 2 OUTPUT pins and 1 ENABLE pin for each motor. 

L293D consist of two H-bridge. 

H-bridge is the simplest circuit for controlling a low current rated motor.

L293D pinout

H-bridge:

The term H-bridge is derived from the typical graphical representation of such a circuit. 

An H-bridge is built with four switches (solid-state or mechanical). 

When the switches S1 and S4 (according to the below figure) are closed (and S2 and S3 are open) a positive voltage is applied across the motor. 

By opening S1 and S4 switches and closing S2 and S3 switches, this voltage is reversed, allowing reverse operation of the motor.

Using the nomenclature above, the switches S1 and S2 should never be closed at the same time, as this would cause a short circuit on the input voltage source. 

The same applies to the switches S3 and S4. This condition is known as shoot-through.


Software Tools:

1. Arduino IDE (to compile code & upload to target board)

2. Fritzing (for schematic drawing only)


Circuit Schematic:

schematic circuit



Code:

#####################

#include <SoftwareSerial.h>

char s;//[64];

SoftwareSerial linus(10, 11);

void setup() {

  linus.begin(9600);

  linus.println("press '1' to run forward");

  linus.println("press '0' to run reverse"); 

  linus.println("press '2' to stop");

  pinMode(36,OUTPUT);

  pinMode(37,OUTPUT);

}


void loop() {

if(linus.available())

{

  s = linus.read();

  if(s == '1')

  {

    digitalWrite(36,HIGH);

    digitalWrite(37,LOW);

  }

  else if(s=='0')

  {

    digitalWrite(36,LOW);

    digitalWrite(37,HIGH);

  }

  else if(s=='2')

  {

  digitalWrite(36,LOW);

   digitalWrite(37,LOW);

  }

}

else

{

  delay(300);

}

}

###############################


REAL TIME WORK SETUP with powerbank: (for illustration only)



For communication with bluetooth module:
The following android application was used.
Appears as below while interacting with bluetooth through above app:


Share this:

CONVERSATION

0 comments:

Post a Comment