As a glutton for punishment, I find it is best to keep as many irons in the fire in terms of micro-electronic projects as possible.
My latest fascination is with the bi-directional properties of light emitting diodes. From reading a few dry papers on using LEDs as inputs, I have found there are at least two ways of accomplishing this. First an LED by itself will generate a tiny DC voltage when exposed to a light source of the same or higher frequency of the LED. I think of this as photovoltaic operation. Any high-impedance voltmeter can measure this voltage, and it ranges based on intensity from 0 to 1.5 volts. The other, and perhaps more useful method, is using the LED as a light dependent capacitor. By reverse biasing the LED, a charge is placed on the junction. This charge is then dissipated by the LED’s photovoltaic properties once the reverse bias is removed.
So, using a microcontroller, I have been able to take advantage of this knowledge to create a simple ‘interactive interface’ with a pair of LEDs. The process works like this:
Breadboard setup: 2 LEDs, 2 current limiting resistors in series with the LEDs. LED anodes are connected to bi-directional digital I/O pins on the mcu. LED cathodes are connected to bi-directional digital/analog I/O pins on the mcu.
Step 1> Forward bias the led array (all LEDs lit). This entails setting the anode connected IO lines to output a HIGH logic state (current source) and the cathode connected pins to output a LOW logic state (current sink).
Step 2> Reverse bias the first led in the array. I accomplish this by switching the rolls of the anode and cathode pins. Anode = sink, Cathode = source. This charges the capacitance of the led up to a logic HIGH potential (+5v).
Step 3> Switch the cathode connected pin into a high-z input mode and connect it to the microcontrollers ADC.
Step 4> Perform an analog to digital conversion on the LED, reading the voltage potential stored in the LED. I’ve obtained values around 3.3 volts while the led is “dark” and as low as 0.9 volts while the led is brightly lit by the rest of the array via a mirror. Using a red laser pointer fully discharges the LED resulting in a 0 volt sample.
Step 5> Forward bias the LED again, switching the cathode connected pin back into a digital output of a logic LOW state.
Step 6> Repeat steps 2 through 6 for remaining LEDs in the array
Step 7> Dump ADC results to the serial port for analysis by the host PC.
On paper, this sounds like a lot of work, but thanks to the mighty Microchip PIC microcontroller, it’s really just a series of setting bitwise registers on the PIC and reading the ADC results.
I want to try connecting an op-amp inline with the ADC sampling to try to increase the response time of the led… right now I’m using a 1ms analog sample time, which is causing a slight flicker in my array. If I can halve that it should eliminate any flicker. The problem with a faster sample time is I loose dynamic range or “brightness sensitivity”. I believe this is due to the fact the LED does not discharge fast enough.
A forum member on the linear1 forum recommended I place a resistor across the LED to speed up this discharge. It is certainly worth trying, and simpler than wiring in an op-amp!