Tuesday, May 8, 2012

Week 5: Testing and Starter Code

After finally attaining all the parts to the robot, the testing and coding of the robot could begin. The following results were found:

1) Ultrasonic Sensor - it was found that at any point in the hallway, the ultrasonic sensor will read a value of 15 or less when along a wall, so it could be programmed to turn when the number went above 15.

2) Touch Sensor - no surprises here, it successfully touched the wall, sensed it and could turn.

3) Infrared Sensor - this could not be posted yet as we had no flame to use, but this will be the first test run next week.
4) Color Sensor - this sensor failed to pick up a difference between black and white because they are technically only 2 different shades of the same color.  Because of this it was decided to use a light sensor instead, because it is known more light will be reflected off of the white than the black.

5) Light Sensor - the two readings received for the white ground and black ground differed by about a value of 30, the white giving off a reading around 70 and the black showing around 40.

After this, it was decided to begin coding.  Below is a view of our code:





Essentially this code programs the robot to do the following:
  1. Move forward until the ultrasonic reads greater than 15
  2. Turn left and move forward again until the ultrasonic reads above 15
  3. Turn left and go forward until the light sensor picks the black line which signifies the entry to a room
  4. Although this has not been added yet because the Infrared has not been calibrated, we will sweep the room to find a flame
  5. If one is found, move forward until we are about 15 centimeters from the flame
  6. Stop and deploy the fan.

No comments:

Post a Comment