extending arduino pins

Hi guys,

I have an arduino Mega first of all and i am going to connect 10sensors like this:

[Ground] ---- [10k-Resister] -------|------- [LDR] ---- [+5v] | Analog Pin

So basically i need 10 analog pins which is found on the mega so it is OK. But when it comes to ground the mega have only 2 and only 5V supply.

So how can I connect 10grounds and 10 (5V) supply to all these sensors?

I was thinking of using an external breadboard? or Maybe the prototype shield but i dunno its use exactly.

so please someone experienced help me out abit please. :(

Use a breadboard then after that, design a pcb :). I'm making a shield that can connect 8 servos and 6 analog inputs

I was thinking of using an external breadboard? or Maybe the prototype shield but i dunno its use exactly.

Yes, a proto-shield is the best way to 'fan-out' more ground and +5vdc connection points for your connections, as well as mounting space for your fixed resistors. Not sure if your LDR will be externally mounted but they could wire to the same shield or be mounted on it.

Note that to gain access to all 10 analog input pins you need, you will have to use a shield designed to interface with the 'expanded I/O pins' that the Mega board has. That is, you require a Mega proto-typing shield rather then the more common standard Arduino proto-shields. Here is one example:

http://www.sparkfun.com/commerce/product_info.php?products_id=9346

Lefty

Another alternative would be a small piece of stripboard (aka Veroboard).

Yes, a proto-shield is the best way to 'fan-out' more ground and +5vdc connection points for your connections, as well as mounting space for your fixed resistors. Not sure if your LDR will be externally mounted but they could wire to the same shield or be mounted on it.

Note that to gain access to all 10 analog input pins you need, you will have to use a shield designed to interface with the 'expanded I/O pins' that the Mega board has. That is, you require a Mega proto-typing shield rather then the more common standard Arduino proto-shields. Here is one example:

http://www.sparkfun.com/commerce/product_info.php?products_id=9346

Lefty

another question about the proto-typing shield... from the pictures i can't quite see how i can get more grounds and +5v supplies :-[ to me ,that shield seems to re-extend the board pins from below 'only'.. so that means i need a mini breadboard too in the middle?

Yes. Its very convenient, i basically do all my protoing on this shields.

So basically i need 10 analog pins

Not necessarily - did you consider using a 4051 analogue mux? You'll need three digital pins to drive it, but since there's only one ADC whether you use a Mega or any other Arduino, there's probably very little penalty.

i can't quite see how i can get more grounds and +5v supplies

All you need to do is to wire them up to the same pins.

i can't quite see how i can get more grounds and +5v supplies

There are some solder pads on a protoboard that are wired to the normal Arduino connector pins, and there are many unattached solder pins. So you can 'daisy chain' soldered connections between the normal Arduino ground and power pads to as many unattached pads as you require. You don't really need that solderless board as it doesn't lend itself well for permanent projects, it's best for testing and trying out experimental circuitry.

Lefty