PDA

View Full Version : Comparator Problem



maxasimo
07-21-2005, 01:42 PM
Hi everybody

Im working on a microphone amplifier to be used in a sound tracking robot. I've completed with the amplifier part, using two sections of inverting op-amp configurations (LM 324). It gives the output as follows: -

No sound (Background noise in a general room) - 0-30 mV
Clap, knock on table, whistle - Output rises to 600 mV

Now i want to interface this amplifier with a digital system, preferably microcontroller. As my system requires only to know when there's a sound, i'm comparing the amplifier output using a comparator, also built from LM324. I'm connecting the amplifier output to the non-inverting pin, pulling up the output with a 4K7 and proving Vref of 214 mV (1M,47k potential divider) to the inverting pin.Now the problem

If i disconnect the -ve input of op amp from the Vref point, everything is fine. But as soon as i connect it, the output of amplifier rises to 290 mV, even without any sound. and making any sound furthur actually brings down the output of the amplifier (clap brings it down to 150 mV from 290 mV)

Please suggest me what to do in this case. What could be the problem with the design. Would using special Comparator chips such as LM339 help?

Thanks in advance

maxasimo
07-23-2005, 03:44 PM
Well...I figured out the problem

A comparator is an amazing A/D interfacing tool. We use it so often that its trivial to be stuck up with it all helpless, as i did. Below is an explaination of the problem i got stuck into and the solution to it.

When operating a comparator with single ended supply (5V-Vcc; 0V-Gnd), a condition on the operation is that the inputs should not be too close to the Supply rails (as was in my case - 0-300 mV) otherwise the comparator tends to LATCH UP. This is a peculiar behaviour in which the comparator output gets locked up to the High Rail and it remains unaffected of the inputs unless power supply is reset. This was happening in my case.

The SOLUTION: - I simply biased the comparator input to 2V using a CE configuration amplifier (low gain, but dc output of 2V) and then all worked just fine. Quite a sensitive amplifier! Even if you whisper from 5 meters, it will detect it. Well just right for my application.

Thanks all anyways.

Do reply with some better ideas also

scaenix
02-19-2007, 01:38 PM
I'm interested in building a robot just like what you did. would it be ok with you to share the details of your project? Thanks very much!

docel
02-20-2007, 12:20 AM
Why do you guys use a MICROCONTROLLER for such a simple task???
And dont you read the Datasheets of the ADCs before you do anything?
....and What is the ADC for????? ...if you need "all kinds" of external circuitry??

scaenix
02-20-2007, 07:22 AM
Why do you guys use a MICROCONTROLLER for such a simple task???
And dont you read the Datasheets of the ADCs before you do anything?
....and What is the ADC for????? ...if you need "all kinds" of external circuitry??

What's simple? just kidding. but i was asking about the whole details about the project. I was not only asking about the comparators, I was asking about the comparator's function on his project as a whole aside from being used as an ADC because as far as I know, there are ICs which are already ADCs in themselves. If you can show me some help, then I would gladly appreciate it. Thanks.