Go Down

Topic: Using a Sony ILX751A Linear CCD with any arduino. (Read 4 times) previous topic - next topic

ralphnev

follow up :
i've just had 'limited' success in driving the ILX551A ,
very little change programming change from the other chip (upd3799cy)
& i save myself two pins

no data collection as yet but i can see the output change on the scope
whoo hooo !!

it requires VERY little light (i'm up to 200lines per sec ) & still get resonable responce in a medium dark room on a cloudy day ...
& it appears as the native output is close to max 3.5 volts -- so if i clamp it i may beable to feed the arduino direcly (probably have to buffer it but makes life easier ..... )
have to wait till monday  to get sockets , clamping diodes , & assorted other things ... 

hiimzackjones

Oh great! Congrats! I haven't had much time to look at things with Mid-terms blowing things up. The exposure time was a big question mark for me. I thought it was cause I am such a noob at this. Here is another noob question.

what does the data actually look like? I have a friend working on the Gui for this project and he would like to make a csv document for our Gui to open and make a simulation of what things will look like so he can further debug. There is no information on the data sheet about what this stuff looks like. I imagine its intensity and wavelength or color.

I attempted to write code for this the other day and failed miserably. I don't know if it's because I don't know what I am doing, or if it is something simple like I started in the wrong part of the clocking sequence. I'm hunting for backup plans on this project just in case.

ralphnev

these Sony devices have a very simple clocking stucture to follow (as opposed to the National part i was mucking with)

there are really only the 3 steps
pulse low on ROG (once)
pulse on CLK , sample  the data  - repeat 2087 times ....
pause (! found the comment in the data sheet - integreation time is 10ms ! )
and repeat ....
use a scope to check that you have the correct polarities ...

not sure about the MEGA but it appears that you should beable to use the transistor buffer shown in the data sheet so easy to connect ( need clamp diodes for the DUE)
data will look like a stream of 10 bit numbers .... relative to the total amount of light .... 
with junk data at the begining & at the end 

davpc

#13
Apr 21, 2013, 01:45 am Last Edit: Apr 21, 2013, 04:28 pm by davpc Reason: 1
Hi RalphNev,

I have an arduino due and I'm about to order a Sony ILX751A Linear CCD, I want to put together what you did. I'm really interested in how your project went. Did it work nicely and is it possible to send a diagram, pictures, code  etc. of your setup?

Any help would be great even a quick message for now saying how it went would be really nice.

Thank you, Dav.

hiimzackjones

Exam week is here and I finally had to get my butt on the ball to finish this. here are the two codes. one is arduino the other is processing. I can't test this yet because I haven't built the CCD circuit yet. Any tips or suggestions would be great!

Code: [Select]

int vout = 26; // sample this pin to get image data
int shsw = 5;  // sample hold. GND cuts on vdd2 cuts off
int clk = 6;   // clock timer pin. controls the timing.
int vdd2 = 7;  // camera needs 5volts supplied to vdd2 to function
int shut = 8;  // shutter function. for use, leave high then 1ms prior to sampling, drop voltage to ground for 1mn then back up to high.
int rog = 9; // pulse rog low once to start sequence
int sample =
0; // this will be used as a serial data output of the samples.


void setup()
{
  Serial.begin(9600); // start serial. Is baud rate correct?
  pinMode (vout,INPUT); // reads data from ccd to give us samples inbetween clock pulses
  pinMode (shsw,OUTPUT);// some of these pin's functions are optional.
  pinMode (clk,OUTPUT);
  pinMode (vdd2,OUTPUT);
  pinMode (shut,OUTPUT);
  pinMode (rog,OUTPUT);

   
}
void loop() 
{
  //clk initialization
    Serial.println("start"); // just for kicks
    digitalWrite(clk,HIGH);  // these next few steps starts the clk, this must be done each time prior to a 2087 cycle
    digitalWrite(rog,HIGH);
    delayMicroseconds(1);
    digitalWrite(rog,LOW);
    delayMicroseconds(1.01);
    digitalWrite(rog,HIGH);
    delayMicroseconds(1);
        for(int i = 0; i < 2087; i++ )
      {
        digitalWrite(clk,LOW); // the 2087 cycle begins here.
        delayMicroseconds(1);
        digitalWrite(clk,HIGH);
        sample = analogRead(vout); // output the ccd's data into a serial sample that can then be read by a processing programing and written to a file
        Serial.println(sample);    // ^^^^^^^^^^^
        delayMicroseconds(1);
   
      }


}


here is the processing code

Code: [Select]
import processing.serial.*;
Serial mySerial; // start a serial called mySerial
PrintWriter output; // calls the writer output
void setup()
{
  mySerial = new Serial( this, Serial.list() [0], 9600);// sets up mySerial
output = createWriter( "SampleData.txt" ); // sets output to a txt file
}

void draw()
{
  if (mySerial.available() > 0 ) //check is serial data is there
  {
    String value = mySerial.readString();
    if (value != null) // if null then something is broke. otherwise...
     {
      output.println( value );// print the serial to output which uses createWriter to place into a new txt file.
      }
    }
}

Go Up