Measuring Light with LED and FPGA

Hi Folks,

got interested to test it out, and well I have VERY preliminary results

- all the test setup was done within 30 minutes, so it's just proof of concept:

Test setup

1) Xilinx S3 FPGA (a GOP module from oho-elektronik) 2) IOPad oscillator (using 2 io pins, see at the end of posting) 3) green 0805 SMD LED 4) JTAG Frequence meter software and ip-core, one channel connected to the IOPad oscillator (the frequence meter application is the same as at

first I tried to put the LED between the 'diff' outputs of the iopad oscillator, but that did not have good results, by placing the LED with one terminal on X2 and other one just unused (put pullup enable) FPGA pin I was able to see light influence on the oscillator frequency. the oscillator did run at 35MHz, light from window or then covered up with paper caused a frequence change of 80KHz, well that isnt much but I guess my setup wasnt not the best to get the 'sensor effect' out - still the frequence change was cleary observable.

of course the current test setup is sensitive also to capacitance so using your finger to cover up the LED will have more capacitive impact then light dependant changes. Anyway with proper bias and (series) resistor the light dependancy of an normal LED should be very easy to measure with an FPGA


---------------------------------- library IEEE; use IEEE.STD_LOGIC_1164.ALL; use IEEE.STD_LOGIC_ARITH.ALL; use IEEE.STD_LOGIC_UNSIGNED.ALL;

entity xti_oco_io2pin is Port ( X1 : inout STD_LOGIC; X2 : inout STD_LOGIC; EN : in STD_LOGIC; -- fake always high signal CLK : out STD_LOGIC ); end xti_oco_io2pin;

architecture Behavioral of xti_oco_io2pin is

begin X1

Reply to
Loading thread data ...

I saw a neat trick recently for effectively all-digital measurement of light using a LED. The gist of it was to charge the junction capacitance of a LED up, then measure the time it took to discharge - higher light-levels increasing discharge rate. This was implemented on a PIC but should be equally do-able on a FPGA.

Reply to
Mike Harrison

Randomly-grabbed led's measured...

red 32 pF yel 9 grn 10 white 42


Reply to
John Larkin

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.