Description:
Specially designed line sensor for more broad line coverage. Each sensor is placed with 7mm apart.
Technical Specs
Works at 5V, total current draw is 240ma for all 16 sensors.
Total weight is 6 grams.
Sensivity is set by built-in trimpot at board.
XLine board's dimension is 117.8mm L x 35mm W x 4.3mm H.
Sensors selected with analog multiplexer and later compared with op-amp. At output sensor is direcly giving digital output.
You need to attach 4 digital outputs and 1 digital input.
So Xline will use total 5 I/O only except of 16!
Kit include:
1 x XLINE 16 Sensor Array Board - Digital
Mikroelectron Code:
//XLine Digital Sensor Board Test Code.
#define s0 3 // Sensor Selection pins.
#define s1 4
#define s2 5
#define s3 6
#define Sens 2 // Digital input pin.
int value;
int j=1; //1mS Delay (It can be optimised up to 100Microseconds)
void setup() {
pinMode(s0, OUTPUT); // 4 Selection pins are output.
pinMode(s1, OUTPUT);
pinMode(s2, OUTPUT);
pinMode(s3, OUTPUT);
pinMode(Sens, INPUT);
Serial.begin(9600);
}
void loop() { // at main loop function we use for loop and make each sensor reading.
for (int i=0; i <= 15; i++){ // Total 16 loop inside for statement.
if (i == 0)
{
digitalWrite(s0, LOW);
digitalWrite(s1, LOW);
digitalWrite(s2, LOW);
digitalWrite(s3, LOW);
delay(j);
value=digitalRead(Sens);
}
else if (i == 1)
{
digitalWrite(s0, HIGH);
digitalWrite(s1, LOW);
digitalWrite(s2, LOW);
digitalWrite(s3, LOW);
delay(j);
value=digitalRead(Sens);
}
else if (i == 2)
{
digitalWrite(s0, LOW);
digitalWrite(s1, HIGH);
digitalWrite(s2, LOW);
digitalWrite(s3, LOW);
delay(j);
value=digitalRead(Sens);
}
else if (i == 3)
{
digitalWrite(s0, HIGH);
digitalWrite(s1, HIGH);
digitalWrite(s2, LOW);
digitalWrite(s3, LOW);
delay(j);
value=digitalRead(Sens);
}
else if (i == 4)
{
digitalWrite(s0, LOW);
digitalWrite(s1, LOW);
digitalWrite(s2, HIGH);
digitalWrite(s3, LOW);
delay(j);
value=digitalRead(Sens);
}
else if (i == 5)
{
digitalWrite(s0, HIGH);
digitalWrite(s1, LOW);
digitalWrite(s2, HIGH);
digitalWrite(s3, LOW);
delay(j);
value=digitalRead(Sens);
}
else if (i == 6)
{
digitalWrite(s0, LOW);
digitalWrite(s1, HIGH);
digitalWrite(s2, HIGH);
digitalWrite(s3, LOW);
delay(j);
value=digitalRead(Sens);
}
else if (i == 7)
{
digitalWrite(s0, HIGH);
digitalWrite(s1, HIGH);
digitalWrite(s2, HIGH);
digitalWrite(s3, LOW);
delay(j);
value=digitalRead(Sens);
}
else if (i == 8)
{
digitalWrite(s0, LOW);
digitalWrite(s1, LOW);
digitalWrite(s2, LOW);
digitalWrite(s3, HIGH);
delay(j);
value=digitalRead(Sens);
}
else if (i == 9)
{
digitalWrite(s0, HIGH);
digitalWrite(s1, LOW);
digitalWrite(s2, LOW);
digitalWrite(s3, HIGH);
delay(j);
value=digitalRead(Sens);
}
else if (i == 10)
{
digitalWrite(s0, LOW);
digitalWrite(s1, HIGH);
digitalWrite(s2, LOW);
digitalWrite(s3, HIGH);
delay(j);
value=digitalRead(Sens);
}
else if (i == 11)
{
digitalWrite(s0, HIGH);
digitalWrite(s1, HIGH);
digitalWrite(s2, LOW);
digitalWrite(s3, HIGH);
delay(j);
value=digitalRead(Sens);
}
else if (i == 12)
{
digitalWrite(s0, LOW);
digitalWrite(s1, LOW);
digitalWrite(s2, HIGH);
digitalWrite(s3, HIGH);
delay(j);
value=digitalRead(Sens);
}
else if (i == 13)
{
digitalWrite(s0, HIGH);
digitalWrite(s1, LOW);
digitalWrite(s2, HIGH);
digitalWrite(s3, HIGH);
delay(j);
value=digitalRead(Sens);
}
else if (i == 14)
{
digitalWrite(s0, LOW);
digitalWrite(s1, HIGH);
digitalWrite(s2, HIGH);
digitalWrite(s3, HIGH);
delay(j);
value=digitalRead(Sens);
}
else if (i == 15)
{
digitalWrite(s0, HIGH);
digitalWrite(s1, HIGH);
digitalWrite(s2, HIGH);
digitalWrite(s3, HIGH);
delay(j);
value=digitalRead(Sens);
}
Serial.print(value);
Serial.print(' ');
}
Serial.print(millis());
Serial.println();
// After 16 for loop we go to 2nd line.
}