Clock Frequency to read a Linear Sensor Array

In the datasheet of TSL1401 design considerations are given in that

1.) How to set the clock frequency to 5-8Mhz inorder to read from Linear Sensor Array(TSL1401rlf) 128x1 array sensor).

2.) Do i need to interface any buffer or Opamp circuitry to the AO pin of the sensor?

Hi, please re-read the spec sheet, 5kHz to 8kHz.

http://docs-asia.electrocomponents.com/webdocs/0892/0900766b80892a98.pdf

By the way its an obsolete device in some packages/manufacturers, but an interesting one.

Tom........ :slight_smile:

But how do i generate 5-8Mhz clock frequency to the sensor from Arduino UNO?????

thats ok..

Say suppose i generate the clock frequency using timer .. will i be able to read ANALOG signal from arduino uno's port??
Won't the timer mess up the analog read funtion??

If yes then how do i generate a clock frequency eg: 5Mhz for the Sensor(TSL1401rlf).

Please help me out..

Hi, sorry, to long a day....

Tom..... :slight_smile:

I have attached some old UNO code I used to test reading a different linear sensor but the principle will be the same and you may be able to hack it to suit your needs.

ILX511_v2.ino (5.48 KB)

Thank you Riva.. i am trying it out..

thank you,, your codes reads data from sensor..!! thank you so much..

Now am suppose to read a barcode using this TSL1401.

how am i supposed to read, store and retrieve the barcode???

In that am struck up with reading the absolute value 0V[white space] and 2V[black spa] accurately..

Please help....

vaish:
thank you,, your codes reads data from sensor..!! thank you so much..
Glad it was adaptable to your needs.

Now am suppose to read a barcode using this TSL1401.
I would guess a good return image would consist of high/low sections corresponding to the black/white barcode. You would need to measure the widths of each section to determine if it's a narrow/wide gap/bar and then convert that into a barcode number (assuming the barcode encoding method is known).
This is probably not going to be easy with an Arduino and I wonder if the TSL1401 has the resolution needed for some barcode types. For example the UPC-A barcode needs 95 pixels plus additional blank areas before and after. To scan this it would need to be exactly placed in position, distance & focus.

how am i supposed to read, store and retrieve the barcode???
With great difficulty I think.

In that am struck up with reading the absolute value 0V[white space] and 2V[black spa] accurately..
You will probably need to amplify the output but clamp it so it never goes over 5V or maybe as your only after a barcode a comparator circuit might do it but you will essentially be getting a 0/1 output (that could be read on a digital pin). You will also need to be able to adjust your reading speed so you can control exposure to the CCD cells. If there anything like the ILX511 then they are insanely sensitive.

mmm so kind of you :slight_smile: .. Well., I have dropped this plan of reading a barcode. (Quite difficult for a newbie like me..!!)

I would like to proceed my work simpler rather than complicating myself in the initial stage itself..For that let me standardize the '0/1' readings from the tsl1401sensor..

Riva i have a doubt in your code..

// It takes about 24uS to process CLK HIGH so don't use anything greater than 200 here.
#define CLK_SPEED 200

1.) Can you please explain me the calculation behind the CLK_SPEED 200??

2.) And also, Can you please suggest me some mechanical/physical setup to focus and read via TSL1401 ie., the angle of inclination between sensor, LED(for lighting purose) and the distance between the paper to be read??

vaish:
Riva i have a doubt in your code..

// It takes about 24uS to process CLK HIGH so don't use anything greater than 200 here.
#define CLK_SPEED 200

1.) Can you please explain me the calculation behind the CLK_SPEED 200??
Timer 2 is an 8 bit timer that I preset to the (max) value 200 so it will count up another 56 times and then the ISR(TIMER2_OVF_vect) is called as it has overflowed. The smaller the number you use the longer it takes to count to 256 and overflow. Using a greater value decreases the time till the overflow interrupt is fired but if you make the value to high (the time to short) then the ISR will not finish before the next overflow happens and I think you end up in a race condition.

2.) And also, Can you please suggest me some mechanical/physical setup to focus and read via TSL1401 ie., the angle of inclination between sensor, LED(for lighting purose) and the distance between the paper to be read??
Sorry I cannot help here. I see you can get the chip in a module with lens but I assume you just have the chip.

ok understood but.. :slight_smile:

Can you please explain with reference to the timer clock frequency/ MCU clock frequency??

vaish:
Can you please explain with reference to the timer clock frequency/ MCU clock frequency??

Timer 2 is set to update on system clock but it's prescale is set to divide by 8 in setup() so it only updates every 8 clock cycles.
With the timer pre loaded with 200 it takes about 56 increments to overflow and this works out about 448 clock cycles (56 * 8)
With a 16MHz clock each cycle takes 62.5 nanoseconds and 448 clocks take 28uS. The ADC conversion and processing the high side of the ISR takes about 24uS so if you go much over the 200 timer2 preload value the timer overflows before the ISR finishes.

Thank you.. :slight_smile:

1.) By default will the arduino uno take the external crystal frequency(16MHz)??
Or
Should any coding be added??

2.) From your code Were you able read '0/1's exactly from the linear sensor ILX5??