# Closed-Loop DC Motor Controller
## Description
Robotics-ready closed-loop brushed DC motor controller with bidirectional 2 A H-bridge drive, quadrature encoder feedback, current sensing, protection, MCU control, debug access, and status indicators.
## Project Details
- **Owner:** pernu
- **Created:** 8/13/2026
- **Last Updated:** 8/14/2026
- **Visibility:** Public
## Key Components
### DS1 — [CA56-12SRWA](https://www.flux.ai/kicad-part-library/ca56-12srwa~42.md)
- Part Type: Display 7Segment
- Manufacturer Part Number: CA56-12SRWA
- Package or Case Code: CA56-12SRWA
- Datasheet URL: http://www.kingbrightusa.com/images/catalog/SPEC/CA56-12SRWA.pdf
- Functional Group: Display Subsystem
- Role Details: Kingbright 4-digit common-anode display driven by TM1637
- Role: Timer Display
**Pins:**
- a [pin 11]
- b [pin 7]
- c [pin 4]
- CA1 [pin 12]
- CA2 [pin 9]
- CA3 [pin 8]
- CA4 [pin 6]
- d [pin 2]
- DPX [pin 3]
- e [pin 1]
- f [pin 10]
- g [pin 5]
### J1 — [SM02B-SRSS-TB(LF)(SN)](https://www.flux.ai/adrian95/sm02b-srss-tblfsn~zzs.md)
- Package or Case Code: SM02BSRSSTBLFSN
- Manufacturer Name: JST Sales America Inc.
- Part Type: Connector
- Functional Group: External Interfaces
- Manufacturer Part Number: SM02B-SRSS-TB(LF)(SN)
- License: https://creativecommons.org/licenses/by/4.0/
- Datasheet URL: https://storage.googleapis.com/graviton-electric-symbols/document_assets/user-uploaded/2f7d5393eb1f236698fbdc2a49add1d8f53dfb94e1cf07ec6cea2889da0d54a0.pdf
**Pins:**
- 1 [pin 1]
- 2 [pin 2]
- MP1 [pin 3]
- MP2 [pin 4]
### J2 — [SM02B-SRSS-TB(LF)(SN)](https://www.flux.ai/adrian95/sm02b-srss-tblfsn~zzs.md)
- Manufacturer Part Number: SM02B-SRSS-TB(LF)(SN)
- Datasheet URL: https://storage.googleapis.com/graviton-electric-symbols/document_assets/user-uploaded/2f7d5393eb1f236698fbdc2a49add1d8f53dfb94e1cf07ec6cea2889da0d54a0.pdf
- License: https://creativecommons.org/licenses/by/4.0/
- Package or Case Code: SM02BSRSSTBLFSN
- Functional Group: External Interfaces
- Part Type: Connector
- Manufacturer Name: JST Sales America Inc.
**Pins:**
- 1 [pin 1]
- 2 [pin 2]
- MP1 [pin 3]
- MP2 [pin 4]
### J3 — [Pin Header 01x04 2.54mm Vertical](https://www.flux.ai/adrian95/pin-header-01x04-254mm-vertical~l97.md)
- Part Type: Connector
- License: https://creativecommons.org/licenses/by/4.0/
- Functional Group: MCU and Debug
**Pins:**
- Pin_1 [pin 1]
- Pin_2 [pin 2]
- Pin_3 [pin 3]
- Pin_4 [pin 4]
### J4 — [S2B-PH-K-S(LF)(SN)](https://www.flux.ai/lcsc/s2b-ph-k-slfsn~vk6f.md)
- Manufacturer Name: JST
- JLCPCB Part Class: Extended Part
- Functional Group: Power Input
- Product Info Url: https://lcsc.com/product-detail/PH-Connectors_JST-Sales-America_S2B-PH-K-S-LF-SN_JST-Sales-America-S2B-PH-K-S-LF-SN_C173752.html
- Package or Case Code: CONN-TH_S2B-PH-K-S-LF-SN
- Manufacturer Part Number: S2B-PH-K-S(LF)(SN)
- Part Type: Wire To Board / Wire To Wire Connector
- LCSC Part Number: C173752
- Datasheet URL: https://storage.googleapis.com/graviton-electric-symbols/document_assets/lcsc/2304140030_JST-S2B-PH-K-S-LF-SN_C173752.pdf
**Pins:**
- 1 [pin 1]
- 2 [pin 2]
### Q1 — [AO3401A](https://www.flux.ai/jecstronic/ao3401a~9r5.md)
- Manufacturer Part Number: AO3401A
- Part Type: Transistor
- Manufacturer Name: HUASHUO
- Functional Group: Display Subsystem
- Datasheet URL: https://www.lcsc.com/datasheet/lcsc_datasheet_2007171935_HUASHUO-AO3401A_C700954.pdf
- License: https://creativecommons.org/licenses/by/4.0/
**Pins:**
- D [pin 3]
- G [pin 1]
- S [pin 2]
### Q2 — [AO3400A](https://www.flux.ai/adrian95/ao3400a~ug9.md)
- License: https://creativecommons.org/licenses/by/4.0/
- Functional Group: Battery Measurement
- Datasheet URL: https://media.digikey.com/pdf/Data%20Sheets/Alpha%20&%20Omega/AO3400A_ds.pdf
- Part Type: Transistor
- Manufacturer Part Number: AO3400A
- Manufacturer Name: Alpha & Omega Semiconductor Inc.
**Pins:**
- D [pin 3]
- G [pin 1]
- S [pin 2]
### SW1 — [SH-6X6X5H-TP](https://www.flux.ai/silicon-yard/sh-6x6x5h-tp~6j.md)
- Package or Case Code: SW-SMD_4P-L6.0-W6.0-P4.50-LS9.0-2
- Manufacturer Name: SHOU HAN
- LCSC Part Number: C42416254
- Current Rating: 50mA
- Functional Group: User Interface
- Switch Type: Tactile Switch
- JLCPCB Part Class: Extended Part
- Voltage Rating: 12V
- Part Type: Tactile Switches
- Throw Configuration: SPST
- Manufacturer Part Number: SH-6X6X5H-TP
- Datasheet URL: https://storage.googleapis.com/graviton-electric-symbols/document_assets/user-uploaded/39e804462b25c23e9a04d26059df9e5776e9b6fc2d360285023d8ddd3112556a.pdf
**Pins:**
- 1 [pin 1]
- 2 [pin 2]
- 3 [pin 3]
- 4 [pin 4]
### SW2 — [SH-6X6X5H-TP](https://www.flux.ai/silicon-yard/sh-6x6x5h-tp~6j.md)
- Datasheet URL: https://storage.googleapis.com/graviton-electric-symbols/document_assets/user-uploaded/39e804462b25c23e9a04d26059df9e5776e9b6fc2d360285023d8ddd3112556a.pdf
- Voltage Rating: 12V
- Part Type: Tactile Switches
- Throw Configuration: SPST
- Manufacturer Part Number: SH-6X6X5H-TP
- Switch Type: Tactile Switch
- JLCPCB Part Class: Extended Part
- Functional Group: User Interface
- Current Rating: 50mA
- LCSC Part Number: C42416254
- Manufacturer Name: SHOU HAN
- Package or Case Code: SW-SMD_4P-L6.0-W6.0-P4.50-LS9.0-2
**Pins:**
- 1 [pin 1]
- 2 [pin 2]
- 3 [pin 3]
- 4 [pin 4]
### U1 — [PY32F002BF15U6TR](https://www.flux.ai/silicon-yard/py32f002bf15u6tr~7a.md)
- Symbol Style: parametric-v1
- Datasheet URL: https://storage.googleapis.com/graviton-electric-symbols/document_assets/user-uploaded/f0f0807ade7b60c840bad6df8211e387cb4f8fe71472f864cb3acceb35b12a57.pdf
- Functional Group: MCU and Debug
- Manufacturer Part Number: PY32F002BF15U6TR
- Part Type: Integrated Circuits
- Manufacturer Name: PUYA
**Pins:**
- EPAD [pin 21]
- PA0 [pin 13]
- PA1 [pin 14]
- PA2(SWCLK) [pin 15]
- PA3 [pin 16]
- PA4 [pin 17]
- PA5 [pin 18]
- PA6 [pin 19]
- PA7 [pin 20]
- PB0 [pin 12]
- PB1 [pin 11]
- PB2 [pin 10]
- PB3 [pin 9]
- PB4 [pin 8]
- PB5 [pin 7]
- PB6(SWDIO) [pin 5]
- PB7-OSCOUT [pin 3]
- PC0-NRST [pin 1]
- PC1-OSCIN [pin 2]
- VCC [pin 6]
- VSS [pin 4]
### U2 — [TM1637](https://www.flux.ai/lcsc/tm1637~5ebn.md)
- Part Type: Integrated Circuit
- Functional Group: Display Subsystem
- Package or Case Code: SOP-20_L12.8-W7.5-P1.27-LS10.4-BL
- Manufacturer Name: TM(天微)
- Symbol Style: parametric-v1
- Manufacturer Part Number: TM1637
- JLCPCB Part Class: Extended Part
- Datasheet URL: https://www.snapeda.com/parts/TM1637/Titan%20Micro%20Electronics/datasheet/
- LCSC Part Number: C2962580
**Pins:**
- CLK [pin 18]
- DIO [pin 17]
- GND [pin 1]
- GRID1 [pin 15]
- GRID2 [pin 14]
- GRID3 [pin 13]
- GRID4 [pin 12]
- GRID5 [pin 11]
- GRID6 [pin 10]
- K1 [pin 19]
- K2 [pin 20]
- SEG1/KS1 [pin 2]
- SEG2/KS2 [pin 3]
- SEG3/KS3 [pin 4]
- SEG4/KS4 [pin 5]
- SEG5/KS5 [pin 6]
- SEG6/KS6 [pin 7]
- SEG7/KS7 [pin 8]
- SEG8/KS8 [pin 9]
- VDD [pin 16]
### U3 — [DRV8837CDSGR](https://www.flux.ai/lcsc/drv8837cdsgr~2zg5.md)
- Product Info Url: https://lcsc.com/product-detail/Others_Texas-Instruments_DRV8837CDSGR_Texas-Instruments-TI-DRV8837CDSGR_C191000.html
- Manufacturer Part Number: DRV8837CDSGR
- Functional Group: Motor Drive
- Manufacturer Name: TI(德州仪器)
- Part Type: Motor Driver ICs
- Datasheet URL: https://storage.googleapis.com/graviton-electric-symbols/document_assets/lcsc/1810291821_Texas-Instruments-DRV8837CDSGR_C191000.pdf
- JLCPCB Part Class: Extended Part
- Package or Case Code: WSON-8_L2.0-W2.0-P0.50-TL-EP
- LCSC Part Number: C191000
**Pins:**
- GND [pin 4]
- IN1 [pin 6]
- IN2 [pin 5]
- NSLEEP [pin 7]
- OUT1 [pin 2]
- OUT2 [pin 3]
- PAD [pin 9]
- VCC [pin 8]
- VMIN [pin 1]
*The full schematic, PCB layout, bill of materials, and interactive design are available at [https://www.flux.ai/pernu/closed-loop-dc-motor-controller~og](https://www.flux.ai/pernu/closed-loop-dc-motor-controller~og).*
---
*Generated from [https://www.flux.ai/pernu/closed-loop-dc-motor-controller~og](https://www.flux.ai/pernu/closed-loop-dc-motor-controller~og)*