LEDs are extremely common in electronic devices. They are used as light emitters, but can also be used as light detectors since they are photodiodes. By quickly switching between light emitting and detecting, you can use the LEDs to determine the ambient lighting and even do bidirectional communication. MERL has a good paper covering the basics of how this system works and how they used it as a “last-centimeter” communication device. The system can be implemented using one LED, a resistor, and two I/O pins. So, it could be used cheaply in almost any device. The microprocessor quickly switches the LED between emitting light, detecting light (LED acts as a charging capacitor), and measuring the discharge rate of the LED to determine light level. Jeff Han has a neat video demo of how this system can be used as a proximity sensor.
UPDATE: [hawkeyeaz1] pointed to a blog covering one person’s investigations into LED sensors.
75 thoughts on “Low-cost Sensing And Communication With An LED”
Lame, HackADay ain’t what it used to be. Before they’d publish hacks that an average guy could do with just a minimal understanding of electronics, and some extra stuff as well for guys who were far more advanced. That was great, and half of the hacks were fun things like how to get around this or that. Now its just all stupid stuff like mousepad coolers and technical reports on LED’s with no actual hack.
I agree that’s not a hack that’s just a lame report on somebody passing time with LEDs and the ball and plate thing from the other day is the same.
i’m sorry straus that you’re stuck in ignorance, read up a little – this is near ground-breaking stuff.
I had no idea an LED could hold a charge. Simply by reading the RC time from it, you can use it to sense light. Wondering if the BASIC Stamp RCTIME is quick enough to handle this.
Oh no, its so HARD to wire up an LED a resistor and a uC. I think this is a good hack, I had never thought of using an LED as a sensor instead of an output. I may be able to use this system in a robotics project I am working on.
Just because you don’t have a use for this “hack” doesn’t mean everyone else on HAD doesn’t.
Get over yourselves, people. This hack is great, it’s one of the coolest things I saw lately, and I saw a lot of them. It’s a LIGHTING device that is used to SENSE movement. Now, if this isn’t great, I don’t know what is. Plus, it uses a LED, one of the most common devices found out there, in ways that others didn’t even dreamt of. For me, it clearly beats downgrading the PSP firmware. No offense.
Not really groundbreaking (as the NYC experimenters note, this is mentioned in the 1977 Forrest Mims book), but a good primer on an often forgotten topic. At least Hackaday isn’t posting daily about how to crochet your own pirate robot ipod cozy like some other publication (cough, Make)
This has been featured on other sites similar to hack-a-day, but it is no less cool. Since I saw it not long ago (the multi touch display mention the other day is by the same group), I’ve been looking for resources on it. I have found one guy who did this after originally seeing the article, and he has blogged about his experiences, and has schematics, etc. His blog about this is here: http://projects.dimension-x.net/technology-and-projects/ledsensors/
I am personally wondering if LEDs as sensors can be used as sensors for glass. The Multi touch display works by frustrated total internal reflection, but requires a camera on the back. Why not use LEDs on the edge (like the MT-FTIR suggests – http://mrl.nyu.edu/%7Ejhan/ftirsense/index.html) but a mirror on two edges so the sensors can sense when something touches the screen (causing a dark spot where the light is reflected down, not back at the LED)…. Kinda hard to explain without a pic. :P
hmm, its sensing multiple things at once… could this be a breakthrough in multi-point sensing tech?
“I had no idea an LED could hold a charge.”
Ditto, and I’ve got an electrical engineering degree. You’d think they would have mentioned it.
Anyway, I’m sorry the first two commenters need their “hacks” springing fully formed from this website like Athena from Zeus’ forehead, but some of us don’t mind learning new things that we can apply to our own projects with a little work.
LEDs as photosensors? Awesome!
I was thinking that you could use this as a type of biometric password device. If you could interface this with usb (or serial, easier), build a driver that detects each led as a part of a matrix, then by simply doing a getsture on the pad while detecting it, waving a certain way or giving it the bird, it would detect that as the proper password. Pretty cool if you ask me.
Also, the merl link still has a dead pdf link. So I’d refer to ‘justDIY’s’ blog I mention above
nvm on the dead link :P
Actually, for those of us who are very attentive readers, we already know that LEDs can be used as light sensors to track the sun
Extremely cool! I like LEDs :D
pretty cool with what I imagine to have millions of uses… Get some tiny leds on a thin circuit board with plastice over it and you’ve got a ultra slim keyboard…
Very interesting, lots of uses.
Well, i agree, it is a good hack (and it is a hack), however generally speaking these hacks all have some feasable albiet unconventional uses. This lacks that. It isn’t even partially economical to use LED’s for an input device, unless total stealth is required (secret agents needs keyboards too i suppose). I guess it would be a cool way to replace your pressure sensative tracking surface on your mouse, or it could make a neat tablet, but from a cost standpoint it just plain isn’t economical to mass-produce. Sure, it’s cheaper then BUILDING your own pressure sensative tablet, but it isn’t cheaper then BUYING one. And is this even all that accurate? Sure, it has loads of pressure layers to be abused, but you would need alot of little LED’s arranged in a dense manner just to get what you want, and even then, you have a bright red (or whatever color you choose) light.
I guess if you manipulated it in such a way that you could use this to add real hand gestures to your computer it would be cool and cost effective since there is no real product out on the market for that, but in comparason to all of the current interface devices it isn’t all that great.
Don’t get me wrong, it’s cool, it’s neat, and if i had the time i sure a hell would do it myself, but it isn’t practical, atleast for the time bieng.
Straus, Dacidboome, maybe you two have forgotten that this site is driven by reader submissions. Instead of getting pissy, maybe you should find or make something cool.
Just a thought…
One of the coolest uses of LEDs I’ve seen in a while.
I love the stuff that gets posted here but most of the time is just “oh that’s kind of cool… completely useless to me but kind of cool” This is actually something I can use.
Interesting enough I think I saw something just like this only a few days ago. I happened to be in Redmond visiting a friend and stopped by the MS visitors center and they had a display with 2 large LED arrays pointing at a piece of glass with a map of the campus projected on it by a separate projector. It responded to hand gestures on or near the glass that allowed you to move, rotate, and zoom the map. considering I didn’t see anything in the apparatus outside of the Projector and the LED arrays (both plugged into a PC) I wouldn’t be surprised if the LEDs were being used in a similar fashion to collect the hand gestures.
logoff, i was thinking exactly the same thing as you.
It seems to be a learning curve is a lost hope among some readers.
hey, LEDs, photodiodes, and solar cells are the same thing, as any engineer ought to know. They’re just optimized for different properties.
I knew this was basically possible — I think I probably read the Forrest Mims thing as a kid, come to think of it — but what makes this cool (and it is cool IMHO) is the clever way of hooking it up to the micro.
Also, that LED-array touch sensor demo is just slick.
Ya I agree that this hack is even more interesting than the FTIR display because I think i have a chance of doing this one myself. I was about to order some LEDs for an xbox I’m modding so I guess I’ll be ordering some extras. If you check out the parent site of this and the FTIR post: http://mrl.nyu.edu/%7Ejhan/ you’ll see they’re working on some really freakin cool stuff.
Twistedsymphony – are you the Twistedsymphony on the xbox-scene forums?
Anybody else wondering if this can also run in infrared ? :) By the way, #10, you pointed out one of the first thoughts I had while reading this. It’s definetely doable.
From everything I’ve read about it, I don’t see why not, as LEDs can detect the freq they put out and lower (red detects red, yellow, green… yellow detects yellow, green but not red),.. ROYGBIV, where IR is to the left or R.
UV likely would work as well, but it would be awefully hot…
This is sweet. I’m going to build myself an interactive multipoint touchpad.
I suppose this works for OLEDs, too? Imagine a flexible transparent display with multipoint touch recognition. The future is now.
Not a hack – i learnt this when i was 9, wat happened to the old hackaday, stop linking outside and some real hacking
Awsome, down with the haters. Projects like this is why i come to hackaday. Who cares about xbox and psp mods.
This is cool! I have a boatload of those matrix led things and never realized I could use them as an input. I’m thinking of putting like 5 by 5 of them together now to make a little drawing table. WOuld love to have seen the source code for the pics on that though to save some time duplicating the effort.
11th post the guy gives the PIC source (at least for an initial version).
….star trek keyboards?
Some other uses of led as a sensor ,for sun tracking!
hi all – thanks for the linkage!
it has been a while since I’ve worked with this project – but if anyone sees anything they’d like on my blog (hires pics, etc), incl source code, just drop me a note (g-mail gordonthree) … the code is nothing fancy, and its written in Proton Plus Basic for PIC microcontrollers.
“I suppose this works for OLEDs, too? Imagine a flexible transparent display with multipoint touch recognition. The future is now.”
I did imagine it… And now I have to change my pants.
Since OLEDs operate on the same basic physical property — a p-n junction created by a boundary between two different semiconductor materials — and just are built and applied in a different way, I assume you probably could implement a multitouch interface with them. Which would be crazygonuts awesome.
H.A.D. rocks……this is a great article.
what was up there awhile ago? ”
Microsoft OLE DB Provider for ODBC Drivers error ‘80004005’
[Microsoft][ODBC SQL Server Driver][TCP/IP Sockets]SQL Server does not exist or access denied. Line 530 ”
Hackaday — hacked?? :)
That oled version would be slick! Right now a big limitation with touchscreens is the touchscreen overlay. This reduces the visibility of the screen greatly.
Looks like this could have many neat applications. Strange how some things were discovered long ago but not many know about it…
I’m just thinking out loud on this, but could this make things like the screens from “1984”?
Read about LED keyboard a year ago. It looked nice but the probable cost wah increadeble. I don’t think that this guy will be well-accepted by customers due to its cost.
to AM ET by sully: do you really what to have such a thing at your apartment? Can’t believe this :))
had – Please ignore my ignorant peers. Hacks are not “getting around this or that”. This particular post has a lot of applications (for your _creative_ readers) and the ball and plate one had a few interesting “hacks”. It had object recognition, real time feedback, etc.
LED’s photo voltaic properties can be used to design a simple robot that would find the brightest local spot. Connect two LEDs to a comparator and use the comparator output with an inverter to drive two cheap DC pager motors.
#22 – Thats funny that you posted that right after me because the first thing I thought of when I started shopping for LEDs was to use IR! The one downside to using this in a practical application that I can see is that it will light the whole room up red.
Also does anyone know if there are even any oled panels (no matter how small and what inputs) available at all to do any testing? I know its a fairly new tech so I don’t know how available it is. Just thinking about a 1/2mm thick display/touch screen makes me want to start building right now.
Now to the important stuff: is a Basic Stamp 2 fast enough to handle this?
i dont see how this is worthy of hackadays attention, and the other multitouch display han is working on gets dissed a few posts back.
as far as the oleds, im pretty sure you can buy them at mouser now.
If you could make it in blue, and set up an algorythm for security entry – it would be a very cool door lock
is there a schematic or block diagram available for this? I would like to build it as a science fair project.
I don’t see why people think that this (and other electronics construction projects) are not worthy of being on hack-a-day.
But I also don’t see why three of the top commented on posts are “HOW-TO: PSP 2.00 to 1.50 downgrade (146),” “How-to: PSP 2.00-2.60 homebrew with eLoader (76),” and “Xbox 360 ATX power supply (73).” I am usually rather dissapointed when I see things like this posted. I’m not saying they don’t qualify as hacks, they just aren’t very interesting.
Rick Marchall: Look at justdiy’s blog mentioned in the update. Also, justdiy mentions in comment #32 if anyone wants schematics, source code, etc to email him.
This is indeed a very cool hack!
Would it be possible to just read the leds at a certain interval and display something the rest of the time? That would make a very cool keyboard, that could displat information as well.
And just imagine, a keyboard wich could be transformed into a gigant touchpad with the press of a button… That sure would be something :)
wow thats friggin awesome never new you could use a led as a sensor to. learn something new everyday :-D
Please be kind and respectful to help make the comments section excellent. (Comment Policy)