12) Test of Sensors

2) Test of Sensors

Image of the focus of the lesson

Date: 17/05 2012
Group members participating: Falk, Jeppe and Jakob
Duration of activity: 4 hours

2.1) Goal

The goal is to test the different sensors expected to be used.

2.2) Plan

  • Test the infrared (IR) sensor.
  • Test the touch sensor.
  • Build the overall structure of the prey-robot.

2.3) Results

2.3.1) IR Sensor

To interact with the IR sensor the IRSeekerV2 class is used. The IR sensor has five sensors inside it, which enables the sensor to detect the direction of the IR signal.
The IR sensor has two modes; AC and DC [Bibliography item irsensor not found.]. To reduce the interference from sunlight the AC mode is used. There still is some background measurements when no IR sender is present, and the readings differ from zero to ten (approximately).

The following snippet shows a few ways to interact with the sensor.

// Initialize the IRSeekerV2 with the sensor port and the 
// AC mode.
IRSeekerV2 irSeeker = new IRSeekerV2(SensorPort.S1, Mode.AC);
// The getDirection returns the direction (1 to 9) or 0 if 
// there is no target.
direction = irSeeker.getDirection();
// The getSensorValues returns the readings from all five 
// sensors in an array.
int[] sensorValues = irSeeker.getSensorValues();

2.3.2) Touch Sensor

The original idea was to use two touch sensors in the front of the prey robots to detect when the preys bump in to each other. After minor tests of the angle of the push to the touch sensor, the conclusion was that it would be better to use an ultrasonic sensor.

2.3.3) The Prey Robot


The ideas behind the prey-robot was the following:

  • Small and compact is better than making a big and long robot.
  • 'Animal' like robot.
  • Easy to detach the NXT.
  • Using the enter button as an upper directed touch sensor.
    • So the predator can smack the prey at the top to kill it.

It is a bit cramped when attaching the wires to the sensors, so shorter cables could be a nice thing.
Perhaps the sensors needs to be moved a bit further forward to make room for the cables.

2.4) Conclusion

Next time the ultrasonic sensor and the color sensor should be tested and implemented.
The prey should be designed and implementation of the prey behavior started.

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License