Mach 16


Project maintained by lois-lee Hosted on GitHub Pages — Theme by mattgraham

Much of what we’ve done in the treasure detection part of this milestone was covered in the second lab. Here is a recap of what we did in lab2 for treasure detection.

Frequency Bins
7 kHz 45, 46, 47
12 kHz 79, 80, 81
17 kHz 113, 114, 115
  if(fft_log_out[i]>60){
        Serial.print(fft_log_out[i]);
        if(i>=45 && i<=47){
          range7++;
        }
        if(i>=79 && i<=81){
          range12++;
        }
        if(i>=113 && i<=115){
          range17++;
        }
      } 
      Serial.print(" ");
    }
    
    
    if(range7>0 && range7>range12 &&range7>range17){
      Serial.println("7 kHz");
    }
    else if(range12>0 && range12>range7 &&range12>range17){
      Serial.println("12 kHz");
    }
    else if(range17>0 && range17>range12 &&range17>range7){
      Serial.println("17 kHz");
    }
    else{
      Serial.println("none");
    }

The wall detection is done using a proximity sensor datasheet. It emits an infrared radiation and looks for a change in filed/signal. If the object is outside the nominal range of the sensor then there is no change in field. If not the sensor generates voltage that corresponds to the detected distance of the object.

We added the short range distance sensing implementation to our previous from lab2. A digital pin was used to take input from the wall sensor. If the wall sensor detects a wall, we write 90 to the robots to stop them.

  if(!detectNoFWall){
    do figure 8;
  }
  else {
   rightServo.write(90);
    leftServo.write(90);  
    delay(100);
  }

This is shown below in the demo video. alt text

For the future, we will also add the wall sensors to the sides of the robot which will assist the navigation of the robot along with the side line sensors.

alt text