A3967 Stepper Motor Driver Documentation
The A3967 Stepper Motor Driver is a bipolar stepper motor driver IC designed to control the speed and direction of stepper motors. It is capable of driving 2-phase bipolar stepper motors with a maximum current of 2A per coil. The A3967 features built-in translators to convert step and direction inputs into the required output signals to drive the motor.
The A3967 Stepper Motor Driver has a 16-pin DIP package with the following pinout:
VCC: Power supply voltage (5V to 35V)
GND: Ground
ENBL: Enable input (active low)
DIR: Direction input (high for clockwise, low for counter-clockwise)
STEP: Step input (rising edge triggers a step)
M1, M2: Motor output pins (connect to motor coils)
R1, R2: Current sense resistor connections
### Example 1: Basic Stepper Motor Control using Arduino
This example demonstrates how to control a stepper motor using an Arduino board and the A3967 Stepper Motor Driver.
```c
const int dirPin = 2; // Direction control pin
const int stepPin = 3; // Step control pin
const int enblPin = 4; // Enable control pin
void setup() {
pinMode(dirPin, OUTPUT);
pinMode(stepPin, OUTPUT);
pinMode(enblPin, OUTPUT);
digitalWrite(enblPin, LOW); // Enable the motor driver
}
void loop() {
digitalWrite(dirPin, HIGH); // Set direction to clockwise
for (int i = 0; i < 100; i++) {
digitalWrite(stepPin, HIGH);
delay(1);
digitalWrite(stepPin, LOW);
delay(1);
}
digitalWrite(dirPin, LOW); // Set direction to counter-clockwise
for (int i = 0; i < 100; i++) {
digitalWrite(stepPin, HIGH);
delay(1);
digitalWrite(stepPin, LOW);
delay(1);
}
}
```
### Example 2: Stepper Motor Control using Raspberry Pi (Python)
This example demonstrates how to control a stepper motor using a Raspberry Pi and the A3967 Stepper Motor Driver.
```python
import RPi.GPIO as GPIO
import time
dir_pin = 17
step_pin = 23
enbl_pin = 24
GPIO.setup(dir_pin, GPIO.OUT)
GPIO.setup(step_pin, GPIO.OUT)
GPIO.setup(enbl_pin, GPIO.OUT)
GPIO.output(enbl_pin, GPIO.LOW) # Enable the motor driver
while True:
GPIO.output(dir_pin, GPIO.HIGH) # Set direction to clockwise
for i in range(100):
GPIO.output(step_pin, GPIO.HIGH)
time.sleep(0.001)
GPIO.output(step_pin, GPIO.LOW)
time.sleep(0.001)
GPIO.output(dir_pin, GPIO.LOW) # Set direction to counter-clockwise
for i in range(100):
GPIO.output(step_pin, GPIO.HIGH)
time.sleep(0.001)
GPIO.output(step_pin, GPIO.LOW)
time.sleep(0.001)
```
Note: These examples assume a basic understanding of microcontroller programming and circuit design. Please ensure proper connection and configuration of the A3967 Stepper Motor Driver and the stepper motor according to the datasheet and manufacturer's instructions.