Standalone LCD project

When I first ordered my Arduino I also picked up a Parallel 16x2 LCD. After a bit of reading I had it up and running and working as designed. One thing I wasn't prepared for was the amount of pins the thing used.

Fast forward to today, I've decided that a fun project would be to make a standalone "LCD Controller" by mounting the LCD and an Atmega168 (and the related hardware) on a circuit board. I'm thinking I should be able to use my Arduino to connect to my controller via 1 or 2 pins and be able to send instructions to control the lcd.

My question is, what is the easiest way for me to communicate between two Arduinos? (The LCD Controller will basically be a stripped down Arduino) I assume there are some pre made Arduino libraries that will help me out here? :slight_smile:

I guess I should clarify, I've read of a few different methods of inter Arduino communication, I'm just looking to find out which is the most common/easiest to use.

I would use Serial.
But, you could implement more protocols [i2c/TWI/OneWire/...] :slight_smile:

[ SparkFun Serial Enabled LCD Backpack - LCD-00258 - SparkFun Electronics ]

I basically want to make my own version of that.

How would I go about implementing serial communication between the two?

Break you problem down to easier milestones.

I suggest something like:

  • Being able to successfully control an LCD
  • Learn how to listen for Serial data: Tutorial
  • Make the letters recieved on the Serial appear on the LCD
  • Design a protocol on how to control things like line,x|y position, brightness etc etc. I think you might be best off implementing an existing protocol/API [like the SerLCD]
  • Implement the protocol
  • Profit :wink:

Just connect Tx from Arduino 1 to RX on Arduino 2, and Rx from arduino 1 to tx on Arduino 2 and connect the grounds of the two Arduinos.

If the communication is strictly one way you probably do not need Rx from arduino 1 to tx on Arduino 2

MikMo - That's what I was thinking, thanks for confirming!

AlphaBeta - I think I'm ready to profit now haha

I think you should go with i2c, and have a 4 dip switch or something, so you can set the address. With i2c you can use alot of extra components with just the 2 i2c lines. So you could use it with multiple chips, having them sending data to the slave i2c (your chip). i2c is damn easy to use too, I connected 2 arduino's for my first test.. then I connected 5 total without any problems!

http://www.arduino.cc/playground/Learning/I2C

See, I like the idea of using i2c as well simply for the educational aspect of it. Serial is kind of boring. Thanks for the links.

Quick question... will an atmega168 + lcd require it's own 5V power supply or is piggy backing off the Arduino +5v sufficient?

You can piggy back it, there is not much current drawn. Are you using the back light? If so don't forget to include a resistor.

I came across this,a cheap way to interface a standard parallel interface LCD to an arduino using only 3 pins and a shift register chip :

http://www.arduino.cc/playground/Code/LCD3wires

(originally I came across it for PICAXE microcontrollers, some of which are severely pin challenged, but then found someone had done it for Arduino too)

The arduinos 5v should handle it fine, I'm able to run 5 atmega 8s blinking led's with a 20x4 lcd with just the USB power.

I've been curious and a bit anxious to try something like this, but I don't have much experience with the i2c.. working in the Wire commands is still a bit confusing for me, but seems to be the best bet.