Yahoo Groups archive

Homebrew PCBs

Index last updated: 2026-04-28 23:05 UTC

Message

Re: UV LED Test

2008-03-06 by javaguy11111

I did up a little program in scilab to add up contributions of a 1D
array of LEDs based on the intensity diagram from the BestHongKong
LEDs. You will have to download scilab to run it. Google for it if you
do not know what it is.

I am assuming that the radiation diagram is in W/m^2-sr or Watts per
meter squared per steradian, but values returned are just relative to
the what is in the radiation diagram. 

For my case of a .5 inch grid spacing it looks like something around
1.9 inches looks optimal which is close to what Adam was recommending.

Disclaimer, I am not an optics expert so I could be doing something
wrong, but the results look reasonable.


//Simple 1D intensity calculator
//Use with scilab
//Change gridl,gridy,gridx to get different patterns
clear all;
gridl=12;  //Number of LEDs
gridy=1.9;//Height above the board
//gridy=1.42;//Height above the board
gridx=.5;//Spacing of LEDs

//Calculate the intensity of a single LED based on 
//angle
function result=getInten(rtheta)
  //Angles step with intensity .1
  //20 Degree LED/10 degree half angle
  point=[0  5  6 7  8  9  10  11  15  20 90];
  //40 degree LED
//  point=[0  8  11 15 18  20  22  28  37  55 90];
  inten=[1,.9,.8, .7, .6, .5, .4, .3, .2, .1, 0];
  theta=abs(rtheta*180/%pi);
//  printf("angle is %i\n",theta);
  prevVal=0;
  currentVal=0;
  if(theta==0)
    result=1;
    return;
  end
  for i=2:length(point)
    currentVal=point(i);
    if currentVal>theta then
      dtheta=currentVal-prevVal;
      dinten=inten(i)-inten(i-1);
      result=inten(i-1)+(theta-point(i-1))*dinten/dtheta;
      return;
    end
    prevVal=currentVal;
//    printf("%i\n",point(i));
  end
  result=0;
endfunction

//Calculate total intensity at a point from
//an line of LEDs
function result=getTotal(x)
  result=0;
  for i=1:gridl
    result=result+getInten(atan((x-gridx*i)/gridy));
  end
endfunction

x=-3*gridx:.05:gridx*(gridl+3);
value=1:1:length(x);

for i=1:length(x)
  value(i)=getTotal(x(i));
end

scf(1);
clf();
text=sprintf("%i LEDs   %.2f spacing   %.2f height",gridl,gridx,gridy);
plot2d(x,value,leg=text);

Attachments

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.