Select Page

For the final project in my first-year engineering class, we were tasked with building a robot capable of solving a short maze, sensing a flame, and then putting it out. I worked with Josh Harris on this project. We were expected to each design and 3D-print wheels and mounts for the stepper motors. We printed out a ping-pong wheel for the back using a premade design from CudaEngineering. We used ultrasonic sensors and a flame sensor. Check out my previous posts to learn more about the 3D-printed parts and the sensors. The robot had to complete a short track of turns before putting out the flame. The track could be set up with both turns left and right.

The robot only had to be able to solve one of the versions. When it came time to build the robot, I ensured all the individual pieces worked before trying to connect them all. Then I worked on making the robot drive and turn correctly. After that, we then began connecting everything together. We went through a couple of iterations before our final design. The first design was about 50% longer than the first design. We had to make it shorter so the robot could turn without hitting the track’s walls. We added a second ultrasonic sensor to the robot’s right side in the final iteration. We wanted to do more than meet the requirements. By adding the additional sensor, the robot can solve both versions of the track without changing the code. I gained a better understanding of programming from this project. I learned how more about how to go about gluing different pieces of code together. I learned how to visualize better how the code should work. Creating a flow chart for the robot helped me see how to connect the different bits of code.

Our robot follows the flow chart with some differences. When the robot senses a wall in front of it, it checks to see if there is a wall on its right side. If the path is clear, it turns right; if not, the robot turns left.

    if(cm < 20){//wall in front
      if(cmRight < 20){//wall on the right
        turnLeftByDegrees(90);  
        Serial.println("turning left");
      }//end if turn left
      if (cmRight > 20){//no wall on the right
        turnRightByDegrees(90);
        Serial.println("turning right");
      }//end if turn right
    }//end if

Another alteration is when the flame is sensed but has not been extinguished. If the flame has not been put out, the robot will drive forward until the fire is extinguished.

      while(sensorValue < 700){//fire is still detected
        sensorValue = analogRead(A0);
        digitalWrite(13, HIGH); 
        driveForwardDistance(5);
        delay(500);
        Serial.println(sensorValue);
        Serial.println("Flame is still there");
      }//end while

Here is the completed project.

We were able to accomplish solving the problem. Our robot worked how we wanted it. If I had more time to work on the fire-fighting robot, I would make it able to sense walls on both sides of it. I would do that by either adding another ultrasonic sensor or attaching the sensor to a motor so it could rotate to check both sides. Then I would program in additional code so it could drive backward and turn around 180 degrees.