Welcome to Scribd, the world's digital library. Read, publish, and share books and documents. See more
Download
Standard view
Full view
of .
Look up keyword
Like this
8Activity
0 of .
Results for:
No results containing your search query
P. 1
Lecture 2

Lecture 2

Ratings: (0)|Views: 279|Likes:
Published by Tanvir Hussain
This is the second lecture sheet supplied at the "Short Course on Electronic Project Design and Fabrication" Jointly organized by IEEE RUET Student Branch and Dept. of EEE, RUET.
This is the second lecture sheet supplied at the "Short Course on Electronic Project Design and Fabrication" Jointly organized by IEEE RUET Student Branch and Dept. of EEE, RUET.

More info:

Published by: Tanvir Hussain on Jul 08, 2010
Copyright:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as PDF, TXT or read online from Scribd
See more
See less

11/09/2012

pdf

text

original

 
Short Course on Electronic Project Design and FabricationShort Course on Electronic Project Design and FabricationShort Course on Electronic Project Design and FabricationShort Course on Electronic Project Design and Fabrication
1
Jointly Organized by: Dept. of EEE and IEEE RUET Student Branch
Lecture 2: LED, Seven Segment display, LCD, Dot matrix, Opto-coupler, Laser, Photo Diode, LDR
LED
LED is acronym of Light Emitting Diode. It is a basic electronic component mainly used as lighting device in manyapplications such as torch light, traffic light, cars head light, cards back light, as indicators in TV, Keyboard, CassettePlayers etc.Now a days, LED is also used in Mobile as back light, in LCD as back light, LED Screen etc. Here we will not go into thedetails of construction but we will only show you the application of LED. If you are interested in learning theconstruction of LED then please see the Reference section for Books name and article citation at the end of this section.
Physical appearance of LED:
LED is tow terminal electronic component. If you look closely thenyou will see that one lead is longer than another led. The longerlead is known as anode or positive lead and the shorter lead iscathode (denoted by K) or negative
Electrical Sysmbol:
In the Figure the electrical symbol of LED is shown. The Coloremitted by a LED depends on which material has been used tomake that LED not on the casing color of the LED.
Basic Circuit to Drive LED:
Here is a circuit to drive LED. Never connect a LED directly across avoltage source (e.g. A battery). Always design a circuit so thatmaximum 20mA current flows through the LED. But it can be(10mA to 20mA). More than 25 mA current for
General LED
willburn out the LED.
LED in Series:
Two or more LED can be connected in series a shown in thefollowing circuit schematic. Here set the value of the resistor insuch that current does not exceed maximum value of the LED.
 Editor:
Md. Mahbub Hasan, EEE-061017, Tanvir Hussain, EEE-061049.
 
Short Course on Electronic Project Design and FabricationShort Course on Electronic Project Design and FabricationShort Course on Electronic Project Design and FabricationShort Course on Electronic Project Design and Fabrication
2
Jointly Organized by: Dept. of EEE and IEEE RUET Student Branch
LED in parallel:
LED’s can be connected as shown in the figure.There are various colors LED are available in the market. All kind of colors LED are available. Red, Green, Blue, Yellow etc. Di color LEDis a three leaded LED. Both common anode and common cathodeare available. RGB LED used for color Display.
LCD
There are various types of LCD. Here we only talk about character LCD. Character LCD are those where only characterscan be shown (some calculator) not the graphics (mobile screen, TV).These LCDs are the standard LCDs used everywhere. They come in many sizes and one size that's used a lot is 16x2characters, so we'll use one of that size for our examples. They're very easy to use in 8 bit mode (4 bit is a little tricky).The LCD ConnectorThe LCD Connector has 16 pins and is usually located at the top of the LCD. It offers pins for power, contrast, controllines, data lines and the LED backlight (if installed):
Pin12 3 4 5 6 7 8 9 10 11 12 13 14 15 16
Gnd 5V Vee RS R/W E D0 D1 D2 D3 D4 D5 D6 D7 LED+ LED-Gnd and 5V shouldn't need any explanation. Vee is the LCDs contrast voltage and should be connected to a pot (voltagedivider). The voltage should be between 0 and 1.5V (this may vary for different manufacturers) and the pin *can* alsobe tied to ground.RS is the register select pin. To write display data to the LCD (characters), this pin has to be high. For commands (duringthe init sequence for example) this pin needs to be low.R/W is the data direction pin. For WRITING data to the LCD it has to be low, for READING data FROM the LCD it has to behigh. If you only want to write to the LCD you can tie it to ground. The disadvantage of this is that you then can't readthe LCDs busy flag. This in turn requires wait loops for letting the LCD finish the current operation, which also meanswasting CPU time.
 
Short Course on Electronic Project Design and FabricationShort Course on Electronic Project Design and FabricationShort Course on Electronic Project Design and FabricationShort Course on Electronic Project Design and Fabrication
3
Jointly Organized by: Dept. of EEE and IEEE RUET Student Branch
E is the Enable pin. When writing data to the LCD, the LCD will read the data on the falling edge of E. One possiblesequence for writing is:- Take RW low- RS as needed for the operation- Take E high- put data on bus- take E low
The LCD Command Set
Most of the LCD commands don't need more time fore the LCD to execute them than writing a character. The datasheetof the LCD used for writing this code stated 40µs for a simple command.Clear Display: 0x01This command clears the display and returns the cursor to the home position (line 0, column 0). This command takes 1.64ms to complete!Cursor Home: 0b0000001xThis commands also sets the cursor position to zero, but the display data remains unchanged. It also takes 1.64 ms for execution, but it also shifts the display to its original position (later!).Entry Mode:0 0 0 0 0 1 I/D SI/D: Increment/Decrement Cursor bit. If set, the cursor will be post-incremented after any read data or write dataoperation. If cleared, the cursor will be post-decremented.S: If set, the whole display will be shifted, depeding on I/D: If I/D and S are set, the display will be shifted to the left, if I/D is cleared (S set), the display will be shifted to the right. Usually I/D = 1, S = 0 is used (increment cursor, don't shiftdisplay).Display On/Off:0 0 0 0 1 D C BD: Display On/Off. If set, the display is turned on. When the display is turned off, character data remains unchanged!C: Cursor On/Off. If set, the cursor is visible in the way set by B.B: Cursor blinks on/off. If this bit is set, the cursor will blink as a black block. Otherwise the cursor is shown as anunderscore _.Shift Cursor/Display:0 0 0 1 S/C R/Lx xS/C: If set, the display is shifted. If cleared, the cursor is shifted. The direction depends on R/L.R/L: If set, the display/cursor is shifted to the right. If cleared, it's shifted to the left.Function Set:0 0 1 DL N F x xDL: Interface length. If set, 8-bit mode is selected (as in this example). If cleared, 4 bit mode is selected. N: Number of display lines. If cleared, the LCD is a one line display. If set, the display is in 2/4 line mode.F: Font size. If cleared, 5x7 Font is selected. If set, 5x10 font is selected.The last two features might lead to the question "Why doesn't my display know what it is?" Well the controller (HD44780) is always the same, but it works with many different display types (1 to 4 lines, 8 to 40 characters per line)and the displays also come with different character sizes (5x7 or 5x10).CG Ram Address Set:0 1 ACGACG is the Address to be set for Character Generator Ram access. The CG can be used to configure and show customcharacters.DD Ram Address Set:1 ADD

Activity (8)

You've already reviewed this. Edit your review.
1 hundred reads
1 thousand reads
fenestron liked this
tanggakuda liked this
Mohamed Errida liked this
ghelai12 liked this

You're Reading a Free Preview

Download
scribd
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->