Github repository:

Powering FOCn

Allowable input voltage is from 9V to 45V. Recomended cell count for lithium batteries is 3s to 10s, depending on your application. If using a power supply that is not a battery, carefully consider the effects of regenerative breaking.

If your application requires high motor currents, consider adding an extra capacitor to the supply input, especially if other devices are powered by the same supply rail. 470uF 50V low ESR capacitor as close as possible to the input voltage terminals is recomended.


FOCn can be programmed and debugged via the onboard USB-C which is connected to the ESP32’s native USB port. Programing should start automatically. If not, BOOT and RESET pushbuttons are available to control boot and programming. UART0 port is exposed on an unpopulated header.

Motor connection

Motor phases should be connected at the screw terminal. Wiring should be as short as possible.

Position sensors

Hall sensors or encoders with AB output can be connected to HA, HB, HC inputs. Inputs are filtered to avoid glitches caused by switching noise coupling to singal lines and strongly pulled up to 3.3V (MCU IO voltage). Pull-up voltage can be disabled from software for power saving during deep sleep.

HA, HB, HC inputs can also be used as general purpose IO by jumping jumpers J1, J2, J3 on the back of the PCB. Do this only if you know exactly what you are doing! Warning: maximum allowable voltage input if jumpers are jumped is 3.3V!

I2C encoders are also supported. Connect the data lines to AUX inputs.

HVP output

High-voltage PWM is a low-side switched output designed for auxilary loads such as solenoids, magnetic brakes, indicator lights and other auxilary loads at up to 5A average current. Voltage is unregulated (same as input voltage to FOCn). Output can be used safely with inductive loads.

LPV output

Low-voltage PWM is a high-side switched output designed for small auxilary loads such as sensors, indicator lights and communication modules. Up to 300mA is allocated for external loads. LVP can also be used to disable hall / encoder power for lower sleep current consumption.

AUX inputs

Two auxilary inputs are available to be used with various sensors, safety switches, etc. Inputs are pulled up to 3.3V to support switches and open-drain outputs commonly used in industrial sensors. Maximum allowable voltage on auxilary inputs is 24V. To use auxilary inputs as outputs or data lines for I2C encoders, jump J4 and J5 on the back side of the PCB. This jumps the series protection resistor and provides a direct connection to MCU (3.3V signal level). Warning: maximum allowable voltage input if jumpers are jumped is 3.3V!

RF keyfob receiver module

Keyfob remote module can be added to FOCn. The unpopulated header (bottom left) is designed to accept a HCS-300 rolling code receiver module. Two digital signals are connected to the MCU (D1 and D2). (module available here:

Wireless communication (Wi-Fi / BT)

The ESP32-S3 module has a built-in Wi-Fi and BLE modem which can be used to communicate with and control FOCn. ESP32-S3 also supports Espressif’s ESP-NOW protocol which is very suitable for BLDC control due to low latency and processing overhead. If possible, run communication and BLDC driver code on sepparate CPU cores.

Adding extra cooling

If prolonged high motor currents (>10A) and/or high ambient temperatures (>35degC) are expected, aditional cooling should be added. This can be done by attaching a heat-dissipating body to the back of FOCn with a thermal pad (most heat is produced below the MOSFETs) or forced air cooling (fan)

Using FOCn with smaller motors

In some cases, current sensing resolution might become an issue with low phase currents on small motors, as FOCn is designed for higher...

Read more »