Binary Outputs: LEDs

Similar documents
Embedded Systems. Interfacing PIC with external devices Analog to digital Converter. Eng. Anis Nazer Second Semester

Hashemite University Faculty of Engineering Mechatronics Engineering Department. Microprocessors and Microcontrollers Laboratory

Electronic Circuits I. Instructor: Dr. Alaa Mahmoud

Diode Limiters or Clipper Circuits

Transistors, Gates and Busses 3/21/01 Lecture #

Laboratory No. 01: Small & Large Signal Diode Circuits. Electrical Enginnering Departement. By: Dr. Awad Al-Zaben. Instructor: Eng.

Discuss the basic structure of atoms Discuss properties of insulators, conductors, and semiconductors

Ch5 Diodes and Diodes Circuits

Lecture 7:PN Junction. Structure, Depletion region, Different bias Conditions, IV characteristics, Examples

CHAPTER FORMULAS & NOTES

Diode Bridges. Book page

EC T34 ELECTRONIC DEVICES AND CIRCUITS

CHAPTER SEMI-CONDUCTING DEVICES QUESTION & PROBLEM SOLUTIONS

Lecture 3: Diodes. Amplitude Modulation. Diode Detection.

EE70 - Intro. Electronics

Electron Devices and Circuits (EC 8353)

Chapter Semiconductor Electronics

Student Lecture by: Giangiacomo Groppi Joel Cassell Pierre Berthelot September 28 th 2004

EDC Lecture Notes UNIT-1

Digital Integrated Circuits A Design Perspective. The Devices. Digital Integrated Circuits 2nd Devices

Downloaded from

MicroToys Guide: Motors N. Pinckney April 2005

CHAPTER 8 The PN Junction Diode

EE/COE 152: Basic Electronics. Lecture 3. A.S Agbemenu.

Università degli Studi di Roma Tor Vergata Dipartimento di Ingegneria Elettronica. Analogue Electronics. Paolo Colantonio A.A.

Section:A Very short answer question

CHAPTER 8 The PN Junction Diode

SEMICONDUCTOR ELECTRONICS: MATERIALS, DEVICES AND SIMPLE CIRCUITS. Class XII : PHYSICS WORKSHEET

Physics 160 Lecture 5. R. Johnson April 13, 2015

More Fun with A/D Converters

REV NO EXPERIMENT NO 1 AIM: To study the PN junction diode characteristics under Forward & Reverse bias conditions. APPARATUS REQUIRED:

PHYS 3050 Electronics I

Lecture 2 p-n junction Diode characteristics. By Asst. Prof Dr. Jassim K. Hmood

1) A silicon diode measures a low value of resistance with the meter leads in both positions. The trouble, if any, is

PN Junction Diode Table of Contents. What Are Diodes Made Out Of?

Lecture 8 Optical Sensing. ECE 5900/6900 Fundamentals of Sensor Design

;;;;;;; Variables ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; cblock Bank0RAM ;Temporary storage for STATUS during interrupts

Electronic devices-i. Difference between conductors, insulators and semiconductors

HOTS (ELECTRONIC DEVICES) 1.Determine the current through resistance R in each circuit.

Unit 2 Semiconductor Devices. Lecture_2.5 Opto-Electronic Devices

Class XII - Physics Semiconductor Electronics. Chapter-wise Problems

GCE A level 1145/01 ELECTRONICS ET5

Physics of Bipolar Transistor


Lesson 08. Name and affiliation of the author: Professor L B D R P Wijesundera Department of Physics, University of Kelaniya.

Chapter 1: Semiconductor Diodes

Lesson 5. Electronics: Semiconductors Doping p-n Junction Diode Half Wave and Full Wave Rectification Introduction to Transistors-

Intrinsic Semiconductor

UNIT IX ELECTRONIC DEVICES

ECE 440 Lecture 29 : Introduction to the BJT-I Class Outline:

ETEK TECHNOLOGY CO., LTD.

SRM INSTITUTE OF SCIENCE AND TECHNOLOGY (DEEMED UNIVERSITY)

Binary Outputs: Transistors Used as a Switch

Diodes and Applications

ECE-342 Test 1: Sep 27, :00-8:00, Closed Book. Name : SOLUTION

CHAPTER 9: ELECTRONICS

Downloaded from

Department of Electrical Engineering IIT Madras

EC6202-ELECTRONIC DEVICES AND CIRCUITS YEAR/SEM: II/III UNIT 1 TWO MARKS. 1. Define diffusion current.

AE103 ELECTRONIC DEVICES & CIRCUITS DEC 2014

Electronics I. Midterm #1

Q1. Explain the construction and principle of operation of N-Channel and P-Channel Junction Field Effect Transistor (JFET).

GCE A level 1145/01 ELECTRONICS ET5. P.M. THURSDAY, 31 May hours. Centre Number. Candidate Number. Surname. Other Names

Diode conducts when V anode > V cathode. Positive current flow. Diodes (and transistors) are non-linear device: V IR!

Microcontroller Based Inductance Capacitance Meter

جامعة اإلسكندرية كلية الهندسة قسم الهندسة الكهربية أبريل ٢٠١٥

UNIT 3: FIELD EFFECT TRANSISTORS

Final Project Report E3390 Electronic Circuits Design Lab. RFID Access Control System. Jeffrey Mok Joseph Kim

Lecture 4. Reading: Chapter EE105 Fall 2007 Lecture 4, Slide 1 Prof. Liu, UC Berkeley

Page 1. Date 15/02/2013

ET215 Devices I Unit 4A

Light Emitting Diodes

Electronics The basics of semiconductor physics

Stepper Motors & Look Up Table

Diode as a Temperature Sensor

Objective Type Questions 1. Why pure semiconductors are insulators at 0 o K? 2. What is effect of temperature on barrier voltage? 3.

Semiconductor Diodes

Lecture 3: Transistors

L MOSFETS, IDENTIFICATION, CURVES. PAGE 1. I. Review of JFET (DRAW symbol for n-channel type, with grounded source)

ELECTRONIC DEVICES AND CIRCUITS

o Semiconductor Diode Symbol: The cathode contains the N-type material and the anode contains the P-type material.

Chapter 2. Diodes & Applications

EASTERN MEDITERRANEAN UNIVERSITY FACULTY OF ENGINEERING Electrical and Electronics Engineering Department

ชาว ศวกรรมคอมพ วเตอร คณะว ศวกรรมศาสตร มหาว ทยาล ยเทคโนโลย ราชมงคลพระนคร

Georgia Institute of Technology School of Electrical and Computer Engineering. Midterm Exam

EJERCICIOS DE COMPONENTES ELECTRÓNICOS. 1 er cuatrimestre

Intro to Electricity. Introduction to Transistors. Example Circuit Diagrams. Water Analogy

LAB V. LIGHT EMITTING DIODES

Module 04.(B1) Electronic Fundamentals

Experiment Topic : FM Modulator

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING

Chapter 3 Bipolar Junction Transistors (BJT)

EC6202- ELECTRONIC DEVICES AND CIRCUITS UNIT TEST-1 EXPECTED QUESTIONS

I E I C since I B is very small

Chapter 2 PN junction and diodes

LED lecture. Wei Chih Wang University of Washington

IENGINEERS- CONSULTANTS LECTURE NOTES SERIES ELECTRONICS ENGINEERING 1 YEAR UPTU. Lecture-4

Electromagnetic spectrum

Semiconductor Devices Lecture 5, pn-junction Diode

UNIVERSITY OF CALIFORNIA AT BERKELEY College of Engineering Department of Electrical Engineering and Computer Sciences.

Transcription:

Diode Theory Binary Outputs: LEDs A diode allows current to flow in only one direction. A diode consists of a semiconductor pn junction: In Silicon, the number of free electrons is a constant: np n i 2 1.5 10 10 2 In p-type silicon, you dope the silicon with Boron, with a typical doping of 10 14 atoms per cc p p 10 14 n p n i 2 p 2.25 106 In n-type silicon, the doping is Phosphorus, resulting in n n 10 14 p n 2.25 10 6 At the pn junction, some electrons and holes are created through thermal electrons. This is a small number, however, so assume it's zero. If electrons and holes are not created, current can only flow by electrons and holes flowing towards the pn junction (where they combine and disappear). Assume the current is flowing from the p-side to the n-side (the left figure below.) In this case, you are using majority carriers, so there are approximately 10 14 charge carriers. Now, assume the current is flowing from the n-side to the p-side. In this case, you are using minority carriers, resulting in only 2.25 10 6 charge carriers. If the diode has a resistance of 1 when using majority carriers (current p to n), it has a resistance of 44M when using minority carriers (!). A diode only allows current to flow from p to n Current Flow Current p n p n holes electrons electrons holes Low Z High Z majority carriers: # charge carriers = 10 14 minority carriers: # charge carriers = 10 6 1 September 6, 2017

Sidelight: The above discussion is a little off when dealing with reverse biased diodes. There are actually two types of current flow: drift current like what's described above, and electron-hole generation in the depletion zone, which is ignored in the above discussion. When forward biased, the number of electrons created in the depletion zone is so small you can ignore it. The depletion zone is small to begin with, and there just aren't that many electron-hole pairs created. When reverse biased, the drift current sees 44M. It doesn't take much to dominate electron-hole generation actually becomes the dominant term for current flow. So, you actually do get a little more current when reverse biased than the above discussion suggests. You can use this 'feature' to your advantage... If you reverse bias a diode, the current flow is related to temperature. This is one way to build a temperture sensor. If you bombard the diode with radiation, current flow will increase as the radiation kicks electrons out of their covalent bonds. This is one way to build a light sensor (photo-transistor) as well as a radiation sensor. With the latter, you can actually see this with an LED. Reverse bias an LED and measure the current flow. Shine a like LED on that LED. The current will increase. 2 September 6, 2017

Binary Outputs Using an LED 1W Star LED, 10mm 0.5W White LED, and Piranah RGB LED Light Emitting Diodes (LED's) can be used to display the status of an output pin on the PIC chip. LED's Are diodes, allowing current to only flow in one direction, They convert current to light.(light is proportional to current flow), and They are very fast, capable of over 1000 flashes per second. The LEDs that are in room 211 are as follows: Part # Color Current Typical Vf Typical mcd Wavelength (nm) Price ea 1W White Star LED 350mA 3.4V 100 lm n/a $1.55 0.5W 10mm White LED 100mA 3.3V 25 lm n/a $0.30 Piranah RGB LED Red 20mA 1.8V 8000 mcd 630 nm $0.31 Green 20mA 3.0V 8000 mcd 525 nm Blue 20mA 3.0V 8000 mcd 470 nm V f is the turn-on voltage for this LED. If the first diode is on, the ideal diode model would have a 3.4V drop across the diode. Typical mcd refers to the efficiency of the diode (mcd is a unit of light intensity). Wavelength is the average wavelength of the light from the LED (a more precise definition of the color than the term 'red'). Note that the PIC processor can only output 25mA. To drive the white LEDs at full power, you'll need to add an amplifier (coming up later when we talk about transistors). A PIC can drive these at a lower brightness level (25mA). Also note that the actual voltage across the diode varies with the current as show in the following figure. Since this is a diode, the VI characteristics are exponential in nature: (from ECE 321) I d I dss exp 1 V d nv T This is shown for a Germanium diode, silicon diode, and three LEDs with Vf = 1.7V, 2.8V, and 4.0V. As a rough approximation, the voltage across the diode is almost constant when Id > 0. This isn't exact, but it is close and makes analysis a lot easier. 3 September 6, 2017

Id 30 20 10 0 0 1 2 3 4 5 6 Vd Two types of circuits are used to drive the LED - depending upon whether you want to output a '1' or '0' to turn on the LED: PIC Output Pin R Id + - Vf PIC Output Pin R Id +5 + - Vf 1 = 'ON' 0 = 'Off' 0 = 'ON' 1 = 'Off' R is selected to set the brightness of the LED when turned on. 4 September 6, 2017

Example: Determine the brightness of a red LED when connected to +5V through a 1k resistor: Solution: Assuming an ideal diode, the current flowing is I d 5V 1.8V 1k 3.2mA The brightness for this LED is then Brightness 3.2mA 20mA 8000mcd 1280mcd Example: Design a circuit which outputs 100mcd from a green LED Solution: The required current flow is I d 100mcd 8000mcd 20mA I d 0.25mA This sets R: Assuming an ideal diode, I d 5V 3.0V R R 8000 More Fun with RGB LEDs If you mix a red, green, and blue LED, you can make other colors by mixing them. (RGB are the primary colors in light). If you can adjust the brightness of each one with N grey levels, you are able to output N 3 combinations. The Piranah LEDs combine three LEDs in a single package as follows. Using three resistors, you can turn on and off each LED separately with a PIC processor. RC2 RC1 RC0 Ir Ig Ib Rr Rg Rb 1.8V 3.0V 3.0V red green blue Piranah Package Connection to a PIC 5 September 6, 2017

Problem 1: LED Flashlight. Design a system which allows you to output 4 different colors based upon which button you press: RB0 All lights off RB1 Red light on RB2 Green light on RB3 Blue light on Define "on" to be 20mA. Hardware Solution: Connect the Pirannah LED to the PIC board as follows. Pick the three resistors so that 20mA is flowing when the output pin is 5V. Software Solution: ; --- Flashlight.asm ---- ; This program drives an RGB flashlight based upon the button pressed COLOR equ 0 #include <p18f4620.inc> Loop: org 0x800 call Init movf COLOR,W btfsc PORTB,0 ; if RB0 pressed, color = 000 (off) 0 btfsc PORTB,1 ; if RB1 pressed, color = 001 (blue) 1 btfsc PORTB,2 ; if RB2 pressed, color = 010 (green) btfsc PORTB,3 ; if RB3 pressed, color = 100 (red) 4 movwf COLOR ; send the color to PORTC movff COLOR, PORTC goto Loop Init: movwf clrf movwf clrf return end 0xFF TRISB TRISC 0x0F ADCON1 COLOR 6 September 6, 2017

Problem #2: Make the LEDs only 25% on (2000 mcd each). Hardware Solution: Change the resistor. Software Solution: Change the code so that each pin is high 1/4th of the time. ; --- Flashlight.asm ---- ; This program drives an RGB flashlight based upon the button pressed COLOR equ 0 CNT1 equ 1 #include <p18f4620.inc> Loop: org 0x800 call Init clrf PORTC ; Turn off the lights for three counts call Wait call Wait call Wait movf COLOR,W btfsc PORTB,0 ; if RB0 pressed, color = 000 (off) 0 btfsc PORTB,1 ; if RB1 pressed, color = 001 (blue) 1 btfsc PORTB,2 ; if RB2 pressed, color = 010 (green) btfsc PORTB,3 ; if RB3 pressed, color = 100 (red) 4 movwf COLOR ; send the color to PORTC movff COLOR, PORTC call Wait ; Turn on for one count Init: goto movwf clrf movwf clrf return Loop 0xFF TRISB TRISC 0x0F ADCON1 COLOR Wait: Loop: movwl 250 movwf CNT1 decfsz goto return end CNT1,F Loop ; waste 25,005 clocks (2.5ms) 7 September 6, 2017

If you change the code so that the lights are 5% on (PORTB), 20% (PORTC), and 90% (PORTD), it looks like the following. Note that it looks like the LEDs are variable brightness. Assembler Code - Modified so that PORTB is on 5% of the time, PORTC is on 20% of the time, PORTD is on 90% of the time On an oscilloscope, you can see this better; Signal for 5% Duty Cycle: 8 September 6, 2017

Signal for 20% Duty Cycle: Signal for 90% Duty Cycle: 9 September 6, 2017