
BMI320
SohumNigam/StabilityBot_MK1
A self-balancing two-wheeled robot. an inverted pendulum stabilized by IMU feedback and PID motor control, being built up toward full 4-state LQR control on a custom PCB.

A self-balancing two-wheeled robot. an inverted pendulum stabilized by IMU feedback and PID motor control, being built up toward full 4-state LQR control on a custom PCB.
Liquorice PCB is an open-source printed circuit board by SohumNigam, from the SohumNigam/StabilityBot_MK1 repository on GitHub. It is a 2-layer board of 53 × 66.6 mm with 23 parts on 42 nets, routed with 181 tracks and 24 vias.
It is built around the BMI320. Its parts include 7 connectors, 6 capacitors, 4 resistors and 2 ICs.
Currently in prototype phase
A self-balancing two-wheeled robot. an inverted pendulum stabilized by IMU feedback and PID motor control, being built up toward full 4-state LQR control on a custom PCB.
Full write-up / showcase: sohumnigam.github.io/projects/stability_bot_MK1.html
I wanted a project that went past the usual "balance a robot with a PID loop" hobby build. Something that let me go deep on control theory (state-space modeling, LQR, Kalman filtering), embedded firmware, and PCB design all at once. The long-term goal is a robot that balances using a full 4-state LQR controller (θ, θ̇, x, ẋ) on hardware I designed myself.
Early prototype

Web interface on mobile. This interface was created with AI as a quick way to validate the behavior I was observing and for much needed live tuning and debugging.

This initial prototype version used PID to validate the hardware setup and learn about basic control theory.
LQR control testing has not been done yet but videos are soon to come.
This is the schematic of the current prototype version. The esp32 interfaces with an MPU6050 for angle readings and L293D for motor control. This vesion is simple a concept validation and more sophisticated hardware is going to be implemented very soon.

Below you can see the polished design for the final version of the robot
This is the schematic for the main board which connects to motors, encoders and 2s battery.

The custom contactles encoder schematic is below. Encoders will be used to track wheel position and allow full 4 state LQR control

| Component | Current | Planned Upgrade |
|---|---|---|
| Compute | ESP32 Devboard | - |
| IMU | MPU6050 | Bosch BMI320 (SPI) |
| Motor driver | L293D | TB6612FNG |
| Motors | Standard yellow DC geared motors | — |
| Battery | ELEGOO battery pack | Will be compatible with any 2s Battery |
| Chassis | 3D printed | — |
| Encoders | None | AS5600 |
FreeRTOS control task
FreeRTOS web interface task
main/idf.py build flash monitorSee the full BOM in BOM.csv. Still a work in progress as some passive parts are not yet finalized.
| Category | Qty | Part | Value | LCSC Part # | Price/unit | Extended Description | Link |
|---|---|---|---|---|---|---|---|
| Compute | 1 | ESP32 WROVER DevKitC | Espressif ESP32-WROVER-DevKitC | - | $11 | Purchased from DigiKey | DigiKey |
| IMU | 1 | BMI320 IMU | Bosch BMI320 | C22391148 | $0.99 | SPI IMU | LCSC |
| Mechanics | 2 | Diametric Magnets | — | — | — | MUST be driametrically magnetized | DigiKey |
| Encoder | 1 | AS5600 Magnetic Encoder | AMS AS5600 | C499458 | $1.1855 | For wheel position tracking | LCSC |
| Motor Driver | 1 | TB6612FNG Motor Driver | Toshiba TB6612FNG | C141517 | $1.1659 | Target PCB driver; STBY tied to GPIO | LCSC |
| Mechanical | 2 | DC Gear Motors | — | $20 | — | Includes wheels | Amazon |
| Mechanical | 1 | Chassis / Frame (custom) | — | — | — | Onshape CAD; STEP in hardware/cad/step/ | — |
Full robot rough cost ~$170 + shipping
| Qty | Value | Footprint | References |
|---|---|---|---|
| 5 | Conn_01x02_Pin | Connector_PinHeader_2.54mm:PinHeader_1x02_P2.54mm_Vertical | J1, J2, J3, J4, J5 |
| 4 | 100nF | Capacitor_SMD:C_0805_2012Metric_Pad1.18x1.45mm_HandSolder | C5, C6, C7, C10 |
| 4 | 5.1k | Resistor_SMD:R_0603_1608Metric_Pad0.98x0.95mm_HandSolder | R1, R2, R3, R4 |
| 2 | 10uF | Capacitor_Tantalum_SMD:CP_EIA-3216-18_Kemet-A_HandSolder | C8, C9 |
| 2 | Conn_01x19_Pin | Connector_PinHeader_2.54mm:PinHeader_1x19_P2.54mm_Vertical | J6, J7 |
| 1 | BMI320 | Package_LGA:Bosch_LGA-14_3x2.5mm_P0.5mm | U3 |
| 1 | TB6612FNG | Package_SO:SSOP-24_5.3x8.2mm_P0.65mm | U1 |
The 19 most common of 23 parts.

SohumNigam/StabilityBot_MK1
A self-balancing two-wheeled robot. an inverted pendulum stabilized by IMU feedback and PID motor control, being built up toward full 4-state LQR control on a custom PCB.

SohumNigam/StabilityBot_MK1
A self-balancing two-wheeled robot. an inverted pendulum stabilized by IMU feedback and PID motor control, being built up toward full 4-state LQR control on a custom PCB.

SohumNigam/StabilityBot_MK1
A self-balancing two-wheeled robot. an inverted pendulum stabilized by IMU feedback and PID motor control, being built up toward full 4-state LQR control on a custom PCB.


google/mozc-devices
Circuit diagrams and firmware source code for Gboard DIY keyboards






Duet3D/Duet-2-Hardware
The KiCAD source for the Duet 3d printer controller see www.duet3d.com
It measures 53 × 66.6 mm and has 2 copper layers, 1.6 mm thick.
23 parts, built around the BMI320. The full list of its parts is on this page, with links to each part's symbol and footprint where PCBKit's library has them.
From the SohumNigam/StabilityBot_MK1 repository on GitHub, at the commit this page was made from: the board is hardware/PCB/Liquorice_PCB/Liquorice_PCB.kicad_pcb and its schematic hardware/PCB/AS5600/AS5600.kicad_sch. PCBKit opens the board in the browser, with nothing to install.
Its repository states no licence, so its author keeps all rights: ask SohumNigam before reusing the design.