Arduino Display Shield

Introduction-

Gizmotz Arduino Display Shield has a 2×16 alphanumeric display (two rows and sixteen columns) which can be mounted over an Arduino UNO board to serve the projects requiring a display. It helps one to go a step further in programming with Arduino by providing facility to attach sensors and displaying their values over the display.

arduino

Description:-

This shield contains-

  • Two independent push buttons S1, S2– These facilitate digital input at pins 6, 7. These can be used to perform different tasks on press of different buttons.

  • A potentiometer– This is used for contrast control of display

  • Six independent Analog input terminals with separate VCC, GND pins– These are used for attaching sensors and displaying their values.

This shield is very simple to use as you don’t need to mess-up with wires and connectors (except for sensors). Just fix it over the Arduino Uno board and start using it.

Sample code for the components over the Arduino Display Shield-

arduino2

arduino3

Arduino sketch

/*
This sketch reads output of LM35 temperature sensor at analog pin A1, converts it to degree Celsius and Fahrenheit and displays it over the LCD according to the state of switches on the shield

The circuit:
* LCD RS pin to digital pin 12
* LCD Enable pin to digital pin 11
* LCD D4 pin to digital pin 5
* LCD D5 pin to digital pin 4
* LCD D6 pin to digital pin 3
* LCD D7 pin to digital pin 2

*/

#include

// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
int s1=6,s2=7; //define switches’ pins
boolean button1=’FALSE’; //variable to hold switch1 value
boolean button2=’FALSE’; //variable to hold switch2 value

void setup()
{
//set switch pins as input
pinMode(s1,INPUT);
pinMode(s2,INPUT);

// set up the LCD’s number of columns and rows:
lcd.begin(16, 2);
lcd.print(“Arduino Display”);

}

void loop()
{
//read the status of switches
button1=digitalRead(s1);
button2=digitalRead(s2);

int temp = analogRead(A1);

temp = temp * 0.48828125;
int temp1=int(temp);

//take decision according to switch condition
if((button1==1)&(button2==0)) //Display temp in degree Celsius
{
lcd.clear();
lcd.setCursor(1, 0);
lcd.print(“Temp(C)=”);
lcd.print(temp1);
delay(500);
}

if((button1==0)&(button2==1)) //Display temp in degree Fahrenheit
{
int tf=(temp1*1.8)+32;
lcd.clear();
lcd.setCursor(1, 0);
lcd.print(“Temp(F)=”);
lcd.print(tf);
delay(500);
}
}

All the products displayed in this tutorial can be purchased from following links. Just click and shop:

1. Arduino Display Shield
2. LM35 Temperature Sensor
3. Breadboard
4. Male to Female Jumpers
5. Arduino UNO R3

Comments