JannisJan R. Seyler
Published © GPL3+

FireFicator

With the FireFicator, your fireplace never runs cold!

IntermediateFull instructions provided5 hours1,059
FireFicator

Things used in this project

Hardware components

Argon
Particle Argon
Price: 32.76€
×1
1S-Lithium/-Polymercell
Price: 4.50€
×1
Battery-Casing with Switch
Price: 1.00€
×1
5 mW Laserdiode 650 nm
Price: 0.98€
×2
FireFicator-Casing
Used Material: 48.32 g PETG, Price: ca 0.72€
×1
breadboard 70x90 mm
Price: 0.60€
×1
IR Fototransistor
Price: 0.55€
×1
1k Potentiometer
Price: 0.53€
×1
Pushbutton switch 12mm
SparkFun Pushbutton switch 12mm
Price: 0.38€
×2
10k Potentiometer
Price: 0.24€
×1
5 mm LED: Green
5 mm LED: Green
Price: 0.11€
×1
5 mm LED: Red
5 mm LED: Red
Price: 0.10€
×1
Screws M3x30mm
Price: ca. 0.10€
×6
Resistor 1k ohm
Resistor 1k ohm
Price: ca: 0.01 €
×1

Software apps and online services

Losant Platform
Losant Platform

Hand tools and fabrication machines

3D Printer (generic)
3D Printer (generic)
Camera Tripod
Soldering iron (generic)
Soldering iron (generic)

Story

Read more

Custom parts and enclosures

FireFicator-Casing

This is the FireFicator-Casing. It is necessesary to get the FireFicator running.

Schematics

Fritzing Model

The Model contains the schematics aswell as the layout.

Layout

Picture of the layout. Download the Fritzing Model to get more content.

Schematics

Picture of the schematics. Download the Fritzing model for more content.

Code

FireFicator2020.ino

Arduino
/*********Code for FireFicator (Particle Argon)**************
 * authors: Ja Rue, Xa Ro, Car Kl
 * version: 1.0
 * Date: 21.01.2019
 * Project: IoT-Lecture, Dr. Jan Seyler, DHBW-Stuttgart, WS 2019/2020
 ****/

/**** Global Defines****/
#define UPDATE_SEC 20L      // Update Sequence in Seconds
#define BUTTON_PIN  D13
#define LASER_PIN D12
#define LED_GREEN D9
#define LED_RED D10
#define IR_SENS_ADC A0
#define BUILT_IN_LED D7

/**** Global Variables ****/
long lastUpdateTime=0;
float mean = 500; //Mittelwert, Start bei 500
int limit = 3800;
boolean limitMode = true;

void setup() {
 
 // Init of Pins
    pinMode(IR_SENS_ADC,INPUT);
    pinMode(BUILT_IN_LED, OUTPUT);
    pinMode(LED_RED, OUTPUT);
    pinMode(LED_GREEN, OUTPUT);
    pinMode(LASER_PIN, OUTPUT);
    pinMode(BUTTON_PIN, INPUT_PULLUP);
    digitalWrite(LASER_PIN, HIGH);
}

void loop() {
   
  // If the Timediff since the lastUpdate is bigger than the Update Sequence the FireFicator sends a Notifcation to Losant
    if(millis()-lastUpdateTime>(UPDATE_SEC*1000)){
        float voltage = analogRead(BATT) * 0.0011224;
        Particle.publish("climate_reading", (String)(millis()/1000/60) + ":" + (String)((int)mean) + ":" + (String)limit + ":" + (String)voltage);
        lastUpdateTime= millis();
    }
    
    mean=mean*0.8+0.2*analogRead(IR_SENS_ADC);      // Mean is calculated to reduce impact of short Flamespikes 
  
    //Compare Mean with Limit. 
    if (mean <= (limit - 100)) { //If Value low enough, the green LED is on
        digitalWrite(LED_GREEN, HIGH);
        digitalWrite(LED_RED, LOW);
    }
    else if (mean  <= limit){ //Value almost too high, both LED on
        digitalWrite(LED_GREEN, HIGH);
        digitalWrite(LED_RED, HIGH); 
    }
    else { //If Value is too high, the red LED is on
        digitalWrite(LED_GREEN, LOW);
        digitalWrite(LED_RED, HIGH);
    }
    delay(50);
    buttonPressed();
    delay(30);
}

void buttonPressed(){   //Logic to change the Limit directly with the FireFicator-Button
    
  if(digitalRead(BUTTON_PIN) == LOW){
    delay(20);
    if(digitalRead(BUTTON_PIN) == LOW){  //Debounce Button
      if(limitMode == true) {
        limit = mean;           // Direct Change Limit to measured mean
      }
      else {
          limit = limit - (limit-mean)/2;       // Slow change of Limit from previous value to measured mean
          digitalWrite(BUILT_IN_LED, HIGH);
          delay(20);
          digitalWrite(BUILT_IN_LED, LOW);
      }
    }
  }
}

Credits

Jannis

Jannis

1 project • 2 followers
What I like: 3D printing, electronics, software- and hardware-development and any combination of them.
Jan R. Seyler

Jan R. Seyler

2 projects • 6 followers
Thanks to Carsten Kleber, Xaver Robrecht, and Collin.

Comments

Add projectSign up / Login