Shop OBEX P1 Docs P2 Docs Learn Events
Here's an easy way to use an LED as a photodiode — Parallax Forums

Here's an easy way to use an LED as a photodiode

Nick McClickNick McClick Posts: 1,003
edited 2010-06-26 07:37 in Propeller 1
I did a sunburn detector for the Propeller using an LED to detect UV (Mr. Burns);
4732817513_a438c506ed.jpg
Video demo

I wanted to make a sunburn alarm for a while, but when I shopped around for a UV detector, they were really expensive. If you take a regular LED and invert it (so the anode is connected to ground), it will generate a very weak voltage in response to light, but you need an op-amp circuit to amplify the voltage and you have to use an ADC or sigma delta to measure the output. I wanted something simpler.

I stumbled across this whitepaper from Mitsubishi; by reversing the LED and adding a capacitor, you can read the light detected like any other R/C decay circuit. Here's how I set it up;
4732832397_01e068c83b_b.jpg
Charge up the cap, and count the discharge. Here's some sample code;
CON
  LEDpin = 7

OBJ
  rc: "rctime" 

VAR
  LONG lightvalue

PUB readlight
  RC.RCTIME(LEDpin,1,@lightvalue)




The LED will be sensitive to light at a shorter wavelength than the light it emits. A green LED will sense some green and blue, but not red or yellow. The blue LED I use is sensitive from around 330nm to 400nm (at least tested with a few glass UV filters I have).

I might be discovering what everyone else already knows, but it's an easy & cheap way to read light levels with a Prop without using ADC.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Propeller Forums RSS Feed!

Gadget Gangster - Share your Electronic Projects

Comments

  • HollyMinkowskiHollyMinkowski Posts: 1,398
    edited 2010-06-25 18:35
    Nice info about the blue LED being sensitive from 330-400nm.

    I may have a use for this smile.gif

    I wonder how a UV LED would work and what its
    detection range would be? Perhaps it would work
    well for UV detection without even needing a filter.
  • Clock LoopClock Loop Posts: 2,069
    edited 2010-06-26 05:37
    Starting in the late 1980's, Forrest Mims began using light-emitting diodes (LEDs) that detect light in the near IR to measure PW. Basically, the measurement involves looking at the ratio of responses from two LEDs, one inside a water vapor absorption band and another just outside this band. At the time, it was not widely recognized that LEDs could be used as spectrally selective light detectors. This new instrument concept, and its application to measuring water vapor, was described in the peer-reviewed literature in 1992 [noparse][[/noparse]Mims, 1992]. Mims continued to make water vapor measurements at his Geronimo Creek Observatory in Seguin, Texas, and in 2002 published a 12-year record of these measurements [noparse][[/noparse]Mims, 2002].

    The substitution of LEDs for other kinds of detectors is not a straightforward matter. First of all, the relationship between the emission and spectral response properties of LEDs is not a simple one. Typically, the peak response wavelength is less than the peak emission wavelength. Second, because LEDs have been developed commercially for other purposes, their performance is certainly not optimized for this rather obscure research application. This means that their spectral response does not necessarily give the maximum sensitivity to changes in PW.

    I use the LED as switch concept in my black box sequencer.

    http://forums.parallax.com/showthread.php?p=831833
Sign In or Register to comment.