Go Down

Topic: proximity sensor + electret microphone = no compatible?? (Read 946 times) previous topic - next topic

noxasdj

Hey guys,

I am having a trouble when I connect and infrared proximity sensor (http://www.sparkfun.com/products/242) and an preamplified electret microphone (http://www.sparkfun.com/products/9964).
When I connect the sensors separately, they work perfect, but when I connect both together the electret microphone reads signal of 1023 (5V) at all time.

Do I have to get the voltage from different power sources? That would be very weird.

Thanks,

Here I leave you the electret mic sketch to read the signal if its necessary.

Code: [Select]
const int micPin = A2;   
int valueMic = 0;
int valueMicMax = 512;
int valueMicMin = 512;

void setup() {
  Serial.begin(9600);
}

void loop() {
  for (int i =0; i < 100; i++){
    valueMic = analogRead(micPin);
    if (valueMic > valueMicMax){
      valueMicMax = valueMic;
    } else {
     if (valueMic < valueMicMin){
      valueMicMin = valueMic;
      }
    } 
  }
  valueMic = valueMicMax-valueMicMin;
  Serial.println(valueMic);
  valueMicMax = 512;
  valueMicMin = 512;
}




MarkT

How are you wiring them up exactly?  Your code doesn't mention the proximity sensor.
[ I won't respond to messages, use the forum please ]

noxasdj

They've been wired normally. 3 pins for each component. Voltage,ground and analog in. proximity sensor is in A1 and microphone in A2
The code is just for the electret microphone as I said before. Because the problem appears when I wire the proximity sensor at the same voltage line of the microphone.

terryking228

Hi,

Possibility: The Infrared sensor uses relatively high powered pulses at 38 KHz.  Maybe that signal is getting into the microphone preamplifier.  Try temporarily putting a capacitor across the microphone terminals.. maybe .1 uF or so. It will hurt the high frequency audio response, but if it makes a big different you are on the right track..

I would also add a larger capacitor (10 uF or so) right at the voltage supply terminals of the microphone.

If you had an oscilloscope or access to one you could trace what signal is getting in to the Mike / amplifier.


Regards, Terry King terry@yourduino.com  - Check great prices, devices and Arduino-related boards at http://YourDuino.com
HOW-TO: http://ArduinoInfo.Info

Go Up