Photoresistor, Transistor, and LED s

Similar documents
Transistor Characteristics and Single Transistor Amplifier Sept. 8, 1997

Controlling a Dot Matrix LED Display with a Microcontroller

Physics 623 Transistor Characteristics and Single Transistor Amplifier Sept. 13, 2006

Cornerstone Electronics Technology and Robotics I Week 15 Voltage Comparators Tutorial

Programming PIC Microcontrollers in PicBasic Pro Lesson 1 Cornerstone Electronics Technology and Robotics II

Pulse Width Modulation (PWM) LED Dimmer Circuit. Using a 555 Timer Chip

Bipolar Transistor Amplifiers

TRANSISTOR/DIODE TESTER

Transistor Amplifiers

BJT Characteristics and Amplifiers

POWER SUPPLY MODEL XP-15. Instruction Manual ELENCO

Basic Electronics Prof. Dr. Chitralekha Mahanta Department of Electronics and Communication Engineering Indian Institute of Technology, Guwahati

Robot Board Sub-System Testing. Abstract. Introduction and Theory. Equipment. Procedures. EE 101 Spring 2006 Date: Lab Section # Lab #6

PHYS 2P32 Project: MIDI for Arduino/ 8 Note Keyboard

Table 1 Comparison of DC, Uni-Polar and Bi-polar Stepper Motors

DC Motor with Shaft Encoder

1. Learn about the 555 timer integrated circuit and applications 2. Apply the 555 timer to build an infrared (IR) transmitter and receiver

Your Multimeter. The Arduino Uno 10/1/2012. Using Your Arduino, Breadboard and Multimeter. EAS 199A Fall Work in teams of two!

Objectives: Part 1: Build a simple power supply. CS99S Laboratory 1

Advanced LED Controller (LED Chaser)

LAB 7 MOSFET CHARACTERISTICS AND APPLICATIONS

ARDUINO SEVERINO SERIAL SINGLE SIDED VERSION 3 S3v3 (REVISION 2) USER MANUAL

The 2N3393 Bipolar Junction Transistor

AVR Butterfly Training. Atmel Norway, AVR Applications Group

OPERATIONAL AMPLIFIERS

Annex: VISIR Remote Laboratory

LM 358 Op Amp. If you have small signals and need a more useful reading we could amplify it using the op amp, this is commonly used in sensors.

3-Digit Counter and Display

GLOLAB Universal Telephone Hold

LABORATORY 2 THE DIFFERENTIAL AMPLIFIER

Voltage boost and buck circuits using Atmel AVR Tiny13V for driving a white LED.

COMBINATIONAL and SEQUENTIAL LOGIC CIRCUITS Hardware implementation and software design

AUTOMATIC NIGHT LAMP WITH MORNING ALARM USING MICROPROCESSOR

TEECES DOME LIGHTING SYSTEMS

PolyBot Board. User's Guide V1.11 9/20/08

Operational Amplifier - IC 741

How to use AVR Studio for Assembler Programming

Transistor amplifiers: Biasing and Small Signal Model

PURDUE UNIVERSITY NORTH CENTRAL

CHAPTER 11: Flip Flops

Programmable Single-/Dual-/Triple- Tone Gong SAE 800

Diodes and Transistors

!Operation:!1. Connect an external power source to J1 (+ and - IN terminals). The

Lab 1 Diode Characteristics

Switch board datasheet EB

Arduino Lab 1 - The Voltage Divider

The basic set up for your K2 to run PSK31 By Glenn Maclean WA7SPY

Joule Thief 3.0 Kit. June 2012, Rev Joule Thief 3.0

Chapter 6 TRANSISTOR-TRANSISTOR LOGIC. 3-emitter transistor.

Lab 7: Operational Amplifiers Part I

Using Ohm s Law to Build a Voltage Divider

Arduino Lesson 13. DC Motors. Created by Simon Monk

BJT AC Analysis. by Kenneth A. Kuhn Oct. 20, 2001, rev Aug. 31, 2008

Tire pressure monitoring

Lab 3 - DC Circuits and Ohm s Law

Electronics I - Laboratory 1 Diode I/V Characteristics

LM2576R. 3.0A, 52kHz, Step-Down Switching Regulator FEATURES. Applications DESCRIPTION TO-220 PKG TO-220V PKG TO-263 PKG ORDERING INFORMATION

Basic voltmeter use. Resources and methods for learning about these subjects (list a few here, in preparation for your research):

If an occupancy of room is zero, i.e. room is empty then light source will be switched off automatically

Talon VFD / Inverter Meter

Lab 5 Operational Amplifiers

DET Practical Electronics (Intermediate 1)

Measuring Resistance Using Digital I/O

Series and Parallel Circuits

The components. E3: Digital electronics. Goals:

Unit/Standard Number. High School Graduation Years 2010, 2011 and 2012

ECEN 1400, Introduction to Analog and Digital Electronics

IR Communication a learn.sparkfun.com tutorial

Voltage/current converter opamp circuits

Electronics and Soldering Notes

Chapter 19 Operational Amplifiers

Tristan s Guide to: Solving Series Circuits. Version: 1.0 Written in Written By: Tristan Miller Tristan@CatherineNorth.com

Tutorials Drawing a 555 timer circuit

Digital Electronics Detailed Outline

Experiment #5, Series and Parallel Circuits, Kirchhoff s Laws

Introduction to Arduino

2.0 Command and Data Handling Subsystem

Fundamentals of Signature Analysis

School of Engineering Department of Electrical and Computer Engineering

Hands On ECG. Sean Hubber and Crystal Lu

Tube Liquid Sensor OPB350 / OCB350 Series

Inductors in AC Circuits

Series and Parallel Resistive Circuits Physics Lab VIII

Supply voltage Supervisor TL77xx Series. Author: Eilhard Haseloff

UMM AL-QURA UNIVERSITY

Semiconductor I. Semiconductors. germanium. silicon

Common-Emitter Amplifier

Using and Wiring Light Emitting Diodes (LEDs) for Model Railroads

Antenna Rotator System

INTRODUCTION TO SERIAL ARM

Glolab Talking Phone Dial Monitor

AN105. Introduction: The Nature of VCRs. Resistance Properties of FETs

Introducing AVR Dragon

Peak Atlas DCA. Semiconductor Component Analyser Model DCA55. User Guide

VJ 6040 Mobile Digital TV UHF Antenna Evaluation Board

EGR 278 Digital Logic Lab File: N278L3A Lab # 3 Open-Collector and Driver Gates

AP Physics Electricity and Magnetism #4 Electrical Circuits, Kirchoff s Rules

ENCODER TEST MODULE APPLICATION GUIDE

Transcription:

PH-1 Photoresistor, Transistor, and LED s Learning Objectives: y the end of this laboratory experiment, the experimenter should be able to: Explain how a photoresistor works Describe the voltage-current relationship for an LED uild a circuit that includes an LED, photoresistor, and transistor and interface the circuit to a microcontroller to create a light controlled switch Write a program for the ATmega16 to control and modify the functionality of a light controlled switch omponents: Qty. Item Qty. Item 2 10 kω resistor 1 470 Ω resistor 1 Solderless readboard 1 220 to 270 Ω resistor 1 Photoresistor 1 red or green LED 1 2N3904, NPN transistor 1 STK500 with Atmel ATmega16 Introduction: A photoresistor is simply a resistor whose resistance depends on the amount of light incident upon it. Photoresistors are used to make light-sensitive devices, and are often made from cadmium sulfide (). The resistance of a photoresistor varies inversely to the amount of light incident upon it. In other words, its resistance will be higher at low light levels (in the dark) and lower at high light levels (in the light). A light emitting diode (LED) behaves like an ordinary diode except that when it is forward biased, it emits light. An LED s forward voltage drop is higher than that of an ordinary diode. Typical LEDs (the two-wire leaded jelly bean type) require 5 to 15mA to reach full brightness, but are not designed to handle more than about 20 ma of current (though some designed specifically for lighting applications can handle upwards of 1A or more). You will therefore always need to provide a resistor in series with an LED to limit the current to about 20 ma or less, or else you will burn it out. Also, don t make the mistake of trying to substitute an LED where a standard diode is called for! Look at the schematic diagram to see which kind of component is needed. 1. Measure the photoresistor s resistance in the ambient lighting of the lab. How stable is it? Once this is recorded, repeat the measurement, only this time, cover the cell with your hand. These two extremes will be used in calculations later on. 2. To verify the behavior of the LED, construct the circuit shown in Figure 1. Measure the actual resistance of the 470 Ω resistor and record your reading. Vary the supply voltage from 1 to 5 volts using 1-volt increments. At each voltage, measure the voltage across the LED and the 470 Ω resistor using the DMM, and enter the values into the following table.

PH-2 The LED current can be calculated by applying Ohm s law across the resistor. A similar table should be entered into the lab report with all voltage values and comments. Remember Ohm s law for calculating the current through a resistor: I = V/R, where V is the voltage across the resistor. Top view flat or notch + + 470 Ω V R Side view anode (A) + - - cathode ( or K) V S LED V LED Figure 1. LED and typical circuit. Note that the anode lead is longer than the cathode. Sometimes there is a flat on the cathode side of the LED to help you distinguish anode from cathode. With voltage sources above the maximum forward voltage of the LED, you must always use a resistor in series to limit the current through the LED. 1 2 3 4 5 Table 1. LED circuit measurements (Refer to Figure 1) V S, V V LED, V V R, V urrent, ma omment on LED brightness Figure 2 shows a simple light-controlled-led. The circuit should turn-off the LED as the photoresistor is covered. Explain the theory of operation of this circuit. ased on the information obtained above, what is a good supply voltage to use? (Hint: V should be high enough so that enough current flows through the LED when the photoresistor has low resistance, and yet should be low enough so that the current is not enough to turn on the LED when the photoresistor has high resistance.) uild the circuit in Figure 2, and check its function. Describe its operation. R V V Figure 2. Light-controlled LED Figure 3. Light-controlled using a transistor switch

PH-3 The Light-ontrolled Switch Using a Transistor A transistor can be added to the light-controlled-switch circuit to improve its sensitivity and to eliminate the half-on-half-off state of the LED. A rudimentary circuit to do so is shown above in Figure 3 (you don t have to build this circuit). Here the photoresistor controls the amount of current flowing into the base of the transistor, which in turn controls the collector current of the transistor, thus controlling the current through the LED. Unfortunately, this circuit may not function properly, because when the photoresistor is in the dark state, and the LED is supposed to be turned off, the base current may be large enough that the LED may stay lit! Prove this (not now, but when you write your report), by calculating the collector current for the circuit in Figure 3 when V=10 V, R =100 kω, R c =220 Ω and h fe =100. Figure 4 shows an improved circuit. This is the circuit that you will build and experiment with next. Rc V S E R1 E Figure 4. Improved light-controlled switch using a 2N3904 transistor. With the flat side of the transistor facing away from you, the pins from left to right are: collector, base, and emitter. (Transistor pinout source: http://www.fairchildsemi.com/ds/2n/2n3904.pdf) With a properly selected resistor R 1, the voltage at the base of the transistor in the dark state is less than 0.7 V, and therefore the transistor is in the cut-off state. Since the transistor is cutoff, no current flows from its collector to its emitter, so the LED will be off. As the photoresistor s resistance decreases (as the result of an increase in light intensity), the voltage at the base increases due the voltage divider formed by R1 and the photoresistor. Once the base voltage reaches 0.7 V, the base current starts to flow, and any further decrease in the photoresistor s resistance causes an increase of base current. This base current increment will be amplified by the current gain of the transistor up to the point that the transistor saturates. The following procedure explains how to select the resistance values for R1 and R in Figure 4. Document with calculations in your report how you arrived at the resistance values that you ultimately used to build the light-controlled transistor switch in Figure 4 using the procedure below. 1. hoose the supply voltage, V S. The supply voltage is often a predetermined value rather than a design choice. For example, suppose the supply consisted of five alkaline batteries in series. Then V S = 5 * 1.5V = 7.5V. 2. Select R1. First, choose the value of the photoresistor s resistance (call it R on ) within the range that you measured earlier at which you would like the LED to be turned on. The resistance value can be that for when the photoresistor is covered or somewhat shaded, it s up to you. The value of R1 should be such that 0.7V = V S *R1/(R1+R on ).

PH-4 hoose a nominal resistor value closest to the value you calculated for R1, or you can use a variable resistor (trim pot). Depending on the resistor value you choose, you may want to check the equation above for R ON to make sure it still within the range that you want. 3. Select R c, the current limiting resistor. With this resistor, the collector current is limited to I max =(V S - V LED - V Sat )/R, where V LED is the voltage drop across the LED (i.e., the voltage you measured across the LED when it was on. See Table 1 above.), and V Sat is the saturation voltage between the collector and emitter. A reasonable value for V Sat for the 2N3904 transistor is about 0.4V. Select R so that the LED current is limited to be less than 20 ma (preferably 5-10 ma). You may need to iterate this calculation depending on the limited choice of resistor values that we have in the lab. Using R c, construct and test the circuit. Using the ATmega16 to Make a Programmable Light-ontrolled Switch The circuit in Figure 4 is very simple, but it suffers from the disadvantage that once R1 is chosen and the circuit is constructed, you re stuck with its performance unless you physically remove R1 and replace it with a different value. That is not too serious if you are dealing with one circuit on a breadboard, but suppose this circuit were part of a product that you were manufacturing, say 1000 per day. If you wanted to change the performance of the device, you would have to modify the assembly drawings, circuit board artwork, component inventory, rework the entire work-in-process, etc. That would be a big deal! Here we will use the ATmega16 to make a light-controlled switch whose performance can be modified by simply reprogramming the microcontroller. 1. uild the part of the circuit in shown in Figure 5 below labeled A. We are going to use the STK500 to supply power and ground to this circuit for convenience, but don t assume that you can power do so as a general approach to your prototyping needs! Loads that draw more than a couple tens of milliamps should be powered by an external supply with a common ground to the STK500. onnect the 10k resistor to pin P0 on the STK500 board using a jumper from the pin to the solderless breadboard. Don t forget that you need to supply power to the ATmega16. The voltage on P0 will either be 0 or 5 V. Which of these will turn the transistor on? When the transistor turns on, is it saturated? ased on your earlier measurements on the LED and the characteristics of the transistor, what are i b, and i c when P0 is at 5 V? 2. reate a New Project in AVR Studio. Refer to the previous lab if you don t remember how to do this. Also, don t forget to set the onfiguration Options with the PU frequency at 8 MHz, O2 optimization, and choose the proper directory location of the hex file. ompile and run the link Test Program, which you can find on the ME 106 website, and see if you can make the LED blink. Explain how the PORT output is toggled by using the ^= operator. 3. When you have successfully completed step 2, build the circuit in shown in Figure 5. reate a New Project, make copies of uart.h and uart.c from the ME 106 website, and compile and run the Photoresistor and A/D test program, which you can also find on the ME 106 website. onnect the microcontroller to Hyperterminal as described in the Introduction to ATmega16 lab. Reset the microcontroller by pressing the reset button on the STK500 or by cycling the power. What happens when you cover the photoresistor? What range of values are shown in the communications window? What voltage do these correspond to?

PH-5 STK500 V TG 220Ω Pinout for transistor 10k Pin PA0 Pin P0 GND A 10k E 2N3904 E Figure 5. Light-controlled switch using the ATmega16. The photoresistor (in ) is part of a voltage divider, the output of which is connected to pin PA0, one of the pins that can be used for analog-todigital conversion. Pin P0 is connected to the base of a transistor (in A), which is used as a switch for illuminating the LED when the light level on the photoresistor is beyond a certain threshold value. (Transistor pinout source: http://www.fairchildsemi.com/ds/2n/2n3904.pdf) 4. When you have successfully completed step 3, write a program that will turn the LED on when you cover the photoresistor with your hand. (Hint: add a test in the While loop that compares the value of adc_level with a value approximately in the center of the voltage range that you measured in step 3 when the photoresistor was covered. Experiment with the threshold value.) Display the state of your LED on the terminal window. What changes need to be made to the software (note: no need to change any hardware) if you want to have the LED stay on under ambient light conditions and turn off when a shadow falls on the photoresistor (i.e. the opposite function to what you programmed in step 4)?