![how to connect l298n motor driver to sensor shield v5 how to connect l298n motor driver to sensor shield v5](https://hackster.imgix.net/uploads/attachments/398557/mBlock_Unit19_0.png)
The motor direction is controlled by sending a HIGH or LOW signal to the drive for each motor (or channel). Then connect D10 to module pin 7 (remove the jumper first) and D5 to module pin 12 (again, remove the jumper). In our example we have two DC motors, so digital pins D9, D8, D7 and D6 will be connected to pins IN1, IN2, IN3 and IN4 respectively. PWM pins are denoted by the tilde (“~”) next to the pin number, for example:įinally, connect the Arduino digital output pins to the driver module. Now you will need six digital output pins on your Arduino, two of which need to be PWM (pulse-width modulation) pins. Don’t forget to connect Arduino GND to pin 5 on the module as well to complete the circuit. This can be fed to your Arduino’s 5V pin to power it from the motors’ power supply. If you supply is up to 12V you can leave in the 12V jumper (point 3 in the image above) and 5V will be available from pin 6 on the module. Next, connect your power supply – the positive to pin 4 on the module and negative/GND to pin 5. Otherwise you may need to swap them over when you set both motors to forward and one goes backwards! If you’re using two motors for a robot (etc) ensure that the polarity of the motors is the same on both inputs. First connect each motor to the A and B connections on the L298N module. To control one or two DC motors is quite easy with the L298N H-bridge module. Connect to PWM output for DC motor speed control. Leave this in place when using a stepper motor. 5V output if 12V jumper in place, ideal for powering your Arduino (etc).Connect your motor supply voltage here, maximum of 35V DC.
![how to connect l298n motor driver to sensor shield v5 how to connect l298n motor driver to sensor shield v5](https://ae01.alicdn.com/kf/H4f47305e156d40e4b34de399272b38fbW/Smart-Electronics-L298-Stepper-DC-Motor-Driver-Shield-Expansion-Development-Board-For-Arduino-DIY-Car-Robot.jpg)
This enables power to the onboard 5V regulator 12V jumper – remove this if using a supply voltage greater than 12V DC.At this point, review the connections on the L298N H-bridge module.Ĭonsider the following image – match the numbers against the list below the image:
#How to connect l298n motor driver to sensor shield v5 how to
With the module used in this tutorial, there is also an onboard 5V regulator, so if your supply voltage is up to 12V you can also source 5V from the board.įirst we’ll run through the connections, then explain how to control DC motors then a stepper motor. The L298N H-bridge module can be used with motors that have a voltage of between 5 and 35V DC. After some hunting around we found a neat motor control module based on the L298N H-bridge IC that can allows you to control the speed and direction of two DC motors, or control one bipolar stepper motor with ease.
![how to connect l298n motor driver to sensor shield v5 how to connect l298n motor driver to sensor shield v5](https://aws1.discourse-cdn.com/arduino/optimized/4X/4/4/9/449c1774caf572072c2174fee7357daf2bb14432_2_500x500.jpeg)
You don’t have to spend a lot of money to control motors with an Arduino or compatible board. NOTE: When the motor shield is powered by external power source, make sure the external power source and Arduino have the same GND.Learn how to use inexpensive L298N motor control modules to drive DC and stepper motors with Arduino. The swith between external and Arduino power is implemented by two jumpers. PWRIN: The motors can be powered by external power supply when the motor current exceeds the limits provided from the Arduino. The male header behide the terminals are the same as the motor terminals. Motor Terminal: Two DC motors are connected to blue motor terminals. The PLL mode uses M1 and M2 to generate phase control signal. The PWM mode uses E1 and E2 to generate PWM signal. Motor Driven Voltage:4.8~35V (From Arduino or External Power Source)Ĭontrol Mode Selection Jumpers: The shield supports PWM and PLL(Phased Locked Loop) control Modes.Logic Control Voltage:5V (From Arduino).It is strongly encouraged to use external power supply to power the motor shield. The Motor shield can be powered directly from Arduino or from external power source. The enable/disable function of the motor control is signalled by Arduino Digital Pin 4 and 7. The speed control is achieved through conventional PWM which can be obtained from Arduino’s PWM output Pin 5 and 6. It uses a L298N chip which deliveries output current up to 2A each channel. This 2x2A DC Motor Shield for Arduino allows Arduino to drive two channel DC motors.