Step 6: Connecting Motor Driver to Arduino
The orientation of the robot for this step is the front end facing you. See the last picture for example.
1. If your l298n motor driver has bridging clips attached to the ENA
ENA and ENB
ENB pins remove them.
2. Using wires with an input and pin make the following connection to the motor driver and then to the
breadboard inputs adjacent to the Arduino Nano pins.
3. Attach yellow wire to ENA
ENA on the driver and insert it next to the Arduino Nano D3
D3 pin.
4. Attach green wire to IN1
IN1 on the driver and insert it next to the Arduino Nano D2
D2 pin.
5. Attach white wire to IN2
IN2 on the driver and insert it next to the Arduino Nano D4
D4 pin.
6. Attach purple wire to IN3
IN3 on the driver and insert it next to the Arduino Nano D5
D5 pin.
7. Attach grey wire to IN4
IN4 on the driver and insert it next to the Arduino Nano D8
D8 pin.
8. Attach blue wire to ENB
ENB on the driver and insert it next to the Arduino Nano D9
D9 pin.
9. Input each wire from the left motor into the OUT1
OUT1 and OUT2
OUT2 ports on the motor driver. Do not tighten
screws, you may need to swap the wires if the motor is driving in reverse. This is called reversing polarity.
10. Input each wire from the right motor into the OUT3
OUT3 and OUT4
OUT4 ports on the motor driver. Do not tighten
screws, you may need to swap the wires if the motor is driving in reverse. This is called reversing polarity.
Note:
Note: you will secure the motor wires in Step 9: Edit and Upload Code
Step 9: Edit and Upload Code.
Autonomous Robot Racer: Scratch Mode: Page 37
Autonomous Robot Racer: Scratch Mode: Page 38
Autonomous Robot Racer: Scratch Mode: Page 39
Autonomous Robot Racer: Scratch Mode: Page 40
Autonomous Robot Racer: Scratch Mode: Page 41
Autonomous Robot Racer: Scratch Mode: Page 42
Autonomous Robot Racer: Scratch Mode: Page 43
Autonomous Robot Racer: Scratch Mode: Page 44
Autonomous Robot Racer: Scratch Mode: Page 45
|