Proper wiring of the power supply is essential to ensure your robot operates safely, stably, and without sparks. In this article, I’ll explain how to set up the power supply using batteries with a step-down converter or a power bank and how to connect components like motors and the ESP32.
Wiring with 18650 Batteries and a Step-Down Converter
When using three 18650 batteries in series within a battery holder, they deliver an output voltage of over 10V, which can be reduced to the required voltages (e.g., 5V or 6V) using a step-down converter. The ESP32 requires 5V or 5.1V for stable operation.
L298N Motor Driver – Powering the Motors
The motors on each side are connected in parallel. Make sure they spin in the same direction.
The following images illustrate how the motors are connected and powered.
Note: The motor driver powers the TT geared motors directly from the battery voltage.
After connecting the motors on each side of the robot car via a terminal block, connect them to the motor driver outputs.
Connecting the Motor Driver
- Connect the motors to the motor driver outputs (OUT1, OUT2 for Motor A and OUT3, OUT4 for Motor B).
Important: The motors are designed for 6V but can temporarily operate at higher voltages. The L298N slightly reduces the voltage due to its internal resistance, but this effect is minimal.
Here’s an image showing how to connect the motors to the L298N H-bridge (motor driver). If the motors on one side of the robot spin in the opposite direction to the other side when the robot should drive straight, reverse the polarity of the wires in the terminal block.
Note: Logical control for motor speed and direction via the servo controller is achieved using the ENA, IN1, IN2, IN3, IN4, and ENB pins with 3.3V PWM signals. For more details, refer to the article on logical wiring.
Preparing the Battery Pack
To wire the battery holder containing three 18650 batteries:
- Connect the black wire (GND) from the battery holder to the terminal block.
- Connect the red wire (~12V) from the battery holder through a switch and then to the terminal block.
- From the other side of the terminal block, connect one pair of wires (12V and GND) to the motor driver’s GND and VIN inputs to power the motors.
- Connect another pair of wires to the step-down converter to generate 5V for the ESP32 microcontroller.
The advantage of connecting the battery holder and switch via a terminal block is that it makes it easy to turn the robot on and off.
Note: If the step-down converter has USB-A outputs, as shown in the image, connect the ESP32 using a suitable USB cable. For converters without USB outputs, adjust the output voltage to 5V and connect the VOUT and GND pins to the ESP32’s 5V and GND pins to power it.
Wiring with a Power Bank
A power bank with two USB-A ports provides a simple way to power the ESP32 and motors. You’ll need a USB cable that can be cut to access the 5V and GND wires for connecting the motor driver.
Step 1: Prepare the USB Cable
- Cut an old USB cable and strip the red (+5V) and black (GND) wires. Trim the white and green data wires short.
Step 2: Connect the ESP32
- Power the ESP32 using a suitable USB cable.
Step 3: Power the Motor Driver
- Use the second USB port of the power bank.
- Connect the red (+5V) and black (GND) wires of the USB cable to the VIN and GND pins of the L298N motor driver.
- If not already done, connect the motors to the L298N outputs as described earlier.
Important Notes
- Shared Ground: Connect all GND pins (ESP32, step-down converter, motor driver, and other components) to avoid voltage fluctuations and errors.
- Check Voltage: Verify output voltages before connecting components to avoid damage.
- Safety Measures: Use a fuse to prevent overcurrent and ensure clean solder joints or connections.
Summary
The power supply for your ESP32 robot car can be achieved using either 18650 batteries with a step-down converter or a power bank. Your choice depends on whether you prefer more power and flexibility (batteries) or a simple and convenient solution (power bank). Both options are efficient and provide a stable foundation for your project.
In the next article, I’ll explain how to set up the logical wiring for your robot car. Enjoy tinkering and wiring!
Artikel Übersicht ESP32 Roboter Auto:
ESP32 Dev Kit C V4 – Build Your Own Robot Car – Project KickoffESP32 Dev Kit C V4 – Build Your Own Robot Car – Electronics and Components
ESP32 Dev Kit C V4 – Build Your Own Robot Car – Chassis Examples
ESP32 Dev Kit C V4 – Build Your Own Robot Car – Power Supply
ESP32 Dev Kit C V4 – Build Your Own Robot Car – Power Supply Wiring
ESP32 Dev Kit C V4 – Build Your Own Robot Car – Logical Wiring
ESP32 Dev Kit C V4 – Build Your Own Robot Car – Setting Up the Arduino Development Environment
ESP32 Dev Kit C V4 – Build Your Own Robot Car – The Robot Software
Recent Comments