Creating a circuit layout for 6 IR distance sensors?

Hi,
I'm using a conjunction of gp2y0a710k0f and GP2Y0A21YK0F with Arduino Mega. I unfortunately don't have much experience with electronics so I was wondering what was the best way to power these devices. My first thought was to have it powered with the Arduino itself as I've read that each 5v pin can output 800 mA. Given this, I borrowed the circuit layout from here and created my own schematic. Is this a feasible design (will it work)?

I am attaching the schematic and the datasheets. I have not decided on using 6 sensors explicity, but would like to know if it is possible before I commit to buying all of them (I currently ordered two for testing and calibration). Thanks!

sensor_close.pdf (369 KB)

ir sensor datasheet.pdf (411 KB)

Well,you could put 800mA through the standard Arduino header pins but your schematic is missing something important: where does this power come from?

The standard USB plugged into the Arduino can only deliver 500mA because it doesn't request any more from the computer. If it's plugged into a "dumb" charger then the charger will provide more current. If you were running motors continuously at 2A then you would also have to worry about the voltage drop down the USB cable.

If you plug in a 12V power supply to the barrel jack, then the onboard 5V regulator has to do a lot of work to carry this kind of current. It will overheat.

The other thing the schematic doesn't consider is: how does the power get from one 5V pin on one side of the Arduino to the ones on the other side? There are only small traces on the Arduino PCB. Those traces are not intended to power high-current devices. The Arduino is set up to power itself and small sensors. You can't expect to get 800mA out of the 5V pin on the far side of the board without causing problems across the board. I have some designs where I have a small sensor on one side of the board which picks up power from a nearby Arduino 5V pin but everything else has its own power distribution on my PCB.

You have the same problem with grounds too. Don't route ground through the Arduino.

So, you need a power supply to provide the required current and voltage and you need to route that power across your own circuit board and not through the Arduino. Then you don't need VCC1, VCC2, GND1, GND2 and all of that.

It's not clear for me exactly what these sensors need. I opened up the "far" sheet and it says the average power consumption is 30mA. That would seem like you have no problem. However there's a note on page 6 which says that 330mA is the peak current to the LED. Unfortunately you don't directly control when those peaks occur. You could keep all the sensors powered down and only power up one at a time. The datasheet timing diagram says you should wait 25ms after power-up to get the first reading. That could reduce your average power consumption (important for a battery-operated device) and you know that your power supply only has to deal with one device drawing 330mA at a time.

I would imagine that the peaks are pretty short. If the power consumption between peaks is 10mA then the peaks would have a duty cycle of about 6%, or something like 1ms out of every 18. So it would be rare that more than two of the 6 would peak at the same time. Except at startup, then all 6 are going to ping simultaneously. That's the difficult part. Ordinarily you would design for the 6 x 30ma = 180mA and just put in some big capacitors to take care of the peaks. (In this context, 10uF is "big" but it may be beneficial to go up to 10x bigger.) But at startup the supply has to charge all those capacitors and feed the hungry LEDs that are all pinging at the same time.

My recommendation is to use a power supply with at least 1A capacity, preferably 1.5A to 2A. Distribute that to the sensors and the Arduino with reasonably thick PCB traces (about 0.024" wide) and put more than the recommended capacitance close to each sensor. Maybe a 1uF and a 100uF instead of the 0.2uF and 10uF you put on the schematic. Connect the two power pins on each sensor right underneath the sensor.

What is the function of R1 to R6? They look like resistors used to convert a current output to a voltage for the Arduino. You already have a voltage output. They will mess up the voltage output. Delete them. The adjacent stabilising capacitors should be much smaller - in the pF range.