FPGA Central - World's 1st FPGA / CPLD Portal

FPGA Central

World's 1st FPGA Portal

 

Go Back   FPGA Groups > NewsGroup > FPGA

FPGA comp.arch.fpga newsgroup (usenet)

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 05-03-2006, 04:57 PM
Antti
Guest
 
Posts: n/a
Default 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
gforge.openchip.org)

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

Antti

----------------------------------
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 <= X2 when EN='1' else 'Z';
X2 <= not X1 when EN='1' else 'Z';
CLK <= X1;
end Behavioral;

Reply With Quote
  #2 (permalink)  
Old 05-03-2006, 05:29 PM
Tommy Thorn
Guest
 
Posts: n/a
Default Re: Measuring Light with LED and FPGA

Antti wrote:
> 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
> gforge.openchip.org)


Eh, http://openchip.org: "All Intellectual property right hold by
OpenChip have been transferred." It appear to have disappeared.

Tommy
Reply With Quote
  #3 (permalink)  
Old 05-03-2006, 06:19 PM
Antti Lukats
Guest
 
Posts: n/a
Default Re: Measuring Light with LED and FPGA


"Tommy Thorn" <[email protected]> schrieb im Newsbeitrag
news:[email protected]
> Antti wrote:
>> 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
>> gforge.openchip.org)

>
> Eh, http://openchip.org: "All Intellectual property right hold by OpenChip
> have been transferred." It appear to have disappeared.
>
> Tommy


http://gforge.openchip.org/projects/fpgafreqmeter/

I was referring to that project - its not the latest version but also
working one. So for the LED sensor test I created a custom toplevel with
iopad oscillator and used the jtag -connected host application to measure
the frequency.

Any yes all rights to ip-cores and source code tagged as: Copyright XXXX
OpenChip
are now hold by Xilant Technologies Inc.
same goes for ip from Silicon Studio and Case2000

As Xilant website is VERY much work in progress so there is nothing much
visible there - yet. SORRY, I am busy working so updating the website is
left behind

But as example the FPGA Frequency meter IP core and host side software
library is used in the Xilinx Spartan3E flash programming tool
http://xilant.com/component/option,c...fileinfo/id,8/

Antti


















Reply With Quote
  #4 (permalink)  
Old 05-03-2006, 09:09 PM
Jim Granville
Guest
 
Posts: n/a
Default Re: Measuring Light with LED and FPGA

Antti wrote:
> 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:


When I tested a (red?) LED a few weeks ago ( similar idea?) the uA meter
in sunlight indicated some few uA.
So yes, it does change, but not by much!

Two leds might allow a Push-pull type drive, but it would
be a challenge to have a stable setup that
could be LED out, or LED in ?

-jg

Reply With Quote
  #5 (permalink)  
Old 05-04-2006, 12:26 AM
Mike Harrison
Guest
 
Posts: n/a
Default Re: Measuring Light with LED and FPGA

On 3 May 2006 08:57:58 -0700, "Antti" <[email protected]> wrote:

>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
>gforge.openchip.org)
>
>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


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 With Quote
  #6 (permalink)  
Old 05-04-2006, 01:29 AM
John Larkin
Guest
 
Posts: n/a
Default Re: Measuring Light with LED and FPGA

On Wed, 03 May 2006 23:26:02 GMT, Mike Harrison <[email protected]>
wrote:

>On 3 May 2006 08:57:58 -0700, "Antti" <[email protected]> wrote:
>
>>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
>>gforge.openchip.org)
>>
>>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

>
>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.
>


Randomly-grabbed led's measured...

red 32 pF
yel 9
grn 10
white 42

John

Reply With Quote
  #7 (permalink)  
Old 05-04-2006, 02:13 AM
Jim Granville
Guest
 
Posts: n/a
Default Re: Measuring Light with LED and FPGA

Mike Harrison wrote:
>
> 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.


Nice idea, but would need care on devices without Schmitt Pins.
Slow edges and FPGA are uneasy bedfellows

-jg


Reply With Quote
  #8 (permalink)  
Old 05-07-2006, 10:22 AM
Antti
Guest
 
Posts: n/a
Default Re: Measuring Light with LED and FPGA

the missing schmitt's shouldnt be a problem.

But I still dont know what is the best and minimal hardware connection
of the LED to the FPGA

I first tried to use no components connection by connecting the LED
directly to io pins and using
pullup-down as resistor, but I got rather bad results for some reason,
the light sensitivity was
about 0.2% at the best (light dependant change of oscillating
frequency)

by using the R-C-R 3 pin oscillator from Peter Alfkes 'six easy pieces'
I got 10% difference
between sunlight and dark, setup
R1=R2=18k
C=10nf in series with green SMD LED

dark 740 KHz
light 670 Khz

I havent looked at signal on the iopins at all, I guess there should be
some better setup than using 3 io pins and 2 resistors to measure the
LED as sensor

Antti

here is the RCR oscillator I used

two resistors in series from ri to ro
the middle of them via led in series with capacitor to c

------------
library ieee;
use ieee.std_logic_1164.all;

entity xti_oco_rcr is port (
ri : in std_logic;
ro : inout std_logic;
c : inout std_logic;
en : in std_logic; -- always 1
clk : out std_logic);
end;

architecture rtl of xti_oco_rcr is
signal c_s : std_logic;
begin
clk <= ri;
ro <= not c when en='1' else 'Z';
c <= c_s when en='1' else 'Z';
c_s <= not (not ((not (not ri and not ro)) and c) and (not (ri and
ro)) );
end rtl;

Reply With Quote
  #9 (permalink)  
Old 05-07-2006, 11:32 AM
Jim Granville
Guest
 
Posts: n/a
Default Re: Measuring Light with LED and FPGA

Antti wrote:

> the missing schmitt's shouldnt be a problem.
>
> But I still dont know what is the best and minimal hardware connection
> of the LED to the FPGA
>
> I first tried to use no components connection by connecting the LED
> directly to io pins and using
> pullup-down as resistor, but I got rather bad results for some reason,
> the light sensitivity was
> about 0.2% at the best (light dependant change of oscillating
> frequency)
>
> by using the R-C-R 3 pin oscillator from Peter Alfkes 'six easy pieces'
> I got 10% difference
> between sunlight and dark, setup
> R1=R2=18k
> C=10nf in series with green SMD LED
>
> dark 740 KHz
> light 670 Khz


That's an appx tau Equiv Cap of 80pF, so the LED is being some
sort of Current Offset Varicap. No DC current can flow thru the 10nF.


> I havent looked at signal on the iopins at all, I guess there should be
> some better setup than using 3 io pins and 2 resistors to measure the
> LED as sensor


The LED will inject is a couple of uA, so a circuit needs to sense that.
With a 3 term Osc, and DC current injection (not what you have above) DC
current injection will first skew duty cycle before it really affects
Freq much.

Probably the best oscillator topology for dF with injection current
sense, is to copy the HC4046 Oscillator.

That is cross coupled S-R latch, with OC discharge, and the charge
signal on one side, can be the LED current.
This OSC can have either a single CAP, or two CAPs
Very large dF with light can result, which can be damped with
a parallel injection current. ( say 10M or 20M )

-jg


Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Measuring pulse width in ModelSim simulation without using cursors and writing the widths to a text file PeterC FPGA 4 03-17-2006 02:26 AM
PS/2 keyboard interface light led's tazkhan83 Verilog 0 02-25-2006 11:38 AM
Measuring DDR SDRAM [email protected] FPGA 0 06-07-2005 01:56 PM
error occurred when downloading in ML310 board: OPB ERR red light - microblaze EDK tutorial Hur FPGA 0 01-08-2005 06:56 PM
let me have logic design for traffic light [email protected] FPGA 8 08-17-2004 07:26 PM


All times are GMT +1. The time now is 09:05 AM.


Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0
Copyright 2008 @ FPGA Central. All rights reserved