I am thinking about using this Linear CCD (http://www.taosinc.com/ProductDetails.aspx?id=3 , TSL1401R-LF) to measure light input in a colorimeter. I am willing to try other methods of input or other sensors; I am not stuck on this one. This sensor has 128x1 sensor elements, it would be nice to have greater resolution, but I do not want to add needless cost and complexity to the project. The sensor should be under $20 USD.
Can I use the PWM output to control the clock on this chip or will I need a separate clock to run this?
I am new to using anything more complicated than an led and blinking.
Would I be able to use a digital output to clock the CCD sensor? And then use another digital output to start the serial output? And then using an analogue input to collect the data from the sensor after the CCD starts to send data out on its Ao.
The suggestion of the app note is that there is a maximum clock speed, but it specifies no minimum, so any digital output should work as a clock.
This looks a bit of a fun way of getting some form of machine vision - I've not seen this device before.
Hi strateego, as you can see in my signature I have just started to interface an TSL214, its an 64x1 array instead.
From what I have seen from datasheets, they are interfaced in pretty much the same way, so the code should work with minor modifications.
As soon as I have a more or less functional code I will post it to github, now I only have a 500kHz clock working using the Timer1 library.
The speed limiting factor is the ADC conversion on the Arduino, clocking with a digital pin is fine. The device can clock at 8MHz without losing much analog precision - but the Arduino ADC conversion time is about 100us if I remember right - certainly around 3 orders of magnitude slower.
Because there wasn't a library to toggle the SI line the way I thought of, I have rewritten the code without the Timer1 library, as I have to study the timers inner workings anyway, so I'm in the same spot, the 500kHz clock, but now hand configured.
The SI line should be now implemented in no time (maybe tomorrow) .
I'm right now documenting the timer configuration I have made, as there is not much info out there.
I only need to read about two samples (every value of the ccd) a second. Would it be easier for me to use the tone function to generated the CLK and use a digital write to trigger the SI line.
loop () {
digital.Write(8, HIGH);
digital.Write(8, LOW); // This would trigger the pulse to start the read
delay(????); // Delay 18 CLK cycles for the ccd to integrate the light
// reading code => array[63] => serial.Print to computer for manipulation.
}
I'm not sure if this code will work in my situation, but all I need a a couple reads of the sensor per second.
I would imagine that there might be some timing issues with this code.
... appears to be very similar, but with twice the resolution, and not marked "not recommended for new designs". For less than $20, why put time in on something which may become unavailable?
b)
I've only glanced at the datasheet, but I suspect you are too worried about the "clock" signal.
You tell the device "Report what the sensors see", and it then stands by to do just that.
It gives you the 1st bit, the 2nd bit, the 3rd... when YOU are ready, within reason. And you tell it you're ready by toggling the "clock" signal. Within reason, that can be as fast, as slow, or as irregular as you wish. Clock is an output from the Arduino (or other controller), and an input to the linear sensor array....
... if I've understood the chip's operation correctly.
When I went to order the TSL1401R they were out of stock, so I upgraded to the TSL202R. It looks like is two of the 128x1 arrays put on the same package.
It arrived in the mail today, so I will be hooking it up this afternoon. Hopefully I will be able to pull data from it by this evening.
I updated the code, and hand toggling the clock line (just sending the control pulses) should take less than 1ms for 64 pixels, but when doing the analog reads, it ramps up to almost 36ms.
It works OK in both cases and output from the CCD is as expected.