Arduino Hydrosound Monitoring Project

Hi! Good morning!
I am a part of a team that is working on this Arduino Hydrosound Monitoring Project with an Arduino Uno. We have already completed the circuit and device construction. We are currently in the testing phase, and the sounds we captured when we installed our underwater microphone are full of static and background noises. We experimented with several mics before settling on a grove mic. Attached here is the google drive link to the audio files that have been recorded so that you may hear the output. Please do assist us by providing advice and recommendations.

https://drive.google.com/drive/folders/11fBHQQuqSRXA6Me9cl4znBYBGRlMk1Z8?usp=sharing

How does that compare to when the microphone is not underwater? How does that compare to when the microphone is disconnected? How are you powering the system? Are all your wiring insulated from the water?

Is the static and background noise periodic or continuous? How about a link to the microphone and a copy of your schematic for the system?

Hi! Thank you for responding to our question.

How does that compare to when the microphone is not underwater? How does that compare to when the microphone is disconnected?
Even when not submerged, the noise remains.

How are you powering the system?
Because we test outside, we use batteries to power the device. When we use a laptop to power up, the noise level is higher.

Are all your wiring insulated from the water?
Our wiring is also properly insulated.

Is the static and background noise periodic or continuous?
The noise is constant.

Link to the microphone

Copy of your schematic for the system
Here's an image of the schematic diagram we used as our only basis. Here, we modified several of the connections.

I would prefer a schematic instead of the frizzy picture which is not really readable. Are you using single point ground and are the low level analog signals properly shielded?

That is not a schematic diagram. Use Google to see what schematic diagrams look like. What you have shown is a breadboard layout/wiring diagram, which has a different purpose to a schematic.

You can use Fritzing to draw a schematic diagram. Select "schematic view" from the menu. Fritzing will show all your components and will draw dotted lines to show which are connected on your breadboard diagram. You can then re-arrange the components to minimise the need for connections to cross, and draw in the connections. Use the "power" symbols (5V, GND) in as many places as you need to reduce crossing connections. This will make the schematic much easier to read. You can switch back to breadboard view any time, it will not be disturbed by drawing the schematic.

I apologize for any confusion caused by the image I uploaded.

I should also tell you that I have seen an important error in your diagram which would prevent the circuit from working at all (with the exception of the 2 LEDs). The 5V and GND bus bars at the top of the breadboard are not connected to those at the bottom.

Here is our schematic diagram and also the link to the file.

Great idea to post it in such a low resolution to be not readable even with magnification.

Why are the components so far apart?

Also, can we receive help with our codes? We intend to do multiple recordings saved in the sd card. Our code is as follows:

#include <SD.h>
#include <SPI.h>
#include <TMRpcm.h>

//#define SD_ChipSelectPin 53 //example uses hardware SS pin 53 on Mega2560
#define SD_ChipSelectPin 8 //using digital pin 4 on arduino nano 328, can use other pins

TMRpcm audio; // create an object for use in this sketch

int count = 0;
int ss1 = 1;
int ss2 = 1;
int ss3 = 1;
bool started = false;
bool stopped = false;
bool playy = false;
bool paused = false;

int red = A4;

void setup() {

//audio.quality(1);

pinMode(12,OUTPUT); //Pin pairs: 9,10 Mega: 5-2,6-7,11-12,46-45
pinMode(13, OUTPUT);
pinMode(red,OUTPUT); //Pin pairs: 9,10 Mega: 5-2,6-7,11-12,46-45

Serial.begin(9600);

if (!SD.begin(SD_ChipSelectPin)) {
Serial.println("SD Not Found");
digitalWrite(red, HIGH);
delay(2000);
digitalWrite(red, LOW);
return;
}else{
Serial.println("SD OK");
digitalWrite(red, HIGH);
delay(2000);
digitalWrite(red, LOW);
}
// The audio library needs to know which CS pin to use for recording
audio.CSPin = SD_ChipSelectPin;
audio.setVolume(5);

}
unsigned long pv1 = 0;
unsigned long pv2 = 0;
unsigned long pv3 = 0;

void loop() {

if(digitalRead(3) == 1){
if(millis()-pv1 > 200){
pv1 = millis();
ss1++;
started = true;
}
}
else if (digitalRead(4) == 1){
if(millis()-pv2 > 200){
pv2 = millis();
ss2++;
playy = true;
}
}

if(ss1%2 == 0 && started){
  Serial.println("Recording on Progress"); 
  started = false; 
  stopped = true;
  digitalWrite(red, HIGH);
  audio.startRecording("test.wav",16000,A0);
  
  }
else if(ss1%2 != 0 && stopped){
  Serial.println("Recording Stopped"); 
  digitalWrite(red, 0);
  audio.stopRecording("test.wav");
  started = true; 
  stopped = false;
  
  }

  
  }

IF I understand correctly, the only way, currently, that you detect noise is on your recording, is that true? Have you tried tracing the audio from the microphone, step-by-step through your system? Find the problem before you record it.

Getting better but still not there yet.
Wires should not go through components and all wires should be routed. Those that are not are shown as dotted lines and because these go through components they are hard to read.

You seem to have Vin connected to 5V, which is a mistake. Your push button is wired in an odd way. It seems to be connecting a HIGH to an input yet there is no pull down resistor. Normally inputs are connected through a push button to ground and the internal pull up resistor for that input is enabled. Then yo will see a HIGH when not pushed and a LOW when it is.

Does your SD module contain a regulator and level converters? These things normally run from 3V3 and therefore so are the signals. If they are not level shifted then the 5V signals from the Uno will damage the SD card. Although the 3V3 signals from the SD card can be connected directly to the UNO's inputs.

Does your microphone module generate a signal biased at 2V5 ? EDIT just looked it up and the answer is no. It seems like that module is totally unsuited to recording an audio signal being only capable of detecting sound or no sound.

This schematic looks nothing like your original physical layout diagram. Not even the processor is the same. So which one is wrong? Only by supplying accurate information can we actually help.

Please see the getting the best out of this forum post to see how to post code correctly.

What academic level is your group?

Hello luigie.
I found this statement in another page describing this item:

Warning

This sound sensor is used to detect whether there's sound surround or not, please don't use the module to collect sound signal. For example, you can use it to make a sound control lamp, but not as a recording device.

Here's the link:
https://wiki.seeedstudio.com/Grove-Sound_Sensor/

It looks like the same product.

I didn't read all the above. I did see tha part that said that when compared with batteries operating from USB gave higher noise.
That strongly implies to me that you have conducted emisions on the microphone's power supply. Filter these.
What is the expected noise output from the microphone? How does that compare with what you are observing?

I have just looed at spec for LM358 (module say L358?) . Input noise voltage is 3uV pp, 26 db gain gives 20x, so that is 60uVpp at those low frequencies.
Op amp input noise is 40nV/rootHz, BW is 16 to 20kHz, giving ~5.5uV RMS noise at the output.
These are the sorts of levels you should be measuring.
You will get degradation from these due to your layout and less than ideal power supply.
What do you get with the microphone sunstituted for a resistor say, or even open circuit?

Then you really should to avoid embarrassment.

There are two causes to the noise. The first one is the data sheet saying it should not be used for audio recording. And the second one is that the OP has failed to bias the signal at mid rail level.

After looking at the schematic of the board he would get a much better signal if a 100K pull up and pull down resistors were added to the A0 input. However the choice of a power amplifier for a preamplifier will limit the quality he is going to get anyway.

I've had a lifetime of embarrassment :wink:

Thank you, sir, but we also tried different types of microphone modules and sensors, and based on our sample recordings for each mic, the grove sound sensor provided better audio.

Then you didn't try enough. At the moment this sounds like insufficient research.

How did you try them, given you are not able to use the SD card for record or playback?