Presentation is loading. Please wait.

Presentation is loading. Please wait.

Motor TYWu.

Similar presentations


Presentation on theme: "Motor TYWu."— Presentation transcript:

1 Motor TYWu

2 SN754410 SN Motor Driver IC

3 L298N L298N DUAL FULL-BRIDGE DRIVER

4 L298N Pin Connections

5 L298N Bidirectional DC Motor Control

6 L298N Example

7 L298N Note The L298N does not have significant internal protection against spike and other electrical noise. Therefore, diodes and capacitors have been added to the motor control circuitry. These diodes and capacitors protect the motor chip and the rest of the circuit from electrical noise (inductive spikes) generated by the motors.

8 Experiment Schematic

9 Experiment Picture

10 Experiment Sketch int speedPin = 3; // H-bridge enable pin for speed control int motor1APin = 6; // H-bridge leg 1 int motor2APin = 7; // H-bridge leg 2 int ledPin = 13; // status LED int speed_value_motor1; // value for motor speed void setup() { // set digital i/o pins as outputs: pinMode(speedPin, OUTPUT); pinMode(motor1APin, OUTPUT); pinMode(motor2APin, OUTPUT); pinMode(ledPin, OUTPUT); }

11 Experiment void loop() {
digitalWrite(ledPin, HIGH); // status LED is always on // put motor in forward motion digitalWrite(motor1APin, LOW); // set leg 1 of the H-bridge low digitalWrite(motor2APin, HIGH); // set leg 2 of the H-bridge high // just invert the above values for reverse motion, // i.e. motor1APin = HIGH and motor2APin = LOW // control the speed speed_value_motor1 = 127; // half speed analogWrite(speedPin, speed_value_motor1); // output speed as // PWM value }


Download ppt "Motor TYWu."

Similar presentations


Ads by Google