<<

LED ME456: Mechatronics Systems Design • Reference: Chapter 7: R. Stojanovic and D.Karadaglic, “Single LED Takes On Both Light Emitting and Light Detecting Duties”, Electronic Design, Vol. 55, Measuring Light with an LED No. 16, 7.19.07 www.electronicdesign.com Prof. Clark J. Radcliffe Mechanical Engineering Michigan State University http://www.egr.msu.edu/classes/me456/radcliff

LED’s

• Can be both light emitters and • typical LED detectors – about 50pA photocurrent. • When biased, • The light emitted and the detected – they emit light – characteristic voltage “ drop” at a – at nearly the same frequency current of 10-20 mA. – green-yellow LED emits 555nM • When subjected to light, – detects light at 525nm. – they generate a backwards biased • Small photocurrent as a detector current proportional to the light striking the diode. – is readily detected by a microcontroller

LED used as a The Conceptual Model

• Analytical Model: Parallel Combination – Current Source (~50pA) LED with light • LED’s response to external light applied – Very Small Internal (10-15pF ) • LED internal structure: parallel current generator and Capacitance

Equivalent current source i and parallel R 2 Conductors+ Dielectric Photodiode across Gap Gap = Capacitor Current Generator

1 Discharge Time RCTIME Values

If the LED is initially “charged” to = 5 volts, LED Voltage Vcr vs Photocurrent ir the time required for the voltage to drop to (Cr = 10 pF) 1/0 threshold voltage (1.4 volts) is directly 6.00E+00 5.00E+00 ir=25uA related to the average photocurrent iR. 4.00E+00 ir=50uA 3.00E+00 Vcr(t) 2.00E+00 Simulated responses show the behavior for 1.00E+00 Cr = 10pF and iR = 25µA and 50 µA 0.00E+00 0 0.001 0.002 0.003 Time, t

Analytical Model Testing the 1 VP1(t) = VP1(0) - iR (t) dt Cr ! • For constant light, iR = constant • Response decreases linearly from VP1(0)

At iR = 25µA , t1.4 = 0.7 ms => 3500 counts

At iR = 50µA , t1.4 = 1.4 ms => 7000 counts LED Voltage Vcr vs Photocurrent ir (Cr = 10 pF) 6.00E+00 5.00E+00 ir=25uA 4.00E+00 ir=50uA 3.00E+00

Vcr(t) 2.00E+00 1.00E+00 0.00E+00 • Pin 2 = 0, Pin 1 is controlled by RCTIME 0 0.001 0.002 0.003 Time, t

The Physical Circuit The Test Code

'{$STAMP BS2} '{$PBASIC 2.5} 'file:LED_Light_Detecter.bs2 'Clark Radcliffe Michigan State University July 31, 2007 'Requires an LED in series with a 220 Ohm resister between pins p0 and p1 'connections P1---|<-----220Ohm---P0 (Note flat side to pin P1 'Symbols P0 PIN 0 P1 PIN 1 'Declarations light VAR Word 'measurement variable OUTPUT P1 'Pins P0 & P1 are both outputs OUTPUT P0 LOW P0 'set P0 TO ground DO HIGH P1 'Set P1 HIGH TO charge LED Capacitance PAUSE 1000 'WAIT FOR LED capacitance TO charge RCTIME P1, 1, light 'Measure discharge current from light DEBUG CLS, "Light Count = ", DEC5 light 'Display measurement LOOP

2 Now Detect AND Emit

'{$STAMP BS2} '{$PBASIC 2.5} ’File:LED_Light_Detecter.bs2 'Clark Radcliffe Michigan State University July 31, 2007 'Requires an LED in series with a 220 Ohm resister between pins 0 and 1 'connections P1-•--|<--•--220Ohm--•-P0 (Note flat side to P1) 'Declarations 'Symbols P1 PIN 1 P0 PIN 0 light VAR WORD DO 'Measure light Level: High Count = Low light LOW P0 HIGH P1 ‘Reverse Charge the LED Capacitance PAUSE 250 RCTIME P1, 1, light ‘Measure Time for Light-Current to discharge C DEBUG CLS, "Light Count = ", DEC5 light 'Blink LED LOW P1 ‘Forward Bias ground HIGH P0 ‘Forward bias 5v to light LED PAUSE 250 ‘Blink for ¼ second LOOP

3