LCDserial Sheild

I just got the PC boards back for my first shield. Its an LCD display board that supports the 2x16 or 4x20 text LCD displays. It can be used standalone or as a shield. It has its own Atmega168/328 processor. It can be used standalone via RS-232 serial, TTL serial or I2C.

It can be used as a shield via serial from pins 0/1 or from the megas extra serial ports. It can also be used via I2C (I havent finished that part of the code yet).

It can be programmed like a standard Duemilanove. I have used every available I/O pin either driving the LCD or reading the buttons

I do plan on making them available but I have not determined a price yet.


More details at

I am impressed. I've been looking for something along these lines for a bit now. If you do make the pcb available i would totally be interested in purchasing one. Do you intend to make the schematic available?

I plan on making it all public. I dont want to publish the schematic until I have had a chance to verify everything.

I had 10 boards made so I do have them available. I still have to test the I2C part. Everything so far is working perfectly.


How are driving the LCD? 8 bit or 4 bit? If you’re using up all the lines, it would seem to indicate you are using 8 bit mode.

This board would be more useful (closer to a Handyboard), if it used the 4 bit interface, and then used a shift register for the buttons, to free up more of the pins for interfacing in “stand-alone” mode.

I will say its a great effort for a “first shield”, though; clean, compact, double-sided - that took some work designing and laying out, no doubt there. I hope you take what I said above as constructive, though - maybe for version 2.0?



Hmm - on second look; maybe you already are using the 4-pin interface (with other pins being used to control the light and brightness/contrast, maybe?); its difficult to tell from the pics released. Maybe there needs to be two shift registers - one for the display and one for buttons…?


My intent was NOT to build an Arduino board. No intention to use it for an actual arduino master board. It is simply a display board (shield).

I am using the 4 bit interface plus the the brightness control, a buzzer, 7 input buttons and the I2C interface. This pretty much takes all of them. The code will fit nicely in the atmega 168. The intent is to keep it simple and cheap. It can be plugged into any arduino and with no modification to any code, what ever is sent out the serial port (Serial.print()) shows up on the display. It supports standard ascii and does not need any special codes to do anything. Baudrate, brightness, and several other settings can be done using the buttons. (hold down buttons 1 and 2 to get into menu mode)

Shift registers are a nice idea if you are trying to build an Arduino cpu board and want to conserve pins. This is an I/O board. It is intended to be used as a shield on TOP OF another Arduino. It also supports the mega extra serial ports.

The reason I built it is because other serial LCD controllers on the market do not support CR/LF and are not open source so you cant change them. They use a PIC chip. My original design goal was a stand alone unit connected via a cable. Once I got going on the design, it cost nothing extra to make into a shield.


That's a very cool project, Mark.

I assume the buttons are each tied to there own digital pin. If you wanted to open up some more pins to add more functionality to the shield you could tie them all to a single analog pin. Doing something like this. Each button will read a different value on the analog pin. This configuration will also allow you to use different button combination to extend the number of available functions.

Analog pin 5 | Ground--1K--|--------|--------|-------|-------| | | | | | btn1 btn2 btn3 btn4 btn5 | | | | | 100 330 680 1K 2.2K |--------|--------|-------|-------|-- +5V

I have found that the value received by the Analog pin can vary buy 2 or 3 points. I've limited to only using 2 button combos since the values get too close together when dealing with 3 and 4 button combos. I'm sure if i change up the resistor values a bit more i can prevent that. With 2 button combination you get unique button combos which should be more then enough for most projects. BUTTONS: VALUES: btn 1 929-931 100 Ohm btn 1 + btn 2 950-951 btn 1 + btn 3 940-942 btn 1 + btn 4 937-939 btn 1 + btn 5 933-934 btn 2 770-771 330 Ohm btn 2 + btn 3 838-839 btn 2 + btn 4 820-821 btn 2 + btn 5 796-797 btn 3 610-611 680 Ohm btn 3 + btn 4 730-731 btn 3 + btn 5 674-676 btn 4 512-513 1K btn 4 + btn 5 607-608 btn 5 318-319 2.2K

This is a little project i recently started on. The goal is to create a nice little library to support these buttons. There is already an AnalogButton library but it puts all the resistors in series from ground and the analog input. So only one button can be IDed at a time.


Thanks for the info, I am probably going to add this to version 2. You deffinately saved me a bunch of work, thanks. Is 5 buttons the limit for one input? I also found a joystick that can be used in the same fashion. I would like to add it to version 2 but I dont think a joystick makes sense on a text only display.


No. You can have as many as you want. The limit is the resistor values. But the more you add the harder it will be to implement button combos. When you press more then one button you are putting the 2 resistors in parallel. If that resistance becomes the same as a resistor on another button you run into a problem. Which is what i have ran into trying to do 3 and 4 button combos. Because there is a 1 to 3 point variation in the values the analog pin picks up its easy for the values to overlap if the resistors, be it single or a pair in parallel, values are close.

EDIT: you could always make a Graphic LCD version. The a joystick with a couple of buttons would be great. Add sound and you have a nice little gaming platform.

I will likely be doing a total rearrangement of what resistors are used.


Yes I plan on doing a Graphics LCD shield, I am working on a processing compatible universal graphics library to go with it.

Let me know when you re-work the R values. I will be starting on rev 2 in a couple of weeks.



I’m at work right now so i don’t have the arduino to test the analog values. But i have been working on the math and it seams with a 1K resistor between the analog pin and ground limits the button resistors to any value between 10 Ohms and 100K Ohms. I would keep the resistors no less then 100 Ohms difference from each other.
I.E. 100, 200, 300… ect.
The wider the gap between resistors the better off you are using button combos.

I also played around with changing the grounding resistor to a different value. If you use a smaller value it limits your available resistors for the buttons. If you use a 100 Ohm grounding resistor then you can’t use any resistor larger then 10K.

Overall you can almost do a full 104 key keyboard. But the code to detact each of those buttons and have an action performed would probably be too big for the Arduino.

If you wanted say 20 Buttons you could easily use this little chart i made.
Resistor Voltage
0 5V
100 4.54V
200 4.17V
300 3.85V
400 3.57V
500 3.33V
600 3.13V
700 2.94V
800 2.78V
900 2.63V
1000 2.5V
1100 2.38V
1200 2.27V
1300 2.17V
1400 2.08V
1500 2V
1600 1.92V
1700 1.85V
1800 1.79V
1900 1.72V
2000 1.67V

Of course this is with a 1K resistor between ground and the analog pin. So this acts as a simple voltage divider. Also it would be easier to get other resistor values rather then trying to keep them 100 Ohms apart.

Here is a new idea for revision 2. Create a 12 button key pad with the single analog pin method and add connection points to add a RFID reader to it. Ads more useful applications to the shield.

EDIT: Found that the AnalogButton library in the playground will work with this. The example given has all the resistors lined up in series but it works with this method of connecting the resistors as well. But doesn't allow for button combos. The Library will need to be edited to add this functionality to it.

Looks great!

Can I also suggest rearranging 4 of the buttons in a directional layout? And hardware debouncing on the board would be great.

Hi all. I am also developing a ks0108 128x64 GLCD interfacing card.

But instead of using pricey components,I just use one cheap 16F628A chip. You can find that chip everywhere. It's poormans GLCD interface. I am using i2c protocol (since 16F628A don't have I2C HW, I use bitbanging). It'is almost done and working. At least I can draw something, Now thinking to modify ks0108 library to make it work with it. The hardest part :)

Mark S, I wonder that if you compleeted porting your library, If you have that libray, I can use it too and could make my Interface to compatible with that libraries i2c routines...Thanks.

I see more and more people that head on working with the I2C interface. That makes me glad, since we can interface many serial devices on just 2 pins with Arduino, instead of using several SoftwareSerial objects and many pins.

I’m not sure if you guys have seen John’s I2C LCD and keypad project. I don’t think he has made a shield, but that isn’t that hard to make. Only one thing I would add to his code, that is regular serial interface, perhaps selectable with a jumper on board. Why? Because sometimes it’s handy to plug it to see the text that is usually sent to the debug window on the PC.

Of course, using a mega168 simplifies the code, I like that, but adds cost to the shield for the same functionality.

Anyway, I’m looking forward to see this project done, I might buy a PCB to give it a try!

Edit: I found this new library, perhaps it’s the way to go for compatibility mode…