About Here

This web blog is established for collecting useful information about building prototype with arduino or other applications. This page shuld help a designer with very basical technical cognition to build a working model or a prototyp for his design concept. We find prototyp or working model an excellent tool to test concept and understand it's usage in real condition (not only fantasy in mind). It's ofter very hard to realize every functions of a design concept. However it's our goal here to make this task easier.

What should be always keeped in mind is that we are not engineers and it's not our goal to design a perfect electron programme control. We are designers who are more willing to understand the users through prototype testing.

This web-site is still under construction and more information shall be collected. :)

Oct 5, 2011

reverse current / DC motor control with L293D IC

L293D IC

Pin Connections

L293D Can be used to control two DC motors. INPUT 1, INPUT 2, and ENABLE  1 (Ven1) controll the first motor which is connected to OUTPUT 1 and OUTPUT 2. Vs should be connected to the Power Supply for DC Motor which is higher than Vss and lower than 36 Volt. Vss should be connected to the Power Supply for the IC which is higher than 4.5 Volt. It's good to differ the power supply Vss from Vs. Ven must be higher than 2.3 Volt to enable the DC motor. It can be given by different Power to change the speed of motor.

Logic
Ven1 high & Pin 4 high & Pin 5 high = Stop
Ven1 high & Pin 4 low & Pin 5 low = Stop
Ven1 high & Pin 4 high & Pin 5 low = clockwise
Ven1 high & Pin 4 low & Pin 5 high = anti-clockwise
Ven1 low = Stop (not applicated)
PWM at Ven can be used to control the speed of Motor.

Connection Example


======Arduino Code Sample======
int switchPin = 2;    // switch input
int motor1Pin1 = 3;    // pin 2 on L293D
int motor1Pin2 = 4;    // pin 7 on L293D
int enablePin = 9;    // pin 1 on L293D
void setup() {
  pinMode(switchPin, INPUT);
  pinMode(motor1Pin1, OUTPUT);
  pinMode(motor1Pin2, OUTPUT);
  pinMode(enablePin, OUTPUT);
}
void loop() {
  // if the switch is high, motor will turn on one direction:
  if (digitalRead(switchPin) == HIGH) {
    analogWrite(enablePin, 255);    // analog output for different speed
    digitalWrite(motor1Pin1, LOW);   // set pin 2 on L293D low
    digitalWrite(motor1Pin2, HIGH);  // set pin 7 on L293D high
  }
  // if the switch is low, motor will turn in the opposite direction:
  else {
    analogWrite(enablePin, 150);   // analog output for different speed
    digitalWrite(motor1Pin1, HIGH);  // set pin 2 on L293D high
    digitalWrite(motor1Pin2, LOW);   // set pin 7 on L293D low
  }
}
==========================

Reference:
Controal a DC motor with Arduino and L293D IC
http://luckylarry.co.uk/arduino-projects/control-a-dc-motor-with-arduino-and-l293d-chip/
http://www.robofun.net/forum/viewthread.php?tid=6189
http://www.freewebs.com/isuru-c/motor_driver.htm

L293D IC by Conrad.de
http://www.conrad.de/ce/de/product/174003/?insert_kz=NA&hk=SEM&WT.srch=1&gclid=CJjz_7WA0asCFcK9zAod_molXA

http://www.conrad.de/ce/de/product/156134/IC-4-KANAL-TREIBER-L293D-STM/SHOP_AREA_17311&promotionareaSearchDetail=005

1 comment:

  1. I loved your post! Simple and to the point. May I suggest one little thing? Include at the start a list of materials you've used. Would be helpful for us noobies ;-)

    ReplyDelete