Using the TSL1401 with an Arduino/Teensy
in Accessories
We have a TSL1401 Linescan Camera and are trying to use it with a Teensy/Arduino. The problem is that our bootleg setup makes it very difficult to diagnose our problem. We have wired the A0 to pin 0, Vdd to 3.3V, GRND to GRND, CLK to pin 2, SI to pin 3, +5V to Vin.
We seem to be getting weird values when we try running code we found on the internet, and we are unable to tell whether our wiring, code, or camera are the problem. We are not seeing any visible change when we change what the camera sees.
Code we tried:
Codebase 1
Codebase 2
Here is an example of our output (we are only having it print out some of the center pixels)
![YuWu0GC.png](https://i.imgur.com/YuWu0GC.png)
Is there anything we can use to test the camera to make sure it is working properly?
We seem to be getting weird values when we try running code we found on the internet, and we are unable to tell whether our wiring, code, or camera are the problem. We are not seeing any visible change when we change what the camera sees.
Code we tried:
Codebase 1
Codebase 2
Here is an example of our output (we are only having it print out some of the center pixels)
![YuWu0GC.png](https://i.imgur.com/YuWu0GC.png)
Is there anything we can use to test the camera to make sure it is working properly?
Comments
First, please understand that I'm not a C programmer. However, a couple things come to mind:
1. If you're printing from a byte array, you should not be getting values like 283, 290, etc. So something odd is happening in your printout routine.
2. You have to realize that just calling the capture routine will not get you the current pixel values. What it gives you are the pixel values integrated over the time since the last call to the capture routine. IOW, you have to call the capture routine twice, separated by the desired integration time. It's usually best to keep calling the capture routine at regular intervals to keep the optical sensors from becoming saturated.
From your description of the wiring, it sounds right, although you do not need to connect +5V, just Vcc, which can be anywhere between 3.3V and 5V.
-Phil
We didn't screen shot the correct code. However, still are getting seemingly random numbers between zero to 90 when we hold the camera in pitch darkness. Also, we have our capture routine running a loop with a delay between each capture for about 10 milliseconds.
Our current output (we took out the +5V)
-forwardsockficus
-Phil
-Phil
- Send a pulse to the SI pin
- Delay 8333 uSec for exposure
- Analog read out the values from A0 with CLK pulses
We also tried:
- Send pulse to SI
- Read out to clear garbage with CLK pulses
- Wait 8333 uSec
- Send pulse to SI
- Read out actual values with CLK pulses
If you could briefly describe the protocol we should be following to communicate with the camera we think that would be helpful. We don't know PBASIC, so we are having trouble translating the example code to work with the Teensy.
Thanks Phil
-{hil
The delay time is printed on the left in microseconds.
Sorry about all the questions, thanks for being so helpful.
- forwardsockficus
-Phil
Are you sure that the array you're printing out is the same array that the ADC is filling from the TSL1401? Without seeing your entire program, it's kinda hard for me to tell what's going on.
Also, do you have an oscilloscope? If you do, take a look at the AO pin on the TSL1401. Use SI as the trigger. That will at least tell you if you're getting output from the imager.
-Phil
-Phil