
Rules for RSSC Fire Fighting Competition
• The objective is for the robot to locate and extinguish the candle in the minimum amount of time.
• Robots may be constructed and programmed using any hardware or software materials and resources.
• Participants may be of any age or affiliation from K-12, high school, college, or beyond. (Affiliation with a school or organization is not required.)
• Robot maximum size is limited to 14 inches by 14 inches by 14 inches. No sensor can be higher than 10 inches from ground. Robots may not look over the walls in any way. This max volume also includes any attachments to the robot (balloons, arms, etc) , and the max volume rule is enforced during the entire time the robot is in operation.
• A single lit candle is placed randomly in one of the rooms of the maze. The height of the lower portion of the flame is between 6 inches and 8 inches from surface.
• The robot score is essentially the time (in seconds) required for the robot to locate and extinguish the candle. The robot with the fastest time, and therefore the lowest point score, is declared the winner. There are bonuses and penalties that apply — see details below.
• Arena is 8ft by 8ft. The walls of the arena are 9″ +- 1″ in height. The walls are made of 1/2″ white mdf. All corners will be reinforced with 2″ white duct tape. The floor of the arena will be the default flooring of the classroom (a commercial floor tile).
• The maze dimensions and layout are known prior to the contest. Any dimension may vary by up to an inch of the labeled value.
• The robot must be fully autonomous.
• No wire (tether) may connect the robot to an external computer (no human operator) and/or external power supply (this is new rule for 2009).. There is no penalty for a wireless connection (see below), but even with a wireless connection from the robot to a computer, the robot operation must be autonomous.
• The robot must move to within 12 inches of the candle before the robot extinguishes the candle. A white circle (12 inch radius) of thin poster board is positioned on the maze floor with the candle at the center.
• The robot is not permitted to “look” over the walls of the maze.
• The robot is not permitted to climb over the walls of the maze.
• The robot is permitted to touch the walls at any time during the run (with no penalties).
• The robot will always start at the fixed home start position in the maze for every run (except for arbitrary start mode option). There is a white circle (12.25″ diameter) at the fixed home start position. The robot must be completely on the start circle, but can be in any orientation (that is, the robot may be facing any direction).
• The candle will be positioned randomly within a room. The candle will be at least 3 inches from any wall.
• The candle will not be positioned at the entrance of the room. In all cases, the robot will be able to enter the room (12 inches minimum) without making contact with the candle or the white poster board circle surrounding the candle.
• The robot is not permitted to touch the candle in any way when the candle is lit except with a designating extinguishing device which must be marked in red.(otherwise there is a 50 point penalty). There is no penalty for touching the candle after the candle is extinguished.
• Each robot will be provided 2 opportunities to locate and extinguish the candle. A robot that successfully extinguishes the candle two times will receive a final score equal to the average of the two scores. Robots that successfully extinguish the candle 2 times will be rated higher than robots with only one successful run, regardless of the run times. (See below for more details).
• There are bonuses for returning to the home position after extinguishing the candle, sound activation, avoiding furniture obstacles, extinguishing the candle without blowing air, and others (see below).
• Return Trip (robot returns to home position after extinguishing candle) – 20% reduction (factor = 0.80)
• Extinguisher Mode — non-contact ——————————————– 20% reduction (factor = 0.80)
• Arbitrary Start (robot is placed in random start position) ————— 20% reduction (factor = 0.80)
• There is also a room factor that is applied to your overall time from start to extinguishing the candle.
• Candle found in first room explored ——– 1.0 factor
• Candle found in second room explored —– 0.85 factor
• Candle found in third room explored ——– 0.50 factor
• Candle found in fourth room explored ——- 0.35 factor

I had ordered a dozen of these and USPS tried to deliver them today but I wasn’t home. Fortunately, I was able to borrow one from a student in the mechatronics course. 
These sensors require a pair of digital pins to read in addition to power and ground. Pulse the trigger pin and then readout the pulse return on the echo pin. The time in us is proportional to the distance in cm.
Here is a bit of arduino code to readout the sensor and send the values to the serial port
/*
Ultrasonic input, serial output
Triggers an ultrasonic sensor, Reads the duration pin, and sends to serial port.
*/
// These constants won't change. They're used to give names
// to the pins used:
const int pingPin = 13; // Trigger Pin
const int inPin = 12; // Echo Pin
long duration, cm;
void setup() {
// initialize serial communications at 57600 bps:
Serial.begin(57600);
pinMode(pingPin, OUTPUT);
pinMode(inPin, INPUT);
Serial.println("Starting");
}
void loop() {
// The PING))) is triggered by a HIGH pulse of 2 or more microseconds.
// Give a short LOW pulse beforehand to ensure a clean HIGH pulse:
digitalWrite(pingPin, LOW);
delayMicroseconds(2);
digitalWrite(pingPin, HIGH);
delayMicroseconds(10);
digitalWrite(pingPin, LOW);
duration = pulseIn(inPin, HIGH);
cm = duration / 29 / 2;
// print the results to the serial monitor:
if (cm < 350){
Serial.println(cm);
}
// wait 10 milliseconds before the next loop
delay(10);
}
Again a bit of vpython to create a visualization showing the distance of the wall from the robot:

John Davis suggested that a zero crossing flame sensor was the way forward at the last meeting of the mechatronics course.
I am using two inexpensive IR phototransistors, of lower quality then the ones used in my previous post. These were purchased in bulk and seem to be centered at 850nm and less sensitive. However, they were purchased at 50 for $6.99 from HK for student use.
In the zero crossing sensor, two phototransistors are aligned nearly parallel as shown at right:
The idea of the sensor is that when the difference between the two sensor values is zero, (assume proper calibration) then the sensor is centered on the target (in this case the flame) Based on which sensor returns the larger value you can determine if the target is either on the right or left of the sensor.
Here is a bit of arduino code to read the two sensors and spit out the values to the serial port:
/*
Read Dual Flame Sensor with Zero Crossing
*/
// These constants won't change. They're used to give names
// to the pins used:
const int analogInPinL = A5; // Analog input pin Right Sensor
const int analogInPinR = A4; // Analog input pin Left Sensor
int sensorValueL = 0;
int sensorValueR = 0; /
void setup() {
// initialize serial communications at 57600 bps:
Serial.begin(57600);
}
void loop() {
// read the analog in value:
sensorValueL = analogRead(analogInPinL);
sensorValueR = analogRead(analogInPinR);
// print the results to the serial monitor:
Serial.print(sensorValueL);
Serial.print("," );
Serial.println(sensorValueR);
// wait 10 milliseconds before the next loop
delay(10);
}
I wrote a python program to display the output of the sensors visually and indicate when the sensor was centered.

A flame sensor is constructed using an IR phototransistor (peak at 900nm). A small schematic is shown below:
The phototransistor has a visual band filter (IE it is DARK BLACK in color) that cuts out visible light. Since the flame emits substantial amounts of IR, this can be detected against a background of visible lighting. This works particularly well in the presence of florescent lights as these emit primarily in the visible spectrum. Below is an image of the test setup.

Below is a graph of the sensor output (where y is in 10bit ADC counts and x is in ms) for my hand passing about 20 cm in front of the sensor.

In order to discriminate the flame from background, it would be nice to detect the flame flicker. The next several images show attempts to detect flame flickering with no real success.
There is no observable regular flicker. The variations are consistent with the variations in the background so are not due to any flame effect.
Here is the background for the above image which shows variations on the order of 20 ADC counts.
This data was taken by taking the sensor out of line with the flame and using a 10 second basesline. We do see some periodic behavior, but I suspect it isn’t real.
Summary:
Can reliably detect a flame at a distance of one meter. Largely insensitive to fluorescent lights. Still sensitive to sunlight or incandescent light.
After working with the ubiquitous CPS2102 breakboards available on Ebay, I wanted to duplicate the arduino system for if not the lowest cost, the lowest cost that would retain the autoreset feature. I found the CPS2102 breakboard above that had the ALL the pins connects and broken out to 0.1 inch pins as opposed the the previous design which only had 6 pins (RX, TX, Gnd, +5, +3.3, RST) Having access to the DTR pin allows the use of the auto-reset feature in the modern bootloaders.
Here is a quick photo of the prototype.
On the one hand, I have eliminated a part (microswitch) but more importantly it now uses the auto-reset feature which is a major bonus for students who are repeatedly programming these chips. However, the above breakboard is slightly more expensive (~$5) as opposed to ~$3 for the older model. You also need to solder a pin to PIN2 on the 10 pin connector.