Whenever you want to make a robot or car using raspberry pi pico(you can use ESP8266 or ESP32 instead of raspberry pi). you have to control motors with your pico but you can't connect motors to your raspberry pi pico board directly like LEDs because motors draws more current from supply than small 5mm LEDs. Your pico's GPIO pins can't handle such high current and may get destroyed so in order to drive motor with your pico board you can use either a BJT or MOSFET. BJT and MOSFET can easily handle this current and you can protect your raspberry pi pico from being destroyed. There is a disadvantage of using BJT or MOSFET for controlling motors with raspberry pi pico and this is that you have to use individual BJT or MOSFET for each motor. This makes your circuit complex and bulky. So where we want to control more that one motor we use motor driver IC(integrated Circuit). The motor driver ICs that are widely used are L2983D and L298N. Here I am going to use L298N. You can easily purchase it. In market a pre assembled circuit is available for this chip and used for robots designing so I am going to use the pre assemble version.
After reading this tutorial carefully, one will be able to:
- Control motors with Raspberry pi pico, Esp8266 or ESP32
- make a robot or car easily.
- handle the L298N motor driver shield easily
Hardware Requirements:
- Raspberry pi pico
- Bread board
- L298N motor driver shield
- Gear motors
- Jumper wires(M-to-F)
- 12 V lead acid battery
Software Requirements:
- Thonny (Python IDE for beginners)
- l298N.py micropython Driver module.
Theory:
L298N IC:
The L298 is an integrated monolithic circuit in a 15-lead Multi watt and Power SO20 packages. It is a high voltage, high current dual full-bridge driver designed to accept standard TTL logic levels and drive inductive loads such as relays, solenoids, DC and stepping motors. Two enable inputs are provided to enable or disable the device independently of the input signals. The emitters of the lower transistors of each bridge are connected together and the corresponding external terminal can be used for the connection of an external sensing resistor. An additional supply input is provided so that the logic works at a lower voltage.
L298N IC(Features and Pin-Configuration)
L298N motor Driver shield:
Pin-Configuration
Features of L298N driver shield:
- Input Voltage: 3.2V~40Vdc.
- Driver: L298N Dual H Bridge DC Motor Driver
- Peak current: 2 Amp
- Operating current range: 0 ~ 36mA
- Control signal input voltage range :
- Low: -0.3V ≤ Vin ≤ 1.5V.
- High: 2.3V ≤ Vin ≤ Vss.
- Enable signal input voltage range :
- Low: -0.3 ≤ Vin ≤ 1.5V (control signal is invalid).
- High: 2.3V ≤ Vin ≤ Vss (control signal active).
- Maximum power consumption: 20W (when the temperature T = 75 ℃).
- Storage temperature: -25 ℃ ~ +130 ℃.
- On-board +5V regulated Output supply (supply to controller board i.e. Arduino)
- Size: 3.4cm x 4.3cm x 2.7cm
Comments