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).
- Hardware license
- MIT (opens in a new tab)
- Software license
- MIT (opens in a new tab)
- Commercial use
- Allowed
This repository contains executable files that Robotheca doesn't check. Only run them if you trust the creator.
Photo and 3D model
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 parts10 of 10 parts shown
| # | Component | Quantity | Est. price | Supplier |
|---|---|---|---|---|
| 1 | 100nf | 1 | – | – |
| 2 | 10u | 1 | – | – |
| 3 | HDGC1002WR-S-4P | 1 | – | LCSC |
| 4 | HDGC1002WR-S-3P | 1 | – | LCSC |
| 5 | HDR-F-2.54_1x3 | 1 | – | LCSC |
| 6 | HDR-M-2.54_1x4 | 1 | – | LCSC |
| 7 | 短路连接点 | 3 | – | MONIK2020 |
| 8 | 4.7k | 2 | – | – |
| 9 | 10K | 1 | – | – |
| 10 | AS5600-ASOM | 1 | – | 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.
- 1Assemble the circuit boards
- 2Prepare the mechanical components
- 3Assemble the motor units
- 43D print the wheels and mounts
- 5Mount the electronics and battery
- 6Connect all components
- 7Flash the firmware
- 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
Schematics, boards and diagrams
- 1.hardware/pcb/encoder_board/Gerber_PCB_as5600-16mm_2022-05-23.zipGerber (PCB manufacturing)
- 1.hardware/pcb/encoder_board/Schematic_as5600-16mm_2022-05-23.pdfDiagram
- 1.hardware/pcb/main_board/Gerber_PCB_balance_car_esp32_simplefoc.zipGerber (PCB manufacturing)
- 1.hardware/pcb/main_board/Schematic_balance_car_esp32_simplefoc_2022-05-23.pdfDiagram
- 1.hardware/pcb/rgb_board/Gerber_PCB_RGB_strip.zipGerber (PCB manufacturing)
- 1.hardware/pcb/rgb_board/Schematic_RGB_strip_2022-05-23.pdfDiagram