DC motor drive experiment
Experimental phenomena
This experiment uses a small DC motor to drive L9110 to drive a small DC motor
Theoretical study
After wiring according to the above figure, the motor connected to the drive board can be controlled.
When A1.A2=0.0, it is stalled. When
A1.A2=1.0, it is forward rotation.
A1.A2=0.1 is reverse rotation.
PA is PWM wave input.
G is common ground pin.
The PWM frequency is up to 60KHZ and the duty cycle is up to 98%.
Schematic diagram
Code writing
int iapin = 6;
int ibpin = 5;
void setup() {
// put your setup code here, to run once:
pinMode(iapin, OUTPUT);
pinMode(ibpin, OUTPUT);
}
void loop() {
// put your main code here, to run repeatedly:
//顺时针旋转
digitalWrite(iapin, HIGH);
digitalWrite(ibpin, LOW);
/*
逆时针旋转
digitalWrite(iapin, LOW);
digitalWrite(ibpin, HIGH);
*/
}