Contents
- About Us
- Brief Introduction
- Bus DC Motor Expansion Board
- 1. Overview
- 2. Interface description
- 2.1 Communication interface
- 2.2 Motor interface
- 2.3 Power interface
- 3. Hardware details
- 3.1 Improving heat dissipation and current
- 3.2 Replacing the motor driver chip
- 3.3 Capacitor selection
- 3.4 PWM output chip address bit selection
- 3.5 Immersion gold finish
- 4. Code and usage notes
- 5. Customization options
- 6. Links
- 7. Design ideas
- 8. References
- 0. Why Choose Us?
- 0.0 Who are we?
- 0.1 Why choose MicroPython?
- 0.2 Why choose our products?
- Project Open-Source Links
About Us
We are a group of university students from a lab at North University of China. Disappointed by the supporting documentation and hardware design quality of most modules and development boards on the market, we decided to design and make electronic modules and the related tutorials ourselves. All of our software and hardware materials, soldering tutorials, and our production, sourcing and sales processes are open source and shared publicly.
Our goal is to let every student in an innovation and entrepreneurship lab make personalized, distinctive modules by hand instead of depending on ready-made ones, write the driver programs, and carry out their own production and local sales.
Visit our wiki for more details: Freak Embedded wiki on GitHub
You can also read our cloud document for further information: Feishu document
Brief Introduction
This board uses an I2C cable to control a PWM generator chip that drives motors. It can be cascaded for expansion and used either as a standalone module or as an expansion board for XIAO series / Adafruit QT Py series main control boards. You can replicate it!
For this module you can choose the colour of the terminal headers, and choose the motor driver chip model as needed.
Bus DC Motor Expansion Board
1. Overview

Domino - Bus DC Motor Expansion Board. The Bus DC Motor Expansion Board is designed to control up to four DC motors through the I2C interface, with the following main features:
- Small size: it can be connected directly to XIAO series / Adafruit QT Py series main control boards, or used as a standalone module.
- I2C interface: provides an I2C bus interface for stacked cascading, supporting up to 16 motor driver expansion boards, with 4 address bits to choose from.
- PWM output pins: the output pins of the PWM expansion chip are connected through protection resistors, and the motor driver chip used has built-in overcurrent and overtemperature protection.
- Button to enable/disable the chip: the enable pin of the PWM expansion chip is brought out to a button, so the chip can be disabled with the button during use.
- Replaceable motor driver chip: as needed, the RZ7899 chip can be replaced with a TMI8260, AM2837 or SS6285L chip.
- Power indicator LEDs: on-board power indicator LEDs show the motor power status and the PWM expansion chip power status.
- Multiple power input options: power can be supplied through the terminal block or the Type-C connector, with reverse-connection protection.
- Supports motors powered at 6V to 18V: the maximum current of the whole expansion board is 5A; if only two motor channels are used, the peak current of a single channel supports up to 4A.
- High-frequency low-impedance electrolytic capacitor power supply: four 220μF high-frequency low-impedance electrolytic capacitors or solid-state capacitors are used for power supply; compared with aluminium electrolytic capacitors, solid-state capacitors have lower ESR, a higher operating frequency and a longer service life.
- Heat dissipation design: the VCC area on the back of the expansion board is opened up (solder mask window), and solder is added to improve heat dissipation.
Board labels: supports up to 4 motors; I2C communication interface; main control board interface (direct plug-in); OE; motor terminal blocks; Type-C power; terminal block power.
The expansion board offers excellent motor protection and power management, suits a wide range of motor control applications, and we provide MicroPython and Arduino example programs.


2. Interface description
2.1 Communication interface
We provide two I2C communication interfaces. When the board is used as a standalone module, the main control module and the expansion board are connected with a PH2.0 cable, as shown below:
Labels: standalone module connection diagram; communication interface; PH2.0-4P cable used.
The main control board can also be plugged directly into the female header interface of the expansion board:
Labels: main control board direct plug-in; shown with a Seeed Studio XIAO RP2040 main control board.
Several expansion boards can also be stacked and connected. In this case, the I2C communication interface below the expansion board, near the power terminals, is connected to the I2C communication interface above the other expansion board, near its power terminals. Pay attention to the wire order when connecting; a PH2.0 double-ended reverse cable is needed here. We fix the two expansion boards together with M2 plastic standoffs:
Labels: stacked connection diagram; PH2.0 double-ended reverse cable.
2.2 Motor interface
When connecting a motor, note that the motor wire M+ connects to channel A and the motor wire M- connects to channel B. If you are not sure of the motor's polarity, drive both numbered motors in the positive direction from the program; if one of them turns in reverse, swap the connection of that motor's wires:
Labels: motor+ connects to channel A; motor- connects to channel B. This expansion board does not provide an encoder interface.
2.3 Power interface
We can supply power with a Type-C power adapter (note the maximum current of the adapter; a 15V 3A adapter is recommended), or through the terminal block, with the power positive connected to V and the power negative connected to G:
Labels: Type-C power; terminal block power; power adapter.
3. Hardware details
3.1 Improving heat dissipation and current
The power section of our circuit board has an opened-up (solder mask window) area. When necessary, heat dissipation can be improved by adding solder to the opened area and attaching a heat sink:
Labels: improving heat dissipation and current; window opening on the power section; photo of heat sink placement.
3.2 Replacing the motor driver chip
We can replace the driver chip according to the voltage and current the motor needs:
Replaceable pin-to-pin chips: TMI8260, AM2837 or SS6285L.
3.3 Capacitor selection
We use 220uF solid-state capacitors as the voltage-stabilizing components. Solid-state capacitors have a lower equivalent series resistance and fast charge release, a lower impedance to high-frequency signals, and can filter high-frequency noise more efficiently; compared with traditional electrolytic capacitors they have more stable performance at high temperature and a longer service life. You can also choose high-frequency low-ESR aluminium electrolytic capacitors:
Capacitor options: high-frequency low-ESR aluminium electrolytic capacitor version; solid-state capacitor version.
3.4 PWM output chip address bit selection
We can set the address bits of the PWM expansion chip by soldering the shorting pads on the back of the expansion board. Note that all four address bits must be soldered; by default the address bits are left floating:
Labels: PWM output chip address bit selection; photo of the soldered address bits (A3A2A1A0=0000 selected).
3.5 Immersion gold finish
Some configurations use an immersion gold finish to ensure soldering quality and extend the service life of the circuit board.
4. Code and usage notes
After flashing the program to the main control board, make sure the motor and communication wiring is correct and the power supply is right before controlling the motors through the expansion board:
Overall wiring: each expansion board can use an independent power supply, to power motors that need different voltages.
The example code includes the following versions:
- MicroPython version: Bus motor expansion board MicroPython example program
- Arduino version: Bus motor expansion board Arduino example program
Note that the MicroPython programs have been optimized by us to better fit the hardware and improve ease of use, while the Arduino code comes from reference code on GitHub (all LICENSEs and code sources are marked and retained) and has been tested and verified by us to run correctly, but has not been further wrapped or optimized.
The wrapped I2C bus motor library was written by ourselves and comes with a Creative Commons Attribution-NonCommercial 4.0 International (CC BY-NC 4.0) license. We will pursue infringement, and we dare to come find you in person!
5. Customization options
Why should your module be the same as everyone else's? We have grown tired of identical electronic modules from open-source hardware vendors on the market, such as the following:
Why are all the modules we buy exactly the same, instead of letting us choose colours and configurations the way we do when buying a phone or a computer?
Saury goes bad, canned meat goes bad, even plastic wrap goes bad, but our willingness to keep meeting players' personalized needs never expires!
When you buy our module, whether you choose parts shipped loose or a finished product, you can choose the height of the female headers, the colour of the pin headers, the capacitor type and the motor driver chip type:
Configuration options 1: motor driver chip types AM2837, TMI8260, SS6285L, RZ7899; female header height 8.5 mm tall or 5 mm low; pin header colours red, blue, green, yellow, white; capacitor types aluminium electrolytic capacitor or high-frequency low-ESR capacitor.
You can even choose the colour of the circuit board and the type of solder mask finish:
Configuration options 2: black immersion gold; blue immersion gold; purple tin spray (HASL). Not all configurations are shown in the picture.
Yes, for a higher price, even our logo can be replaced!!!:
Configuration options 3: the logo can be replaced; the characters can be replaced; this can be customized, so replace it with the pattern you want!!
6. Links
- Hardware open-source link: Hardware files on GitHub
7. Design ideas
I2C bus motor expansion boards can be divided into two types: the I2C bus PWM motor control type and the I2C bus external-MCU motor control type:
Bus motor expansion board types shown: YFRobot I2C bus motor driver; Adafruit DC Motor + Stepper FeatherWing (I2C bus PWM motor control type); Grove - I2C Motor Driver (I2C bus external-MCU motor control type).
The basic principle of the I2C bus PWM motor control type is this: the main control board uses the I2C communication interface to control an independent PWM chip that generates multiple PWM signals and sends them to the motor driver chip, which controls the speed and direction of the motors:
Diagram, bus motor expansion board type - I2C bus PWM motor control: the main control board controls a separate PWM chip through the I2C communication interface to generate multi-channel PWM signals and passes them to the motor driver chip to control motor speed and direction. It suits simple, direct motor control, the structure is simple and the control method is easy to implement. Direction and speed are set by controlling the duty cycles of two PWM channels. Labelled parts: multi-channel PWM output chip; RZ7899-MS.
The basic principle of the I2C bus external-MCU motor control type is this: the main control board communicates through the I2C interface with a chip on the motor driver board; the chip on the driver board reads the main control board's commands, data or status, and controls the motor driver chip accordingly (for example adjusting the motor speed or changing the motor direction):
Diagram, bus motor expansion board type - I2C bus external-MCU motor control: the core of this kind of module is a main control chip (for example STM32 or ESP32) with a built-in program that handles and controls the motor drive. The main control board communicates with the chip on the motor driver board through the I2C interface; the chip on the driver board reads the main control board's commands, data or status and controls the motor driver chip accordingly (for example adjusting the motor speed or changing the motor direction). More complex motor control algorithms can be implemented (for example PID control and motor status monitoring). Labels: parse command; drive motor.
The two approaches each have their own emphasis:
- I2C bus PWM motor control type: suits simple, direct motor control; the structure is simple and the control method is easy to implement.
- I2C bus external-MCU motor control type: can implement more complex motor control algorithms (for example PID control and motor status monitoring).
The core design ideas of this board:
- Small size, so it can be paired with my XIAO series main control boards, or used directly as an external module
- When the motor driver chip burns out, it can be replaced easily
Why make this motor driver expansion board? Small size: it can be paired with my XIAO series main control boards, or used directly as an external module (standalone module use; paired use). When the motor driver chip burns out, it can be replaced easily: a DIP (Dual In-line Package) part is easy to replace, compared with an SOP-8 package.
8. References
- Seeed grove.py: i2c_motor_driver.py
- Seeed grove.py: grove_i2c_motor_driver.py
- Adafruit micropython-adafruit-pca9685: stepper.py
- Seeed wiki: Grove - I2C Motor Driver (TB6612FNG)
- Seeed wiki: Grove - I2C Motor Driver V1.2
- Seeed wiki: Grove - I2C Motor Driver (L298P)
- Adafruit product 3243
0. Why Choose Us?
0.0 Who are we?
At first glance, this question seems out of place on a product page or an open-source link page. Most people who buy electronic modules are university students just like us, and their reasons are very simple: study, course projects or competitions, exactly like us when we first started learning embedded development.
Yes, the person in the top right is me, the organizer of this small project and the head of a small lab in an ordinary university. During my four years of university I spent almost all my time in the lab and in my rented room, among all kinds of development boards, chips and electronic modules.
And of course there are our other juniors and seniors. Yes, we are a group of students from an obscure lab at North University of China (the team photo has never been taken, how embarrassing).
While competing, we found that manufacturers who design and make electronic modules have, more or less, the following problems:
- When selecting parts, they do not fully compare the key parameters (such as power consumption, speed and temperature range) of several chips of the same type (such as MCUs, sensors and driver ICs), and do not fully consider user needs; they just copy each other
- The firmware or driver programs of the modules often lack a unified coding standard, the styles differ, and they are hard to maintain
- There is no structured design, functions are not wrapped into classes, so code reuse is poor and modularization and extension are difficult
- Comments are incomplete and the code logic is hard to understand; you can only call their functions, and cannot write the chip driver yourself from the code
- Open-source hardware package designs do not consider the difficulty of hand soldering; some components have packages that are too small (such as 0402 and 0201), which is very unfriendly to individual makers and to education, and detailed BOMs, schematics and layout files are not provided, so users find it hard to reproduce or modify the design
- Too little attention is paid to protection circuits (such as overcurrent protection, reverse-connection protection or power isolation), so modules are easily damaged under non-ideal conditions of use
- Accessories are expensive: a PH2.0 adapter cable or a few female headers sell for tens of yuan
- Extremely cheap electronic modules come with very little documentation and basically no after-sales technical support
Looking back at our own experience when we first started learning embedded development:
From the perspective of learning embedded development, manufacturers who design and make electronic modules should provide:
- Complete driver library support: complete functions, a unified code style and adherence to standards, for easy learning and use.
- Detailed documentation and example code: including API descriptions, initialization flow and code examples, so beginners can get started quickly.
- Structured and modular code design: class-wrapped drivers that improve readability and reuse, so learners can extend them.
- Thorough comments and tutorials: so learners can not only use the code but also understand the driver code in depth and write their own.
- Hardware packages suited to teaching and personal DIY: avoid packages that are too small (such as 0201 and 0402) and provide reasonable pad designs, lowering the soldering barrier so users can assemble and debug by themselves.
- Complete open-source materials: provide the complete schematic, BOM and PCB layout, to make it easy to study and modify the circuit design.
- Debug interfaces: reserve debug interfaces to support users' in-depth exploration and secondary development.
From the perspective of competitions or fast project prototyping, manufacturers who design and make electronic modules should provide:
- Fast technical support: provide several support channels such as forums, QQ groups and GitHub Issues, and reply to questions within 24 hours, so that competition and project schedules are not affected.
- Highly compatible hardware design: follow standard interfaces (such as Grove, Qwiic and PH2.0) so modules can be connected quickly without extra conversion circuits.
- Reasonable prices: the selling price of a single module should not exceed twice its product cost, and accessories such as connecting cables, adapter boards and expansion boards should be reasonably priced; the selling price of a single module should also not exceed the cost of designing and proofing it yourself and buying the components.
- Sturdy and durable circuit design: with overcurrent protection, reverse-connection protection, power isolation and similar functions, to ensure reliability in competition or project environments.
- Complete open-source support: provide open-source hardware and software designs to make team collaboration and customization easy.
- Plenty of example code: the code design should support plug and play, with a simple, easy-to-use API that conforms to the official standard, reducing development time.
- Sharing embedded development knowledge: for example small tools and coding tricks.
However, most manufacturers who design and make electronic modules do not do most of the above. The modules and example programs they provide are of little value to an embedded beginner who wants to develop quickly or learn; their tutorials and code are popular science rather than teaching. Many manufacturers even give users books written from old versions of documentation for outdated drivers to read and learn from, and some even compile open-source code from the internet into firmware, without keeping the original author's statement and license, and release it closed source.
As old hands in the lab, while teaching juniors and preparing for competitions we once tried wrapping libraries for the various STM32 modules to speed up development, and teaching with official boards (such as the ST Nucleo series):
Part of our earlier tutorials, in screenshots. But the results were not ideal; the reasons are in the next section.
After we later came to learn and use the LCSC EDA software and tried MicroPython, the idea arose of letting freshman juniors use electronic modules we made ourselves, together with detailed tutorials and thorough technical support.
0.1 Why choose MicroPython?
Continuing from the previous section, based on our observation and statistics (the author has run competition and embedded development training at 8 ordinary undergraduate colleges, including Shanxi Jinzhong Institute of Technology, Shanxi Institute of Technology and Guangxi City Vocational University, with more than a thousand trainees), the reasons why most students at ordinary undergraduate colleges easily give up when starting embedded development with traditional C library functions or Arduino are as follows:
- Long compile times hurt learning efficiency: STM32 development usually needs Keil, IAR or STM32CubeIDE, and compilation is slow; after every code change you have to recompile, download and debug, which hurts development efficiency. Arduino is simpler than STM32, but still needs compiling and uploading, and with a large amount of code the compile time increases noticeably, slowing the development rhythm.
- Missing positive feedback makes it hard to stay interested: the traditional STM32 development environment is complex, and problems with environment configuration, driver installation and compiler settings easily frustrate newcomers so that they get no positive feedback; at the same time the results of code execution are not visible, and things like LED control and sensor reading need a long debugging time.
- Complex syntax and a steep learning curve: beginners who have just mastered the basics of C (variables, pointers, arrays, structs and so on) go straight into low-level operations such as register configuration, peripheral initialization, timers and interrupts and easily get lost; the STM32 HAL library wraps things at a higher level than bare metal, but you still need to understand structs and low-level register configuration, which is a high barrier for newcomers.
- Hard to focus on application-layer development: developing STM32 in traditional C means starting from register initialization and peripheral configuration, and learners must spend a lot of time understanding low-level chip operations such as RCC clock configuration, GPIO mode selection, and UART/ADC/I2C/SPI initialization. These tedious low-level configurations make it hard for beginners to get into application development quickly, and they easily get stuck on configuration errors and driver problems, which hurts the learning experience. MicroPython hides the low-level details so users can call high-level APIs directly and focus on application logic.
Compared with traditional C library functions and Arduino, MicroPython has the following advantages:
- No compiling needed: code runs directly and changes take effect immediately, improving development efficiency.
- REPL interactive debugging: you can read sensor data and execute commands immediately, without flashing firmware or adding debug code.
- High-level API wrapping: you control hardware by calling the
machinemodule directly, without configuring registers by hand.
As for the problem most people online raise, that MicroPython runs slowly, for example:
- Python interprets code while C is compiled, so there is a gap in execution efficiency.
- MicroPython runs on a virtual machine and does not operate low-level registers directly, which affects some high-performance applications.
- Because of the GIL (global interpreter lock) and the nature of the Python language, MicroPython code does not execute as efficiently as C.
In fact there is no need to worry:
- Most module peripherals do not need to consider speed: most electronic modules communicate over an I2C bus (100kHz ~ 3.4MHz), an SPI bus (usually 1MHz ~ 10MHz, or even higher) or UART (common baud rates 115200bps or 921600bps). The bottleneck of these communication methods is mainly the hardware protocol itself, not the MicroPython interpreter.
- For the few speed-sensitive modules, use PIO or DMA to improve performance: for modules with higher requirements on data throughput or timing, such as LCD screen refresh, DDS, high-frequency PWM control or real-time data acquisition, you can use the DMA library provided by MicroPython or features of the chip itself (the programmable PIO of the RP2040).
- MicroPython itself provides bytecode optimization: we can use mpy-cross to compile code into .mpy bytecode files to improve execution speed and reduce storage use, or use the MicroPython native emitter for optimization, achieving speeds close to C.
Some students then wonder whether starting with MicroPython will hurt their learning of embedded development itself, since company work will surely call library functions in C. Here I give the following personal views, based on how previous seniors have fared at work:
- The goal of the beginner stage is to understand the basic concepts of embedded development and hardware interaction: with MicroPython, developers can debug and verify a module in a very short time and get results quickly. This fast feedback effectively strengthens the sense of achievement and motivation, and quickly builds the framework of "hardware and software interaction", helping them better understand the basic flow and modules of embedded development and stay interested in embedded system development.
- The division of responsibilities of embedded engineers at work: in real work the division of responsibilities of embedded engineers is fairly clear, and different roles handle different work. Most embedded engineers spend their days developing and implementing business logic, not writing drivers or low-level system frameworks from scratch; in that case, learning how to implement functions quickly and debug function interfaces is the focus of the job.
- High-level language development helps in understanding the embedded development framework: learning embedded development with MicroPython does not mean giving up low-level development skills; it is a more efficient and easier way to understand the overall structure of the embedded development framework, for example modular design, abstraction and encapsulation, layered design, and the execution timing of the tasks in an embedded system.
Some students also want to learn low-level chip development. Here, our seniors are making a MicroPython tutorial that works through the RP2040 chip itself and the datasheets of various sensor driver chips, helping everyone quickly understand the basic characteristics of the chip and how to communicate with peripherals, and on that basis learn the concepts and principles behind writing drivers:
0.2 Why choose our products?
We know well that many large manufacturers, with abundant capital and the advantage of mass production, can push module prices extremely low and use machines for placement and soldering. We are at an early stage, so we have to buy components in small batches, which makes component costs higher, and because of hand soldering the appearance may not be perfect, but here we polish every module with care:
- Careful part selection and optimized design: in the initial stage we do not just rely on the part choices of existing modules on the market; we also make targeted design optimizations according to user feedback and market demand, try several chip and component options, and pick the best-performing combination based on test results. We will certainly have the high-quality capacitors, regulators and driver chips we should have, and the reverse-connection protection circuits, high-order filter circuits, power isolation, overcurrent protection, overtemperature protection and surge circuits that most cheap modules do not include, we will certainly have too.
- Small batches, high quality: during the hardware testing of every module we strictly check every connection of the circuit, to make sure each board meets our set standard.
- Easy secondary development and replacement: for example, in sensor conditioning circuits we leave the necessary isolation design and hardware test points, making it easy for users to do secondary development on the hardware, and we leave enough spacing around easily damaged components so that they can be replaced later, so that every module people buy is worth the money.
- Open platform support: although we do not yet have the funds and resources to build our own site like the large manufacturers, we provide platform support to users through the GitHub wiki, our WeChat official account and blog platforms (such as CSDN, cnblogs and Zhihu). We promise to update documentation and tutorials regularly, and use these platforms to give users the latest module features and detailed walkthroughs of the software examples, helping users understand how the hardware works and write their own libraries and module wrappers, rather than merely depending on a particular platform to call functions.
- Technical support: we focus on giving users technical support as fast as possible; whether you run into problems during development or need guidance on functions, we promise to do our best to answer within 24 hours, or to give one-on-one video guidance, so that every user gets timely and effective help.
Project Open-Source Links
Hardware open-source link: Hardware files on the LCSC open-source hub (OSHWHub)
Project code link: Code on GitHub
Video (in Chinese, Bilibili): Driving many DC motors over one I2C bus
Related Anvol case: Multi-Channel DC Motor Driver and FOC Control Board