* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
Download l298 user guide - K
Survey
Document related concepts
Mains electricity wikipedia , lookup
Alternating current wikipedia , lookup
Transmission line loudspeaker wikipedia , lookup
Control system wikipedia , lookup
Electrification wikipedia , lookup
Switched-mode power supply wikipedia , lookup
Pulse-width modulation wikipedia , lookup
Immunity-aware programming wikipedia , lookup
Voltage optimisation wikipedia , lookup
Opto-isolator wikipedia , lookup
Electric motor wikipedia , lookup
Rectiverter wikipedia , lookup
Brushless DC electric motor wikipedia , lookup
Brushed DC electric motor wikipedia , lookup
Induction motor wikipedia , lookup
Transcript
L298 USER GUIDE USER GUIDE FOR L298 MOTOR DRIVER BOARD 1 K-IMAGINATIONS | www.kimaginations.com L298 USER GUIDE Introduction: Double H driver module uses ST L298N dual full-bridge driver. It is a high voltage, high current dual full-bridge driver designed to accept standard TTL logic levels and drive inductive loads such as relays, solenoids, DC and stepping motors. Features: Light weight, small dimension Super driver capacity Two enable inputs are provided to enable or disable the device independently of the input signals 2 DC motor/ 4 coil dual phrase stepper motor output 4 standard mounting holes Specifications: Driver: L298 Driver power supply: +5V~+46V Driver peak current: 2A Logic power output Vss: +5~+7V (internal supply +5V) Logic current: 0~36mA Controlling level: Low -0.3V~1.5V, high: 2.3V~Vss Enable signal level: Low -0.3V~1.5V, high: 2.3V~Vss Max drive power: 25W (Temperature 75 oC) Working temperature: -25oC~+130oC Dimension: 55mm*45mm *18mm (l*b*h) 2 K-IMAGINATIONS | www.kimaginations.com L298 USER GUIDE Hardware connection: Pin configurations: Double H driver module can drive two DC motors at the same time. The board has a total of 10 pins. Enable 1 & 5V: These pins are to be shorted with a jumper if the input signals have to control the motors, if in case the control of the motors is dependent on the microcontroller data then the enable pin has to be connected to the controller data pins. Enable 2 & 5V: These pins are to be shorted with a jumper if the input signals have to control the motors, if in case the control of the motors is dependent on the microcontroller data then the enable pin has to be connected to the controller data pins. Digital port D1,D2,D3,D4:These four pins are used to control the direction of the motor. D1 and D2 for one motor & D3 and D4 for the other motor. For example D1=0, D2=1, motor 1= forward & D3=0, D4= 1, motor 2= forward. Similarly if the data is D1=1, D2=0 & D3=1, D4=0 the motors will rotate in reverse direction. K-IMAGINATIONS | www.kimaginations.com 3 L298 USER GUIDE Table for enable and digital port: ENABLE 0 1 1 D1 D2 D3 D4 (Motor 1) (Motor 1) (Motor 2) (Motor 2) 0 0 1 1 1 0 0 0 1 1 1 0 DIRECTION OF THE MOTORS No change Clockwise Anticlockwise Actual Hardware connections: 4 K-IMAGINATIONS | www.kimaginations.com L298 USER GUIDE Driving motors with Arduino Uno and L298Motor DriverBoard 1. Setting up Arduino Uno Connect the USB – Arduino cable from a PC USB port to the Arduino port. Install Arduino-IDE on your PC. Connect to the arduino by going to Tools Port COM port (which shows the arduino uno). 2. Setting up L298Motor Driver Board Connect M1, M2 to Motor 1 and connect M3, M4 to Motor 2. Connect power supply to +, - pins. This power supply is for motors. K-IMAGINATIONS | www.kimaginations.com 5 L298 USER GUIDE Short both the enable pins with 5v pins if the motor has to driven only with the input signals D1, D2, D3 and D4. 3. Interfacing of Arduino Uno and L298 Arduino Uno L298 5V 5V Pin 5 D4 Pin 4 D3 Pin 3 D2 Pin 2 D1 GND GND Connect the signal pins D1, D2, D3 and D4 to pins 2,3,4 and 5 (Any 4 digital pins on Arduino can be used). Connect the 5V pin and GND pin on L298 board to 5V pin and Gnd pin on Arduino Uno. 4. Implementation Code for Arduino Uno const int D1 = 2; const int D2 = 3; const int D3 = 4; const int D4 = 5; // This means pin 2 on arduino will be called D1 in the below code. This is done as we have connected D1 of L298 and Pin 2 of Arduino. void setup() { 6 // initialize digital pins as an output. pinMode(D1, OUTPUT); pinMode(D2, OUTPUT); K-IMAGINATIONS | www.kimaginations.com L298 USER GUIDE pinMode(D3, OUTPUT); pinMode(D4, OUTPUT); } void loop() { // put your main code here, to run repeatedly: digitalWrite(D1, HIGH); // turn the Motor 1 on (HIGH is the voltage level) digitalWrite(D2, LOW); digitalWrite(D3, HIGH); // turn the Motor 2 on digitalWrite(D4, LOW); delay(3000); // Motors on for 3 seconds digitalWrite(D1, LOW); // turn the Motor 1 on in reverse direction (LOW is the voltage level) digitalWrite(D2, HIGH); digitalWrite(D3, LOW); // turn the Motor 2 on in reverse direction. digitalWrite(D4, HIGH); delay(3000); // Motors on for 3 seconds } For more help regarding Interfacing use the following link: http://www.instructables.com/ For the details of the pin description of L298 you may refer the datasheet of the chip which is available at http://www.st.com/web/en/resource/technical/document/datasheet/CD00000240.pdf Ordering Information 7 K-IMAGINATIONS, Pune 9960860390 K-IMAGINATIONS | www.kimaginations.com L298 USER GUIDE E-mail us at:[email protected] , [email protected] 8 K-IMAGINATIONS | www.kimaginations.com