2
\$\begingroup\$

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:

enter image description here

\$\endgroup\$
  • \$\begingroup\$ Your issue is probably at the ADC (from experience). As noted, a circuit diagram would be very helpful. \$\endgroup\$ – Peter Smith Apr 12 '18 at 17:17
  • \$\begingroup\$ It's nearly always better to first concentrate on and deal with noise before (in the physical design/arrangements) and also at the 1st stage electronically where the transducer operates. Once noise gets into the system, you have rather fewer and poorer options. \$\endgroup\$ – jonk Apr 12 '18 at 17:19
  • 1
    \$\begingroup\$ Do you have a front end anti-aliasing filter? \$\endgroup\$ – Peter Smith Apr 12 '18 at 17:31
  • \$\begingroup\$ Can you post images of the scope traces? That might help in identifying the noise. \$\endgroup\$ – JRE Apr 12 '18 at 17:57
  • \$\begingroup\$ @PeterSmith no, I don't. \$\endgroup\$ – csg Apr 12 '18 at 19:05
1
\$\begingroup\$

I would start using twisted pair where is possible, by twisting the pair you reduce the noise quite a lot.

And then, the simplest thing would be to make a high pass RC filter, where the cutoff frequency should be above 80HZ, the latter is to remove the electrical noise produced by the 110/220 power outlet (which uses 50 or 60HZ). I recommend you putting two of those filters in series, so you leave the signal to the output much cleaner, although with one you already solve a lot.

Also, you can look into this article, it's very instructive.

\$\endgroup\$
1
\$\begingroup\$

Set aside a big buffer in your microcontroller, capture your A/D converter output in the buffer, and then pull the data up to a PC and torture it with MATLAB. Use GNU Octave if you don't have MATLAB available. Put some extra markers into your data stream so you can see your blanking and signal intervals.

Your input rate is 250 kHz and your active interval is 8 ms, so you will be getting 2000 samples/active interval.

Once you can capture SOMETHING, look at the signal into the A/D converter, and replace it with a signal from a function generator with "similar" characteristics. Take data, torture it, and see what you're getting. Then back up to before your microphone conditioning (analog) circuits, and repeat the exercise.

\$\endgroup\$
  • \$\begingroup\$ This is the way to go to check the behaviour of the ADC. comparing it with the DAC output, you introduce errors from another conversion, possible timing erros and the output network. If you want to check it with the DAC, you need to verify the proper behaviour of the DAC output first. \$\endgroup\$ – Grebu Apr 12 '18 at 18:19
  • \$\begingroup\$ @Grebu, you start by verifying the A/D, by feeding it a known signal and looking for the expected results. Once you have verified the A/D, you look hard at the signal conditioning chain before the A/D. Once you've got that, you can start looking at what your transducer is giving you. \$\endgroup\$ – John R. Strohm Apr 12 '18 at 21:23
  • \$\begingroup\$ yes, you are right. I was just supplementing your answer with the reason for why it's difficult to verify the ADC behaviour by measuring the DAC output. Thus your answer avoids that problem and is the way to go. Maybe I phrased it ambigious. \$\endgroup\$ – Grebu Apr 13 '18 at 8:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.