Margaret Donohoe
Created March 3, 2021 © GPL3+

Automatic Candle Extinguisher

Pulley controlled by a button moves a flame sensor down the shaft of a candle, triggering a fan that blows the flame out when reached.

Automatic Candle Extinguisher

Things used in this project

Hardware components

Argon
Particle Argon
×1
DC Motor, Miniature
DC Motor, Miniature
(mine came with the Elegoo Super Starter Kit, which had a fan attachment)
×1
Jumper wires (generic)
Jumper wires (generic)
×1
Pushbutton switch 12mm
SparkFun Pushbutton switch 12mm
×1
1N4007 – High Voltage, High Current Rated Diode
1N4007 – High Voltage, High Current Rated Diode
×1
General Purpose Transistor NPN
General Purpose Transistor NPN
×1
Grove - Infrared Temperature Sensor
Seeed Studio Grove - Infrared Temperature Sensor
×1
HSR-1425CR Servo (Continuous rotation)
×1
Breadboard (generic)
Breadboard (generic)
×1

Software apps and online services

Particle Build Web IDE
Particle Build Web IDE

Story

Read more

Schematics

Schematics

The Elegoo Fritzing bin was acting up when I made this, so I substituted the flame sensor with a different one.

Code

Code

C/C++
Servo myservo;
const int buttonPin= D3;
const int flamesensorPin = D2;
const int fanPin = D7;
const int servoPin = D6;

void setup() {
myservo.attach(servoPin);
myservo.write(90);
pinMode(buttonPin, INPUT_PULLUP);
pinMode(flamesensorPin, INPUT);
pinMode(fanPin, OUTPUT);

}

void loop() {

int flamedetected = digitalRead(flamesensorPin);
    
if(digitalRead(buttonPin) == LOW)
{
myservo.write(95);
delay(250);
}
else
{
myservo.write(90);;
delay(250);
}


if(flamedetected == 1)
{
    analogWrite(fanPin, 200);
    delay(5000);
}
else
{
    analogWrite(fanPin, 0);
}


delay(500);
}

Credits

Margaret Donohoe
3 projects • 1 follower
Contact

Comments

Please log in or sign up to comment.