element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • About Us
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Personal Blogs
  • Community Hub
  • More
Personal Blogs
Legacy Personal Blogs More on Using an LED as a Light Sensor
  • Blog
  • Documents
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: jc2048
  • Date Created: 11 Apr 2020 9:54 PM Date Created
  • Views 2424 views
  • Likes 12 likes
  • Comments 6 comments
  • nano
  • light sensor
  • op amp
  • analogue design
  • led
  • jc2048
  • mcp6022
Related
Recommended

More on Using an LED as a Light Sensor

jc2048
jc2048
11 Apr 2020

Last week I did a blog where I looked at the response of an LED to light: Experimenting With Using an LED as a Light Sensor . I thought it might be interesting to extend that a little bit further.

 

As before, the input is a reverse-biased LED acting as a photodetector. Again, I'm going to use an op

amp as a transresistance amplifier (this time a Microchip device that can operate on 5V) but, for a bit

of added interest, instead of generating an output voltage that's linear with diode current I decided

to generate the log of the current. Whether that was a good idea, we'll see in a moment. In theory this

should give a larger dynamic range, though we shall have to see whether I can actually make use of it

[it will depend on where the dark current falls on the scale].

 

My starting point was a quick simulation, just to check whether what I was thinking of would work in

principle.

 

Here's the simulation circuit. It is somewhat messy because it is just how it was slapped together; I

wasn't really thinking about anyone other than myself looking at it.

 

image

I've got a current generator (IG1) placed where the LED would be to act as a substitute. It isn't going

to behave quite the same because a somewhat better model for a photodiode would have the device

capacitance in parallel with the source, however I just want to look at the logging here, so it won't

matter much. The component that does the log conversion is the transistor (T1) in the amplifier

feedback path that is wired as a diode. The voltage across the 'diode' will be proportional to the log

of the current and that operates over quite a wide range. That diode voltage adds to the 2.5V voltage

source which, in the final circuit, I'm going to construct with a TL431. To condition the output of the

first op amp I've got the second device in the package connected as a differential amplifier, measuring

the difference between the 2.5V reference and the output and multiplying it by ten. That will then give

a signal referenced to ground.

 

Here's what the simulation looked like. For the current generator, I had constructed a custom waveform

that stepped the current up by a decade after each second. The other trace shows the output of the

differential amplifier. The transistor is doing the log conversion, but without a great deal of

accuracy. At the low end, it all runs out of steam at a few pA.

 

image

 

Although that looks reasonable on paper, in some ways the op amp and transistor are too good. Since

they're responding and developing an output from the single-digit picoamp area upwards, my problem is

going to be the dark current of the LED [the leakage through the device when no light is falling on

it]. That's probably going to be up in the nanoamp region, so half the range here may be useless as the

current will never be down in that first two or three decades.

 

Rather than worry about that, I decided to build the circuit anyway so that we could see how it behaved

as a physical prototype. It's not many components and didn't take long to construct.

 

Here is the circuit

 

image

 

I haven't shown it on the diagram, but I've also got a 100nF ceramic capacitor directly between Vss and

Vdd under the op amp package.

 

Here is the board with the components on it:

 

image

 

image

 

If I try it out with the Arduino UNO, driving an LED at 500Hz, that I used in the previous blog [the

LEDs are inside a small cardboard cylinder to keep out the ambient light], I get this waveform

 

image

 

As suspected, if we compare the bottom level of the waveform to the voltage levels from the simulation,

the dark current looks like it's around the 5nA area. But there are several problems with my circuit.

 

The rise time

 

[631]image

 

isn't too bad (a couple of microseconds), but the fall

 

image

 

takes a much longer time because there's nothing to discharge the small photodiode capacitance other

than the leakage [the op amp will be trying to pull it low, but it's defeated by the transistor 'diode'

reverse biasing].

 

The second problem is that it is very sensitive to mains voltage capacitively coupled in. That's the

variation that you see at the bottom of the waveform. The boards are on top of an old cardboard

shoebox, to get them away from the anti-static mat which I know couples signals into sensitive circuits

[it's a cheap rubbery mat with a fairly low resistance], but there's still enough coupling to the

equipment on the bench for it to show.

 

This is the output with the UNO board turned off, so just the dark current in the sensor LED with added mains.

 

image

 

And this is with the palm of my hand an inch away from the LED. Obviously my body is good at picking up

mains and coupling it to the circuit.

 

image

 

The final problem is that I have slightly too much gain and it's close to limiting at the rail at the

top [the level from pointing the LED at the sun, through a window, was hardly any different to that

from the test LED].

 

So, in many ways, the logging turned out not to be a particularly inspired idea.

 

Update 17th April

 

Since I did the blog, just out of curiosity I've tried a simple shield around the sensitive bits. It's made from a piece of

flexible PCB material: thin plastic with a copper layer bonded to it. It's connected to the ground, but it's open one end,

so doesn't form a complete cage. Here's what it looks like:

 

image

 

That gets the mains noise down to this on the dark current level

 

image

 

With my finger on the end of the sensor LED (so a bit closer than the unshielded one above), I get this

 

image

 

The chip in the LED on its cup can still sense the outside field, even though it's a few millimetres below the copper

level, but it's better than before.

 

If you found this interesting and would like to see other blogs I've written, a list can be found here: jc2048 Blog Index

  • Sign in to reply

Top Comments

  • ankur608
    ankur608 over 5 years ago +2
    Inspirational and outstanding blogs. -Ankur
  • dubbie
    dubbie over 5 years ago +2
    Very interesting. I liked the use of simulation and then the real circuit. It is good to see some 'real' analogue signals. I still prefer digital though. Dubbie
  • jc2048
    jc2048 over 5 years ago in reply to ankur608 +2
    Thank you.
Parents
  • dubbie
    dubbie over 5 years ago

    Very interesting. I liked the use of simulation and then the real circuit. It is good to see some 'real' analogue signals. I still prefer digital though.

     

    Dubbie

    • Cancel
    • Vote Up +2 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • jc2048
    jc2048 over 5 years ago in reply to dubbie

    I've come to like playing with the simulator, though you do need to keep in mind the things it can't do as well as the things it can.

    • Cancel
    • Vote Up +2 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • dubbie
    dubbie over 5 years ago in reply to jc2048

    Jan,

     

    I agree, simulators tend to be ideal, whereas the world isn't!. It is still useful to be able to see a first approximation to the real world though.

     

    Dubbie

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
Comment
  • dubbie
    dubbie over 5 years ago in reply to jc2048

    Jan,

     

    I agree, simulators tend to be ideal, whereas the world isn't!. It is still useful to be able to see a first approximation to the real world though.

     

    Dubbie

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
Children
No Data
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube