Skip to content

SimpleFOC Balance Car

A self-balancing robot car driven by two BLDC motors using the SimpleFOC library and ESP32 microcontroller.

  • Wheeled
  • Open source
  • arduino
  • 3D printable

Suggested by Robotheca, created by @FranHawk (opens in a new tab), from github.com/FranHawk/simplefoc_balance_car (opens in a new tab). Pinned to commit 4fd3b23 (opens in a new tab).

Photo and 3D model

This repository has no photo of the robot yet.

3D preview converted from github.com/FranHawk/simplefoc_balance_car at 4fd3b23, under MIT. View the original files from GitHub (350 KB) (opens in a new tab)

Power
12 V

What it can do

Written by Robotheca from the project's documents.

  • Self-balances on two wheels
  • Moves forward, backward and turns via Bluetooth app
  • Shows RGB light effects on two LED strips
  • Streams video over Wi-Fi using an ESP-CAM module

Bill of materials

10 parts

10 of 10 parts shown

Parts list
#ComponentQuantityEst. priceSupplier
1100nf1––
210u1––
3HDGC1002WR-S-4P1–LCSC
4HDGC1002WR-S-3P1–LCSC
5HDR-F-2.54_1x31–LCSC
6HDR-M-2.54_1x41–LCSC
7短路连接点3–MONIK2020
84.7k2––
910K1––
10AS5600-ASOM1–LCSC

10 of 10 parts have no price in the source, so there is no parts total. Read from 1.hardware/pcb/encoder_board/BOM_PCB_as5600-16mm_2022-05-23.csv at the pinned commit.

Build guide

The creator's steps, each with its instructions.

  1. 1Assemble the circuit boards
  2. 2Prepare the mechanical components
  3. 3Assemble the motor units
  4. 43D print the wheels and mounts
  5. 5Mount the electronics and battery
  6. 6Connect all components
  7. 7Flash the firmware
  8. 8Calibrate and test the balance car

The guide appears here as you scroll.

Guide by @FranHawk (readme.md), under MIT. The English translation is by Robotheca, shared under the same license.

Wiring and electronics

Notes written by Robotheca from the project's documents.

Main parts

  • ESP32 microcontroller
  • Two L6234P three-phase H-bridge motor drivers
  • Two AS5600 magnetic encoders via I²C
  • Two INA240A1 current sensors
  • MPU6050 6-axis IMU
  • WS1802B addressable RGB LEDs on two strips
  • ESP-CAM module for Wi-Fi video transmission
  • TPS5430 12 V to 5 V buck converter
  • AMS1117 5 V to 3.3 V linear regulator
  • 3S 900 mAh LiPo battery

Connections

  • ESP32 I²C bus to AS5600 encoders (SDA, SCL)
  • ESP32 analog inputs to INA240A1 current sensors
  • ESP32 GPIO to WS1802B LED strips
  • ESP32 UART to ESP-CAM module
  • ESP32 PWM outputs to L6234P motor drivers
  • 12 V battery to TPS5430 input, TPS5430 output to 5 V rail, AMS1117 input from 5 V rail