science tinker

Sound sensor (KY-038)

A small microphone on a board: AO gives a voltage that follows the loudness, DO goes HIGH when the sound passes a level you set.

Sensors · Elements inside: AlCSiO

Function: what the KY-038 does in a circuit

A small microphone on a board: AO gives a voltage that follows the loudness, DO goes HIGH when the sound passes a level you set.

  • Detects claps, knocks and loud sounds
  • Gives a loudness level (AO) and a trigger signal (DO)
  • Switches things on by sound

KY-038 key facts

Supply3.3 V to 5 V
AOanalog signal from the microphone
DOHIGH when the sound passes the level set by the trimmer
ComparatorLM393
PinsAO, G, +, DO

KY-038 pinout

The legs from left to right, as the part is drawn in the simulator:

No.Name
1AO (analog out)
2G (ground)
3+ (5 V)
4DO (digital out)

How it works

Sound waves move a thin charged film inside the microphone, which changes a tiny voltage. A comparator chip (LM393) compares that with the level set by the blue trimmer potentiometer and switches DO, and an LED on the board, when the sound is louder. AO carries the microphone signal for analogRead. A real module gives a fast wave on AO; the simulator gives its loudness level so it is easy to read.

What it is made of

  • Microphone: Electret film in an aluminium can AlC
  • Comparator: Silicon integrated circuit (LM393) Si
  • Board: Glass-fibre and epoxy circuit board SiOC

Where the materials come from: Aluminium from bauxite (Australia, Guinea, China); the film is a fluoropolymer made from fluorite; silicon from quartz sand.

The chemistry

An electret is a plastic film with electric charge frozen into it during manufacture, so the microphone needs no high voltage to work.

Biology connection

Your ear does the same job: the eardrum moves with the sound wave, and hair cells in the cochlea turn the movement into nerve signals. How the ear hears →

Safety and the environment

Turn the trimmer until the DO LED is just off in a quiet room. It detects claps and knocks well, but it cannot recognise words.

Did you know? Clap switches for lamps, popular since the 1980s, are this circuit plus a relay.

Try it in the simulator

Build and code a circuit with a Sound sensor in these practice projects:

Questions students ask

What does the KY-038 do?

A small microphone on a board: AO gives a voltage that follows the loudness, DO goes HIGH when the sound passes a level you set. Main functions: detects claps, knocks and loud sounds; gives a loudness level (AO) and a trigger signal (DO); switches things on by sound.

How do I detect a clap with a sound sensor?

Connect DO to a digital pin and watch for it going HIGH. Toggle your output on each new HIGH, then wait about 200 ms so one clap is not counted twice.

What are the connections of the KY-038?

In order: AO (analog out), G (ground), + (5 V), DO (digital out).

How does the KY-038 work?

Sound waves move a thin charged film inside the microphone, which changes a tiny voltage. A comparator chip (LM393) compares that with the level set by the blue trimmer potentiometer and switches DO, and an LED on the board, when the sound is louder. AO carries the microphone signal for analogRead. A real module gives a fast wave on AO; the simulator gives its loudness level so it is easy to read.

What is the KY-038 made of?

Microphone: Electret film in an aluminium can. Comparator: Silicon integrated circuit (LM393). Board: Glass-fibre and epoxy circuit board.

Is the KY-038 safe? How should it be recycled?

Turn the trimmer until the DO LED is just off in a quiet room. It detects claps and knocks well, but it cannot recognise words.

More sensors

Know someone who would use this?

It’s free for every learner. Send it to your class, team or club.

Updated · Free, no sign-up ·

Connected tools

The same idea from another angle, across the site.