Multiple infrared proximity sensors and Arduino

I am wondering if it's possible to connect multiple infrared proximity sensors as this one IR Distance Sensor - Includes Cable (100cm-500cm) [GP2Y0A710K0F] : ID 1568 : $29.95 : Adafruit Industries, Unique & fun DIY electronics and kits to an arduino uno. I would need to connect 5 of them pointing in different directions.

Should i use an external power supply for each of them to be sure they are all running at 5V? Should i be aware of something else or it should be just plug and play as if i was using just one sensor? Thank you very much for your support. Any suggestion is higly appreciated!

The device draws approx 50nA unless ranging, then the peak is 350mA. They are analog devices with Vcc max as 7.0V... For Arduino do not run Vcc higher than 5.0 Volts.

Uno has 6 A/D so it can handle 5 with no problem, poll each in software.

I would run the Uno and sensors from same high-quality 5 Volt supply, rated at 1.5A constant current or higher. Do not run from USB power. Add a more powerful power supply if you attach relays, etc. For alarm conditions.

Hello mrburnette and thanks for the quick answer.
Could you please explain what do you mean by

poll each in software

and what do you mean with

I would run the Uno and sensors from same high-quality 5 Volt supply

You want to say that i have to use one 5V power supply for each sensor and one for arduino (so 6 in total)? I am not going to use any other sensor or relays other that those 5 infrared ones.

Hope you can answer back, thanks

A connection diagram like the one attached should work in your opinion?

EDIT:
Added.
In your graphic, you are combining all of the output signals from each sensor - this is not correct.
You parallel the power (as you have done) but each of the sensor outputs must go to a separate input on the Arduino... A0, A1, A2... etc.

Then, in your sketch, read the analog value of A0 and store it. Read the analog value of A1 and store it... continue until all sensors are read. Then process the data.
The basic concept for 1 analog device is shown here:

For more than one analog device, just use the above as a template, but use different variables. Remember, you must declare your separate variables before you can use them... just as the example above did with
int analogPin = 3;
UNO has six analog inputs: A0 - A5
![](http://int analogPin = 3;)

Hello mrburnette and thanks for the quick answer.
Could you please explain what do you mean by
Quote
poll each in software

and what do you mean with
Quote
I would run the Uno and sensors from same high-quality 5 Volt supply
You want to say that i have to use one 5V power supply for each sensor and one for arduino (so 6 in total)? I am not going to use any other sensor or relays other that those 5 infrared ones.

Poll each in software is simply you will check the sensor on A0, then check the sensor on A1, then check the sensor on A2.... at the end of the checks, you loop back up to A0 and repeat. No interrupt routine(s) are required.

I would run the Uno and sensors from same high-quality 5 Volt supply...
One power supply. Not one for the Arduino and many for the sensors. This ensures that the reference voltage inside the Arduino and the voltage to the sensors are all on the same "reference plane." It also eliminates ground loops and other possible interference. The exception would be if you had a sensor which was at a great distance from the Arduino... it may be more convenient to use a local 5V supply, but this does introduce some issues with calibration of the signal; especially since the analog signal is not linear. Personally, I would use maybe a 220uF capacitor on each sensor between +5V and Gnd if the wiring between the sensor and the Arduino is greater than 1 meter or so. When the IR LED fires on the sensor, the current will jump to 350+ mA, so the (bulk) capacitor will help with voltage stabilization. If you do it for one, do it for all.

Ray

Ray thank you so much for your quick and useful answer, you gave me precious informations!
In my drawing all the sensors are connected to different inputs (yes i agree in the picture it doesn't seem like so) so everything is correct except the missing capacitor.
Could you confirm that the updated drawing is ok (i have never worked with multiple capacitors so i'm not sure about that)?

Thank you very much again!

Your drawing looks correct.

Multiple capacitors are NOT needed in this solution. Were you to make the sensors remote by more than a meter, then I would recommend that each have a bulk capacitor at the sensor to stabilize voltage drop from the wiring. This is simply not necessary when everything is in close proximity.

Ray