DriveCell isn’t just for driving motors and actuators—it can also make them generate sound and vibrations. By sending a signal through the audible frequency range, DriveCell can create different tones that can be played on devices like piezo buzzers, CoilPads, FlatFlaps, and even motors. Making it useful for alert systems or interactive responses. In this guide, we’ll explore how DriveCell can generate buzzing tones, how to wire it, and how to use it for various applications, from piezo buzzers to CoilPad and motor vibrations.
Buzzing is achieved by sending rapid electrical pulses to a device, causing it to oscillate within the audible frequency range (~20Hz–20kHz). DriveCell allows control over these pulses using PWM (Pulse Width Modulation), letting you generate tones, alerts and vibrations.
Here’s how to wire a buzzer, CoilPad, or FlatFlap to DriveCell:
To generate buzzing tones, DriveCell provides Arduino-compatible functions for buzzing tones.
The following example makes a buzzer, CoilPad, or FlatFlap buzz using DriveCell's library built-in function:
#include <DriveCell.h>
#define IN1_pin1 2
#define IN1_pin2 3
DriveCell myDriveCell(IN1_pin1, IN1_pin2);
void setup() {
myDriveCell.Init(); /* Initialize DriveCell */
}
void loop() {
myDriveCell.Buzz(100); /* Buzz at 100 microseconds */
delay(500);
myDriveCell.Tone(); /* Play a fixed tone with varying frequencies */
delay(500);
}
Buzz(duration)
→ Generates a buzzing effect:
duration
→ Tone frequency in microseconds (adjust to change intensity)Tone()
→ Plays a fixed tone built into the library⚠ Note: Some sounds can also be played on DC motors, but check the datasheet and avoid running high-frequency buzzing on brushed motors continuously, as it may cause excessive wear.
The tiny DriveCell module makes buzzing simple! Check out the DriveCell GitHub Repository for more code examples and technical documentation!
Erfahren Sie als Erster von neuen Projekten und sichern Sie sich spannende Angebote!
© 2025 Microbots.