Overview
This document outlines the solution and troubleshooting process for controlling a brushless motor via a 4-in-1 ESC using an Arduino Nano ESP32 board, which operates at 3.3V logic levels. The main goal was to ensure reliable motor control using PWM signals generated by the ESP32, despite compatibility quirks with traditional ESC behavior. The insights here can be applied directly in drone development projects. The same concept was used with a ESP32 C3 Supermini and the same outcome was observed.
The Problem
When using the Arduino Nano ESP32 board to control a BLHeli_S 4-in-1 ESC:
- ESC always emitted 3 startup beeps (meaning PWM signal detected)
- But then it entered calibration mode unexpectedly and could not complete it
- Or stayed silent after the beeps without spinning the motor
- Even when using correct code to send PWM signals (e.g. ESC.write(1300)), the motor didn’t spin
This didn’t happen with traditional 5V Arduino boards, which worked perfectly.
Debugging Process Summary
The initial suspicion was that the ESC doesn’t support 3.3V PWM logic. But ESC receives the signal and gives correct arming beeps, so it was confirmed that 3.3V logic was supported.
Using a multimeter, it was found that the signal was reaching the ESC (some average low voltage due to the 50HZ narrow pulse).
After some trials it was found that the ESC had to be powered after the ESP32 was already sending 1000us signals (min signal). Doing this, the motor started spinning.
What is the root cause? During ESP32 boot, pins are floating. ESC sees garbage voltage, so it thinks you want calibration, or it gets “confused”. Once you send a real signal, it’s too late, ESC is stuck in limbo.
Final Fix (Implemented)
Of course we cannot always power first the microcontroller, and then power the ESC at the right time so to give a clean min signal to the ESC. The best long term solution to fix the problem is to add a 10kΩ pull-down resistor between the PWM pin and GND:
- Ensures PWM line stays LOW at boot
- ESC sees safe 1000us-equivalent at startup
This solution works because:
- ESP32 pins float at boot → ESC sees undefined voltage
- ESC misinterprets it and gets “confused”, ends up not spinning motors
- Pull-down resistor keeps signal LOW until code runs
- ESC sees a valid low signal → arms successfully
- Then PWM ramps up and motor spins as expected
Arduino Sketch:
#include <ESP32Servo.h>
Servo ESC1;
void setup() {
ESC1.attach(3, 1000, 2000); // PWM pin and pulse range
ESC1.write(1000); // Send low throttle to arm
delay(5000); // Wait for ESC to beep and arm
}
void loop() {
ESC1.write(1500); // Spin motor
delay(40);
}
Comparison to Arduino UNO/Nano (5V logic)
Why Arduino boards working at 5V do not have this issue?
- Arduino boots much faster than ESP32
- Arduino pins default to LOW or INPUT safely
- ESC gets valid signal almost instantly
- 5V logic levels are stronger and more easily understood by most ESCs
ESP32 requires extra care due to:
- 3.3V logic
- Longer boot time
- Floating pins at startup
Conclusion
Even with a 3.3V logic board like the Arduino Nano ESP32, it’s possible to reliably control brushless motors through a 4-in-1 ESC using PWM, as long as you:
- Ensure clean signal at startup
- Avoid accidental calibration triggers
This solution is hardware-efficient, drone-safe, and fully usable for flight applications.
Leave a Reply