3
\$\begingroup\$

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.

\$\endgroup\$
3
\$\begingroup\$

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.

\$\endgroup\$
0
\$\begingroup\$

I have Ethernet shield and LCD shield similar to yours and mines conflicted on two pins. (I think it was 10 and 4, (CS for eth and SD)) What I did is I bought a protoshield for Arduino, put it between ethernet shield and LCD shield and rewired pins 10 and 4 from LCD shield to the unused pins 2 and 3 on the ethernet shield. It nicely stacks on top of each other, in addition I cut a rectangle off this shield where ethernet connector is, so they fit together nicely without having LCD leaning on the ethernet connector (because the connector is too big), I also got a platform to connect all my sensors.

So after you got them running individually, check in your code which pins you are using and if they are conflicting. If yes, do what I did and if no, still do what I did, because you don't want your LCD leaning against ethernet shield anyway

\$\endgroup\$
-1
\$\begingroup\$

I had the same issue. To clarify the conflict is with pin D4 and D10, not pin 4 etc. This took me a while to figure out, because I was looking for a pin 4.. Maybe I am slow. I used a proto- shield between the Ethernet card and the display, rerouted D4 to D2 as others suggest. The modification required in your code is LiquidCrystal lcd(8, 9, 2, 5, 6, 7), where 2 replaces 4. Pin D10 is used for backlight control on the Stainsmart display. So at first, I left D10 disconnected which keeps the backlight on all the time and I left the code update for later...good luck, Rick

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.