Menu
Microbots
0
  • Make
    • Getting Started
    • Maker Builds
    • Education
  • Shop
    • Maker-Modules
    • Maker-Packs
    • Tools & Gears
    • Robots & Displays
  • About
    • Our Story
    • Reach Out
    • FAQs
  • English
  • Your Cart is Empty
Microbots
  • Make
    • Getting Started
    • Maker Builds
    • Education
  • Shop
    • Maker-Modules
    • Maker-Packs
    • Tools & Gears
    • Robots & Displays
  • About
    • Our Story
    • Reach Out
    • FAQs
  • Language

  • 0 0

CoilCell

CoilCell - Making Magnets Bounce

CoilCell - Making Magnets Bounce

CoilCell is a compact magnetic actuator that can make magnets move and even jump! In this guide, we will explore how to make a small 5mm diameter ball magnet bounce using the CoilCell, using short pulses to generate motion.

How It Works

CoilCell generates a magnetic field when an electric current passes through its coil. By applying a short pulse, we create a rapid magnetic repulsion that propels the magnet upwards. Depending on the power of the CoilCell module, the effect varies:

  • 1W CoilCell: Produces a small bounce of a few millimeters, just enough for the magnet to return to the CoilCell due to attraction
  • 2.5W CoilCell: Shoots the magnet much higher (~10cm)

Safety Note

When using the 2.5W 200-Turns CoilCell, always wear eye protection. The repulsion force may cause small magnets to shoot upwards unpredictably.

Generating the Pulse

To generate a pulse, we use the CoilCell library. The following example demonstrates how to make a 5mm ball magnet bounce using an on-time pulse of 20ms, followed by a delay to allow the magnet to be attracted back:

#include <CoilCell.h>

/* Learn more at microbots.io */
/* In this example, we initialize a CoilCell and make a 5mm diameter ball magnet bounce */

#define IN1_pin1 5
#define IN1_pin2 6

CoilCell myCoilCell(IN1_pin1, IN1_pin2);

void setup() {
  myCoilCell.Init(); /* Initialize the CoilCell */
}

void loop() {
  myCoilCell.Bounce(0, 20); /* Bounce the magnet up for 20ms */
  delay(600); /* Attract the magnet back down for 600ms */
}

Understanding the Function:

  • Bounce(direction, duration)
    • direction: The pulse direction (0 for normal bounce behavior).
    • duration: Time in milliseconds for the activation pulse.

By tweaking the duration and delay, you can fine-tune the bouncing effect. A longer pulse will push the magnet higher, while a shorter delay may not allow it to return fully before the next bounce.

Conclusion 

This showed us how to make a small ball magnet bounce using CoilCell! Check out the CoilCell GitHub Repository for more code examples and technical documentation!

Read More

CoilCell - Turning it into an Electromagnet

CoilCell - Turning it into an Electromagnet

CoilCell can be used as a weak electromagnet, instead of interacting with magnets. By upgrading to the Iron Back-Plate option, you can enhance the 2.5W CoilCell's peak strength to 17 mT, turning it into a weak electromagnet suitable for attracting small metallic objects like paper clips.

⚠ Caution: When using the 2.5W 200-Turns CoilCell, it may heat up to 110°C (especially the iron back-plate). Keep hands away from hot areas to prevent injury and always turn off the coil when not in use.

How It Works

CoilCell operates by passing current through its coil, generating a magnetic field. Instead of controlling polarity to interact with magnets, we can maximize field strength to attract small metallic objects.

Since CoilCell has an integrated H-bridge, it can directly control the coil’s magnetic strength without requiring an external driver. By pulling one of the input pins HIGH, CoilCell will operate at maximum magnetic power. If magnetic field adjustments are needed, the CoilCell library can be used to adjust the power using Pulse Width Modulation (PWM) to finely tune the intensity.

Varying the Magnetic Field Strength

The following example demonstrates how to adjust the strength of the electromagnet:

#include <coilcell.h>

#define COIL_PIN1 2
#define COIL_PIN2 3
CoilCell myCoilCell(COIL_PIN1, COIL_PIN2);

void setup() {
  myCoilCell.Init();
}

void loop() {
  myCoilCell.Drive(true, 100); // Maximum power
  delay(3000);
  
  myCoilCell.Drive(true, 75); // 75% power
  delay(3000);
  
  myCoilCell.Drive(true, 50); // 50% power
  delay(3000);
  
  myCoilCell.Drive(true, 25); // 25% power
  delay(3000);
}

⚠ Note: The Drive() function uses a high-speed PWM timer, making it compatible only with CodeCell and ESP32-based devices.

Understanding the Functions:

  • Init() → Initializes CoilCell and sets up the control pins.
  • Drive(bool direction, uint8_t power_percent)
    • direction: true (activates electromagnet) / false (not used in this case)
    • power_percent: Magnetic force strength (0 to 100%)

Conclusion

This showed us how to power and control a CoilCell and use it as a weak electromagnet, capable of attracting paper clips and other lightweight metal objects. Check out the CoilCell GitHub Repository for more code examples and technical documentation!

Read More

CoilCell - Controlling Magnetic Polarity

CoilCell - Controlling Magnetic Polarity

In this guide, we’ll focus on controlling the CoilCell's polarity and magnetic field strength, making it ideal for applications like flip-dot mechanical pixel and other magnetic pixels.

How It Works

CoilCell operates by passing current through its coil, generating a magnetic field whose polarity depends on the current direction. Since CoilCell has an integrated H-bridge, it can directly control the coil’s polarity and strength without requiring an external driver, like DriveCell.

Instead of simply turning the coil on or off, we’ll use Pulse Width Modulation (PWM) to finely adjust the magnetic strength and flip polarity as needed.

Flipping Polarity and Adjusting Strength

Several factors affect polarity control and field strength:

  • Voltage Level – Maximum voltage is 5V, providing the highest magnetic force.
  • PWM Frequency – A frequency of 20kHz is recommended to avoid audible noise.
  • Load Conditions – The coil’s performance depends on magnet size and grade strength.

Remember CoilCell is available in two configurations:

  • 1W CoilCell: Made from a 1.3mm thin, 4-layer PCB with a 70 turns spiral coil, with a peak magnetic field of 2.3 mT. 
  • 2.5W CoilCell: Made from a 2.6mm thin, 14-layer PCB with a 200 turns spiral coil, with a peak magnetic field of 10 mT, which can be increased to 17 mT using an iron back-plate.

Using CoilCell for Polarity Control

If you're using the CoilCell library, the following example demonstrates how to flip polarity and adjust strength:

#include <CoilCell.h>

#define COIL_PIN1 2
#define COIL_PIN2 3
CoilCell myCoilCell(COIL_PIN1, COIL_PIN2);

void setup() {
  myCoilCell.Init();
}

void loop() {
  myCoilCell.Drive(true, 100); // Strong north pole field
  delay(3000);
  
  myCoilCell.Drive(false, 100); // Strong south pole field
  delay(3000);
  
  myCoilCell.Drive(true, 50); // Weaker north pole field
  delay(3000);
  
  myCoilCell.Drive(false, 50); // Weaker south pole field
  delay(3000);
}

⚠ Note: The Drive() function uses a high-speed PWM timer, making it compatible only with CodeCell and ESP32-based devices.

Understanding the Functions:

  • Init() → Initializes CoilCell and sets up the control pins.
  • Drive(bool direction, uint8_t power_percent)
    • direction: true (north pole) / false (south pole)
    • power_percent: Magnetic force strength (0 to 100%)

Flipping Polarity

By alternating polarity, CoilCell can be used to flip magnetic elements, such a flipdot pixel combined with a magnet. To smooth this out, we can use Pulse Width Modulation (PWM) on both outputs. This method gradually changes the magnetic field intensity, reducing mechanical stress on the CoilCell.

This function is automatically handled within our CoilCell library:

#include <coilcell.h>

#define COIL_PIN1 2
#define COIL_PIN2 3

CoilCell myCoilCell(COIL_PIN1, COIL_PIN2);

uint16_t vibration_counter = 0;

void setup() {
  myCoilCell.Init();
  myCoilCell.Tone();
}

void loop() {
    myCoilCell.Vibrate(1, 75, 1000); // Flip at 75% power every 1sec
}

Understanding the Functions:

  • Init() → Initializes CoilCell and sets up the input pins.
  • Vibrate(smooth, power, speed_ms) → Oscillates the CoilCell in either a square wave or a smoother PWM wave.
    • smooth → 1 (PWM wave) / 0 (square wave)
    • power → Magnetic-field strength (0 to 100%)
    • speed_ms → Vibration speed in milliseconds

⚠ Note: The Vibrate() function uses a high-speed PWM timer, making it compatible only with CodeCell and ESP32-based devices.

Conclusion

With these techniques, you can start controlling CoilCell's magnetic polarity. Check out the CoilCell GitHub Repository for more code examples and technical documentation!

Read More

CoilCell - Creating Vibration

CoilCell - Creating Vibration

This guide explains how the CoilCell can generate vibrations, how frequency and polarity affect its movement, and how to create its drive signals.

How it Works?

To make CoilCell vibrate, an electric current is applied to its coil, generating a magnetic field. By reversing the polarity at a set frequency, we create a repetitive push-pull motion that causes vibrations.

The vibration frequency can be controlled within the range of 1 Hz to 25 Hz, which means CoilCell can oscillate between 1 to 25 times per second depending on the input signal. It can go to higher frequencies, but usually the magnet won't have enough time to react.

If you attach it to something, you can adjust it to match its new resonant frequency and make the whole thing shake.

Generating a Square Wave for Vibration

A square wave signal is required to make the CoilCell vibrate. Unlike CoilPad, CoilCell has an integrated H-Bridge driver, so no external driver like DriveCell is needed. The input signals of the square wave can be generated using simple digitalWrite() commands in Arduino:

#define VIB_PIN1 2
#define VIB_PIN2 3

void setup() {
  pinMode(VIB_PIN1, OUTPUT);
  pinMode(VIB_PIN2, OUTPUT);
}

void loop() {
  digitalWrite(VIB_PIN1, HIGH);
  digitalWrite(VIB_PIN2, LOW);
  delay(100); // Adjust delay for desired vibration speed
  
  digitalWrite(VIB_PIN1, LOW);
  digitalWrite(VIB_PIN2, HIGH);
  delay(100); // Adjust delay for desired vibration speed
}

This simple code creates a square wave oscillation, making the CoilCell vibrate continuously. You can adjust the delay time to change the vibration frequency.

Optimizing Vibration with PWM 

The code example above generates a basic square wave, which drives the coil in an abrupt on-off manner. At low frequencies, this might not be desirable. To smooth this out, we can use Pulse Width Modulation (PWM) on both outputs. This method gradually changes the magnetic field intensity, reducing mechanical stress on the CoilCell.

This function is automatically handled within our CoilCell library:

#include <coilcell.h>

#define COIL_PIN1 2
#define COIL_PIN2 3

CoilCell myCoilCell(COIL_PIN1, COIL_PIN2);

uint16_t vibration_counter = 0;

void setup() {
  myCoilCell.Init();
  myCoilCell.Tone();
}

void loop() {
  delay(1);
  vibration_counter++;
  if (vibration_counter < 2000U) {
    myCoilCell.Vibrate(0, 100, 100); // Square Wave mode
  }
  else if (vibration_counter < 8000U) {
    myCoilCell.Vibrate(1, 100, 1000); // Smooth PWM Wave mode
  } else {
    vibration_counter = 0U;
  }
}

Understanding the Functions:

  • Init() → Initializes CoilCell and sets up the input pins.
  • Vibrate(smooth, power, speed_ms) → Oscillates the CoilCell in either a square wave or a smoother PWM wave.
    • smooth → 1 (PWM wave) / 0 (square wave)
    • power → Magnetic-field strength (0 to 100%)
    • speed_ms → Vibration speed in milliseconds

⚠ Note: The Run() function uses a high-speed PWM timer, making it compatible only with CodeCell and ESP32-based devices.

Conclusion

With these techniques, you can start using CoilCell to vibrate. Check out the CoilCell GitHub Repository for more code examples and technical documentation!

Read More

Using CoilCell to Generate Buzzing Tones

Using CoilCell to Generate Buzzing Tones

CoilCell isn’t just a compact coil actuator – it can also generate buzzing tones, much like a piezo buzzer. By sending a high-frequency signal, CoilCell can produce audible tones and vibrations, making it useful for alert systems, interactive responses, and creative sound-based installations.

Unlike CoilPad, CoilCell has an integrated H-Bridge driver, making it even easier to integrate into microcontroller projects without requiring an external driver like DriveCell.

How CoilCell Produces Sound

CoilCell uses a built-in H-Bridge to rapidly switch the direction of current through a thin copper coil, which can interacts with an N52 neodymium magnet to create motion. By switching the current at an audible frequency (~100Hz–10kHz), CoilCell can emit tones similar to a speaker or piezo buzzer.

By varying the frequency, you can:

  • Play basic tones → Useful for notifications
  • Play melodies → Generate melodies like the Super Mario song
  • Integrate into interactive designs → Add audible feedback to projects

Wiring CoilCell

Since CoilCell already includes an H-Bridge, wiring it is straightforward:

Basic Connection for Buzzing CoilCell

  • Connect CoilCell to Microcontroller:
    • IN1 → Any digital pin
    • IN2 → Another digital pin
  • Power Connections:
    • VCC → 5V maximum
    • GND → Common ground with the microcontroller

Controlling CoilCell to Play Tones

CoilCell can generate tones using PWM signals. Below is an example using the CoilCell library to generate buzzing tones.

1. Installing the Library

  1. Open Arduino IDE
  2. Go to Library Manager
  3. Search for CoilCell and install it

2. Code Example for Playing a Tone on CoilCell

This example makes CoilCell buzz like a speaker, playing a sequence of tones:

#include <CoilCell.h>

#define IN1_pin1 2
#define IN1_pin2 3

CoilCell myCoilCell(IN1_pin1, IN1_pin2);

void setup() {
  myCoilCell.Init(); /* Initialize FlatFlap with DriveCell */
  myCoilCell.Tone();  /* Play a fixed tone*/
delay(500); } void loop() {   myCoilCell.Buzz(100); /* Buzz at 100 microseconds */ }

Understanding the Functions:

  • Buzz(duration) → Generates a buzzing effect at 100 microseconds, controlling the vibration speed.
  • Tone() → Plays an audible tone, varying its frequency automatically.

Tip: By adjusting the frequency and duty cycle, you can create different musical notes, alarms, or feedback sounds.

3. Playing the Super Mario Theme on CoilCell

Below is another code example that plays the Super Mario song using CoilCell:


/* Arduino Mario Bros Tunes With Piezo Buzzer and PWM
 
             by : ARDUTECH
  Connect the positive side of the Buzzer to pin 3,
  then the negative side to a 1k ohm resistor. Connect
  the other side of the 1 k ohm resistor to
  ground(GND) pin on the Arduino.
  */
  

#define NOTE_B0  31
#define NOTE_C1  33
#define NOTE_CS1 35
#define NOTE_D1  37
#define NOTE_DS1 39
#define NOTE_E1  41
#define NOTE_F1  44
#define NOTE_FS1 46
#define NOTE_G1  49
#define NOTE_GS1 52
#define NOTE_A1  55
#define NOTE_AS1 58
#define NOTE_B1  62
#define NOTE_C2  65
#define NOTE_CS2 69
#define NOTE_D2  73
#define NOTE_DS2 78
#define NOTE_E2  82
#define NOTE_F2  87
#define NOTE_FS2 93
#define NOTE_G2  98
#define NOTE_GS2 104
#define NOTE_A2  110
#define NOTE_AS2 117
#define NOTE_B2  123
#define NOTE_C3  131
#define NOTE_CS3 139
#define NOTE_D3  147
#define NOTE_DS3 156
#define NOTE_E3  165
#define NOTE_F3  175
#define NOTE_FS3 185
#define NOTE_G3  196
#define NOTE_GS3 208
#define NOTE_A3  220
#define NOTE_AS3 233
#define NOTE_B3  247
#define NOTE_C4  262
#define NOTE_CS4 277
#define NOTE_D4  294
#define NOTE_DS4 311
#define NOTE_E4  330
#define NOTE_F4  349
#define NOTE_FS4 370
#define NOTE_G4  392
#define NOTE_GS4 415
#define NOTE_A4  440
#define NOTE_AS4 466
#define NOTE_B4  494
#define NOTE_C5  523
#define NOTE_CS5 554
#define NOTE_D5  587
#define NOTE_DS5 622
#define NOTE_E5  659
#define NOTE_F5  698
#define NOTE_FS5 740
#define NOTE_G5  784
#define NOTE_GS5 831
#define NOTE_A5  880
#define NOTE_AS5 932
#define NOTE_B5  988
#define NOTE_C6  1047
#define NOTE_CS6 1109
#define NOTE_D6  1175
#define NOTE_DS6 1245
#define NOTE_E6  1319
#define NOTE_F6  1397
#define NOTE_FS6 1480
#define NOTE_G6  1568
#define NOTE_GS6 1661
#define NOTE_A6  1760
#define NOTE_AS6 1865
#define NOTE_B6  1976
#define NOTE_C7  2093
#define NOTE_CS7 2217
#define NOTE_D7  2349
#define NOTE_DS7 2489
#define NOTE_E7  2637
#define NOTE_F7  2794
#define NOTE_FS7 2960
#define NOTE_G7  3136
#define NOTE_GS7 3322
#define NOTE_A7  3520
#define NOTE_AS7 3729
#define NOTE_B7  3951
#define NOTE_C8  4186
#define NOTE_CS8 4435
#define NOTE_D8  4699
#define NOTE_DS8 4978

#define melodyPin 5
//Mario main theme melody
int melody[] = {
  NOTE_E7, NOTE_E7, 0, NOTE_E7,
  0, NOTE_C7, NOTE_E7, 0,
  NOTE_G7, 0, 0,  0,
  NOTE_G6, 0, 0, 0,

  NOTE_C7, 0, 0, NOTE_G6,
  0, 0, NOTE_E6, 0,
  0, NOTE_A6, 0, NOTE_B6,
  0, NOTE_AS6, NOTE_A6, 0,

  NOTE_G6, NOTE_E7, NOTE_G7,
  NOTE_A7, 0, NOTE_F7, NOTE_G7,
  0, NOTE_E7, 0, NOTE_C7,
  NOTE_D7, NOTE_B6, 0, 0,

  NOTE_C7, 0, 0, NOTE_G6,
  0, 0, NOTE_E6, 0,
  0, NOTE_A6, 0, NOTE_B6,
  0, NOTE_AS6, NOTE_A6, 0,

  NOTE_G6, NOTE_E7, NOTE_G7,
  NOTE_A7, 0, NOTE_F7, NOTE_G7,
  0, NOTE_E7, 0, NOTE_C7,
  NOTE_D7, NOTE_B6, 0, 0
};
//Mario main them tempo
int tempo[] = {
  12, 12, 12, 12,
  12, 12, 12, 12,
  12, 12, 12, 12,
  12, 12, 12, 12,

  12, 12, 12, 12,
  12, 12, 12, 12,
  12, 12, 12, 12,
  12, 12, 12, 12,

  9, 9, 9,
  12, 12, 12, 12,
  12, 12, 12, 12,
  12, 12, 12, 12,

  12, 12, 12, 12,
  12, 12, 12, 12,
  12, 12, 12, 12,
  12, 12, 12, 12,

  9, 9, 9,
  12, 12, 12, 12,
  12, 12, 12, 12,
  12, 12, 12, 12,
};
//Underworld melody
int underworld_melody[] = {
  NOTE_C4, NOTE_C5, NOTE_A3, NOTE_A4,
  NOTE_AS3, NOTE_AS4, 0,
  0,
  NOTE_C4, NOTE_C5, NOTE_A3, NOTE_A4,
  NOTE_AS3, NOTE_AS4, 0,
  0,
  NOTE_F3, NOTE_F4, NOTE_D3, NOTE_D4,
  NOTE_DS3, NOTE_DS4, 0,
  0,
  NOTE_F3, NOTE_F4, NOTE_D3, NOTE_D4,
  NOTE_DS3, NOTE_DS4, 0,
  0, NOTE_DS4, NOTE_CS4, NOTE_D4,
  NOTE_CS4, NOTE_DS4,
  NOTE_DS4, NOTE_GS3,
  NOTE_G3, NOTE_CS4,
  NOTE_C4, NOTE_FS4, NOTE_F4, NOTE_E3, NOTE_AS4, NOTE_A4,
  NOTE_GS4, NOTE_DS4, NOTE_B3,
  NOTE_AS3, NOTE_A3, NOTE_GS3,
  0, 0, 0
};
//Underwolrd tempo
int underworld_tempo[] = {
  12, 12, 12, 12,
  12, 12, 6,
  3,
  12, 12, 12, 12,
  12, 12, 6,
  3,
  12, 12, 12, 12,
  12, 12, 6,
  3,
  12, 12, 12, 12,
  12, 12, 6,
  6, 18, 18, 18,
  6, 6,
  6, 6,
  6, 6,
  18, 18, 18, 18, 18, 18,
  10, 10, 10,
  10, 10, 10,
  3, 3, 3
};

void setup(void)
{
  pinMode(5, OUTPUT);//buzzer
  pinMode(6, OUTPUT);
  digitalWrite(6, LOW);

}
void loop()
{
  //sing the tunes
  sing(1);
  sing(1);
  sing(2);
}
int song = 0;

void sing(int s) {
  // iterate over the notes of the melody:
  song = s;
  if (song == 2) {
    Serial.println(" 'Underworld Theme'");
    int size = sizeof(underworld_melody) / sizeof(int);
    for (int thisNote = 0; thisNote < size; thisNote++) {

      // to calculate the note duration, take one second
      // divided by the note type.
      //e.g. quarter note = 1000 / 4, eighth note = 1000/8, etc.
      int noteDuration = 1000 / underworld_tempo[thisNote];

      buzz(melodyPin, underworld_melody[thisNote], noteDuration);

      // to distinguish the notes, set a minimum time between them.
      // the note's duration + 30% seems to work well:
      int pauseBetweenNotes = noteDuration * 1.30;
      delay(pauseBetweenNotes);

      // stop the tone playing:
      buzz(melodyPin, 0, noteDuration);

    }

  } else {

    Serial.println(" 'Mario Theme'");
    int size = sizeof(melody) / sizeof(int);
    for (int thisNote = 0; thisNote < size; thisNote++) {

      // to calculate the note duration, take one second
      // divided by the note type.
      //e.g. quarter note = 1000 / 4, eighth note = 1000/8, etc.
      int noteDuration = 1000 / tempo[thisNote];

      buzz(melodyPin, melody[thisNote], noteDuration);

      // to distinguish the notes, set a minimum time between them.
      // the note's duration + 30% seems to work well:
      int pauseBetweenNotes = noteDuration * 1.30;
      delay(pauseBetweenNotes);

      // stop the tone playing:
      buzz(melodyPin, 0, noteDuration);

    }
  }
}

void buzz(int targetPin, long frequency, long length) {
  long delayValue = 1000000 / frequency / 2; // calculate the delay value between transitions
  //// 1 second's worth of microseconds, divided by the frequency, then split in half since
  //// there are two phases to each cycle
  long numCycles = frequency * length / 1000; // calculate the number of cycles for proper timing
  //// multiply frequency, which is really cycles per second, by the number of seconds to
  //// get the total number of cycles to produce
  for (long i = 0; i < numCycles; i++) { // for the calculated length of time...
    digitalWrite(targetPin, HIGH); // write the buzzer pin high to push out the diaphram
    delayMicroseconds(delayValue); // wait for the calculated delay value
    digitalWrite(targetPin, LOW); // write the buzzer pin low to pull back the diaphram
    delayMicroseconds(delayValue); // wait again or the calculated delay value
  }

}

Conclusion

As we've seen, CoilCell can also produce buzzing tones - Check out the CoilCell GitHub Repository for more code examples and technical documentation!

Read More

Understanding CoilCell Circuitry

Understanding CoilCell Circuitry

CoilCell is a thin planar PCB coil built on a multi-layered PCB with an integrated driver that simplifies magnetic control. In this post, we’ll explore its circuitry and how it functions.

What is CoilCell?

CoilCell is a PCB-based planar coil that generate a magnetic field that can interact with magnets. It is available in two configurations:

  • 1W CoilCell: Made from a 1.3mm thin, 4-layer PCB with a 70 turns spiral coil, with a peak magnetic field of 2.3 mT. 
  • 2.5W CoilCell: Made from a 2.6mm thin, 14-layer PCB with a 200 turns spiral coil, with a peak magnetic field of 10 mT, which can be increased to 17 mT using an iron back-plate.

With its DRV8837 H-Bridge driver, CoilCell allows control of current flow, determining both magnetic polarity and strength via the 2 input signals.

The Heart of CoilCell: DRV8837 H-Bridge

Unlike the CoilPad (which requires an external driver) this CoilCell module has an integrated DRV8837 H-Bridge driver. It enables bidirectional current flow, allowing the coil to generate a north or south magnetic field:

  • Magnetic North: IN1 = VCC/PWM, IN2 = GND
  • Magnetic South: IN1 = GND, IN2 = VCC/PWM
  • Off State: IN1 = GND, IN2 = GND

For added clarity, an onboard LED provides visual feedback, indicating the polarity of the output.

Key Features of the DRV8837:

  • Overcurrent Protection
  • Undervoltage Lockout
  • Thermal Shutdown
  • Supports up to 1.8A continuous current

These safety features help prevent damage from overheating or incorrect wiring, ensuring reliable operation.

Getting Started with CoilCell

To start using CoilCell, follow these steps:

1. Wiring CoilCell to Your Circuit

Solder the power and input pins to your microcontroller. 

  • Setting IN1 high generates a north magnetic field
  • Setting IN2 high generates a south magnetic field
  • Setting both IN1 and IN2 to GND turns the coil off

The VCC must be connected to a maximum supply voltage of 5V.

If using multiple CoilCells, the side pads allow for easy daisy-chaining to share power and control signals across multiple units.

2. Coding with the CoilCell Library

To simplify programming we had a CoilCell library with easy to use functions.

Steps to Install the Library:

  1. Open Arduino IDE
  2. Go to Library Manager and search for “CoilCell”
  3. Click Install
  4. Load the example sketches to start experimenting!

3. Keeping things tiny

Use our CodeCell module which is designed to be pin-to-pin compatible with CoilCell. With CodeCell, you can add wireless control and interactive sensing, unlocking new possibilities for your projects.

Safety Tips & Heat Management

Heat Considerations

  • The 2.5W 200-turn CoilCell can reach temperatures of up to 110°C - especially when combined with an iron back-plate.
  • Ensure that 3D-printed parts or materials near the coil can withstand high temperatures.
  • Reduce power output by adjusting the PWM duty cycle to manage heat generation.

General Safety

  • Avoid direct contact with the coil when operating at high power.
  • Use eye protection when working with small magnets that may be repelled at high speeds.
  • Ensure any soldered wires or jumpers are non-magnetic to prevent unintended magnetic interference.

Conclusion

With the CoilCell module you have everything you need to start experimenting and build your own fun magnetic actuators! Check out the CoilCell Schematics here to explore its circuit design and start integrating it into your next project!

Read More

CoilCell Basics: Your First Steps

CoilCell Basics: Your First Steps

CoilCell is a compact planar coil designed for various DIY projects. Whether you're just starting or are an experienced maker, CoilCell offers easy integration to simplify your creations. In this tutorial we will explain:

  • What is a CoilCell and how does it work?
  • Getting started with its Arduino software library
  • Program a ball-magnet to bounce every few milliseconds
  • Make the CoilCell more interactive with the CodeCell sensors

What is CoilCell?
CoilCell is a thin, planar coil built on a multi-layered PCB, with an integrated driver that simplifies controlling magnetic polarity and strength. It is available in two configurations:

  • 1W CoilCell: 70 turns, with a peak magnetic field of 2.3 mT.
  • 2.5W CoilCell: 200 turns, with a peak magnetic field of 10 mT, which can be upgraded to 17 mT using an iron back-plate.

Magnetic Applications

  • N52 Magnets: Use lightweight N52 ball or disk magnets for dynamic interactions like bouncing or shaking objects by finding their resonant frequency.
  • FlipDot: Create interactive mechanical pixel by pivoting a magnet to flip. Build your own 3D-printed magnetic FlipDot pixel, and add more for a mini displpay. Both your ears and eyes will love it!
  • Iron Back-Plate: Upgrade the 2.5W CoilCell to boost its peak strength to 17 mT, turning it into a weak electromagnet suitable for attracting small metallic objects like paper clips.
  • Magnetic Dice: Perform fun tricks with our special dice containing a hidden magnet inside, allowing you to create automatic shaking or influencing the roll outcome with the 2.5W CoilCell.

Safety Tips
While using the 2.5W 200-Turns CoilCell, it can potentially heating up to 110°C, especially when combined with the iron back-plate. Follow these precautions:

  • Keep hands away from hot surfaces and turn off the coil when not in use.
  • Ensure that 3D-printed parts and materials can withstand high temperatures. 
  • Also, use eye protection when working with small magnets that may be repelled at high speeds.

How Does CoilCell Work?
CoilCell utilizes an on-board DRV8837 H-bridge chip to control current flow through the coil, allowing it to switch magnetic polarity:

  • North: IN1 = VCC/PWM, IN2 = GND
  • South: IN1 = GND, IN2 = VCC/PWM
  • Off: IN1 = GND, IN2 = GND

The DRV8837 chip provides overcurrent protection, undervoltage lockout, and thermal shutdown features, ensuring safe operation.


Getting Started with CoilCell
Wiring one of the input-pins to VCC will instantly turn on the CoilCell. But to make it smarter we also developed a Arduino Software Library to make it easier for you to get started.

You will need to write some basic code to tell CoilCell what to do. Don’t worry, it’s quite simple! Start by downloading the "CoilCell" library from the Arduino's Library Manager. Once this is installed, we are ready to control your device. There are multiple examples that can help you get started but next we will breakdown and understand all the functions:

Before we start make sure you connect the CoilCell to your microcontroller -- We recommend using a CodeCell which is pin to pin compatible, the same size, supports all the library functions, and can add wireless control + interactive sensing. 

1. Initialize CoilCell

#include <CoilCell.h>

CoilCell myCoilCell(IN1, IN2); // Replace IN1 and IN2 with your specific pins

void setup() {
    myCoilCell.Init(); // Initializes the CoilCell
}

This code configures the CoilCell, setting it up for magnetic control based on your selected pins and microcontroller.

2. Bounce(bool direction, uint8_t ms_duration)

The Bounce() function makes a magnet bounce up and down. The first parameter, sets the polarity of the CoilCell and the delay_ms, sets the duration for which the magnet is repelled./

myCoilCell.Bounce(true, 20); //Bounce the magnet up for 20ms

3. Buzz(uint16_t us_buzz)
Create a buzzing sound by rapidly alternating the coil’s polarity. Adjust 'us_buzz' to control the frequency of the buzz.

myCoilCell.Buzz(80); // Generates a buzzing effect at 80 microseconds intervals

4. Tone()
This function plays a default tone by making the CoilCell vibrate at different saved frequencies.

myCoilCell.Tone(); // Plays varying tones

5. Drive(bool direction, uint8_t power_percent)
By using the CodeCell or any other ESP32 microcontroller, this function lets control the coil’s magnetic polarity and strength. The magnetic strength is adjusted by the 'power_percent', which controls how far the magnet is pushed from the coil.

myCoilCell.Drive(true, 75); // Drive the coil north with 75% strength

6. Toggle(uint8_t power_percent)
By using the CodeCell or any other ESP32 microcontroller, this function toggles the coil’s polarity at a set power level, useful for simple magnetic flipping actions.

myCoilCell.Toggle(60); // Toggle polarity at 60% power

For other Arduino devices, this command makes the coilcell flip its direction at full power. 

myCoilCell.Toggle(); // Toggle polarity at 100% power

7. Vibrate(bool smooth, uint8_t power_percent, uint16_t vib_speed_ms)

This function flips the coil’s polarity at a specified speed and power. Setting 'smooth' to true creates smoother motions, ideal for slow frequencies below 2 Hz.

myCoilCell.Vibrate(true, 50, 1000); // Smooth vibration at 50% power every 1000 ms

For other Arduino devices, this command makes the coilcell flip its polarity at full power. 

myCoilCell.Vibrate(100); // Vibrate at 100% power every 100 ms

 

Here's an example where we initialize a CoilCell to make a 5mm diameter ball magnet bounce. In this example, the CoilCell is initialized with pins 5 and 6. The setup() function calls myCoilCell.Init() to configure the CoilCell. In the loop(), the Bounce() function is used to make the magnet bounce upwards for 20 milliseconds, followed by a 600 milliseconds delay that attracts the magnet back down.

#include <CoilCell.h>

#define IN1_pin1 5
#define IN1_pin2 6

CoilCell myCoilCell(IN1_pin1, IN1_pin2);

void setup() {
    myCoilCell.Init(); /*Initialize the CoilCell*/
}

void loop() {
    myCoilCell.Bounce(0, 20); /*Bounce the magnet up for 20ms*/
    delay(600); /*Attract the magnet back down for 600ms*/
}
    

In this next example we use the CodeCell's Motion Sensor to detect tapping. When a new tap is detected the CoilCell flips its magnetic polarity and sets a 1 second delay to flash the onboard LED to yellow.

#include <CodeCell.h>
#include <CoilCell.h>

#define IN1_pin1 5
#define IN1_pin2 6

CoilCell myCoilCell(IN1_pin1, IN1_pin2);
CodeCell myCodeCell;

void setup() {
  Serial.begin(115200); /* Set Serial baud rate to 115200. Ensure Tools/USB_CDC_On_Boot is enabled if using Serial. */

  myCodeCell.Init(MOTION_TAP_DETECTOR); /*Initializes Tap Detection Sensing*/
  myCoilCell.Init();
  myCoilCell.Tone();
}

void loop() {
  if (myCodeCell.Run()) {
    /*Runs  every 100ms*/
    if (myCodeCell.Motion_TapRead()) {
      /*If Tap is detected shine the LED Yellow for 1 sec and flip the CoilCell's polarity*/
      myCodeCell.LED(0XA0, 0x60, 0x00U);
      myCoilCell.Toggle(100);
      delay(1000);
    }
  }
}


With these basic functions, you can start experimenting with CoilCell in your projects. Whether you’re controlling magnets, creating interactive displays, or experimenting with magnetic forces, CoilCell provides a simple and effective solution.

If you have any more question about the CoilCell feel free to email us and we will gladly help out!

Read More


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!

© 2025 Microbots.