image1 image2 image3

HELLO I'M LiNuS|WELCOME TO MY PERSONAL BLOG|I LOVE TO DO CREATIVE THINGS|I PRESENT MY WORKS ON VLSI AND EMBEDDED

DISPLAY UNITS INTERFACING


Interfacing LCD and Seven segment display units to Arduino(Micro-controller)

We will be ahead with
  1. Why Display Units are Required?
  2. What is LCD and 7 segment display?
  3. How to Interface LCD module?
  4. Coding for LCD.
  5. How to Interface 7 segment display module?
  6. Coding for 7 segment display
  7. Working/Implementation video.
1.Why Display Units are Required?


                             Display Units acts as interface between the Hardware world and the Human world. The Display Units tries to convey the information from Hardware to the Outer world. When ever feedback is there then it can be seen on Display units. For showing the results of a task performed by machines to outer world then the Display Units are required. Display Units show the message from Hardware language to human digestible language. Some display units are
  1. Cathode ray tube, a type of vacuum tube used for information displays (monitors or TVs) or oscilloscope.
  2. liquid-crystal display (LCD) is a flat panel display, that uses the light modulating properties of liquid crystals. Liquid crystals alter the existing light instead of emitting. 
  3. seven-segment display (SSD), or seven-segment indicator, is a form of electronic display device for displaying decimal numerals that is an alternative to the more complex dot matrix displays.

2.What is LCD and 7 segment display?
             
                    LCD : We use the 16 * 2 array type LCD display module. It can display the alphanumeric values and several character sets. The pin configuration is as follows:
      
 This module has three special pins
                         1.RS(Register select)pin  - Selects registers.  
                                   - 0: Instruction register (for write) Busy flag: address counter (for read)   
                                   - 1: Data register (for write and read)
                         2.R/W pin - selects Read when 0 and Write when 1
                         3.E pin - Enables read or write operations.

         DB0 - DB7 are Bidirectional tristate data bus pins.

for more details refer:

1.http://www.picaxe.com/docs/led008.pdf
2.https://www.sparkfun.com/datasheets/LCD/HD44780.pdf
3.https://www.sparkfun.com/datasheets/LCD/ADM1602K-NSW-FBS-3.3v.pdf
4.http://www.ics.uci.edu/~givargis/cs145/resources/lcd.pdf


                 7 segment display: These are used to display the characters by glowing the LED's. These are available mainly in two configurations:
                                        1. common cathode(cc)
                                        2. common anode(ca)


By programming the a,b,c,d,e,f,g pins we can display the required characters.

For more details refer:

1.http://datasheet.sparkgo.com.br/LD3361BS.pdf
2.http://ecee.colorado.edu/~mcleod/pdfs/IADE/lectures/ECEN%201400%20Lecture%2015%20Seve    n%20Segment%20Display.pdf
3.http://hibp.ecse.rpi.edu/~connor/education/IEE/lectures/Lecture_7_digital_display.pdf
4.https://www.sparkfun.com/datasheets/Components/LED/7-Segment/SFE-0012-DS-7segmentSerial-v41.pdf


3.How to interface LCD module?

   1.  At first,have a look on the circuit 



   2.  This LCD module can be worked in two different modes - 4 bit mode & 8 bit mode. The circuit         shown above is 4 bit mode i.e, the higher data bus pins DB4-DB7 are connected to the digital             pins 4,5,6,7. 

   3.  Prior to coding we need a header file to be included in our code which specifies about the liquid        crystal libraries. The library is "<LiquidCrystal.h>".
   4.  Let us see coding part : code to display the text" STUDENT BASED PROJECTS"

4.Coding for LCD:

Without Scrolling:
#include <LiquidCrystal.h>
LiquidCrystal linu(2, 3, 4, 5, 6, 7); //pin2&3 are RS and Enable pins
void setup() {
  // Initialising the LCD 16*2 array
  linu.begin(16, 2);

}

void loop() {
  // This appears on Display unit
   linu.print("STUDENT BASED");
   linu.setCursor(8,1);// sets the cursor to the second row
   linu.print("PROJECTS");
   
   delay(5000);
  //since loop repetedly occors & after 5 sec display clears 
   linu.clear();

}


With scrolling:

#include <LiquidCrystal.h>
LiquidCrystal linu(2, 3, 4, 5, 6, 7);
void setup() {
  // Initialising the LCD 16*2 array
  linu.begin(16, 2);
//displays the following content
  linu.print("STUDENT BASED PROJECTS");
}

void loop() {
  // scrolling is done at 350milliseconds speed repeatedly
   linu.scrollDisplayLeft();  
   delay(350);

}

5.How to Interface 7 segment display module?

    1.  At first,have a look on the circuit 

      2. The seven segment used in the above was Common Cathode configured. Black Wire = Ground.

      3. By programming the Pins of seven segment a,b,c,d,e,f,g , we can display the alphanumeric's on          the display units. 
        
      4. Let us see the coding part: to display " 0 to 9 ".

6.Coding for 7 segment display:

int a[ ]={52,50,42,31,32,24,28};
void setup() {
  // initializing pins to output mode
pinMode(a[0],OUTPUT);
  pinMode(a[1],OUTPUT);
  pinMode(a[2],OUTPUT);
  pinMode(a[3],OUTPUT);
  pinMode(a[4],OUTPUT);
  pinMode(a[5],OUTPUT);
  pinMode(a[6],OUTPUT);
}

void loop() {
  // display digit 0
 digitalWrite(a[0],HIGH);
 digitalWrite(a[1],HIGH);
 digitalWrite(a[2],HIGH);
 digitalWrite(a[3],HIGH);
 digitalWrite(a[4],HIGH);
 digitalWrite(a[5],HIGH);
 digitalWrite(a[6],LOW);
 delay(3000);
 // display digit 1
 digitalWrite(a[0],LOW);
 digitalWrite(a[1],HIGH);
 digitalWrite(a[2],HIGH);
 digitalWrite(a[3],LOW);
 digitalWrite(a[4],LOW);
 digitalWrite(a[5],LOW);
 digitalWrite(a[6],LOW);
 delay(3000);
 // display digit 2
 digitalWrite(a[0],HIGH);
 digitalWrite(a[1],HIGH);
 digitalWrite(a[2],LOW);
 digitalWrite(a[3],HIGH);
 digitalWrite(a[4],HIGH);
 digitalWrite(a[5],LOW);
 digitalWrite(a[6],HIGH);
 delay(3000);
 // display digit 3
 digitalWrite(a[0],HIGH);
 digitalWrite(a[1],HIGH);
 digitalWrite(a[2],HIGH);
 digitalWrite(a[3],HIGH);
 digitalWrite(a[4],LOW);
 digitalWrite(a[5],LOW);
 digitalWrite(a[6],HIGH);
 delay(3000);
 // display digit 4
 digitalWrite(a[0],LOW); 
 digitalWrite(a[1],HIGH);
 digitalWrite(a[2],HIGH);
 digitalWrite(a[3],LOW);
 digitalWrite(a[4],LOW);
 digitalWrite(a[5],HIGH);
 digitalWrite(a[6],HIGH);
 delay(3000);
 // display digit 5
 digitalWrite(a[0],HIGH);
 digitalWrite(a[1],LOW);
 digitalWrite(a[2],HIGH);
 digitalWrite(a[3],HIGH);
 digitalWrite(a[4],LOW);
 digitalWrite(a[5],HIGH);
 digitalWrite(a[6],HIGH);
 delay(3000);
 // display digit 6
 digitalWrite(a[0],HIGH);
 digitalWrite(a[1],LOW);
 digitalWrite(a[2],HIGH);
 digitalWrite(a[3],HIGH);
 digitalWrite(a[4],HIGH);
 digitalWrite(a[5],HIGH);
 digitalWrite(a[6],HIGH);
 delay(3000);
 // display digit 7
 digitalWrite(a[0],HIGH);
 digitalWrite(a[1],HIGH);
 digitalWrite(a[2],HIGH);
 digitalWrite(a[3],LOW);
 digitalWrite(a[4],LOW);
 digitalWrite(a[5],LOW);
 digitalWrite(a[6],LOW);
 delay(3000);
 // display digit 8
 digitalWrite(a[0],HIGH);
 digitalWrite(a[1],HIGH);
 digitalWrite(a[2],HIGH);
 digitalWrite(a[3],HIGH);
 digitalWrite(a[4],HIGH);
 digitalWrite(a[5],HIGH);
 digitalWrite(a[6],HIGH);
 delay(3000);
 // display digit 9
 digitalWrite(a[0],HIGH);
 digitalWrite(a[1],HIGH);
 digitalWrite(a[2],HIGH);
 digitalWrite(a[3],LOW);
 digitalWrite(a[4],LOW);
 digitalWrite(a[5],HIGH);
 digitalWrite(a[6],HIGH);
 delay(3000);
}

7. Working/Implementation video:
      1. Video for LCD interface:



         2. Video for Seven segment display:


        



  
          

       
                












          


                                        
                                          

Share this:

CONVERSATION

0 comments:

Post a Comment