Close
0%
0%

Accesible Motion with Steppers

A plug-and-play unipolar stepper motor controller built around the ultra-low-cost CH32V003 MCU, designed for makers, educators, and designer

Similar projects worth following
A plug and Play Motion Controller for Stepper Motors

Problem Statement & Decomposition

The Problem:

Stepper motors, though common and cheap, come with a learning curve. This is especially true for the 28BYJ-48 unipolar stepper, which is widely available and very affordable, but not very beginner-friendly when it comes to wiring, sequencing, and control logic.

To add to the difficulty:

  • You often need a microcontroller and some level of programming knowledge.

  • A driver board is typically needed to interface between motor and microcontroller.

  • Even with hardware in place, writing or adapting stepper motor code can be overwhelming for non-technical users.

  • Configuring motion patterns like oscillations or synchronizing multiple motors becomes even more complex.

Decomposing the Need:

From a design perspective, the challenge can be broken down into a few key problems:

  1. Ease of Use: Users shouldn't have to understand H-bridges, pulse sequences, or lookup tables.

  2. Configurable Motion: The system should support both continuous and oscillating motion, ideally with live tuning.

  3. Standalone Control: Motion should be easily initiated and adjusted without a PC or development board.

  4. Scalability: Multiple motors should be able to run in sync, and optionally be triggered by external events or sensors.

  5. Compact and Drop-in Friendly: The hardware should be compact, self-contained, and easy to integrate into small spaces or enclosures.

This decomposition became the guiding framework for the final design — from microcontroller choice to UI and feature set.

Project Idea & Features

The Unipolar Stepper Motor Controller is a 43mm x 32mm PCB that houses a CH32V003 microcontroller, driver circuitry, a rotary encoder for real-time control, and an intuitive interface that supports both manual and automated motor control. While it is optimized for the 28BYJ-48 stepper motor, it works with any unipolar stepper.

Here’s what makes it special:

🔧 1. Built Around the CH32V003 MCU

At the heart of the controller is the CH32V003, a rising star in the ultra-low-cost microcontroller world. Despite its small price tag and footprint, it offers:

  • Adequate I/O for stepper control.

  • Fast interrupt handling for rotary encoder inputs.

  • Support for I2C communication.

  • Low power consumption, making it ideal for embedded, standalone systems.

Using CH32V003 also makes this project replicable and modifiable by other hardware hackers without resorting to high-cost components.

🎛 2. Rotary Encoder as a Natural UI

The controller includes a rotary encoder, which acts as a human-friendly interface for all key operations:

  • Rotate CW/CCW to turn the stepper motor in either direction.

  • Press to save configurations or trigger motion.

  • Navigate through modes like Continuous or Arc without the need for serial terminals or software tools.

It’s a small addition, but it turns the product into a plug-and-play device rather than a development kit.

🔁 3. Continuous and Arc Modes

There are two main modes for using the motor:

  • Continuous Mode: Spin continuously in CW or CCW direction. Great for things like rotating displays, kinetic sculptures, or simple mechanisms.

  • ARC Mode: Here’s where it gets interesting. In ARC mode, the user can define left and right extents by manually rotating the motor to each endpoint using the encoder. Once set, the motor automatically oscillates between these positions. This opens the door to:

    • Windshield-wiper style motion

    • Linkage animations

    • Scanner head sweeps

    • Servo-like behavior with a stepper

🧩 4. I2C Daisy Chain Support

Want multiple motors working in sync or responding to a central controller like a Raspberry Pi, ESP32, or another CH32 board?

The onboard I2C interface allows multiple controller boards to be daisy-chained. This supports master-slave configuration, enabling advanced behaviors like:

  • Coordinated multi-axis movement

  • Sequenced motion (domino-style animations)

  • Centralized triggering...

Read more »

IMG20250701134058.jpg

A Fully Assembled Board with the stepper connected.

JPEG Image - 3.45 MB - 07/02/2025 at 02:44

Preview

IMG20250701134117.jpg

Front View showing the Encoder and buttons in place

JPEG Image - 2.25 MB - 07/02/2025 at 02:44

Preview

IMG20250701132829.jpg

Programming Works! Checked basic blink program with the WCH Link E Dongle.

JPEG Image - 1.26 MB - 07/02/2025 at 02:44

Preview

IMG20250701132701.jpg

SMD Devices are placed at the back of the PCB, to allow for buttons and controls on the front.

JPEG Image - 748.39 kB - 07/02/2025 at 02:44

Preview

IMG20250701132650.jpg

Bare PCBs, front and back

JPEG Image - 1.03 MB - 07/02/2025 at 02:44

Preview

View all 7 files

  • Project Milestone: It's Alive — Motion Modes Fully Functional!

    Rupin Chheda07/07/2025 at 06:09 0 comments

    Big update! The stepper controller firmware has reached a stable, working state — and I’m happy to report that all major features are now live and tested!


    Core Features Now Working

    Here’s what’s running smoothly:

    • CW (Clockwise) Mode – Tap the encoder, and the motor rotates smoothly in one direction.

    • CCW (Counter-Clockwise) Mode – Same deal, but in reverse!

    • ARC Mode – The star feature. Users define the left and right limits using the Auxillary buttons. Once saved, the motor oscillates smoothly between the two ends.

    • Play/Pause – Pressing the encoder switch now pauses or resumes the motion, regardless of mode. Super intuitive.

    • Non-Volatile Memory – The system now remembers the last mode and positions even after power-off. This makes it ideal for installations or embedded setups — set it once and forget it.

    🧠 How It Works for the User

    1. Choose your mode (CW, CCW, ARC) while the motor is paused.

    2. In ARC mode, press the Aux buttons and rotate to set endpoints, then press the Save/Erase Button to save the position. 

    3. Press the play button to start motion.

    4. Pause or play any time with a single click.

    5. Power it off and on — your config is still there!

    🧪 What’s Next?

    • Implement I2C daisy-chaining for multiple synchronized motors.

    • Create a printable case or mounting bracket.

    • Start testing with real-world mechanical linkages and kinetic art setups.

    🎊 This is a huge step forward in making stepper motor control plug-and-play for non-engineers. No code, no libraries — just intuitive hardware and motion.

    More to come soon!

  • First Assembly & Debugging Surprises

    Rupin Chheda07/02/2025 at 03:03 1 comment

    The PCBs finally arrived from Lioncircuits, and I kicked off the initial hardware bring-up!

    Assembly Progress

    • The USB-C port footprint didn’t align with the mounting holes — a mechanical mismatch. This means the USB port won't be populated in this revision.

    • I began with soldering SMD resistors:

      • 1kΩ for LEDs

      • 10kΩ pull-ups for I2C (SDA & SCL)

    • Next came the A03416 MOSFETs, followed by a careful hand-solder of the CH32V003 microcontroller.

    • To test programming, I added a simple pin header breakout for 5V, GND, and SWIO, which worked flawlessly.

    • Finished off with all through-hole parts: switches, LEDs, the rotary encoder, and the stepper motor connector.

    All components passed individual tests — switches and LEDs functioned correctly.




    Debugging the Stepper Motor

    I encountered a strange issue — the stepper motor wouldn’t move.

    To isolate the problem, I connected an LED in place of the motor to observe the pin sequences. Strangely, the LED connected to PD7 wasn’t toggling. I checked the MOSFET for shorts — no issues there.

    After digging into the datasheet, I realized the root cause:
    PD7 is also the NRST (reset) pin, which is pulled high at startup, unintentionally turning the MOSFET on and grounding the connected pin. 

    Solution?

    I used the WCH-Link Utility to reconfigure PD7 as a general I/O pin. Once that was done, the sequence worked — and the stepper motor spun beautifully.


    Power Concerns

    While testing the motor, I noticed the power LED dims significantly when the stepper coil energizes. Measuring current draw showed around 200mA, which is expected.

    The issue appears to be a voltage dip when coils energize. I’ve switched to an external power supply for now, but will be adding a beefy capacitor across 5V and GND to buffer the current surges and stabilize power delivery.

    🧪 What’s Next?

    • Fix the USB-C footprint in the next revision

    • Tune power filtering with appropriate capacitance

    • Begin firmware work for motion configuration and I2C chaining

    • Build mounting brackets and start integration with real-world mechanisms

    More to come — but for now, I’m thrilled the first spin of the motor is live!

View all 2 project logs

Enjoy this project?

Share

Discussions

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates