Skip to content

Microphone Wireling Tutorial

TinyCircuits Microphone Wireling product photo

This Wireling uses the SPW2430 MEMS Microphone to detect sound and output an analog signal.

Technical Details

SPW2430 Specs

  • Consists of an acoustic sensor, a low noise input buffer, and an output amplifier
  • Low Current
  • MaxRF protection
  • Ultra-Stable performance

    TinyDuino Power Requirements

    • Voltage: 3.0V - 5.5V 
    • Current: 70-110 µA (Normal Mode). Due to the low current, this board can be run using the TinyDuino coin cell option

    Pins Used

    • A5/SCL - I²C Serial Clock line
    • A4/SDA - I²C Serial Data line 

    Dimensions

    • 10mm x 10mm (.394 inches x .394 inches)
    • Height (from the lower bottom of Wireling to upper top Wireling Connector): 3.70mm (0.15 inches)
    • Weight: 1 gram (.04 ounces)

    Materials

    Processor Adapter
    *TinyDuino and USB TinyShield Wireling Adapter TinyShield
    *TinyZero Wireling Adapter TinyShield
    *TinyScreen+ Wireling Adapter TinyShield
    WirelingZero N/A
    *RobotZero N/A
    Arduino Wireling Arduino Shield
    Raspberry Pi Wireling Pi Hat

    * These processors have a 32-pin connector and can have multiple Wireling Adapter TinyShields stacked to increase the number of Wireling ports up to a maximum of 32 total Wireling ports.

    In order to interface with Wirelings, you'll need the appropriate number of Wireling Cables and the Wireling.h Library (You can download this from GitHub as linked, or from the Library Manager in the Arduino IDE).

    You will also need the Microphone Wireling and the included example Arduino sketch.

    Wireling Code
    Port 0 Microphone Wireling Example Sketch

    Hardware Assembly

    Depending on the development system you choose, you will need to put together a TinyDuino stack using the 32-pin tan connectors, or you will just need to plug in your Wireling to Port 0 using a Wireling Cable. (You can change this port in the included Arduino Sketch using the Wireling.selectPort() function)

    NOTE: Be mindful when inserting Wireling Cables - the connector pins inside the 5-pin connectors on Wirelings can be bent when cables are inserted at an angle.


    Software

    Make the correct Tools selections for your development board. If unsure, you can double check the Help page that mentions the Tools selections needed for any TinyCircuits processor.


    Upload Program

    If you would like to use a different Wireling Port, simply change the value of micPin in the code and plug the Wireling into the corresponding port on the adapter. Note that on the Wireling Adapter TinyShield, A0 corresponds to Port 0, A1 to Port 1, and so on.

    Open the Serial Monitor to see the analog value the microphone is picking up.

    Code
    /*
      TinyCircuits Microphone Wireling Example Sketch
    
      This sketch reads the analog value output by the
      microphone based on the volume of sound it receives. The
      best way to see data is via the Serial Plotter. A simple
      test can be done by speaking at a normal volume, clapping,
      or blowing gently into the microphone and looking at the
      data on screen.
    
      Written 15 July 2019
      By Hunter Hykes
      Modified N/A
      By N/A
    
      https://TinyCircuits.com
    */
    
    #if defined (ARDUINO_ARCH_AVR)
    #define SerialMonitorInterface Serial
    #elif defined(ARDUINO_ARCH_SAMD)
    #define SerialMonitorInterface SerialUSB
    #endif
    
    float micPin = A0; // use port 0
    float value = 0.0;
    
    void setup() {
      SerialMonitorInterface.begin(9600);
      while (!SerialMonitorInterface); // must open Serial Monitor to execute following code
    
      delay(100);
    }
    
    void loop() {
      value = analogRead(micPin);  // read the input pin
      SerialMonitorInterface.println(value);  // print value
      delay(1);
    }
    

    Try clapping near the microphone or blowing into it to see a reading on the Analog pin.


    Downloads


    Contact Us

    If you have any questions or feedback, feel free to email us or make a post on our forum. Show us what you make by tagging @TinyCircuits on Instagram, Twitter, or Facebook so we can feature it.

    Thanks for making with us!