Menu
Microbots
0
  • Apprendre
  • Boutique
    • Modules et technologies
    • Maker-Packs
    • Outils et engrenages
    • Robots & Displays
    • Tous les produits
  • Communauté
    • Education
    • Software
  • À propos
    • Notre histoire
    • Tendez la main
    • FAQ
  • français
  • Votre panier est vide
Microbots
  • Apprendre
  • Boutique
    • Modules et technologies
    • Maker-Packs
    • Outils et engrenages
    • Robots & Displays
    • Tous les produits
  • Communauté
    • Education
    • Software
  • À propos
    • Notre histoire
    • Tendez la main
    • FAQ
  • Langue

  • 0 0

BobineCell

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!

Voir l'article entier

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!

Voir l'article entier

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!

Voir l'article entier

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!

Voir l'article entier

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!

Voir l'article entier

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!

Voir l'article entier

CoilCell Basics: Your First Steps

Notions de base sur CoilCell : vos premiers pas

CoilCell est une bobine planaire compacte conçue pour divers projets DIY. Que vous débutiez ou que vous soyez un maker expérimenté, CoilCell offre une intégration facile pour simplifier vos créations. Dans ce tutoriel, nous vous expliquerons :

  • Qu'est-ce qu'un CoilCell et comment fonctionne-t-il ?
  • Démarrer avec sa bibliothèque de logiciels Arduino
  • Programmez une boule aimantée pour qu'elle rebondisse toutes les quelques millisecondes
  • Rendre le CoilCell plus interactif avec les capteurs CodeCell

Qu'est-ce que CoilCell ?
CoilCell est une bobine mince et plane construite sur un PCB multicouche, avec un pilote intégré qui simplifie le contrôle de la polarité et de la force magnétiques. Elle est disponible en deux configurations :

  • Bobine 1 WCellule : 70 tours, avec un champ magnétique maximal de 2,3 mT.
  • Bobine 2,5 W : 200 tours, avec un champ magnétique maximal de 10 mT, qui peut être mis à niveau jusqu'à 17 mT à l'aide d'une plaque arrière en fer.

Applications magnétiques

  • Aimants N52 : utilisez des aimants à billes ou à disques N52 légers pour des interactions dynamiques telles que faire rebondir ou secouer des objets en trouvant leur fréquence de résonance.
  • FlipDot : créez un pixel mécanique interactif en faisant pivoter un aimant pour le retourner. Construisez votre propre pixel FlipDot magnétique imprimé en 3D et ajoutez-en d'autres pour un mini affichage. Vos oreilles et vos yeux vont l'adorer !
  • Plaque arrière en fer : améliorez la CoilCell de 2,5 W pour augmenter sa puissance maximale à 17 mT, la transformant en un électro-aimant faible adapté pour attirer de petits objets métalliques comme des trombones.
  • Dés magnétiques : réalisez des tours amusants avec nos dés spéciaux contenant un aimant caché à l'intérieur, vous permettant de créer des secousses automatiques ou d'influencer le résultat du lancer avec le CoilCell de 2,5 W.

Conseils de sécurité
Lors de l'utilisation du CoilCell 2,5 W 200 tours, il peut potentiellement chauffer jusqu'à 110 °C, en particulier lorsqu'il est combiné avec la plaque arrière en fer. Suivez ces précautions :

  • Gardez les mains éloignées des surfaces chaudes et éteignez la bobine lorsqu’elle n’est pas utilisée.
  • Assurez-vous que les pièces et matériaux imprimés en 3D peuvent résister à des températures élevées.
  • Utilisez également une protection des yeux lorsque vous travaillez avec de petits aimants qui peuvent être repoussés à grande vitesse.

Comment fonctionne CoilCell ?
CoilCell utilise une puce de pont en H DRV8837 intégrée pour contrôler le flux de courant à travers la bobine, lui permettant de changer de polarité magnétique :

  • Nord : IN1 = VCC/PWM, IN2 = GND
  • Sud : IN1 = GND, IN2 = VCC/PWM
  • Désactivé : IN1 = GND, IN2 = GND

La puce DRV8837 offre une protection contre les surintensités, un verrouillage en cas de sous-tension et des fonctions d'arrêt thermique, garantissant un fonctionnement sûr.


Premiers pas avec CoilCell
Le câblage d'une des broches d'entrée sur VCC activera instantanément la CoilCell . Mais pour le rendre plus intelligent, nous avons également développé une bibliothèque de logiciels Arduino pour vous faciliter la mise en route.

Vous devrez écrire un code de base pour indiquer à CoilCell ce qu'il doit faire. Ne vous inquiétez pas, c'est assez simple ! Commencez par télécharger la bibliothèque « CoilCell » à partir du gestionnaire de bibliothèques de l'Arduino. Une fois celle-ci installée, nous sommes prêts à contrôler votre appareil. Il existe plusieurs exemples qui peuvent vous aider à démarrer, mais nous allons maintenant décomposer et comprendre toutes les fonctions :

Avant de commencer, assurez-vous de connecter le CoilCell à votre microcontrôleur. Nous vous recommandons d'utiliser un CodeCell compatible broche à broche, de la même taille, prenant en charge toutes les fonctions de la bibliothèque et pouvant ajouter un contrôle sans fil + une détection interactive.

1. Initialiser CoilCell

 #include <CoilCell.h>

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

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

Ce code configure le CoilCell , le configurant pour le contrôle magnétique en fonction de vos broches et de votre microcontrôleur sélectionnés.

2. Bounce(bool direction, uint8_t ms_duration)

La fonction Bounce() fait rebondir un aimant de haut en bas. Le premier paramètre définit la polarité de la CoilCell et le delay_ms définit la durée pendant laquelle l'aimant est repoussé.

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

3. Buzz (uint16_t us_buzz)
Créez un bourdonnement en alternant rapidement la polarité de la bobine. Ajustez « us_buzz » pour contrôler la fréquence du bourdonnement.

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

4. Tonalité()
Cette fonction joue une tonalité par défaut en faisant vibrer la CoilCell à différentes fréquences enregistrées.

 myCoilCell.Tone(); // Plays varying tones

5. Drive(bool direction, uint8_t power_percent)
En utilisant le CodeCell ou tout autre microcontrôleur ESP32, cette fonction permet de contrôler la polarité et la force magnétique de la bobine. La force magnétique est ajustée par le « power_percent », qui contrôle la distance à laquelle l'aimant est poussé par rapport à la bobine.

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

6. Basculer(uint8_t power_percent)
En utilisant le CodeCell ou tout autre microcontrôleur ESP32, cette fonction bascule la polarité de la bobine à un niveau de puissance défini, utile pour des actions de retournement magnétique simples.

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

Pour les autres appareils Arduino, cette commande fait que la bobine inverse sa direction à pleine puissance.

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

7. Vibrer (bool lisse, uint8_t power_percent, uint16_t vib_speed_ms)

Cette fonction inverse la polarité de la bobine à une vitesse et une puissance spécifiées. Le réglage « smooth » sur true crée des mouvements plus fluides, idéaux pour les fréquences lentes inférieures à 2 Hz.

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

Pour les autres appareils Arduino, cette commande fait que la bobine inverse sa polarité à pleine puissance.

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

Voici un exemple où nous initialisons une CoilCell pour faire rebondir un aimant à bille de 5 mm de diamètre. Dans cet exemple, la CoilCell est initialisée avec les broches 5 et 6. La fonction setup() appelle myCoilCell.Init() pour configurer la CoilCell . Dans la fonction loop() , la fonction Bounce() est utilisée pour faire rebondir l'aimant vers le haut pendant 20 millisecondes, suivi d'un délai de 600 millisecondes qui attire l'aimant vers le bas.

#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*/
 }

Dans l'exemple suivant, nous utilisons le capteur de mouvement du CodeCell pour détecter les tapotements. Lorsqu'un nouveau tapotement est détecté, le CoilCell inverse sa polarité magnétique et définit un délai d'une seconde pour faire clignoter la LED intégrée en jaune.

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

 #define IN1_pin1 5
 #define IN1_pin2 6

 CoilCell myCoilCell(IN1_pin1, IN1_pin2);
 CodeCell myCodeCell;
 
vide configuration() {
 Serial.begin(115200); /* Définissez le débit en bauds série sur 115 200. Assurez-vous que Tools/USB_CDC_On_Boot est activé si vous utilisez Serial. */

 myCodeCell.Init(MOTION_TAP_DETECTOR); /*Initialise la détection de pression*/
 maCoilCell.Init();
 maCelluleCoil.Tone();
 }

 boucle vide() {
 si (myCodeCell.Run()) {
 /*S'exécute toutes les 100 ms*/
 si (myCodeCell.Motion_TapRead()) {
 /*Si Tap est détecté, la LED s'allume en jaune pendant 1 seconde et inverse la polarité de la CoilCell*/
 monCodeCell.LED(0XA0, 0x60, 0x00U);
 maCoilCell.Toggle(100);
 délai(1000);
 }
 }
 }


Grâce à ces fonctions de base, vous pouvez commencer à expérimenter CoilCell dans vos projets. Que vous contrôliez des aimants, créiez des affichages interactifs ou expérimentiez des forces magnétiques, CoilCell offre une solution simple et efficace.

Si vous avez d'autres questions sur le CoilCell, n'hésitez pas à nous envoyer un e-mail et nous serons heureux de vous aider !

Voir l'article entier


Partage

Github

  • À propos
  • Software
  • Education
  • Contact
  • FAQ
  • Termes
  • Politique de remboursement
  • politique de confidentialité

Soyez le premier informé des nouveaux projets et bénéficiez d'offres intéressantes !

© 2025 Microbots.