Go Down

Topic: RoboCup Junior Arduino-based Soccer Robots (Read 5 times) previous topic - next topic

Chypsylon

Hi dockedrockets,
I'm also an Participant in Robocup Soccer.

Although we've already a somewhat working solution to detect the ball it would be cool if you could share your findings :)

dockedrockets

i have been experimenting with TSOP1138 s. These are really good because they can see really far and they filter out ambient IR. but ordinarily they return either a high or a low. The roboball (v2) does not send out either and on or an off however. it ends out 16 different amplitudes slowly increasing in power. then resetting to zero. this means that there is a threshold in this period of time where the tsop will no longer be able to see the ball. this means that you can see distance with a digital sensor.

you connect the two pins close together to 5v and gnd with a 100R resistor on the Vs line. (the Vs line is the line connected to 5v and it is to the right when thee curve is facing you)The last pin to digital pin 2



int ir = 0 ;
int x = 0 ;
void setup() {
  Serial.begin(9600);
  pinMode(2, INPUT);
}

void loop() {
  while(x <= 16){
  int sensorValue = digitalRead(2);
  if (sensorValue>0){
  ir++ ;
  }
  delayMicroseconds(52.0625);
  x++ ;
  }
  Serial.println(ir, DEC);
  ir = 0;
  x = 0;
}

Go Up