Do not power the relay coils from the ESP32/NodeMCU. ESP32 GPIO is 3.3 V logic and cannot supply relay-coil current.
Use the existing 12 V → 5 V buck converter for both the NodeMCU’s 5V/VIN input and the relay module’s 5V/VCC input, provided it has enough current capacity. A separate buck is usually unnecessary.
Recommended wiring:
- 12 V supply → motor relay contacts
- 12 V supply → buck input
- Buck 5 V → NodeMCU 5V/VIN
- Buck 5 V → relay module VCC/JD-VCC
- NodeMCU GND ↔ relay module GND ↔ buck GND
- ESP32 GPIOs → relay module IN pins
Important checks:
- Confirm the relay module accepts 3.3 V GPIO control. “5 V relay” often describes coil power, not the input-high threshold.
- Size the buck for NodeMCU peak current plus all simultaneously energized coils; 5 V, 2 A is a sensible minimum.
- Never connect 5 V to an ESP32 GPIO.
- Use two mechanically/electrically interlocked changeover relays for polarity reversal, and switch the motor off before reversing. The other two relays may provide enable/braking, but avoid any state that shorts 12 V.
- Ensure relay contact ratings cover the motor’s stall current, not just running current.
- Add suppression for motor noise—preferably a bidirectional TVS or RC snubber across the motor, since a normal flyback diode would prevent polarity reversal.
No project changes were made; the project remains empty. Execution stopped because your ACUs ran out.