Arduino code and video Flame Sensor module for Arduino Robojax.com

This is the Arduino code and video for Flame Sensor module for Arduino

When the infrared diode sees the flame, it sends the digital out DO to also the level of flame is represented with analog output
  1. LM393 Data sheet(PDF)

  
/*
 * This is code for  Flame Sensor module for Arduino
* watch the video https://youtu.be/OZkZIP3KlHQ
  * Other Arduino libarary and videos http://robojax.com/learn/arduino/
 *  * 
	Flame Sensor module for Arduino
	Written by Ahmad Nejrabi for Robojax.com
	on Jan 18, 2018 at 22:21 in Ajax, Ontario, Canada
 * Permission granted to share this code given that this
 * note is kept with the code.
 * Disclaimer: this code is "AS IS" and for educational purpose only.
 * 
 * 
 */
/*


What it does?
When the infrared diode sees the flame, it sends the digital out DO to
also the level of flame is represented with analog output

 */
  // 4 Infrared Obstacle code for Robojax.com
#define FLAME 2 // pin 2 for flame sensor
#define ALARM 8 // pin 8 for Alarm 


void setup() {
  Serial.begin(9600);
  Serial.println("Robojax.com Fire Module Test");
  pinMode(FLAME, INPUT);//define FLAME input pin
  pinMode(ALARM, OUTPUT);//define ALARM output pin
  // Flame sensor code for Robojax.com

}

void loop() {
    // Flame sensor code for Robojax.com

  int fire = digitalRead(FLAME);// read FLAME sensor
  int fireAn = analogRead(A0);// read flame analog value

  if( fire == HIGH)
  {
    digitalWrite(ALARM,HIGH);// set the buzzer ON
    Serial.println("Fire! Fire!");
    Serial.println(fireAn);// print analog value
  }else{
    digitalWrite(ALARM,LOW); // Set the buzzer OFF
    Serial.println("Peace");
    // Flame sensor code for Robojax.com

  }



  delay(200);
}