At 13:36 24/09/97 -0400, you wrote: >Hello, > >I have an application which requires that a PIC >microcontroller monitor the volume level on a microphone. >It doesn't need to record or anything, simply monitor >the volume level and take some action based on whether >the level is above or below a certain threshold. >This cannot be done with a comparator since the threshold >can be set at will by software inside the PIC. > >Are there any schematics available on how to connect >a microphone to the A/D port of a PIC? Do I need a >pre-amp? What else would I need? > >Thanks in advance. > > Hisham. One solution occured to me. If you want to avoid a-to-d the cheapest solution is to use a software pwm and a comparator. Of course this assumes you have enough idle time/interrupts to run PWM. The rectified audio signal is used to charge one RC system, and the pwm from the PIC to charge another. The comparator simply compares the two values. If you already have an op-amp to amplify the microphone you could probably replace it with a dual op-amp for only a few cents, then use the second op amp as a comparator (no feedback, but beware of offset voltages). Using a quad op-amp would allow you to use one as a precision rectifier too. Just my early morning musings, Keith. ------------------------------------------------------------ Keith Dowsett "Variables won't; constants aren't." E-mail: kdowsett@rpms.ac.uk or kdowsett@geocities.com WWW: http://kd.rpms.ac.uk/index.htm http://www.geocities.com/CapeCanaveral/Lab/8979