Electronic – arduino – How to connect multiple shields to the arduino and have them all function

arduinoarduino-shield

I'm sorry if these are stupid questions but with my little knowledge about this stuff I don't really know any better.

My project is basically just a data logger storing the output from 3 accelerometers.

I picked up a Arduino Mega, 3 ADXL-335 accelerometers, and a Ethernet shield.

I also had some fun playing with a SainSmart LCD keypad
http://www.sainsmart.com/module/lcd-module/sainsmart-1602-lcd-keypad-shield-for-arduino-duemilanove-uno-mega2560-mega1280.html

I had all of them working individually. My question is how to making them all work together. With the shields I am not sure what pins they are using and what are available. Can I stack the LCD on top of the Ethernet shield? Kind of afraid just to wire it all up before knowing if I'd hurt anything.

So in short can I connect 3 Accels, SD card, and a LCD screen to 1 Mega and make them all coexist nicely?

If there is a better hardware combination then what I have please let me know.

Best Answer

The ethernet shield is SPI. A quick look at the schematic for the LCD shows that the pins it uses don't conflict with the SPI ethernet pins, except that pin 4 is used as the SS pin for the SD card on the ethernet shield. You have to deal with this. You might be able to cut the track on the LCD shield to pin 4 and wire it to another pin. You'd also have to change the LCD software.

The LCD shield uses analog pin 1 for the buttons, so pick other analog pins for the accelerometer.

Adafruit.com have an LCD 'backback' that allows you to drive those 16x2 displays from I2C or SPI, which reduces pin conflicts.

This is good shield resource http://shieldlist.org/ and it lists the pins for each shield.