# LCD Keypad Shield for Arduino – IC Station Product Review

We recieved an LCD keypad shield for an Arduino from IC Station in our mailbag this week. This is a great way to add a user interface to your Arduino and I show you how to do that in my review video.

IC Station liked our reviews and have given us a discount code.

Details of the Coupon Code:
(Coupon Code can be used for all items, except the on sale ones.)
Coupon Code: icsois
Discount Amount: 10%
Max Use: 1
No Min Order
Started Date: 8th July, 2014
Ended Date: 9th October, 2014

The first thing we test is the LCd on it’s own and I first tried to download the default “HelloWorld” sketch from Examples – LiquidCrystal menu in the Arduino IDE.

We find that the pins used in the HelloWorld sketch are not those used by the LCD keypad shield the pins for the shield are

• RS – Pin 8
• Enable – Pin 9
• D4 – Pin 4
• D5 – Pin 5
• D6 – Pin 6
• D7 – Pin 7
• D10 – Backlight Control

which means you need to change the line

to

The complete code is as follows

With the LCD working it was then time to understand how the buttons worked. This shield saves pins by creating a network of voltage dividers with the switches as shown in the image.

Each button creates a unique voltage divider which results in a unique voltage at the analogue input A0. Knowing these voltages allows us to test for the voltage and know which pin has been pressed. I measure mine in the video and find that the voltages are

• Right – 0V
• Up – 0.65V
• Down – 1.49V
• Left – 2.33V
• Select – 3.5V

The Arduino has a 10 bit ADC which means when it measures the A0 pin it represents the result as a integer between 0 and 1024. This is because the binary value 1111111111 is 1023 in decimal.

Now that we know the values that will be created we can use them by testing the values for example if the voltage on A0 is less than 66 (133/2) then the button is “Right”. If the value is not less than 66 but it is less than 219 (133+((305-133)/2) the the button is Up and so on for the other buttons.

The second piece of code used in the review video tests the buttons of the keypad shield. This code was written by a guy called Mark Bramwell in 2010 and can be found here. The values he uses are close to those I measured so I didn’t modify his code and it is shown here.

The final code snippet used to drive the excavator is made from sections of code from the last piece of code.

If you have suggestions on how to improve the code please let us know either here or in the RC Tractors Forum it would be great to have suggestions.