Ultrasonic Amp

rogs

Joined Aug 28, 2009
279
Is the circuit still noisy with the mic not fitted?......If so, then it could be the extra stray capacitance introduced by the stripboard itself is cauaing some instability.

It might be wise at this stage to follow the 'golden rule' of project prototypes. (This is from the 'old days' -- and was especially important for radio frequency projects!) :
Once you have a working prototpye of an experimental circuit you leave it working as a reference. You then build another, knowing that you have a working example to compare you new circuit against.
Although simulation software is very useful, it doesn't always deal well with the real world 'quirks' that an actual prototype will throw up at you....and as you progress - and things get worse before they get better! - then the original working version keeps reassuring you that it can work for real... even if it's real 'birds nest'.

These actual hardware prototypes are where you learn the so called 'black arts' of analogue electronics..... the real thing doesn't always work quite like the simulation said it should!...there can be elements of trial and error, with things like power supply de-coupling, and stray capacitance...

As an aside, I'm wondering how, without any 'tuning' at all (other than high pass filters to remove low frequency audio) you are intending to discriminate your bat calls from the whole bunch of other ultrasound there is out there?
For example, some rodents generate a lot of ultrasound, and you might be surprised at just how much grass and trees generate... especially on a windy night!!

But first things first. Is it the circuit that's noisy... or is the microphone picking up a whole bunch of unwanted ultrasound in the environment and actually doing its job and amplifying it?
 

Thread Starter

mjr

Joined Apr 6, 2014
23
I followed the 'golden rule' (although unintentionally :) ). So I still have the breadboard circuit to compare to (but only one LM339, so I keep switching that IC).
I double-checked the stripboard and made sure that all strips are only as long as necessary and added an additional 10u cap between V+ and VG (which reduced the noise quite a bit). The noise is now about the same as on the breadboard. Is this kind of noise to be expected without the mic installed (also note the spikes which trigger the comparator)? (see attached image, 10mV/div).
scope.JPG
The other two images are back and front of my stipboard, the LM339 is currently on my breadboard :) (100u Cap between V+ and V- is not visible...)
back.JPG front.JPG
 

ericgibbs

Joined Jan 29, 2010
18,849
hi mjr,
I dont see the X,Y settings on your scope image, but I would expect some noise on your amps.
Is the the VG , OPA input divider resistor pair [ 10K > 10K or are they 47K's?] decoupled to 0V, at the +Inp of the OPA.? say by 100nF.?
E
 

rogs

Joined Aug 28, 2009
279
Eric - mjr mentions 10mV/div in his post, so it looks about 10mVp-p of noise at present. Likely to become significantly more, when the electret mic preamp FET is added to the input....
The small amount of hysterisis added to the LM339 by R11 is not really going to 'drag' that+ input lower by very much, and I suspect the comparator will react to random noise, unless that sensitivity is made adjustable.

Without any frequency discrimination at all, I can see it being quite difficult to isolate the bat calls from general 'noise' ... both intrinsic to the circuit, and external .

The circuit I added to post #13, the maximum gain for the device was about 90dB. In practical use, the sensitivity was adjustable to isolate the natural background noise from the output, so a preamp gain of some 60dB was required. But that was using a selective transducer, with a sensitivity of some -46dB at the resonant frequency... about 10dB better than an electret.

The resonant transducer output was then filtered by a bandpass filter that added an extra 30dB of gain. In my example, that provided enough amplification to reliably 'fire' the Schmitt trigger levels of the 4017 divider clock input, which replaced the comparator in this new circuit.

So I would expect there to be a requirement of a signal to noise ratio of at least 60dB in the gain chain, to allow for detection of specific external ultrasonic signals.

And I still feel it may be difficult to isolate bat calls from other broadband HF audio and ultrasonic 'noise' that the transducer will pick up, without some frequency discrimination. (Not necessarily 'tuneable', but at least 'pointing' to the appropriate part of the ultrasonic spectrum)
Without it, I think you'll just pick up too much unwanted 'rubbish', to get reliable readings..
.....All IMHO of course!:)
 

rogs

Joined Aug 28, 2009
279
Further to my post above, I took a quick look at the OPA2344 spec. It doesn't appear to be a low noise device, which might explain the reason you are getting more noise than you expected. I take it you are intending to use a single 5V supply for the unit?..... If so, then something like the low noise OP213 might suit your project better.
 

Thread Starter

mjr

Joined Apr 6, 2014
23
@ericgibbs: Y-Setting is 10mV/div; X is 0.1 ms/div but because of the exposure time of the camera the image blurred a bit. The OPA input divider resistor pair are 10k. VG is decoupled to V+ and V0 with 1uF. But not the +Inp of the OPA.

I did not notice that you changed that part of the Circuit. I'll see if this reduces the noise.

@rogs: Maybe I should add make R10 adjustable, to be able to change the sensitivity. I realize that I may be picking up lots of unwanted ultrasonic sounds. Thats why I would like to have a working prototype to do some 'real world' tests. With the initial circuit I tried that already (on the breadboard, so I could not leave it outside over night) circuit and it was detecting the Bat-Calls ok. Obviously it would detect lots of other sounds as well. Thats why I wanted a circuit that I can leave outside over night.

BTW: I tested the circuit with the MEMS-mic. It works a lot better than the electret mic. If I am able to use those mics I might be able to reduce the required gain of the opamp. The problem is, that my circuit need to run with 5V (to write to the SD-Card) and the mic is only rated for 3.3V.

Thanks a lot for your help. It is very much appreciated!
 

rogs

Joined Aug 28, 2009
279
You can't use a TLO74 in this application. It won't work with a supply of less than 7 volts. The TL974 looks to be pretty good (although I've never actually used one myself... maybe someone else can comment ?..... Low noise and ideal for 5 volt operation.

Regarding the MEMs mic. Simply feed it from your VG supply. (2.5V). It only draws about 100uA, so no problem with loading!

One little tip that might make life a bit easier during indoor testing. To see if you are in the 'ball park' gain wise for the ultrasound you're looking to detect, simply rub your thumb and finger together.. only very gently....
You won't hear anything yourself of course, but the ultrasound generated by that action should be picked up by your device as 'valid' data from a minimum of at least 30cm. The further away the better of course.. If you can only detect the ultrasound from that action at a much shorter distance, then you're unlikely to detect bats reliably.
Not terribly scientific of course, but a easy way to make a quick check that you're in the right sort of area, gain wise.

Regarding your comparator sensitivity.... I'm not sure that varying the reference voltage by shifting the hysteresis level is going to be is a very effective way of adjusting sensitivity. I think you'll find it will chase its own tail!
As you will see from my circuit, I took a slightly different approach. By including an extra adjustable gain stage I was able to use the Schmitt trigger clock input of the 4017 counter, to reliably trigger that device, and turn 40KHz signals into 4KHz ones.

You could do something similar. I'm guessing that converting 20KHZ - 60KHz signals into 2KHz - 6Khz signals would make them easier to store into your microcontroller. As you are simply detecting the presence of bats (frequency division has no way of retaining any amplitude data) then turning their ultrasound into audio frequencies that are easier to both hear and record seems to make life a bit simpler.

For example, faced with your requirements, I would simply build a simple frequency division detector and feed the divided (audio) output directly into a cheap SD card audio recorder.
These devices can run for many hours, make recordings that are time stamped, and produce downloadable audio files that can be easily analysed on a computer.
Unless of course your are intending to correlate and manipulate all your data in real time?....
 
Last edited:

ian field

Joined Oct 27, 2012
6,536
Hi,

I am trying to design an circuit to amplifying a mic signal (~15kHz-100kHz) to feed it into a microcontroller (which will use the input for Bat-Detection an Logging). With lots of help from google and this forum I finally came up with a circuit that seems to work (breadborad and simulator). But since I have no experience with this kind of circuits I was wondering if someone with more knowledge could look over my design (are there some 'obvious' beginners mistakes? could the design be improved? Any potential problems?) before I produce a PCB.

My Idea was to amplify the signal from the mic and filter out low frequencies. After that I used a comparator to create a 'rectified' signal for the microcontroller. For the OpAmp's I used two OPA2344.

View attachment 74318

Thanks for your help!
You could heterodyne the bat noises with a local oscillator just like an analogue radio does, that way you could use a pretty much off the shelf AF amplifier.

If you need to record actual frequencies, you can do that mathematically in the micro.
 

Thread Starter

mjr

Joined Apr 6, 2014
23
@rogs: Thanks for the Idea with VG as Powersource for the MEMS.

Regarding the frequency divider: At first I was planning to use a counter IC to reduce the frequency fed into my micro. But then I realized that the micro already has a fast counter builtin that seems to be working with the required frequencies. The micro is just going to read this counter once a millisecond. Because the micro does not like sine-like input I decided to go with the comparator to rectify the signal somewhat (I probably could have used a schmitt-trigger as well...).
Looking at you circuit I should probably use one of my gain stages to adjust the sensitivity (either R5 or R12)?
I am not really interested in audio files. The second part (and the easier part for me) of the project is to write a piece of Software that can load the files produced by the detector and display the results on a map (and animate them over time).
 

rogs

Joined Aug 28, 2009
279
I'll be interested to hear how you get on. As I have suggested in my earlier posts I think you may have some adventures trying to isolate valid bat calls, from both system and external ultrasonic 'noise', with just a rudimentary 'counting' technique.
Although I was pleased to get my frequency divider detector working... and finding bats!... it was also very difficult to isolate the valid bat signals from other ultrasound 'signals'. You might be surprised, for example, to discover just how loud swaying grass can be, from an ultrasound point of view. And rustling leaves in trees put out both audio and ultrasound in windy conditions!...not to mention ultrasound from other wildlife (rodents can be particularly 'noisy'!)
Heterodyne detectors are much better at detecting actual 'bat' signals, because you have so much more information to work with, with both amplitude and frequency components being detected, and transferred to the audio spectrum. But, as you have already mentioned, they do need to be manually tuned, so they're not really suitable for your particular project.
It will be interesting to see how your intended frequency divider technique progresses....
 
Top