Reader small image

You're reading from  Arduino for Secret Agents

Product typeBook
Published inNov 2015
Reading LevelIntermediate
Publisher
ISBN-139781783986088
Edition1st Edition
Languages
Tools
Concepts
Right arrow
Author (1)
Marco Schwartz
Marco Schwartz
author image
Marco Schwartz

Marco Schwartz is an electrical engineer, entrepreneur, and blogger. He has a master's degree in electrical engineering and computer science from Supélec, France, and a master's degree in micro engineering from the Ecole Polytechnique Fédérale de Lausanne (EPFL), Switzerland. He has more than five years' experience working in the domain of electrical engineering. Marco's interests center around electronics, home automation, the Arduino and Raspberry Pi platforms, open source hardware projects, and 3D printing. He has several websites about the Arduino, including the Open Home Automation website, which is dedicated to building home automation systems using open source hardware. Marco has written another book on home automation and the Arduino, called Home Automation With Arduino: Automate Your Home Using Open-source Hardware. He has also written a book on how to build Internet of Things projects with the Arduino, called Internet of Things with the Arduino Yun, by Packt Publishing.
Read more about Marco Schwartz

Right arrow

Testing the microphone


We are now going to make sure that the microphone is working correctly and especially check whether it can record voice levels, for example. I had a problem when I was testing the prototype of this project with a microphone that wasn't amplified; I just couldn't hear anything on the recording.

The first step is to plug the microphone into the Arduino board. There are 3 pins to connect the microphone: VCC, GND, and AUD. Connect VCC to the Arduino 5V pin, GND to the Arduino GND pin, and AUD to the Arduino analog pin A5.

The following is a schematic to help you out:

Here is an image of the final result:

We are now going to use a very simple sketch to read out the signal from the microphone and print it on the serial monitor:

// Microphone test

void setup() {
 
  // Start Serial
  Serial.begin(115200);
}

void loop() {
 
  // Read the input on analog pin 5:
  int sensorValue = analogRead(A5);
 
  // Print out the value you read:
  Serial.println(sensorValue);
  delay(1); ...
lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
Arduino for Secret Agents
Published in: Nov 2015Publisher: ISBN-13: 9781783986088

Author (1)

author image
Marco Schwartz

Marco Schwartz is an electrical engineer, entrepreneur, and blogger. He has a master's degree in electrical engineering and computer science from Supélec, France, and a master's degree in micro engineering from the Ecole Polytechnique Fédérale de Lausanne (EPFL), Switzerland. He has more than five years' experience working in the domain of electrical engineering. Marco's interests center around electronics, home automation, the Arduino and Raspberry Pi platforms, open source hardware projects, and 3D printing. He has several websites about the Arduino, including the Open Home Automation website, which is dedicated to building home automation systems using open source hardware. Marco has written another book on home automation and the Arduino, called Home Automation With Arduino: Automate Your Home Using Open-source Hardware. He has also written a book on how to build Internet of Things projects with the Arduino, called Internet of Things with the Arduino Yun, by Packt Publishing.
Read more about Marco Schwartz