Circuit Documentation
Summary
This circuit is designed to control multiple DC motors using Raspberry Pi 4B as the main controller and L298N motor drivers. The Raspberry Pi 4B interfaces with the L298N drivers to control the direction and speed of the motors. Power is supplied to the Raspberry Pi by a HobbyWing External UBEC-8A, which is connected to a lipo battery. The L298N drivers are powered by a separate Lipo Battery. The circuit is designed to ensure that all components share a common ground.
Component List
Raspberry Pi 4B
- Microcontroller with multiple GPIO pins for interfacing with external hardware.
- Pins: 3V3, 5V, multiple GPIOs, GND, ID_SD, ID_SC, TR01_TAP, TR00_TAP, TR03_TAP, TR02_TAP, RUN, GLOBAL_EN.
L298N DC Motor Driver
- A motor driver module capable of driving two DC motors.
- Pins: OUT1, OUT2, 12V, GND, 5V, OUT3, OUT4, 5V-ENA-JMP-I, 5V-ENA-JMP-O, +5V-J1, +5V-J2, ENA, IN1, IN2, IN3, IN4, ENB.
DC Motor
- A standard DC motor for rotational motion.
- Pins: pin 1, pin 2.
Lipo Battery
- A rechargeable battery providing power to the motor drivers.
- Pins: VCC, GND.
HobbyWing External UBEC-8A
- A voltage regulator that provides a stable power supply to the Raspberry Pi.
- Pins: VCC, GND.
Lipo Battery 2200mAH 30c
- A high-capacity rechargeable battery that powers the UBEC.
- Pins: VCC, GND.
Wiring Details
Raspberry Pi 4B
- 5V and GND are connected to the HobbyWing External UBEC-8A for power.
- GPIO pins are used to control the L298N motor drivers:
- GPIO17, GPIO27, GPIO22, GPIO23, GPIO24, GPIO25 for motor driver control signals.
- GPIO5, GPIO6, GPIO19, GPIO16, GPIO20, GPIO21 for additional motor driver control signals.
L298N DC Motor Driver
- GND is connected to the common ground network.
- 5V is connected to the Lipo Battery for power.
- ENA, ENB, IN1, IN2, IN3, IN4 are connected to the Raspberry Pi GPIO pins for motor control.
- OUT1, OUT2, OUT3, OUT4 are connected to the DC Motors.
DC Motor
- pin 1 and pin 2 are connected to the OUT pins of the L298N motor drivers.
Lipo Battery
- VCC is connected to the 5V input of the L298N motor drivers.
- GND is connected to the common ground network.
HobbyWing External UBEC-8A
- VCC is connected to the 5V pin of the Raspberry Pi 4B.
- GND is connected to the GND pin of the Raspberry Pi 4B.
Lipo Battery 2200mAH 30c
- VCC is connected to the VCC pin of the HobbyWing External UBEC-8A.
- GND is connected to the GND pin of the HobbyWing External UBEC-8A.
Documented Code
There is no code provided for the microcontrollers in the circuit. The Raspberry Pi 4B would typically be programmed to control the L298N motor drivers using its GPIO pins. The code would set the GPIO pins to high or low to control the direction and speed of the motors connected to the L298N drivers. Since no code is provided, it is assumed that the user will develop their own software to control the motors based on the specific requirements of their application.
