(SKU:RB-01C020)LCD1602 Keypad Shield v2.0 For Arduino

From ALSRobot-Wki
Jump to: navigation, search
Arduino LCD 1602 Keypad Shield01.jpg

Contents

overview

This ALSRobotBase LCD1602 keypad shield v2.0 for Arduino collect all the advantages of many shields at home and abroad. to provide a user-friendly interface that allows users to go through the menu, make selections etc. It consists of a 1602 white character blue backlight LCD. The keypad consists of 5 keys — select, up, right, down and left. To save the digital IO pins, the keypad interface uses only one ADC channel. The key value is read through a 5 stage voltage divider.

2015 new update PCB with immersion gold process, mainboard adopt new high-quality 2 lines16 characters LCD, not only has the contrast adjustment knob, the backlight selector switch, 4 direction keys, 1 select keys and a reset button, four sensor analog interfaces , RB URF v1.1 ultrasonic sensor interface, bluetooth module interface, APC220 wireless digital communication interface, easy-to-use for independent expansion. For beginners of Arduino, the 1602 LCD Keypad Shield v2.0 in the true sense will simplify the circuit. Inserting it into Arduino-compatible Duemilanove controller directly, a 3p sensor connecting line to connect, the sensor data records will be displayed easily.

Technical parameters and performance

1 module size: 20.5mm x 41mm
2 module weight: 57g

1602 character LCD

1602LCD main technical parameters

1 display capacity: 16 x 2 character
2 chip operating voltage: 4.5 - 5.5V
3 working current: 2.0mA (5.0V)
4 module best working voltage: 5.0V
5 character size: 2.95 x 4.35 (W * H) mm



Pin definition

1602LCD uses a standard 14 pin (no back) or 16 pin (with back light) interface, each pin interface is shown in the following table:

Arduino LCD 1602 Keypad Shield02.jpg

First feet: VSS for ground power supply.
Second foot: 5V positive power supply VDD.
The 3 foot: VL is a liquid crystal display contrast adjustment end, connected to the positive power supply when the contrast is the weakest, grounding contrast highest contrast is too high will lead to "ghosting". When in use can be through a 10k potentiometer to adjust the contrast.
Fourth feet: RS as a register selection, high power usually select data registers, low power usually select the instruction register.
Fifth feet: R/W to read and write signal line, high power usually read operation, low power usually write operation. When RS and R / W for low usually can be written instructions or display the address. When the RS for the low level of R / W is high can usually read busy signal, when RS is high level R / W low usually can write data.
Sixth feet: E end for the E, when the end of the high level of the jump into a low power, LCD module to execute the command.
Seventh to 14 feet: D0 ~ D7 for 8 bit data lines.
Fifteenth feet: back light source cathode.
Sixteenth feet: back light source negative.

1602LCD instruction

1602 LCD module inside the controller a total of 11 control instructions, as shown in the table below:

Arduino LCD 1602 Keypad Shield03.jpg

1602 LCD module read and write operations, the screen and the cursor is achieved through programming instructions. (Description: 1 for the high level, 0 for the low level)
Instruction 1: clear display, instruction code 01H, cursor reset to address 00H location.
Instruction 2: the cursor is reset and the cursor is returned to the address 00H.
Instruction 3: cursor and display mode setting I / D: cursor moving direction, right shift of the high level, low level left shift shifts to the left or right shift of the Sheldon: on the screen all the text to take it. High level representation is valid, low level is invalid.
Instruction 4: display switch control. D: display the overall control of opening and closing, high level said the open display, low level expressed concern that C: cursor control opening and closing, high level said cursor, low level said no cursor B: control the cursor flashing, high level flashing and low level does not blink.
Instruction 5: cursor or display shift S/C: high power usually displayed by the text, low power usually move the cursor.
Instruction 6: set command DL function: high electricity at ordinary times for the four bus, low power usually 8-bit bus N: low electricity at ordinary times for single line display, high power usually double display F: low power usually display 5x7 dot matrix characters, high electricity at ordinary times display 5x10 dot matrix characters.
Instruction 7: character generator RAM address setting.
Instruction 8:DDRAM address setting.
Instruction 9: read the busy signal and the cursor address BF: for the busy flag bit, the high level is busy, the module can not receive the command or data, if the low level is not busy.
Instruction 10: write data.
Instruction 11: read data.
The chip timing table compatible with HD44780 is as follows:

Arduino LCD 1602 Keypad Shield04.jpg

Read operation sequence diagram

Arduino LCD 1602 Keypad Shield05.jpg

Write operation sequence diagram

Arduino LCD 1602 Keypad Shield06.jpg

1602LCD general initialization (reset) process

Delay 15mS
Write instruction 38H (not detected busy signal)
Delay 5mS
Write instruction 38H (not detected busy signal)
Delay 5mS
Write instruction 38H (not detected busy signal)
After each write instruction, read / write data operations are required to detect the busy signal
Write instruction 38H: display mode set
Write instruction 08H: show off
Write command 01H: display screen
Write instruction 06H: display the cursor move set
Write instruction 0CH: display and cursor settings

Functional diagram of LCD1602 Arduino character LCD

LCD1602 Arduino character LCD expansion board v2.0 test

Delay 15mS
Write instruction 38H (not detected busy signal)
Delay 5mS
Write instruction 38H (not detected busy signal)
Delay 5mS
Write instruction 38H (not detected busy signal)
After each write instruction, read / write data operations are required to detect the busy signal
Write instruction 38H: display mode set
Write instruction 08H: show off
Write command 01H: display screen
Write instruction 06H: display the cursor move set
Write instruction 0CH: display and cursor settings

Functional diagram of LCD1602 Arduino character LCD

Arduino LCD 1602 Keypad Shield07.jpg

LCD1602 Arduino character LCD expansion board v2.0 test

We use Arduino controller to do a test, to use the hardware device as follows:
1. Arduino Controller x 1
2. LCD1602 Arduino character LCD expansion board v2.0 x 1
3. URF v1.1 RB ultrasonic sensor module x 1
4. 4P ultrasonic sensor connection line x 1
5. USB data communication line x 1

Arduino LCD 1602 Keypad Shield08.jpg

Below for the key test, Arduino experiment code is as follows:

#include <LCD4Bit_mod.h> 
LCD4Bit_mod lcd = LCD4Bit_mod(2); 
char msgs[5][15] = {   "Right Key OK ", 
                    "Up Key OK    ", 
                    "Down Key OK  ", 
                    "Left Key OK  ", 
                    "Select Key OK" };
int  adc_key_val[5] ={30, 150, 360, 535, 760 };
int NUM_KEYS = 5;
int adc_key_in;
int key=-1;
int oldkey=-1;
void setup() { 
  pinMode(13, OUTPUT);  
  lcd.init();
  lcd.clear();
  lcd.printIn("KEYPAD testing... pressing");
}
void loop()
 {
	adc_key_in = analogRead(0);   
  digitalWrite(13, HIGH);  
  key = get_key(adc_key_in);
	
	if (key != oldkey)		
	{
    delay(50);		
		adc_key_in = analogRead(0);  
    key = get_key(adc_key_in);		    
    if (key != oldkey)				
    {			
      oldkey = key;
      if (key >=0){
      lcd.cursorTo(2, 0);  //line=2, x=0
  			lcd.printIn(msgs[key]);
      }
    }
  }
  digitalWrite(13, LOW);
}
int get_key(unsigned int input)
{
	int k;
  for (k = 0; k < NUM_KEYS; k++)
	{
		if (input < adc_key_val[k])
		{
         return k;
      }
	}
   if (k >= NUM_KEYS)
     k = -1;
   return k;
}

Function code, press the select button to display the select key OK, press the right button to display the right key OK, press the left button to display the left key OK, press the up button to display the up key OK, press the down button to display the Keydown OK, press the reset button to display the KEYPAD testing... By.

Product recommendation

Buy address:LCD1602 Keypad Shield v2.0 For Arduino

Personal tools
Namespaces

Variants
Actions
Navigation
Tools