🔌 Solar Powered Motor Control System
Solar Panel →
Charging Module →
Li-ion Battery →
Buck Converter →
ESP32 + Motor Driver →
DC Motor
🌞 Solar Panel
9V Output
Pins:
+ (Positive)
- (Negative)
🔋 Solar Charging Module
TP4056 or similar
Pins:
IN+, IN- (Solar input)
B+, B- (Battery)
OUT+, OUT- (Load output)
🔋 Li-ion Battery
3.7V Nominal
Pins:
+ (Positive)
- (Negative)
⚡ Buck Converter
Step Down Module
Pins:
VIN+, VIN- (Input)
VOUT+, VOUT- (Output)
🤖 ESP32
Microcontroller
Key Pins:
VIN, 3V3, GND
GPIO pins for control
🎛️ Motor Driver
L298N or similar
Pins:
VCC, GND
IN1, IN2, ENA
OUT1, OUT2
⚙️ DC Motor
12V DC Motor
Wires:
Red (+)
Black (-)
📋 Complete Wiring Connections
| From Component |
From Pin/Wire |
Wire Color |
To Component |
To Pin/Wire |
Notes |
| Solar Panel |
+ (Positive) |
Red |
Charging Module |
IN+ |
Solar input power |
| Solar Panel |
- (Negative) |
Black |
Charging Module |
IN- |
Solar input ground |
| Charging Module |
B+ |
Red |
Li-ion Battery |
+ (Positive) |
Battery charging |
| Charging Module |
B- |
Black |
Li-ion Battery |
- (Negative) |
Battery ground |
| Charging Module |
OUT+ |
Red |
Buck Converter |
VIN+ |
Power to buck converter |
| Charging Module |
OUT- |
Black |
Buck Converter |
VIN- |
Ground to buck converter |
| Buck Converter |
VOUT+ |
Blue |
ESP32 |
VIN |
5V power to ESP32 |
| Buck Converter |
VOUT- |
Black |
ESP32 |
GND |
Ground connection |
| Buck Converter |
VOUT+ |
Blue |
Motor Driver |
VCC |
Power to motor driver logic |
| Buck Converter |
VOUT- |
Black |
Motor Driver |
GND |
Ground connection |
| Charging Module |
OUT+ |
Orange |
Motor Driver |
12V or VMS |
Motor power supply (if 12V needed) |
| ESP32 |
GPIO 2 |
Yellow |
Motor Driver |
IN1 |
Motor direction control |
| ESP32 |
GPIO 4 |
Green |
Motor Driver |
IN2 |
Motor direction control |
| ESP32 |
GPIO 5 |
Purple |
Motor Driver |
ENA |
Motor speed control (PWM) |
| Motor Driver |
OUT1 |
Red |
DC Motor |
Red wire |
Motor positive connection |
| Motor Driver |
OUT2 |
Black |
DC Motor |
Black wire |
Motor negative connection |
🔧 Buck Converter Settings
- Input: 3.7-4.2V from battery
- Output: Adjust to 5V for ESP32
- Current: Set to at least 1A
- Use multimeter to verify output voltage
⚙️ Motor Driver Configuration
- Logic Power: 5V from buck converter
- Motor Power: Battery voltage (3.7-4.2V) or 5V
- Control: 3 GPIO pins from ESP32
- Remove jumper if using separate motor power
🔋 Battery Considerations
- Capacity: Choose based on motor current draw
- Protection: Use battery with built-in BMS
- Charging: TP4056 handles 3.7V Li-ion charging
- Monitor battery voltage in code
☀️ Solar Panel Setup
- Voltage: 9V is good for 3.7V battery charging
- Current: Higher current = faster charging
- Placement: Maximum sun exposure
- Add bypass diode to prevent reverse current
💡 Important Notes
- Power Management: The charging module provides load output that automatically switches between solar and battery power
- Voltage Levels: ESP32 can handle 3.3-5V input. Buck converter ensures stable 5V supply
- Motor Power: If your motor needs more than 5V, connect motor driver's motor power directly to battery output
- Current Draw: Calculate total current draw to size your battery appropriately
- Fusing: Consider adding fuses for safety, especially on battery connections
⚠️ Safety Warnings
- Battery Safety: Never short-circuit Li-ion batteries. Use proper charging modules
- Polarity: Double-check all positive/negative connections before powering on
- Current Limits: Ensure all components can handle the expected current draw
- Heat: Buck converters and motor drivers can get hot - ensure adequate ventilation
- Testing: Test each connection with a multimeter before final assembly
🖥️ Sample ESP32 Code Structure
Your ESP32 code should control the motor driver pins:
- GPIO 2 & 4: Control motor direction (IN1, IN2)
- GPIO 5: Control motor speed using PWM (ENA)
- Monitor battery voltage through analog pin
- Implement low battery protection