I was recently reserching on LEDs and I stumbled upon this page as I read it I found that LEDs are not just used to emit light but the also have the ability to sense light.At first using LED as light sensor sounds complicated but it quiet quickly becomes clear. This is a fun project in which we will be experimenting with LEDs requires minimal parts.

This instructable will explain you how to use a LED as sensor,creating it on a breadboard,making a shield for arduino, how to get a reading from our LED sensor and how to change the sensitivity of our sensor.

This is my first instructable, any suggestions,corrections or comments are welcome.

This instructable is a entry in the arduino contest so if you like it please vote.

A short video of the sensor in sensitive to dark mode:

 

A short video of it in the light sensitive mode:


 
Remove these adsRemove these ads by Signing Up

Step 1: Why Arduino?

arduino_logo.jpg
Arduino is an open-source electronics prototyping platform based on flexible, easy-to-use hardware and software. It's intended for artists, designers, hobbyists, and anyone interested in creating interactive objects or environments.There are many other microcontrollers and microcontroller platforms available for physical computing. Parallax Basic Stamp, Netmedia's BX-24, Phidgets, MIT's Handyboard, and many others offer similar functionality. All of these tools take the messy details of microcontroller programming and wrap it up in an easy-to-use package. Arduino also simplifies the process of working with microcontrollers, but it offers some advantage for teachers, students, and interested amateurs over other systems:

~ Inexpensive - Arduino boards are relatively inexpensive compared to other microcontroller platforms. The least expensive version of the Arduino module can be assembled by hand, and even the pre-assembled Arduino modules cost less than $50

~ Cross-platform - The Arduino software runs on Windows, Macintosh OSX, and Linux operating systems. Most microcontroller systems are limited to Windows.
Simple, clear programming environment - The Arduino programming environment is easy-to-use for beginners, yet flexible enough for advanced users to take advantage of as well. For teachers, it's conveniently based on the Processing programming environment, so students learning to program in that environment will be familiar with the look and feel of Arduino

~ Open source and extensible software- The Arduino software and is published as open source tools, available for extension by experienced programmers. The language can be expanded through C++ libraries, and people wanting to understand the technical details can make the leap from Arduino to the AVR C programming language on which it's based. SImilarly, you can add AVR-C code directly into your Arduino programs if you want to.

~ Open source and extensible hardware - The Arduino is based on Atmel's ATMEGA8 and ATMEGA168 microcontrollers. The plans for the modules are published under a Creative Commons license, so experienced circuit designers can make their own version of the module, extending it and improving it. Even relatively inexperienced users can build the breadboard version of the module in order to understand how it works and save money.

(Taken From Official Website Of Arduino)
kb0iaa says: Apr 22, 2013. 8:32 AM
Would have loved to see your videos but they no longer exist. Your pictures were great though and illustrate your instructable very well. This was a great read and I learned something because I didn't know that LEDs could be used like this. Thanks for the great info!
Twisted~Mind says: Apr 25, 2012. 8:28 AM
In the supplies section, it says we need resistors - but where do we put the resistors on the Arduino?

(I'm new at this, and I thought your Instructable was really cool and decided to give it a try.)
Bot1398 (author) in reply to Twisted~MindApr 25, 2012. 8:41 AM
You can connect the resistor to the outputting LED for providing more protection to it but there is already a resistor on pin13 of the arduino so I didnt use it.
Twisted~Mind in reply to Bot1398Apr 25, 2012. 8:47 AM
Oh! I see. Thank you for the help! This is a really neat idea, thank you for sharing :).
blinkyblinky says: Mar 29, 2012. 4:36 PM
I did some code editing so that I had both a light and dark detector without having the need to reprogram it. Here is the result:

Bot1398 (author) in reply to blinkyblinkyMar 29, 2012. 7:23 PM
I also made the same thing earlier here is the result btw you deserve a patch for your innovation.
e=mc^2 says: Mar 13, 2012. 4:14 AM
Great work!
oallaa says: Mar 7, 2012. 8:39 PM
Great project never thought that a LED can be used as a sensor!!XD
toddie123 says: Feb 20, 2012. 8:02 PM
Wonderful discovery! Just tried it out and thats what I call MARVELOUS!
Bot1398 (author) in reply to toddie123Feb 21, 2012. 2:37 AM
Post some pictures and get a patch!
jensenr30 says: Feb 20, 2012. 8:26 PM
This is brilliant. I mean REALLY brilliant. I'm following XD
anmol11 says: Feb 15, 2012. 7:04 AM
what a project rohit!!....badiya ekdum...abe meko patch bejh in my this account!..please
scromp says: Feb 12, 2012. 6:44 PM
This is a cool discovery.. but why not just use a photoresistor?
Bot1398 (author) in reply to scrompFeb 13, 2012. 5:56 PM
Yes can suerly use a photoresistor .
Samimy says: Feb 11, 2012. 4:10 PM
nice man, a great post !
that was actually a big discovery, i never heard of it before.

Bot1398 (author) in reply to SamimyFeb 11, 2012. 7:09 PM
I too never heard about it before seeing this.It says they can be used to sense light.

Ã

MikB says: Feb 11, 2012. 3:25 AM
I recall seeing a design for a clock, LED based, where the flashing colon in the time (12:00) was implemented using two discrete LEDs. When driven (high) by an I/O port, they lit. The other half of the time, they weren't just off, they were switched as analogue INPUTS to read the "light level" in the room.

This then allowed the microcontroller driving the LEDs for the whole display to adjust the brightness of the display according to the light level in the room, as the current fed to the display was under the microcontroller's supervision.

Now that's a cool trick! Two uses for the same LED. I'm sure similar things can be done on Arduiono/ATMEGA/PIC, as long as you can reprogram an I/O pin from a driven OUTPUT to an analogue INPUT.
Pro

Get More Out of Instructables

Already have an Account?

close

PDF Downloads
As a Pro member, you will gain access to download any Instructable in the PDF format. You also have the ability to customize your PDF download.

Upgrade to Pro today!