Project showcase
Audio Input

Audio Input © GPL3+

This lesson aims to show how to interface an electret microphone with the analog input.

  • 7,934 views
  • 3 comments
  • 6 respects

Components and supplies

A000066 iso both
Arduino UNO & Genuino UNO
×1
Breadboard 830 points with Wire Kit
×1
1M resistor
×1
10k resistor
×1
Capacitor 4.7 µF
×1
Capacitor 10 pF
×1
TLV2451C
×1
Electret microphone
×1
2.2k resistor
×1

About this project

1. How does it work?

Since the signal of the microphone is too little to drive directly the analog input, we need to amplify it. Furthermore a good read of the analog input can be done if the input signal is between 0 and 5V so we also need to offset it. This can be done through an operational amplifier.  In particular we will use an inverting amplifier because is simple and an audio signal is not affected by a rotation of 180°.

2. Schematic

This is the resulting schematic.

3. The code

Now we can simply read the analog input in this way. Take note that if there isn't an audio signal the read will be about 512 because to have an audio signal between 0 and 5V we need an offset of 2.5V. Little variations are caused by the noise.

/*Read the analog input of a microphone
Author: Arturo Guadalupi */
int micIN= A0;
int audioVal = 0;
void setup() {
  Serial.begin(9600);
}
void loop() {
 audioVal = analogRead(micIN);
 Serial.println(audioVal);
 delay(600);
}

Code

Code snippet #1Arduino
/*
Read the analog input of a microphone
*/

int micIN= A0;
int audioVal = 0;

void setup() {
  Serial.begin(9600);

}

void loop() {
 audioVal = analogRead(micIN);
 Serial.println(audioVal);
 delay(600);
}

Schematics

Schematic 1
750x750 5236fef5b9af57 11229535 5uezn0poey

Comments

Similar projects you might like

Use a hard disk like a rotational input device

Project tutorial by Arduino_Scuola

  • 3,406 views
  • 1 comment
  • 12 respects

Talkative Automation || Audio from Arduino || HC-05 || Voice

Project tutorial by Vishalsoniindia

  • 2,753 views
  • 0 comments
  • 5 respects

DFT Audio Analyser

Project tutorial by Akash Kollipara

  • 1,802 views
  • 0 comments
  • 7 respects

Audio Blink

Project tutorial by Arduino_Scuola

  • 1,616 views
  • 0 comments
  • 2 respects

Animate a Billy Bass Mouth With Any Audio Source

Project tutorial by Donald Bell

  • 7,789 views
  • 4 comments
  • 32 respects

TV,DVD & Audio Control from Android and Arduino

Project tutorial by Jose Luis Bejarano Vasquez

  • 5,625 views
  • 1 comment
  • 19 respects
Add projectSign up / Login