Stufin
Home Quick Cart Profile

MB35M - 35mm Musical

Buy Now on Stufin

Component Documentation

MB35M - 35mm Musical Module

Overview

The MB35M is a 35mm musical module, designed to add audio capabilities to IoT projects and devices. This compact module provides a simple and efficient way to play music, voices, or sound effects, making it an ideal component for a wide range of applications, from interactive toys to smart home devices.

Functionality

The MB35M module is capable of playing audio files stored on an external memory card (microSD). It supports various audio formats, including MP3, WAV, and WMA. The module can be controlled using a simple serial communication protocol, allowing users to play, pause, stop, and adjust the volume of audio files.

Key Features

  • Audio Playback: The MB35M module can play audio files from an external microSD card, allowing users to store and play back a vast library of sounds, music, and voices.
  • Serial Communication Protocol: The module uses a simple serial communication protocol, making it easy to control and integrate with microcontrollers, such as Arduino or Raspberry Pi.
  • External Memory Support: The module supports microSD cards up to 16GB, providing ample storage for audio files.
  • Built-in Amplifier: The MB35M module has a built-in amplifier, which can drive a small speaker directly, eliminating the need for an external amplifier.
  • Low Power Consumption: The module has a low power consumption, making it suitable for battery-powered devices and IoT applications.
  • Compact Size: The MB35M module measures only 35mm in diameter, making it ideal for use in space-constrained devices and projects.
  • Multiple Audio Formats: The module supports various audio formats, including MP3, WAV, and WMA, providing flexibility and compatibility with different audio sources.

Technical Specifications

Operating Voltage

2.5V - 5.5V

Current Consumption

50mA (maximum)

Audio Format Support

MP3, WAV, WMA

Memory Card Support

microSD (up to 16GB)

Serial Communication Protocol

UART (baud rate9600bps)

Frequency Response

20Hz - 20kHz

Signal-to-Noise Ratio80dB

Dimensions

35mm (diameter) x 15mm (height)

Applications

The MB35M musical module is suitable for a wide range of IoT applications, including

Interactive toys and games

Smart home devices and appliances

Wearable devices and accessories

Industrial control systems and automation

Advertising and promotional displays

Educational and research projects

Conclusion

The MB35M 35mm musical module is a compact, powerful, and easy-to-use component that adds audio capabilities to IoT projects and devices. Its simple serial communication protocol, external memory support, and low power consumption make it an ideal choice for a wide range of applications.

Pin Configuration

  • MB35M - 35mm Musical Module Component Documentation
  • Overview
  • The MB35M is a 35mm musical module designed for use in IoT projects, robotics, and interactive applications. This module is capable of producing high-quality audio output and is equipped with a built-in amplifier and speaker. In this documentation, we will outline the pinouts and connectivity guidelines for the MB35M module.
  • Pinout Description
  • The MB35M module has a total of 7 pins, each serving a specific purpose. The pinout diagram is shown below:
  • Pin 1: VCC (Power Supply)
  • Function: Power supply pin for the module
  • Voltage: 3.3V to 5V DC
  • Notes: Connect to a stable power source, such as a battery or a regulated power supply.
  • Pin 2: GND (Ground)
  • Function: Ground pin for the module
  • Notes: Connect to a common ground point in your circuit.
  • Pin 3: TX (Data Transmit)
  • Function: Serial data transmit pin
  • Protocol: UART (Universal Asynchronous Receiver-Transmitter)
  • Baud Rate: 9600 bps (default), can be configured
  • Notes: Connect to the RX pin of a microcontroller or a serial communication module.
  • Pin 4: RX (Data Receive)
  • Function: Serial data receive pin
  • Protocol: UART (Universal Asynchronous Receiver-Transmitter)
  • Baud Rate: 9600 bps (default), can be configured
  • Notes: Connect to the TX pin of a microcontroller or a serial communication module.
  • Pin 5: BZ (Buzzer Control)
  • Function: Buzzer control pin
  • Notes: Connect to a digital output pin of a microcontroller to control the buzzer.
  • Pin 6: SPK+ (Speaker Positive)
  • Function: Positive speaker terminal
  • Notes: Connect to the positive terminal of a speaker or headphones.
  • Pin 7: SPK- (Speaker Negative)
  • Function: Negative speaker terminal
  • Notes: Connect to the negative terminal of a speaker or headphones.
  • Connection Structure
  • To connect the MB35M module to a microcontroller or other IoT components, follow these steps:
  • 1. Power Supply: Connect VCC (Pin 1) to a 3.3V to 5V DC power source.
  • 2. Ground: Connect GND (Pin 2) to a common ground point in your circuit.
  • 3. Serial Communication: Connect TX (Pin 3) to the RX pin of a microcontroller or serial communication module, and RX (Pin 4) to the TX pin of the microcontroller or serial communication module.
  • 4. Buzzer Control: Connect BZ (Pin 5) to a digital output pin of a microcontroller to control the buzzer.
  • 5. Speaker Connection: Connect SPK+ (Pin 6) to the positive terminal of a speaker or headphones, and SPK- (Pin 7) to the negative terminal of the speaker or headphones.
  • Note: Ensure that the module is properly powered and grounded before making any connections.
  • By following this documentation, you should be able to successfully integrate the MB35M module into your IoT project or interactive application.

Code Examples

Component Documentation: MB35M - 35mm Musical
Overview
The MB35M is a 35mm musical module designed for IoT projects that require a melodic output. This component is a tiny, low-power music player that can play melodies through an external speaker. It's ideal for adding audio feedback to interactive projects, robots, and other IoT devices.
Technical Specifications
Operating Voltage: 3.3V - 5V
 Communication Interface: UART (Serial)
 Baudrate: 9600bps (default), adjustable up to 115200bps
 Supported Music Formats: MID (MIDI), WAV (16-bit, 44.1kHz)
 Built-in Flash Memory: 1MB
 External Speaker Connection: 2-pin JST connector
Using the MB35M in Various Contexts
### Example 1: Playing a MIDI File using Arduino
In this example, we'll use an Arduino board to send MIDI file data to the MB35M module.
Hardware Connection
Connect the MB35M's VCC pin to the Arduino's 5V pin.
 Connect the MB35M's GND pin to the Arduino's GND pin.
 Connect the MB35M's TX pin to the Arduino's RX pin (Serial Communication).
Arduino Code
```cpp
#include <SoftwareSerial.h>
// Define the serial communication pins
#define MB35M_RX 2
#define MB35M_TX 3
SoftwareSerial mb35mSerial(MB35M_RX, MB35M_TX);
void setup() {
  // Initialize the serial communication
  mb35mSerial.begin(9600);
}
void loop() {
  // Send the MIDI file data to the MB35M
  mb35mSerial.write(0x7F); // Header
  mb35mSerial.write(0x00); // Song header
  mb35mSerial.write(0x00); // Time signature
  mb35mSerial.write(0x00); // Tempo
  mb35mSerial.write(0x01); // Channel 1
  mb35mSerial.write(0x90); // Note on
  mb35mSerial.write(0x3C); // C4 note
  mb35mSerial.write(0x64); // Velocity
  delay(500);
  mb35mSerial.write(0x80); // Note off
  delay(500);
}
```
### Example 2: Playing a WAV File using Raspberry Pi (Python)
In this example, we'll use a Raspberry Pi to play a WAV file using the MB35M module.
Hardware Connection
Connect the MB35M's VCC pin to the Raspberry Pi's 3.3V pin.
 Connect the MB35M's GND pin to the Raspberry Pi's GND pin.
 Connect the MB35M's TX pin to the Raspberry Pi's RX pin (UART).
Python Code
```python
import serial
import time
# Initialize the serial communication
ser = serial.Serial('/dev/ttyUSB0', 9600)
# Open the WAV file
wav_file = open('example.wav', 'rb')
# Send the WAV file data to the MB35M
while True:
    chunk = wav_file.read(1024)
    if not chunk:
        break
    ser.write(chunk)
    time.sleep(0.01)
wav_file.close()
```
### Example 3: Playing a Custom Melody using ESP32 (MicroPython)
In this example, we'll use an ESP32 board to play a custom melody using the MB35M module.
Hardware Connection
Connect the MB35M's VCC pin to the ESP32's 3.3V pin.
 Connect the MB35M's GND pin to the ESP32's GND pin.
 Connect the MB35M's TX pin to the ESP32's RX pin (UART).
MicroPython Code
```python
import machine
import uart
# Initialize the UART communication
uart.init(9600, bits=8, parity=None, stop=1)
# Define the custom melody
melody = [69, 71, 73, 74, 76, 77, 79, 81]  # C4, D4, E4, F4, G4, A4, B4, C5
# Play the melody
for note in melody:
    uart.write(bytearray([0x90, note, 0x64]))  # Note on
    machine.delay(200)
    uart.write(bytearray([0x80, note, 0x64]))  # Note off
    machine.delay(200)
```
Note: In all examples, make sure to connect a suitable speaker to the MB35M's JST connector and adjust the volume accordingly. Additionally, the provided code examples are for illustration purposes only and may require modifications to work with your specific project.