Thanks for that - wanna make a touch remote controller for Winamp, for when I am in the shower (will be sealed in a box, with windows for the leds to make it water resistant). Gonna use a picaxe, then hack a cheap usb numeric keypad (unsolder keys & replace dem with relays) to give an input for next or last track or volume up or down. Coool!
Don't know numbers, but certainly less sensitive than a true photodiode. Any semiconductor can manifest some degree of photovoltaic effect. I've removed the metal casing of small transistor and under light some voltage did buid up. The solar cells are also made of silicone junctions.
I have few Soviet transistrors in metal. If remove a part of its body they became a fototransistors. Sensitivity depends of its amplification characteristics.
Wow thats pretty cool mate! i never new that L.E.D's acted as capacitors?? are they photo L.E.D's tho? ie IR L.E.D's?
Might have to go maplins and get some high bright ones and try! plus gives me an excuse to see the fit girl that works in there on wednesday! Lol thanks! :)
No, you don't even need to use a LED in forward bias configuration at all. The point is that any LED _generates_ a voltage when it _receives_ light (just like an oscillation generates a sound and a sound generates an oscialltion, as in crystal glasses being broken by a sound). You can try this by connecting a voltmeter across the pins of any *disconnected* LED, and putting the LED under a bright light.
What we are doing is essentially disconnecting the led from the circuit, quickly connecting it to the ADC and measuring whatever voltage is across its terminals. You will inevitably lose something, because as fast as your MCU may be, it will still need to set the pins and start the ADC reading.
So, in short: the 'LED on' part is entirely unnecessary: you can keep another LED always on, and use the 'input' LED to continuously start ADC readings.
That's actually what Roland does on its VA-7 and VA-76 keyboards (I have a VA-7 :)). It was two infrared LEDs that allow you to change midi parameters in real time by waving your hand above it. The whole ordeal is marketed as D-Beam, but it's the same thing I was describing. Pointing a digital camera to the thing reveals that one LED is always on while the other is off (presumably because it's reading).
but then would you have it on a on/off cycle so you can take a reading without interference? or are you trying to figure out range from the light that bounces back?
its not really that hard to prevent flicker is it? why would it be flickering?
yea, when your using leds as inputs it will be highly sensitive. because it has a very little difference. if your worried about interfearence you should use photo resistors and just hide them.
if its near an appliance then definitely it will get interference too.
what exactly are you trying to do with it though?
That's correct. I didn't even use a specific reference voltage; I found that ADC readings at the top and the bottom of the scale were not as reliable, as if it lost some accuracy.
I don't have the schematics or the code anymore, so I can't tell for sure what frequency the LEDs are working at. It's probably in the order of a few dozen milliseconds.
If I were to re-do this, I would use a few transistor to control the LEDs, to have higher current in shorter pulses (= higher granularity).
I don't think that using only one LED will work, but I cannot say that for sure as I haven't tried that.
The idea is that the LED 'sees' the reflected light coming from another LED with the same wavelength, so one has to be forward biased and the other has to be reverse biased (and then disconnected) at the same time.
Using PWM for the 'transmitting' LED would work, as long as the 'receiving' LED used the same frequency. This is, in a way, similar to how remote controls work. :)
Thanks for the replay. I kinda figured that is why you need two.
What I meant was could you use the LED as just a sensor and never forward bias it? That would sense the ambient light right? Also as you said each LED is most sensitive to its color, so could you use a RGB LED to detect colors?
Yes, you could just alternate between reverse bias and high impedance; I am not so sure about sensing ambient light. The main problem is that LEDs tend to be sensitive about their own specific wavelength, so the possibility of detecting other shades would decrease. I haven't tried that too.
As for RGB leds... that might work, but you'd need to cycle through red, green and blue, and possibly calculate an average.
When you shine light on the reverse-biased LED, wouldn't the increased photocurrent discharge the charge on the junction (resulting in a lower voltage), as oppose to giving a bigger ADC reading?
I assume your bar graph displays the ADC range 0 - 255?
In my single-LED setup, I read lower ADC readings via serial port when I shone light on the sensor LED.
Oh, it seems youtube ate my reply. Yes, you are right -- I checked the code and the first thing I do with the ADC reading is subtract it from 255, effectively "reversing" it (I am using only 8 bits for the ADC as it's a proof of concept). The bar graph is handled by simply calculating how many leds need to be turned on (I have 8 leds, so each led is worth 32; I just divide my value by 32) and I turn them on accordingly with a for loop.
The code is fairly simple: you have to alternate the LEDs between being forward biased (Vcc on anode, GND on cathode), reverse biased (GND on anode, Vcc on cathode) and disconnected (tri-stated on both poles). At that point you start an ADC reading and measure the voltage you receive: the more light a LED sees when it's disconnected, the higher voltage it will shows across its poles. You can try this by using any led connected only to a voltmeter moving it under a table lamp. (continued)
You could use one led constantly on and the other alternating between reverse bias (charging) and high impedance (disconnected). The key here is letting it charge and quickly disconnect it to measure it. If you wanted to go all digital, you could measure the time it takes to discharge, but that would be tedious and imprecise, while ADC readings are usually quicker (and make the code much cleaner). However, digital readings could be used in an instantaneous fashion, for instance (continued)
if you wanted to use this system to have two led-equipped devices to communicate, in a kind of ultracheap serial wireless connection. The main issue would be making it synchronized, but using two leds (one for RX and one for TX) and USART outputs of any MCU would leave the burden of it to the hardware. In any case, even by reinventing the wheel, it would be a software wheel. Imagine being able to access the 'debug menu' of a television set by merely placing a terminal close to its standby led!
When you shine light on the reverse-biased LED, wouldn't the increased photocurrent discharge the charge on the junction (resulting in a lower voltage), as oppose to giving a bigger ADC reading?
In my single-LED setup, I read lower ADC readings via serial port when I shone light on the sensor LED.
Well, I'm sure Logitech knows about this. It's a little known but quite easy concept, in fact my Roland VA7 keyboard (music keyboard!) has implemented the same thing using a couple of infrared leds and gave it the fancy name of "D-Beam". Looking at the leds with a cheap camera (the cheaper the better, as they are more sensitive to infrared light), one can see how one is emitting light, and the other is not. :) In my case both appear as emitting light, but they're actually pulsing.
Thanks for that - wanna make a touch remote controller for Winamp, for when I am in the shower (will be sealed in a box, with windows for the leds to make it water resistant). Gonna use a picaxe, then hack a cheap usb numeric keypad (unsolder keys & replace dem with relays) to give an input for next or last track or volume up or down. Coool!
66Ralphy99 1 month ago
will this be affected by daylight...and darkness?...
100roberthenry 7 months ago
hi im looking to just fade 1 led up and down by this type of sensor...any ideas..i want to be able to fade a led up and down with my foot?... :)
100roberthenry 7 months ago
can you do the same with Flexi Force Sensors
CARLHALEY1964 7 months ago
Type PRIZE before youtube and hit enter
kiriakoskakos 1 year ago
00:54 OVNIS!
GustavoFire 1 year ago
can you please give us the schematic diagram of this project and it's components? thank you in advance!
herecomesurman 1 year ago
my friend could you tell me how to do this proyect please
eduardo17cova 1 year ago
very nice, good job!
msplace08 1 year ago
ш can't get how it is working. Is there a light sensor and you using ADC to sense a light???
extremisto47 1 year ago
When one LED is on, the other one is used as input sensor, then switch places. Read the description.
McGuywer 1 year ago
what sevsitivity of LEDs in mV??? I never heard leds can be used like sensors... hm
extremisto47 1 year ago
Don't know numbers, but certainly less sensitive than a true photodiode. Any semiconductor can manifest some degree of photovoltaic effect. I've removed the metal casing of small transistor and under light some voltage did buid up. The solar cells are also made of silicone junctions.
McGuywer 1 year ago
I have few Soviet transistrors in metal. If remove a part of its body they became a fototransistors. Sensitivity depends of its amplification characteristics.
extremisto47 1 year ago
can i get instruction on how you made this
atpinternational 2 years ago
Your pumping waaay to much juice threw those two LEDS
Lexakron 2 years ago
Wow thats pretty cool mate! i never new that L.E.D's acted as capacitors?? are they photo L.E.D's tho? ie IR L.E.D's?
Might have to go maplins and get some high bright ones and try! plus gives me an excuse to see the fit girl that works in there on wednesday! Lol thanks! :)
DjSprinks890 2 years ago
Comment removed
AgentCROCODILE 2 years ago
Comment removed
AgentCROCODILE 2 years ago
No, you don't even need to use a LED in forward bias configuration at all. The point is that any LED _generates_ a voltage when it _receives_ light (just like an oscillation generates a sound and a sound generates an oscialltion, as in crystal glasses being broken by a sound). You can try this by connecting a voltmeter across the pins of any *disconnected* LED, and putting the LED under a bright light.
jollino 2 years ago
What we are doing is essentially disconnecting the led from the circuit, quickly connecting it to the ADC and measuring whatever voltage is across its terminals. You will inevitably lose something, because as fast as your MCU may be, it will still need to set the pins and start the ADC reading.
So, in short: the 'LED on' part is entirely unnecessary: you can keep another LED always on, and use the 'input' LED to continuously start ADC readings.
jollino 2 years ago
That's actually what Roland does on its VA-7 and VA-76 keyboards (I have a VA-7 :)). It was two infrared LEDs that allow you to change midi parameters in real time by waving your hand above it. The whole ordeal is marketed as D-Beam, but it's the same thing I was describing. Pointing a digital camera to the thing reveals that one LED is always on while the other is off (presumably because it's reading).
jollino 2 years ago
Note that LEDs are most sensitive to the same wavelength that they emit, so you should use LEDs of the same kind!
jollino 2 years ago
Comment removed
AgentCROCODILE 2 years ago
i think the two leds are on a seperate cycle
skierplaterandy 2 years ago
Comment removed
AgentCROCODILE 2 years ago
i figured, cuz its hard to switch them on and off at the speed of light XD
skierplaterandy 2 years ago
Comment removed
AgentCROCODILE 2 years ago
but then would you have it on a on/off cycle so you can take a reading without interference? or are you trying to figure out range from the light that bounces back?
its not really that hard to prevent flicker is it? why would it be flickering?
skierplaterandy 2 years ago 2
Comment removed
AgentCROCODILE 2 years ago
use pwm (pulse width modulation)
change it so the on pulse is longer than the off one.
and yes make it high frequencey
skierplaterandy 2 years ago 2
Comment removed
AgentCROCODILE 2 years ago
Comment removed
AgentCROCODILE 2 years ago
yea, when your using leds as inputs it will be highly sensitive. because it has a very little difference. if your worried about interfearence you should use photo resistors and just hide them.
if its near an appliance then definitely it will get interference too.
what exactly are you trying to do with it though?
Fuckyeahimover18 2 years ago 2
Comment removed
AgentCROCODILE 2 years ago
Comment removed
AgentCROCODILE 2 years ago
wait what?
skierplaterandy 2 years ago
Comment removed
AgentCROCODILE 2 years ago
That's correct. I didn't even use a specific reference voltage; I found that ADC readings at the top and the bottom of the scale were not as reliable, as if it lost some accuracy.
I don't have the schematics or the code anymore, so I can't tell for sure what frequency the LEDs are working at. It's probably in the order of a few dozen milliseconds.
If I were to re-do this, I would use a few transistor to control the LEDs, to have higher current in shorter pulses (= higher granularity).
jollino 2 years ago
Comment removed
AgentCROCODILE 2 years ago
Comment removed
AgentCROCODILE 2 years ago
Wow that is rather cunning I never knew that fact about LED's functioning as a capacitor when flipping the current around briefly. NICE STUFF 5 STARS
rdoetjes 2 years ago
it is amazing ciruit could i get the schematic of this project and the SW you used please.
is it ciruit can used to detect motion for long distance
thanks for advance
melsaidy 2 years ago
don't believe it is for long distance since the light must be reflected from one led to another....
1. you must have proper magnification lences for the receiver
2.and the light must be coherent like that of a laser
dtfbandit 2 years ago
im assuming you used C while making this?
what did you do to detect the voltage of the leds?
would you post your code?
Berserk879 2 years ago
Nice sensor. Can I get the circuit of this. Is this possible with 6 or more Leds. I need i it for atleast 6 Leds
hahaiha 3 years ago
wow that was some crazy IR you captured running through the LEDs, are they hooked to an IR or Photo sensor?
theEphimeralADub 3 years ago
This is great! Can you do this as effectively with only one sensor LED or does it work better with two?
Does pulsing forward bias effect the reading? If the LED was off, (reverse bias and high-impedance) would this still be possible?
Thanks,
Justin
JRproducts 3 years ago
I don't think that using only one LED will work, but I cannot say that for sure as I haven't tried that.
The idea is that the LED 'sees' the reflected light coming from another LED with the same wavelength, so one has to be forward biased and the other has to be reverse biased (and then disconnected) at the same time.
Using PWM for the 'transmitting' LED would work, as long as the 'receiving' LED used the same frequency. This is, in a way, similar to how remote controls work. :)
jollino 3 years ago
Thanks for the replay. I kinda figured that is why you need two.
What I meant was could you use the LED as just a sensor and never forward bias it? That would sense the ambient light right? Also as you said each LED is most sensitive to its color, so could you use a RGB LED to detect colors?
JRproducts 3 years ago
Yes, you could just alternate between reverse bias and high impedance; I am not so sure about sensing ambient light. The main problem is that LEDs tend to be sensitive about their own specific wavelength, so the possibility of detecting other shades would decrease. I haven't tried that too.
As for RGB leds... that might work, but you'd need to cycle through red, green and blue, and possibly calculate an average.
jollino 3 years ago
Hello, My name is Oscar and from mexico city.
I have a two question, What kinds of sensor used? and What happens if a PIC16F84 it stopped sending signals to the pic if this already is running?
I would appreciate your prompt response
I have a project of a robot and wanted to know whether using a sensor that resivir signal to activate a relay and the making of crystal quartz Logoff
ODFH 3 years ago
I see. Thanks for your replies.
When you shine light on the reverse-biased LED, wouldn't the increased photocurrent discharge the charge on the junction (resulting in a lower voltage), as oppose to giving a bigger ADC reading?
I assume your bar graph displays the ADC range 0 - 255?
In my single-LED setup, I read lower ADC readings via serial port when I shone light on the sensor LED.
programwithpassion 3 years ago
Oh, it seems youtube ate my reply. Yes, you are right -- I checked the code and the first thing I do with the ADC reading is subtract it from 255, effectively "reversing" it (I am using only 8 bits for the ADC as it's a proof of concept). The bar graph is handled by simply calculating how many leds need to be turned on (I have 8 leds, so each led is worth 32; I just divide my value by 32) and I turn them on accordingly with a for loop.
jollino 3 years ago
Very nice!
Esp the bar graph.
Shouldn't the reading decrease when you hover your fingers over it, since more light is reflect back on the sensor LED?
How does this implementation work (in terms of code)? I tried something similar a couple of months ago
P1Cpro 3 years ago
The code is fairly simple: you have to alternate the LEDs between being forward biased (Vcc on anode, GND on cathode), reverse biased (GND on anode, Vcc on cathode) and disconnected (tri-stated on both poles). At that point you start an ADC reading and measure the voltage you receive: the more light a LED sees when it's disconnected, the higher voltage it will shows across its poles. You can try this by using any led connected only to a voltmeter moving it under a table lamp. (continued)
jollino 3 years ago
You could use one led constantly on and the other alternating between reverse bias (charging) and high impedance (disconnected). The key here is letting it charge and quickly disconnect it to measure it. If you wanted to go all digital, you could measure the time it takes to discharge, but that would be tedious and imprecise, while ADC readings are usually quicker (and make the code much cleaner). However, digital readings could be used in an instantaneous fashion, for instance (continued)
jollino 3 years ago
if you wanted to use this system to have two led-equipped devices to communicate, in a kind of ultracheap serial wireless connection. The main issue would be making it synchronized, but using two leds (one for RX and one for TX) and USART outputs of any MCU would leave the burden of it to the hardware. In any case, even by reinventing the wheel, it would be a software wheel. Imagine being able to access the 'debug menu' of a television set by merely placing a terminal close to its standby led!
jollino 3 years ago
I see. Thanks for your replies.
When you shine light on the reverse-biased LED, wouldn't the increased photocurrent discharge the charge on the junction (resulting in a lower voltage), as oppose to giving a bigger ADC reading?
In my single-LED setup, I read lower ADC readings via serial port when I shone light on the sensor LED.
Thats why I was thinking the bar graph
P1Cpro 3 years ago
cool man
antirealm 3 years ago
Brilliant job, i would love something like this on my g15 keyboard :D. Perhaps send your idea to logitech?
Anomalybilly 3 years ago
Well, I'm sure Logitech knows about this. It's a little known but quite easy concept, in fact my Roland VA7 keyboard (music keyboard!) has implemented the same thing using a couple of infrared leds and gave it the fancy name of "D-Beam". Looking at the leds with a cheap camera (the cheaper the better, as they are more sensitive to infrared light), one can see how one is emitting light, and the other is not. :) In my case both appear as emitting light, but they're actually pulsing.
jollino 3 years ago
great work
hopeitshappy 3 years ago
Thank you :)
jollino 3 years ago