MotorCell isn't just for continuous motion - it can also be pulsed for a short bursts of movement. This is particularly useful for kinetic art projects, where controlled, rhythmic motion can create stunning visual effects. By pulsing the motor for a few milliseconds at a time, you can achieve coordinated spinning effects across multiple motors.
This example demonstrates how to pulse six motors for 2000 milliseconds (2 seconds) each, creating a sequential spinning effect. The function Pulse(IN_pinX, pulse_ms)
activates each motor for a set duration before moving to the next.
#include <MotorCell.h>
#define IN_pin1 1
#define IN_pin2 2
#define IN_pin3 3
#define IN_pin5 5
#define IN_pin6 6
#define IN_pin7 7
#define pulse_ms 2000
int motor_num = 0;
MotorCell myMotorCell(1,2,3);
void setup() {
}
void loop() {
delay(100);
motor_num++;
switch (motor_num) {
case 1:
myMotorCell.Pulse(IN_pin1, pulse_ms); /* Pulse motor 1 for 2000ms */
break;
case 2:
myMotorCell.Pulse(IN_pin2, pulse_ms); /* Pulse motor 2 for 2000ms */
break;
case 3:
myMotorCell.Pulse(IN_pin3, pulse_ms); /* Pulse motor 3 for 2000ms */
break;
case 5:
myMotorCell.Pulse(IN_pin5, pulse_ms); /* Pulse motor 5 for 2000ms */
break;
case 6:
myMotorCell.Pulse(IN_pin6, pulse_ms); /* Pulse motor 6 for 2000ms */
break;
case 7:
myMotorCell.Pulse(IN_pin7, pulse_ms); /* Pulse motor 7 for 2000ms */
motor_num = 0; /* Reset the sequence */
break;
}
}
motor_num
variable tracks which motor is currently active.motor_num
and selects the corresponding motor.Pulse(IN_pinX, pulse_ms)
is used to activate each motor for 2 seconds before moving to the next.pulse_ms
to adjust the spin time of each motor.Ready to start experimenting? Grab a MotorCell today and check out the MotorCell GitHub Repository for more code examples and technical documentation!
MotorCell utilizes the BD67173NUX three-phase back-EMF controller with a sensorless drive system, allowing speed control via a PWM input signal duty cycle. The IN pin defaults to low, running the motor at full speed when pulled high (2.5V–5V). You can adjust the speed in 1,000 RPM increments via the duty cycle, or directly use the MotorCell library functions.
To get started, install the MotorCell library from the Arduino Library Manager:
The library includes examples to help you quickly get started with MotorCell control.
We going to start with control the speed level using the Spin function. This function adjusts the motor’s speed to the desired percentage of its maximum capability and returns the current RPM value. This value is also automatically printed on the Serial Monitor, for easy debugging. If the motor stalls, it will automatically attempt to restart.
#include <MotorCell.h>
#define IN_pin1 2
#define OUT_pin2 3
#define FR_pin2 1
MotorCell myMotorCell(IN_pin1, OUT_pin2, FR_pin2); /* Configure the MotorCell pins */
void setup() {
Serial.begin(115200); /* Set up serial - Ensure Tools/USB_CDC_On_Boot is enabled */
myMotorCell.Init(); /* Initialize the MotorCell */
}
void loop() {
uint16_t MotorRPM = myMotorCell.Spin(25); /* Set speed to 25% of maximum speed */
}
⚠ Note: For this function we recommend using an ESP32 device like the CodeCell to avoid delays when reading the RPM
This next example demonstrates how to reverse the motor’s direction every 5 seconds while running it at full speed. The MaxSpin function sets the motor to its maximum speed, while the ReverseSpin function changes its rotation direction. This alternates between clockwise and counterclockwise rotation with a 5-second delay between each direction change.
#include <MotorCell.h>
#define IN_pin1 2
#define OUT_pin2 3
#define FR_pin2 1
MotorCell myMotorCell(IN_pin1, OUT_pin2, FR_pin2); /* Configure the MotorCell pins */
void setup() {
Serial.begin(115200); /* Set up serial - Ensure Tools/USB_CDC_On_Boot is enabled */
myMotorCell.Init(); /* Initialize the MotorCell */
}
void loop() {
myMotorCell.MaxSpin(); /* Set motor to maximum speed */
myMotorCell.ReverseSpin(); /* Reverse the motor's rotation direction */
delay(5000); /* Wait for 5 seconds */
myMotorCell.MaxSpin(); /* Maintain maximum speed */
myMotorCell.ReverseSpin(); /* Reverse direction again */
delay(5000); /* Wait for another 5 seconds */
}
This final example implements a PID controller to regulate the motor speed to the desired RPM using the SpinPID function. The PID controller dynamically compensates for disturbances and load variations, ensuring smooth operation. If the motor stalls, the function will automatically restart it and notify you if the target speed cannot be reached. This is also automatically printed on the Serial Monitor, for easy debugging.
#include <MotorCell.h>
#define IN_pin1 2
#define OUT_pin2 3
#define FR_pin2 1
MotorCell myMotorCell(IN_pin1, OUT_pin2, FR_pin2); /* Configure the MotorCell pins */
void setup() {
Serial.begin(115200); /* Set up serial - Ensure Tools/USB_CDC_On_Boot is enabled */
myMotorCell.Init(); /* Initialize the MotorCell */
}
void loop() {
uint16_t MotorRPM = myMotorCell.SpinPID(15000); /* Set target RPM to 15,000 using PID */
}
⚠ Note: The SpinPID()
function uses a high-speed PWM timer, making it compatible only with CodeCell and ESP32-based devices.
With the MotorCell library installed, you can easily control speed, direction, and monitor its RPM!
Ready to start experimenting? Grab a MotorCell today and check out the MotorCell GitHub Repository for more code examples and technical documentation!
MotorCell’s shaftless design keeps things slim and easy to integrate. The rotor is made from 3.3mm aluminum with knurling on its edge, allowing direct press-fit attachment to the rotor’s teeth for a secure connection.
For installing press-fit 3D-printed parts, we recommend an inner diameter of 16.4mm to 16.6mm, depending on your 3D printer’s tolerance. Once printed, simply press the part onto the rotor’s teeth to hold it in place.
If additional security is needed, superglue can be applied to the rotor’s teeth. Make sure the glue is only applied to the sides, and doesn't enter near the MotorCell's bearing.
A variety of 3D-printed mounts can be found in the MotorCell GitHub repository: 👉 MotorCell 3D Mounts
Examples include:
We aim to make integrating MotorCell into your projects as seamless as possible.
Ready to start experimenting? Grab a MotorCell today and check out the MotorCell GitHub Repository for more code examples and technical documentation!
When working on projects that require high-speed motion in a compact form factor, traditional brushless motors can be difficult to integrate due to their size and complexity. This is why MotorCell is unique as it combines the rotor, stator, and driver into a single, ultra-compact module.
In this post, we’ll explore the MotorCell’s design, driver functionality, and integration into your projects.
MotorCell is the smallest coreless high-speed PCB motor with planar PCB windings and built-in sensorless control, eliminating the need for extra sensors! By integrating everything into a single module, it provides a tiny and compact solution for makers and developers working on applications requiring high speed motor control.
Designed for low-torque, high-speed applications, MotorCell supports PWM-based speed control and works seamlessly with the MotorCell library, which includes prebuilt PID control for CodeCell and other ESP32-based devices.
It's PCB stator is made from a 6-layer FR4 board, that has 6 copper windings connected in a star-shape configuration. This makes the motor a 3-phase axial-flux brushless motor. These type of motors need to be powered with specific timings to generate a commutation waveform and rotate the magnetic rotor on top.
This is why MotorCell also utilizes the BD67173NUX chip as its three-phase back-EMF controller, enabling a sensorless commutation, so no Hall sensors required. This driver allows speed adjustments via the input signal PWM duty cycle, with a resolution of around 1,000 RPM increments. The IN pin is by defaults low, running the motor at the maximum speed when pulled high (2.5V–5V).
If the motor is forced to stop, it enters a 5-second lock protection mode, which can be instantly resets when PWM is set to 0% and restarted - this is automatically managed by the MotorCell library’s Spin function.
We believe the exciting advantage of PCB motors lies in their ability to integrate seamlessly with electronics, eliminating the need for additional PCBs. That’s why we’ve made it simpler to incorporate the Stator directly into your custom PCB, thanks to its Open Source Design - available here.
However, building a high-speed rotor remains a complex challenge. To make things easier, you can purchase the rotor separately, allowing you to effortlessly add a PCB motor to your board for a more compact design while ensuring a reliable rotor configuration!
To get started with Arduino:
With the MotorCell library installed, you can easily control speed, direction, and monitor its RPM, explained in more detail in our other tutorials.
Ready to start experimenting? Grab a MotorCell today and check out the MotorCell GitHub Repository for more code examples and technical documentation!
MotorCell is an ultra-compact, shaftless PCB motor designed for high-speed, low-torque applications. With its innovative pancake design and planar PCB windings, MotorCell is perfect for robotics, art installations, and DIY projects. This motor simplifies integration by using sensorless control with PWM speed adjustments.
In this tutorial, we’ll cover:
What is MotorCell?
The MotorCell reimagines motor design by integrating the rotor, stator and driver, into a single, flat PCB. This unique structure:
MotorCell is ideal for applications that require small, lightweight, compact motors, such as small robotics, kinetic art, or even portable gadgets.
Setting Up Your MotorCell
To get started, follow these steps:
Pins:
Open the Arduino IDE, go to Sketch > Include Library > Manage Libraries, search for "MotorCell," and install it. Then include it in your code and setup your pins:
#include "MotorCell.h"
#define IN_PIN 2
#define OUT_PIN 3
#define FR_PIN 1
MotorCell myMotorCell(IN_PIN, OUT_PIN, FR_PIN);
void setup() {
myMotorCell.Init(); // Initialize the MotorCell
}
MotorCell Library Functions
Here are the core functions of the MotorCell library:
myMotorCell.Init();
uint16_t rpm = myMotorCell.Spin(50); // Spin at 50% speed
uint16_t rpm = myMotorCell.SpinPID(12000); // Maintain 12,000 RPM
myMotorCell.ReverseSpin();
Pulse(uint8_t p_pin, uint8_t ms_duration): Sends a short pulse to the specified pin for a given duration (in milliseconds). Useful for quick bursts of motion or momentary signals.
myMotorCell.Pulse(FR_PIN, 50); // Sends a 50ms pulse to the FR_PIN
uint16_t currentRPM = myMotorCell.RPMRead();
myMotorCell.MaxSpin();
Example Project: RPM Monitoring
Here’s a simple project to get you started:
#include "MotorCell.h"
#define IN_PIN 2
#define OUT_PIN 3
#define FR_PIN 4
MotorCell myMotorCell(IN_PIN, OUT_PIN, FR_PIN);
void setup() {
Serial.begin(115200);
myMotorCell.Init();
}
void loop() {
uint16_t rpm = myMotorCell.Spin(50); // Spin at 50% speed
}
More examples available on github, but if you have any questions about MotorCell, feel free to contact us!
A PCB motor is an innovative solution that integrates the motor's mechanics into the electronic components, using the PCB itself as the structure of the motor.
What is a PCB Motor?
A PCB motor is a unique type of motor that uses the copper traces on a printed circuit board (PCB) to create a magnetic field that drives the motor. This concept is inspired by how radio systems use PCB traces as antennas. The same principle is applied to generate a magnetic field strong enough to turn a rotor. This type of motor is known as an axial flux brushless motor, where the PCB stator and the rotor are aligned in parallel.
The Design and Construction of a PCB Motor
The first step in creating a PCB motor is designing the PCB stator coils. In traditional motors, these coils are often made from wire wound into dense, three-dimensional shapes. In a PCB motor, the coils are instead manufactured as flat spiral traces printed onto the layers of a PCB.
One of the challenging aspects of these planar motors is fitting enough turns in the small space available to generate sufficient magnetic flux. These coils have to be connected in a star or delta configuration to create a 3-phase system. In our 6-slotted star-configured MotorCell design, we were able to stack the coils on four layers, utilizing two additional layers for the controller, to produce the required magnetic field to spin the rotor.
Over the years, we have also learned that the design of the rotor is crucial for improving the motor's efficiency. It is important to use high-quality ceramic ball bearings and to align the bearings precisely to achieve the optimal mechanical solution. This typically requires specialized tools, so we also offer the MotorCell 's rotor individually, allowing you to easily integrate it with your custom PCB.
Achieving Synchronization in the PCB Motor
One of the most critical aspects of driving a brushless motor is ensuring that the rotor stays in sync with the stator's electromagnetic field. In traditional motors with brushes, synchronization is mechanically managed by the brushes themselves. However, in a three-phase brushless motor like a PCB motor, sensory feedback is necessary to keep the motor running smoothly.
Back EMF is typically used as feedback to control the motor's speed. Back EMF is the voltage generated by the spinning motor itself, which can be measured to determine the rotor’s speed. This information is then fed into the motor’s control electronics, ensuring that the stator coils are driven in sync with the rotor's motion. For the MotorCell, all of this is handled directly by the onboard chip, simplifying the process.
Join our Community ~ Be the first to know about new products and get exciting deals!
© 2025 Microbots.