Menu
Microbots
0
  • Robots & Kits
    • ProtoBot
    • CubeBot
    • Robot Parts
  • Modules & Parts
    • CodeCell ESP32 Modules
    • Motors & Actuators
    • LiPo Batteries
  • Gear
    • Tools
    • Merch
  • Learn
    • User Guide & Tutorials
    • DIY Projects & Files
    • Education Discounts
  • About
    • Our Story
    • Reach Out
    • FAQs
  • Sign in
  • Your Cart is Empty
Microbots
  • Robots & Kits
    • ProtoBot
    • CubeBot
    • Robot Parts
  • Modules & Parts
    • CodeCell ESP32 Modules
    • Motors & Actuators
    • LiPo Batteries
  • Gear
    • Tools
    • Merch
  • Learn
    • User Guide & Tutorials
    • DIY Projects & Files
    • Education Discounts
  • About
    • Our Story
    • Reach Out
    • FAQs
  • 0 0

MotorCell - Pulsing a Spin

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.

Why Pulse a Motor?

  • Kinetic Art Installations: Create timed, individual spins to form unique patterns and illusions.
  • Efficiency: Only running the motor when needed reduces power consumption.
  • Tactile Feedback: Short bursts of motion can simulate haptic feedback.

Pulsing Motor Example

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;
  }
}

How This Works

  1. The motor_num variable tracks which motor is currently active.
  2. The loop increments motor_num and selects the corresponding motor.
  3. The function Pulse(IN_pinX, pulse_ms) is used to activate each motor for 2 seconds before moving to the next.
  4. The sequence resets, continuously looping the effect.

Expanding on the Effect

  • Modify Pulse Duration: Change pulse_ms to adjust the spin time of each motor.
  • Add More Motors: Expand the case structure to include additional motors.
  • Vary the Timing: Introduce random delays or different pulse durations for each motor.
  • Use Sensor Inputs: Trigger motor pulses based on sensor data for interactive installations. The CodeCell's proximity can make this super fun!

Ready to start experimenting? Grab a MotorCell today and check out the MotorCell GitHub Repository for more code examples and technical documentation!

  • Share:

Follow

Github

  • About
  • Software
  • Education
  • Contact
  • FAQs
  • Terms
  • Refund Policy
  • Privacy Policy

Join our Community ~ Be the first to know about new products and get exciting deals!

© 2026 Microbots.

★ Reviews

Let customers speak for us

87 reviews
Write a review
87%
(76)
5%
(4)
2%
(2)
2%
(2)
3%
(3)
81
21
A
CodeCell C3
Anonymous

Perfect product!

A
ProtoBot
Anonymous

This is a great product for beginners who want hands-on experience with Arduino and 3D printing. The Protobot has a sleek, solid design, and the software is just as polished. I’ve bought several educational robotics kits, and this is the best one so far. Looking forward to more awesome products!

Thank you so much for your kind review! 😊

F
ProtoBot
Francis van Uyten

Really love this robot. I like that is simple to assemble and I like that you guys prepares it easy to start programming with examples and libraries. My opinion on what to improve is more like a add-on, can you guys develop a localisation sensor or function so it will know where the bot is. Expecting only great things coming from you guys. Succes

Thank you so much for your thoughtful review! Glad you’re enjoying ProtoBot 😊 A localisation sensor is a great suggestion! The I²C connection lets you add compatible sensors, so there’s room to explore this. Thanks for your support!

G
Experiment in Progress Mug
Gerald Kendrick

I am enjoying my Experiment in Progress coffee mug. It fits in well in the lab.

Hi Gerald, we’re so glad you’re enjoying it! Thanks for sharing your kind review.

K
12-in-1 Screwdriver (Pen-Size)
Klaas

Very useful fun little screwdriver for the all tiny stuff

Hi Klaas, thanks for the great review! We’re glad you’re enjoying your screwdriver!