# Sound input module (4-pin)

**Type:** Product page · **SKU:** CE09434 · **Brand:** [Core Electronics](https://core-electronics.com.au/brands/core-electronics-australia)
**Page:** https://core-electronics.com.au/sound-module-4-pin.html ([markdown](https://core-electronics.com.au/sound-module-4-pin.html.md))

An all-in-one module for easily sensing sound!

## Pricing

- **Price:** $1.20 (inc GST) — $1.09 AUD, exc GST
- **Quantity discounts:** 25+ $1.04 (exc GST) · 50+ $0.98 (exc GST) · 100+ $0.93 (exc GST)

## Availability & dispatch

- In stock, ships same business day if ordered before 2PM (Australia/Sydney).
- We can dispatch 26 today; more stock is typically available with a 8–12 day lead time.

## Description

Featuring one analog and one digital threshold output this microphone breakout is really handy to have in your parts library.

The onboard potentiometer adjusts the threshold (note this is a 20-turn potentiometer, it can take a few turns to reach your desired sensitivity).

### Features

- Onboard LM393 amplifier
- Analog microphone output
- Audio threshold output
- A maker classic KY-038 sound module with lots of community support and libraries

### Specifications

- Supply voltage (Vcc): 3-5V
 
### Pinout

 | Pin function | Board silkscreen |
|---|---|
| Microphone Analog output | AO |
| Ground | G |
| Power input | + |
| Audio threshold | DO |

### Examples

#### Raspberry Pi Pico - Micropython

 ```
from machine import Pin, ADC
from time import sleep

# Initialization of ADC0
adc = ADC(0) #AO on the sound module to GPIO26<br></br>
# Initialization of GPIO18 as input
digital = Pin(18,Pin.IN, Pin.PULL_UP) #DO on the module to GPIO18

print("Sound Input Module test")

# Endless loop for reading out the ADC
while True:
    raw_value = adc.read_u16()
    # Conversion from analog value to voltage
    Volt = round(raw_value* 3.3 / 65536, 2)
    digital_value = digital.value()

    # Serial output of the analog value and the calculated voltage
    print("Analog voltage value: " + str(Volt) + " V\t Threshold value: ", end="")

    # Query whether the digital value has changed with serial output
    if digital_value == 1:
        print("reached")
    else:
        print("not reached")
    
    print("----------------------------------------")
    sleep(2)
```

## Images

- [Product image 1](https://core-electronics.com.au/media/catalog/product/s/o/sound.jpg)
