L298N Dual H Bridge DC Motor Driver IC ที่ใช้งานง่าย ราคาไม่แพง
H bridge คือ
An H bridge is an electronic circuit that enables a voltage to be applied across a load in either direction. These circuits are often used in robotics and other applications to allow DC motors to run forwards and backwards.[1]
Most DC-to-AC converters (power inverters), most AC/AC converters, the DC-to-DC push–pull converter, most motor controllers, and many other kinds of power electronics use H bridges. In particular, a bipolar stepper motor is almost invariably driven by a motor controller containing two H bridges.
จาก http://en.wikipedia.org/wiki/H_bridge
ชุดขับมอเตอร์อเนกประสงค์ด้วย IC เบอร์ L298 / L298N ซึ่งเป็น IC ขับมอเตอร์แบบ H-Bridge - สามารถใช้ขับมอเตอร์ DC ได้พร้อมกันจำนวน 2 ตัว
การต่อวงจร
ENA >> PWM 9 ของ arduino
IN1 >> PIN7
IN2 >>PIN8
ENAB>> PWM 9 ของ arduino
IN1 >> PIN7
IN2 >>PIN8
วีดีโอการใช้งาน
โปรแกรม
const int analogOutPin = 9; // Analog output pin that the LED is attached to
void setup() {
// initialize serial communications at 9600 bps:
Serial.begin(9600);
pinMode(7,OUTPUT);
pinMode(8,OUTPUT);
}
void loop() {
analogWrite(analogOutPin, 255);
digitalWrite(7,HIGH);
digitalWrite(8,LOW);
delay(5000);
analogWrite(analogOutPin, 127);
digitalWrite(7,HIGH);
digitalWrite(8,LOW);
delay(5000);
analogWrite(analogOutPin, 0);
digitalWrite(7,HIGH);
digitalWrite(8,LOW);
delay(5000);
analogWrite(analogOutPin, 255);
digitalWrite(7,LOW);
digitalWrite(8,HIGH);
delay(5000);
analogWrite(analogOutPin, 127);
digitalWrite(7,LOW);
digitalWrite(8,HIGH);
delay(5000);
analogWrite(analogOutPin, 0);
digitalWrite(7,LOW);
digitalWrite(8,HIGH);
delay(5000);
analogWrite(analogOutPin, 0);
digitalWrite(7,HIGH);
digitalWrite(8,HIGH);
delay(5000);
}
ขอบคุณครับ ที่แวะมาอุดหนุนทางร้าน