Project tutorial
Sound Direction Tester

Sound Direction Tester © GPL3+

In this video, I test two DAOKI microphone sensors with my Arduino Uno to create a sound direction tester.

  • 254 views
  • 0 comments
  • 0 respects

Components and supplies

Necessary tools and machines

Apps and online services

About this project

This project makes finding the general direction of sound easy. The Arduino drives to LEDs to indicate which of two microphones is receiving an audible sound.

If both microphone sensors detect sound both (left and right) LEDs light indicating that both microphones have detected sound. If one microphone sensor (left or right) detects sound, then the corresponding LED (left or right) will light up. If both microphone sensors detect sound then both LEDs will light up.

For more information visit https://clydelettsome.com/blog/2019/08/15/my-weekend-project-sound-direction-tester/

Code

SoundDirectionFinderArduino
This code/sketch makes finding the general direction of sound easy. This code/sketch drives to LEDs to indicate which of two microphones is receiving an audible sound.
If both microphone sensors detect sound both (left and right) LEDs light indicating that both microphones have detected sound. If one microphone sensor (left or right) detects sound,
then the corresponding LED (left or right) will light up. If both microphone sensors detect sound then both LEDs will light up.
/*
 File/Sketch Name: SoundDirectionFinder

 Version No.: v1.0 Created 14 August, 2019
 
 Original Author: Clyde A. Lettsome, PhD, PE, MEM
 
 Description:  This code/sketch makes finding the general direction of sound easy. This code/sketch drives to LEDs to indicate which of two microphones is receiving an audible sound.
 If both microphone sensors detect sound both (left and right) LEDs light indicating that both microphones have detected sound. If one microphone sensor (left or right) detects sound,
 then the corresponding LED (left or right) will light up. If both microphone sensors detect sound then both LEDs will light up.


 License: This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License (GPL) version 3, or any later
 version of your choice, as published by the Free Software Foundation.

 Notes: Copyright (c) 2019 by C. A. Lettsome Services, LLC
 For more information visit https://clydelettsome.com/blog/2019/08/15/my-weekend-project-sound-direction-tester/

 */

int leftLedPin=13;
int rightLedPin=12;
int rightSensorPin=7;
int leftSensorPin=8;
boolean rightVal = 0;
boolean leftVal = 0;

void setup()
{
  pinMode(leftLedPin, OUTPUT);
  pinMode(rightLedPin, OUTPUT);
  pinMode(leftSensorPin, INPUT);
  pinMode(rightSensorPin, INPUT);
  Serial.begin (9600);
}
  
void loop ()
{
  rightVal =digitalRead(rightSensorPin);
  leftVal =digitalRead(leftSensorPin);
  
  // when the sensor detects a signal above the threshold value, LED flashes
  if (leftVal==LOW && rightVal==LOW) 
  {
    digitalWrite(leftLedPin, LOW);
    digitalWrite(rightLedPin, LOW);
    Serial.println("None");
  }
  else if (leftVal==LOW && rightVal==HIGH)
  {
    digitalWrite(leftLedPin, LOW);
    digitalWrite(rightLedPin, HIGH);
    Serial.println("Right");
  }
  else if (leftVal==HIGH && rightVal==LOW)
  {
    digitalWrite(leftLedPin, HIGH);
    digitalWrite(rightLedPin, LOW);
    Serial.println("Left");
  }
  else 
  {
    digitalWrite(leftLedPin, HIGH);
    digitalWrite(rightLedPin, HIGH);
    Serial.println("Both");
  }
}

Schematics

Fritzing Diagram
Fritzing Diagram
Sound directional finder bb vr2s6xdz9l

Comments

Similar projects you might like

Sound Sensor Activated LEDs with LCD for Sound Level Data!

Project tutorial by HeathenHacks

  • 4,339 views
  • 5 comments
  • 16 respects

Arduino Project: Burglar Zone Input Tester

Project tutorial by Cezarjar

  • 1,675 views
  • 2 comments
  • 9 respects

The Magnetic Field and RGB Tester

Project tutorial by Kutluhan Aktar

  • 4,424 views
  • 0 comments
  • 17 respects

8x LED Lighting by Sound

Project tutorial by Mantas Utka

  • 2,456 views
  • 0 comments
  • 12 respects

LSS (Light Status System) Intensity and Direction Finder

Project tutorial by Alireza Karkon

  • 954 views
  • 0 comments
  • 7 respects
Add projectSign up / Login