Arduino Dieci 2 Sharp sensors problem

Hey everyone!

Hope you can help me, i have 1 Arduino and 2 IR SHARP sensors, i connected 1 sensor, with mounted capacitors between GND and VCC (100nf, 10000nf), everything is fine, i have good values BUT when i connect the second sensor, both get electrically disturbed. I get strange values from both sensors. What can i do that i get good Values of both sensors with 1 arduino board?

Thank you

What is the part number of the sensors, and how have you connected them to the Arduino?

I use this sensors : Infrared Proximity Sensor Long Range - Sharp GP2Y0A02YK0F - SEN-08958 - SparkFun Electronics , connected them both parallel on the 5V pin of the arduino and the GND pin of the arduino, the output of the sensors go to the analog in pins 5 and 4.

Is it to do with the light interfering? The beams are pretty focussed so it shouldn't be an issue unless you point them at each other, though. Have you got a good 5v, can you check it with a meter when they are both on?

Are you powering the Arduino from USB, from Vin, or from the barrel jack?

Those sensors take up to 33mA and they have an on-board oscillator, so they may interfere with each other if they share the same Vcc and/or ground connections and the connections have significant resistance or inductance. Try using a separate Arduino ground connection for each sensor. Also keep the common +5V Vcc wire short, and give each sensor its own decoupling capacitor between its +5V and its ground connection.

Hi
I have a similar problem with the Sharp GP2YOA21YK IR distance sensor. I first noticed it using two of these on an Mega. I tried decoupling the supplies to the sensors but it did not fix it. The Mega is running off a 7.2volt NiCad pack. I read the analog voltage from the sensor with my electronic mutimeter and got the kind of dist/voltage readings as in the spec sheet.
So I set up on the bench using a UNO, a single sensor and a serial link it worked perfectly giving results you would expect. I added a potentiometer between 5v and gnd and the wiper to another Analog input. The sketch reads both analog inputs (with a delay between) and outputs them serially.
If I turn the pot the reading for the pot changes as would be expected. If I trigger the sensor both analog readings rise, even though I am not adjusting the pot.
I have tried doing a readAnalog then waiting for 100 msec then reading the analog port again to get the value. But I have the same problem.
Swapping the analog pins around has no effect. The Sharp sensor ALWAYS effects the other analog reading. Has anybody else seen this effect?

I think you're going to be stuck setting them up to run off of seperate 5v power supplies. I'm watching intently though, because I have a project that uses 4 sharp IR x 2, and I'd like to avoid having to deal with 8 seperate power supplies just for the Sharps, plus others.

OK further test, disconnected the signal line of the SharpIR from the arduino.
Left the Sharp still connected to the power rails of the Arduino.
If the problem is power line related then triggering the Sharp will still register on the pot input.
Result - it doesn't. I conclude that there is no power related interference between the sharp, the arduino and the pot.

Further test;
Replaced the sharp ir with another pot. We still have the same problem.

Trying to read two pots on analog inputs one value impacts the other. So its not a sharpir problem as I originally thought its an Arduino analog input problem.

Maybe this is not the right post for this.

The Sharp IR sensors fire continuously. Can you get away with "power up A1, read your Sharp, power it down; power up A2, read your pot/Sharp2, power it down"? Does that stabilize your readings?

I'm not sure what you mean "power up" and "power down". There is no enable/disable line on the sensors the only way would be to turn their 5volt rail on and off. The only problem with this is that the sensors take a while to stabilise when powered up and this would delay the whole read process.

windy:
Further test;
Replaced the sharp ir with another pot. We still have the same problem.

Trying to read two pots on analog inputs one value impacts the other. So its not a sharpir problem as I originally thought its an Arduino analog input problem.

Maybe this is not the right post for this.

What value pots are you using? If you use a value greater than about 22k then they will affect each other, unless you take suitable precautions.

Checked the pots. Yes one was a high value. Replaced with a 10k pot and now both seem to work independently.

Thanks for the help. I doubt I would have discovered that on my own.