I have built a Ultrasonic range sensor using a ultrasonic (250ST/R160) speaker, which emits a 25kHz square wave with a Vpp of 12V for 1ms. The microphone (SPU0410LR5H-QB) is powered with 3.3V and its SGN pin is connected to the ADC input pin of the microcontroller. The ADC is sampling at 250kHz (at 10 points). ADC turns ON 1ms after the speaker turns OFF and stays ON for 8ms. Then this process is repeated.
I am monitoring the ADC output by outputting the signal using a DAC. The problem is that the readings that the DAC is outputting are noisy. (Initially I thought I was sampling too frequently that I was picking up the noise instead of the actual signal. But I believe sampling 10 times faster is the rule of thumb.)
I am also monitoring the SGN pin of the microphone (the signal that is fed into the ADC), and although there is little amount of noise it is no where near to what I am seeing at the DAC output.
It appears that the level of the noise is constant and the Signal-to-Noise ratio can be increased by increasing the Vpp of the square wave to 30V. But I cannot supply such a high voltage onboard without a power supply. Therefore, I need to find a way to alleviate the noise without increasing the Vpp.
I am waiting for your recommendations, thank you.
Please see the diagram below: