Two ways to use an LED as a light sensor with Arduino
blog.jgc.org
blog.jgc.org
An LED is still a photodiode, as this blogpost noted. But you'll get more consistent results with a real photodiode (or phototransistor, if you want a bit of amplification added in)
----------
Obviously the diode works here and for this project. But given higher levels of sophisticated photosiodes (but still a similar circuit), you can choose photosiodes that detect infrared light
We humans light up like a light bulb in the infrared spectrum. So two IR Photodiodes is all you need for a human motion sensor.
A motion sensor detects motion by looking at two pixels of IR light. Motion is 'defined' as one pixel lighting up.... Followed by the second pixel lighting up. If only one pixel lights up, then no motion (it's just a glitch). Real motion should show up across both pixels in a slight time delay fashion.
IR Photodiodes (or phototransistors) are used because it's the spectrum of light humans shine the most brightly in, despite being invisible to us humans it's the best sensor at the electronics level for these purposes.
---------
There really isn't much electrical complexity to the motion sensor that this blogpost was trying to debug.
I would suggest building your own motion sensor as the next step in your EE journey.
A CMOS sensor is an array of thousands of photodiodes. So erm... diodes are _already_ used as the basis of modern digital cameras.
I guess building one out of LEDs (diodes designed to emit light, rather than receive it) is feasible but I can't imagine it'd work very well. If you build a big enough camera and calculate the right lenses, it probably would work. But it wouldn't surprise me if the proper size of such a camera was on the order of a 20-feet by 30-foot room (with a "camera sensor" the size of maybe 5-feet by 5-feet, composed of thousands of LEDs acting as terrible photodiodes).
--------
A proper CMOS sensor miniturizes all of that to happen on a micrometer scale, so you can shrink modern cameras down to... well... the size of our phones.
But the principles of light, sensors, and cameras in general work even with larger / inefficient objects. You just got to build a "large enough" camera to compensate for all the problems.
EDIT: And also what the other poster pointed out about the control circuitry. The circuits in a typical LED Screen are all "output only". There's no way for the information to come back / reverse the LED Screen because the circuits are already set. I'm assuming you're somehow building those circuits and have embedded them into the LEDs somehow.
Also, it would be an infrared screen.
Another fun fact about light and semiconductors is that the first commercial digital camera - the Cromemco Cyclops - used a 32x32 memory ic that used a windowed dip package so the chip was exposed to light. The memory was refreshed to all 1's, and the light would flip them back to 0's with the strongest light flipping the bits the fastest. The times were then parsed and converted to pixel values.
No sense in soldering this together just for a quick-and-dirty demo, right?
Yes, they work on resistor leads.
YKINMKBYKIOK
See US Patent 6,870,148 B2 March 22 2005 "LED WITH CONTROLED CAPACITIVE DISCHARGE FOR PHOTO SENSING" by Mitsubishi Electric Research Lab (MERL). https://image-ppubs.uspto.gov/dirsearch-public/print/downloa...
Also:
Dietz, P.H., Yerazunis, W.S., Leigh, D.L., "Very Low-Cost Sensing and Communication Using Bidirectional LEDs", ACM International Conference on Ubiquitous Computing (UbiComp), October 2003. BibTeX TR2003-35 - https://www.merl.com/publications/TR2003-35
Which is good for ~30 Baud and distances of inches at best.
https://people.ece.cornell.edu/land/courses/ece4760/FinalPro...
Hopefully you find it and let us know.
Forrest Mims was the first to propose using the LED as a sensor in the early 70s, not long after LEDs became common.
governments burn libraries
This feels like it would be part of the plot of a Neal Stephenson or Andy Weir book.
Our intrepid hero has to send super secret plans to save humanity through glass to his partner, so they can prevent Jupiter going supernova! But the Bad Guys are jamming wifi signals!
https://advlabs.aapt.org/items/detail.cfm?ID=13808
It includes a simple circuit that probably anyone here on HN could build. (Even me!)
A single photon source from an LED. I need to read it more closely, but was curious if it could be used to create a quantum RNG.
It sounds like if it's probabilistic it could also generate multiple photons.
It turns out the microcontroller was doing read-modify-write on a port that had an LED connected, and in bright sunlight the LED input would be high, and then stay high after the write. It was fixed with a firmware update that set the LED bit based on whatever logic determined if it should be on on every write.
What other sensors/emitters can be reversed this way?
I can also remember a project that used the arm of a galvanometer as a very sensitive balance for weighing tiny masses, too, which is the same sort of idea but the way it worked was to put a feedback loop around the voice coil and measure the current needed to keep it locked in place against the weight of the sample. https://www.erowid.org/archive/rhodium/chemistry/equipment/s... is a copy of the original article which would probably appear at https://www.scientificamerican.com/id/down-among-the-microgr... if I had access.
(although ti claims it's actually them https://www.youtube.com/watch?v=n90whRO-ypE)
1. Peltier effect. 2. Piezoelectric effect.
The second one is especially useful in DYI stuff since you can use a piezo speaker in order to generate a current when mechanically stressed.
(It sounds like you do need to apply an alternating current for this though)
The above paper goes further implementing two way comms using only a LEDs
[1] https://www.researchgate.net/publication/221568729_Very_Low-...
[2] https://courses.cs.washington.edu/courses/cse590u/03su/paper...
A red LED emits a lower energy photon than a green LED. Each will pick up their own reflections, but the green LED will not pick up the light from the red one.
Interesting read John but since no one brought it up you should be careful to assume the sensor is at fault.
Hypothetically the timestamps in the example (roughly 00:00 to 04:00) sound like a fine time for rodents to roam and many motion sensors will also trigger on our small mass friends. :)
Have you seen the movie Parasite?
Wait, what? Photodiodes are supposed to be letting (dark) current through continuously when light hits them in reverse bias. Heck, I even tested it empirically myself, and the light was continuous.
On this topic, what kind of light detector is the most linear? Photodiode? Phototransistor? Photoresistor? Something else?
I'm thinking about connecting it to a white LED to have an ambient-aware light.