Mic amps

I want to use a microphone in a simple project (reflex tester) so I don't want to use an op amp to get the audio signal. How can I use an NPN transistor to amplify the signal?
The idea of the project is that an LED turns on at a random time, and you have to clap when you see it come on. Your reflex time is the time between when the LED turned on and when you clapped. I obviously don't care about audio quality, so I don't want to use an op amp.

I've looked here:

But I didn't know what resistor value to use.

Thanks!
baum

baum,

What kind of microphone are you using? I guess it generates a small mV signal when talked to. You can't switch on the transistor with that small of a signal unless you bias it.

What I did a while back was to bias the signal from an mp3 player (+-1V max) with a coin battery and voltage divider. I take about 1.5V from the voltage divider using a 3V coin battery. I then chained the signal from the mp3 player in series with this bias voltage. Then I used a 10KOhm resistor for base, and maybe 300Ohm for emitter with a small speaker. My collector bias voltage Vcc was 9V from a 9V battery. Without knowing the voltage range of your microphone when it's in real-time situation, I can't say for sure my setup works for you.

BTW, do you want an amplified analog signal or just a digital high/low? If you want digital, make the collector resistance larger, like 2K.

I found something that should work, I just don't have a 100k pot, only a 10k pot.


http://www.nerdkits.com/videos/sound_meter/

This is the circuit from my book. Its actually to amplify the mic signal to make a maximum logging VU meter.

If you want the sketch, it can be downloaded from http://www.arduinoevilgenius.com.

Could I use a 2n3904?

I don't know that one, but if its a small signal NPN bipolar transistor, it should be fine.

Stick it in the breadboard and try it :wink:

OK. I'll try it. Just wondering... How does your pulse rate monitor work? I've been wanting to make one but don't understand how it works.

Thanks!
baum

I just get a constant analog reading of 880....

The circuit is for an electret mic insert. Is that what you are using?

Are you sure the transistor is wired up ok and is healthy?

The pulse monitor shines IR light into one side of your finger and measures the light coming out the other side. Its called pulse oxymetry.

If you want to know any more you'll have to buy the book :wink:

My transistors work, (I tried 5 new ones, they didn't work), and I am using an electret. Maybe the circuit doesn't work w/ my transistors.

Have you got the electret the right way around? The negative pin that should go to ground is connected to the case.

What are you doing with the Analog in? This cct does not integrate the signal to just give you a volume level, it actually follows the audio waveform. So the integration goes no in the software. Even so, you would get some variation.

I tried flipping my mic, with no luck.

I just get a constant analog reading of 880....

You should get a reading of around 512, but that need not be important. Maybe its just got a slightly high bias. Have you checked with a scope, or other test (speaker, AC meter, arduino test program...), that it doesn't react to sound?

I think Si's schematics should work. You can also try my one-transistor variant that I used on my morse encoder/decoder. I think the 3904 should work instead of the BC548 I used, but thats mostly a guess, I haven't really checked.

Both schematics just amplifies the soundwaves, and will oscillate around the center value (maybe 880 in your case). You will have to make some threshold value in software to check against. It's the same thing I did with my morse decoder btw, it just checks for sounds for its audio input. A simple clipping filter, I just ignored any samples below a certain value.

Other that that, why not use an op-amp? It seems well suited for your purpose, easy to make the amplification / sensitivity variable and much more sensitive than the aforementioned circuits.

A few links here for some inspiration:

I've already done amplification with an op-amp, so I just wanted to try the NPN variation. The circuit from nerdkits worked, but I took it apart for si's.... maybe I'll try it again. I don't have a scope, but a constant value of 880 seems odd... Unless all of my transistors are shot.

Pull everything out all the wires and build it on the breadboard again.

Check the transistor pins.

The circuit definitely works ok.

I have tried that, but I still get the constant reading. I'll try again.

nvrmnd. transistors were in backwards. Now, I get some fluctuation from 170~250, which you can see on a pwm'd led.

Edit: Just ran a high/low program:

int low = 1023;
int high = 0;
void setup() {
  Serial.begin(9600);
}

void loop() {
  int sensorValue = analogRead(A3);
  if (sensorValue < low) {
    low = sensorValue;
  }
  if (sensorValue > high) {
    high = sensorValue;
  }
  Serial.print("h: ");
  Serial.print(high);
  Serial.print("\t");
  Serial.print("l: ");
  Serial.println(low);
}

And if I clap ~5 inches from mic I get h:939, l:40. So it works! yay!!

Thats probably it working fine :slight_smile:

As I said before, the fluctuation is the signal. If you want to get the overall level, you need to do some Integration / low pass filtering / averaging.

The sketch I pointed you at for the book, has an algorithm in it to LP filter.

OK. Thanks! But I only care about amplitude, why would I need filtering?

A 1 KHz sound wave is an oscillation at 1000 times per second. Lets say a sine wave. So if you sample the amplitude you may hit it when its at a peak, or when its in a trough. But unless you do something like find the highest value, or low pass filter it to obtain the envelope, you will not have a measure of the 'volume' of the sound.

Words to lookup on Wikipedia: low pass filter, signal envelope, sine wave