L298N 电机驱动板模块 直流步进电机马达 ¥10.43
https://detail.tmall.com/item.htm?spm=a230r.1.14.16.17c57d63EjELxB&id=18566053714&cm_id=140105335569ed55e27b&abbucket=6
AliExpress L298N Dual H Bridge DC Stepper Motor Driver Controller Board Module for Uno R3 Raspberry Pi Starter DIY Kit – US$1.68 / pièce
L298 Datasheet Dual Full Bridge Driver
https://www.st.com/resource/en/datasheet/l298.pdf
L298N Module Dual H Bridge Stepper Motor Driver Board Modules for Smart Car
Features:
Working mode: H bridge (double lines)
Control chip: L298N (ST)
Logical voltage: 5V
Driving voltage: 5V-35V
Logical current: 0mA-36mA
Driving current: 2A (MAX single bridge)
Storage temperature: (-20 °C)-(+135 °C)
Maximum power: 25W
Weight: 30g
Periphery dimension: 43 x 43 x 27mm(L x W x H)
Using L298N made by ST company as the control chip, the module has such characteristics as strong driving ability, low calorific value and strong anti-interference ability.
This module can use built-in 78M05 for electric work via a driving power supply part. But to avoid the damage of the voltage stabilizing chip, please use an external 5V logic supply when using more than 12V driving voltage.
Using large capacity filter capacitor, this module can follow current to protect diodes, and improve the reliability.
Wiring & Driving the L298n H Bridge with 2 to 4 DC Motors – 14Core
https://www.14core.com/wiring-driving-the-l298n-h-bridge-on-2-to-4-dc-motors/
Raspberry Pi L298N Interface Tutorial | Control a DC Motor with L298N and Raspberry Pi – Electronics Hub
https://www.electronicshub.org/raspberry-pi-l298n-interface-tutorial-control-dc-motor-l298n-raspberry-pi/
import RPi.GPIO as GPIO
from time import sleep
in1 = 24
in2 = 23
en = 25
temp1=1
GPIO.setmode(GPIO.BCM)
GPIO.setup(in1,GPIO.OUT)
GPIO.setup(in2,GPIO.OUT)
GPIO.setup(en,GPIO.OUT)
GPIO.output(in1,GPIO.LOW)
GPIO.output(in2,GPIO.LOW)
p=GPIO.PWM(en,1000)
p.start(25)
print(“\n”)
print(“The default speed & direction of motor is LOW & Forward…..”)
print(“r-run s-stop f-forward b-backward l-low m-medium h-high e-exit”)
print(“\n”)
while(1):
x=raw_input()
if x==’r’:
print(“run”)
if(temp1==1):
GPIO.output(in1,GPIO.HIGH)
GPIO.output(in2,GPIO.LOW)
print(“forward”)
x=’z’
else:
GPIO.output(in1,GPIO.LOW)
GPIO.output(in2,GPIO.HIGH)
print(“backward”)
x=’z’
elif x==’s’:
print(“stop”)
GPIO.output(in1,GPIO.LOW)
GPIO.output(in2,GPIO.LOW)
x=’z’
elif x==’f’:
print(“forward”)
GPIO.output(in1,GPIO.HIGH)
GPIO.output(in2,GPIO.LOW)
temp1=1
x=’z’
elif x==’b’:
print(“backward”)
GPIO.output(in1,GPIO.LOW)
GPIO.output(in2,GPIO.HIGH)
temp1=0
x=’z’
elif x==’l’:
print(“low”)
p.ChangeDutyCycle(25)
x=’z’
elif x==’m’:
print(“medium”)
p.ChangeDutyCycle(50)
x=’z’
elif x==’h’:
print(“high”)
p.ChangeDutyCycle(75)
x=’z’
elif x==’e’:
GPIO.cleanup()
break
else:
print(“<<< wrong data >>>”)
print(“please enter the defined data to continue…..”)
.END
Categories: DC Motor