I'm currently attempting a project that requires the use of three DC motors and an LCD display. I'm all but set on using an Arduino and the motor shield from ladyada for this project, but I can't find any information on using the motor shield AND an LCD on the same Arduino board.
Does anyone out there with any motor shield experience know of an LCD that will connect to the Arduino+motor shield configuration without too much hassle?
I've searched the forum and one individual has taken to using i2c and two arduinos to achieve this goal, but I was hoping to keep cost down by using just one Arduino. Any thoughts?
I didn't think the motor shield used that many outputs from the Arduino... in which case, there is no problem running a 4-bit LCD interface.. You need about 6 pins for the LCD.. 4 for the 4-bit interface, an enable pin and an RS pin. The enable tells the LCD to listen to the data coming in and the RS selects data or command mode when it is toggled. The RW pin can just tie to ground and the rest of the pins are +5v, Gnd and a trim resistor for the LCD contrast/bias.. they don't use up any pins for those features.
Unless you modify the 4-bit library(easy to do), it is coded to use d4-d7, d8, d9, etc.. You're best to use d4-d7 for the 4-bit port as you want 4 contiguous pins for ease of coding..
The biggest issue is that some shields cover ALL of the pins on the arduino board.. so unless it has pass-thru connectors to allow you access to the unused pins, that may create a small issue trying to tie in other parts..
Look at the spec sheet for the motor shield you are using and see what features it offers/needs.
Thanks for all the good advice, dnear1. I'm totally new when it comes to the Arduino thing. I'm also asking questions before I purchase the device because I don't want to end up purchasing something that won't be able to accommodate all my needs. So when I say 'seems like it will work', I'm basing that off of online sources and not something I'm holding in my hands.
I believe this will work since it leaves the digital pins I need free, and I think I can get to 5V and GND terminals for the contrast and LCD power easily enough. If anyone sees any glaringly obvious reasons why it won't work, please let me know.
Thanks for the input...seeing as I'll also be needing at least a thermister and IR rangefinder for my project, I may end up having to go the i2C route. I might also abort the LCD approach and try to find an alternate solution....perhaps just reading the data to a computer via a USB connection after the robot has performed its duties instead of writing the data to an LCD.
I'm going to show what a hardware noob I am now. Is there any type of LCD I could use that would take less than 6 pins? A 16X2 would be convenient, but I think I could away with a 16X1. Would less rows = less pins or is that just wishful thinking? In considering the sensors I need to use. I think I'm going to need at least 4 I/O pins. Seeing as I have 8 left over after the motorshield (2 digital 6 analog) and it will take 6 to control the 16x2 display, I'm going to come up just short...
I've seen some tutorials on i2C, so I think it's something I can figure out. If not, I know I can always come here if/when I get stuck :).
Thanks for the link grinan. This looks like a good solution for me since I'm coming up just short on pins with the current setup. Also the fact that you can get it fully assembled for under $20 is a big plus as well. I'll do a little more reading on it later tonight.
When you start running out of pins, don't forget about the Sanguino board recently developed by the RepRap people: http://sanguino.cc/
It can almost be thought of as Arduino's big brother. The theory is that you make some minor changes to the Arduino development environment and send the same sketch you used with the Arduino and like magic you have more pins and more space for your sketch. I haven't tried it out yet, so I don't know how hard it is to get one up and going.
To add a little bit of closure to this thread, I got the LCD kit from moderndevice.com and the motor shield from Adafruit this weekend. I soldered both and got them each up and running individually using the Arduino.
The LCD kit looks and functions fantastically. Also, Paul at moderndevice.com is a great help and answers e-mails very promptly.
When I tried to interface all three components (arduino, motor shield, and LCD kit) I got an error that my USB device was drawing too much current. This didn't really surprise me consiering how much I was trying to power of a 5V USB supply. I'll power the motorshield externally using a 12V DC supply tomorrow and see if it resolves the issue.
In short, though..check out this LCD kit if you need a pin saving solution. It's great!