We have the L298N Motor Driver. Rear motors are connected to the driver. Now it is time to connect the Raspberry Pi. The Raspberry Pi will control the motor driver and from there the car motors.

Необходимо е да се абонирате за FLLCasts.com, за да достъпите това видео
- #794
- 23 Feb 2018
TL. DR.
Input 1 to GPIO 27 - Forward; Input 2 to GPIO 22 - Backward; Input 3 to GPIO 23 - Left; Input 4 to GPIO 24 - Right;
Motor Drive Outputs
The structure of the driver is simple. We have the pins for controlling the motors. The back motor is connected to the left pins (Out1 and Out2). The front motor will be controlled by the right pins (Out 3 and Out 4) on the motor driver. So we use all the four output pins. We also have 4 input pins named 1 to 4. These four pins are connected to the output pins in the following way: Input 1 to Output 1. Input 2 to Output 2. Input 3 to Output 3. Input 4 to Output 4. Simple. The driver is built in such a way that the inputs are connected to the outputs.
Here is the driver from below to understand where are the outputs:
Motor drivers inputs
The inputs receive signals from the controller. The inputs should be connected to the controller with the jumper cables. Picture:
If you look closely you could also see a small print next to the pins that are "In1","In2","In3","In4". In this way you know which pins are which.
Connect them in the following way.
Motor Driver Input 1 to GPIO 27 - Forward
Motor Driver Input 2 to GPIO 22 - Backward
Motor Driver Input 3 to GPIO 23 - Left
Motor Driver Input 4 to GPIO 24 - Right
If you need to remind yourself which GPIO is which take a look at the driver scheme
Курсове и занятия включващи този Урок
Този Урок е използван в следните курсове и занятия.

Perfect STEM course. Module 1 - Smart Car with Raspberry PI
Disassemble a remote control car. Change the brain of the car with a smart computer like Raspberry Pi. Build a smart device with artificial intelligence that you could control from your phone and that could freely navigate itself in the real world and on the Internet. Use your hands. Develop programs for your robot and your phone. Be curious and invent.
The perfect course lives up to its name. You move through the content, we check it and return feedback to you.
In the end, you should be able to better understand how to program and design smart devices that would make the world a better place. For everybody age 12+, 16+, 21+, 35+, etc. The hardware costs about 150$. It changes through the years so it might take some time for you to find it as Raspberry PI, motor drivers, power banks and h-bridges.. they change. Note that the course was designed to be led by a teacher with a decent knowledge in embedded hardware and software. This, on the other hand should not stop you, if you are curious.
- 118
- 42:47
- 136

Connecting Motor driver to Controller
We have the L298N Motor Driver. Rear motors are connected to the driver. Now it is time to connect the Raspberry Pi. The Raspberry Pi will control the motor driver and from there the car motors.
- 3
- 0
- 3
- 3d_rotation 1