For this project, you’ll need:
- 2 DC motors with a current rating of less than 600 mA (most small motors will be fine)
o Can be run with just one motor, including the motor in the Freenove kit
- An L293D chip
- 10 male-to-male jumper wires
- A power supply for the motors (I’m using a 9V battery for 2 6V motors, but I’d recommend using a 5V or 6V supply if using the Freenove motor)
- A breadboard with a T-connector to interface with the Raspberry Pi
In this build guide, I disconnect each wire I’ve plugged in before moving on to the next step. This was only done to ensure that the pictures clearly show the wires needing to be connected – if building this yourself, leave all wires connected after each step.
Also, for reference, here’s a diagram (from lastminuteengineers.com) of the L298N chip which includes all of the connections I make in this build guide
Make sure the side with the dimple (circled in red) is on top!
Place the L293D chip on the breadboard, across the center as shown (note the orientation!)
Connect one of the two L293D grounds on each side to the breadboard’s ground rail
Connect one of the Pi’s ground pins to the ground rail
Connect your external power source, a 9V battery in my case (don’t mix up + and - here!)
Connect a 5V output from the Pi to the top-right pin on the L298N
Connect your motor(s), ensuring both are connected with the correct polarity
Connect both PWM control pins to GPIO pins 12 and 13
Connect the left two motor control pins to GPIO pins 23 and 24
Connect the right two motor control pins to GPIO pins 25 and 26
https://lastminuteengineers.com/