I am attempting to build a small spectrophotometer.
I have the following linear diode array (RL2048PAG-021). Here is the datasheet link: http://www.isgchips.com/pdf/P-series-021web.pdf
This array has 2048 linearly arrange photodiodes. I am attempting to read it with an Arduino, but to no avail. Full disclosure: I’m a beginner.
I’ve attached a diagram of how exactly I have the pins hooked up. You can check the data sheet Figures 3 and 4 for the transfer timing diagrams.
!(http://Photodiode Arduino Connection.png)
/* Linear Array
*--------------
*
*/
int H1 = 2; //set all digital pin outputs
int H2 = 4;
int RG = 6;
int TG = 8;
int PG = 10;
int AB = 12;
int VOUT = 0; //analog pin input attached to VOUT, microcontroller pin 2
int val = 0; //set counter variables
int i = 0;
void setup()
{
Serial.begin(9600); // opens serial port, sets data rate to 9600 bps
pinMode(H1, OUTPUT); // sets the digital pin as output
pinMode(H2, OUTPUT);
pinMode(RG, OUTPUT);
pinMode(TG, OUTPUT);
pinMode(PG, OUTPUT);
pinMode(AB, OUTPUT);
pinMode(VOUT, INPUT); // sets the analog pin as input
}
void loop()
{
digitalWrite(H1, HIGH); //the transfer timing says to begin by holding
digitalWrite(H2, LOW); // H1 - HIGH and H2 - LOW
digitalWrite(TG, HIGH); // next I pulse TG and PG HIGH
digitalWrite(PG, HIGH);
delayMicroseconds(100);
digitalWrite(PG, LOW); // then I pulse PG and TG LOW
delayMicroseconds(1000);
digitalWrite(TG, LOW);
delayMicroseconds(100);
for (i=0; i<2072; i++) //shift register for 2048 photodiodes + 20 dark pixels + 4 transfer pixels = 2072
{
digitalWrite(H1, HIGH); //now I utilize the horizontal shift register
digitalWrite(H2, LOW); //according to Figure 4 in the Readout Timing waveforms
digitalWrite(RG, HIGH);
digitalWrite(RG, LOW);
delayMicroseconds(100);
digitalWrite(H1, LOW);
digitalWrite(H2, HIGH);
val = analogRead(VOUT); //then after 1 cycle, I try to read the VOUT pin
Serial.println(val);
}
delay(5000);
}
The Serial data is basically the value ‘147’ over and over.
Is it because the voltages called for by the pins are -4 and 4, rather than the 0V and 5V that the arduino is putting out?
Also, I haven’t worked in the Antiblooming control (mostly because I don’t know how or what it is).
Anybody see any obvious errors here?