how do i get a microphone to detect a sound greater than 450 ADC to output a true value
and also how would i wire it?
Welcome to the Forum! Read the forum guidelines to see how to properly ask a question and some good information on making a good post.
Please describe what the hardware do you use. You will get faster and better help if you post all your code as requested by the forum guidelines.Use the IDE autoformat tool (ctrl-t or Tools, Auto format) before post…
const byte MicrophonePin = A0;
const byte OutputPin = 4;
void setup()
{
pinMode(OutputPin, OUTPUT);
digitalWrite(OutputPin, LOW); // set output to 'false'
}
void loop()
{
if (analogRead(MicrophonePin) > 450)
digitalWrite(OutputPin, HIGH); // Set output to 'true'
}
1 Like
You will need a suitable microphone amplifier module.
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.