Go Down

Topic: Microphone Audio Issues (Read 157 times) previous topic - next topic


Hello. I made a modified version of the Spy Bug by GreatScottLab (https://www.instructables.com/id/Make-Your-Own-Spy-Bug-Arduino-Voice-Recorder/)

For a while, I could record audio no problem until someone took apart the project and I put it back together. Now all the audio comes out as white noise.

This is the schematic I am following. The biggest difference is I have my switch on pin 2 and I am using a UNO

Here is the code I am using

Code: [Select]
//////////////////////////////////////// SD CARD
#include <SD.h>
#include <SPI.h>
#include <TMRpcm.h>
#define SD_ChipSelectPin 10
TMRpcm audio;
//////////////////////////////////////// SWITCH CASE
unsigned int i = 0;     // # of recording
unsigned long d = 0;
bool recmode = 0;      // recording state
//////////////////////////////////////// SWITCH
int inPin = 2;         // input Switch Pin
int state = HIGH;      // the current state switch
int reading;           // the current reading from the switch

void setup() {
  pinMode(A0, INPUT);  // Microphone
  pinMode(inPin, INPUT_PULLUP); // Switch
  //////////////////////////////////////// SD CARD
  audio.CSPin = SD_ChipSelectPin;

void loop() {
  char buffer[50];
  sprintf(buffer, "%i.wav", i++);
  reading = digitalRead(inPin);
  while (d < 300000) {
  d = 0;
  if (reading == LOW) {
    if (recmode == 0) {
      recmode = 1;


      audio.startRecording(buffer, 16000, A0);
  else if (reading == HIGH) {
    recmode = 0;



I cannot figure out if the issue is a wiring problem, a technical issue with the microphone or a code issue. Any help is welcomed. Thank you


If you made this once and had it working before you should be able to do it again.  Suggest you start over with the original instructions. 
Bad Boys Rate Our Young Girls But Violet Goes willingly - Get Some Now :) - ELI the ICE man


Welcome to the forum.

What controller did you use before?

Thanks.. Tom.. :)
Everything runs on smoke, let the smoke out, it stops running....


Aug 20, 2019, 06:15 pm Last Edit: Aug 20, 2019, 06:20 pm by Grumpy_Mike
This is the schematic I am following.
So if I am reading this correctly you are putting 5V into an SD card? Or does the SD card reader have a built in power supply and level shifting circuitry?

And you are connecting the vogad amplifier direct to your analogue input and not through a capacitor and biasing circuit? Do you have a capacitor on the input.

I made a modified version of the Spy Bug by GreatScottLab
I have come across this individual before and his electronic skills are not very impressive for the following he seems to attract. Like most instructables authors he seems to know something about electronics but not nearly enough to be publishing anything.


Aug 20, 2019, 06:22 pm Last Edit: Aug 20, 2019, 06:24 pm by wolframore
Hey Mikey... here are the links... the instructions clearly uses pin 2 for switch so I'm not even sure what he's explaining.

the instruction set is from Instrucables: Instructables

The SD module has level conversion: SD Card Module
Bad Boys Rate Our Young Girls But Violet Goes willingly - Get Some Now :) - ELI the ICE man

Go Up