Select Page

For this objective, this robot is built and coded to run through a maze. At the end of the maze this robot has a sensor to detect a fire which is the “problem” and distinguish the flame with a fan. Some unique iterations on the robot include the motor mount, ultrasonic sensor, fire sensor, and wheel. For this we decided that its best to place everything with a purpose. The collection of the three components with fan, fire sensor, and ultrasonic sensor is best when close together. We placed the fire sensor right over the fan to increase accuracy when putting out the flame, and also put the ultrasonic sensor in the front to detect the wall clearly. With the wheels we built this with unique size and dimensions.

Here’s the link to my partners blog, https://portfolio.wcu.edu/ajjudson1/

/*
*/

int inches = 0;

int cm = 0;
int delayTime=0;

long readUltrasonicDistance(int triggerPin, int echoPin)
{
  pinMode(triggerPin, OUTPUT);  // Clear the trigger
  digitalWrite(triggerPin, LOW);
  delayMicroseconds(2);
  // Sets the trigger pin to HIGH state for 10 microseconds
  digitalWrite(triggerPin, HIGH);
  delayMicroseconds(10);
  digitalWrite(triggerPin, LOW);
  pinMode(echoPin, INPUT);
  // Reads the echo pin, and returns the sound wave travel time in microseconds
  return pulseIn(echoPin, HIGH);
}

void setup()
{
  Serial.begin(9600);
}

void loop()
{
  // measure the ping time in cm
  delayTime=readUltrasonicDistance(7, 8);
  cm = 0.01723 * readUltrasonicDistance(7, 8);
  // convert to inches by dividing by 2.54
  inches = (cm / 2.54);
  Serial.print(delayTime);
  Serial.print("s, ");
  Serial.print(cm);
  Serial.print("cm, ");
  Serial.print(inches);
  Serial.println("in, ");
  delay(100); // Wait for 100 millisecond(s)
}

This is an example code of the ultrasonic sensor. We collectively used this code and codes for the fire sensor, and stepper motor. We setup the code is a fashion where all the codes sat in a for loop banking on the action of the other. For example the ultrasonic sensor reads the front of the robot to see if its clear and then the wheel will only activate then.

 

Here are the final pictures below

If we had more time on the project I would built the robot to not be exposed. I would built it to expose the fan, ultrasonic sensor, fire sensor, and plug for Arduino. Everything else I would cover up to protect the integrity of the piece. This strength would make the robot perform and look better. I would also replace the rubber bands on the wheels to O rings that would sit in a dished ring on the printed wheel. This would cause less slippage.

Here’s the video of failing and success

https://youtu.be/12gXiiWuWqY​