From this article we will learn about a very interesting homemade product. This is a fake candle, but it is lit not from a button or switch, but from a held match flame.
If you bring a lighted match or lighter to the upper tip of the fake candle, the LED lamps at the top of the fake candle light up. There is another interesting element in this project. It will not be an ordinary artificial candle, but with a flickering flame.
Let's watch a short video.
Tools and materials: -Arduino Nano; -Flame sensor; -Two yellow LEDs; -Red LED; -Element CR2032 3V; -Create CR2032; -Mini-switch; -Soldering iron; -Glue gun; -3D- printer;
Step one: how it works
As mentioned, a fake candle has two main features that make it different from any other fake candle:
1. Ignition with Real Flame:
The most important feature of this 3D printed fake candle is that it cannot be turned on by the remote control or the switch on the candle. It turns on and starts to glow when a real flame of a match, lighter, etc. is brought up to it. The secret here is very simple. A flame sensor is installed at the top of the candle.
This flame sensor detects any kind of flame approaching it and signals the Arduino Nano board inside the candle to turn on the LEDs.
2. Flickering Candle:
For this wizard function we will use 3 LEDs instead of one, two yellow and one red. The LEDs will light up and go out in turn one after the other, and create a flickering effect.
The candle is powered by a 2032 battery. The master also installed a switch. It is needed to turn off the candle.
Step two: schema
The device diagram is very simple. The main components of the circuit:
Arduino Nano board
IR flame sensor
Instead of the IR sensor used in the above circuit diagram, a flame sensor is installed.
Also add to the circuit switch between Arduino and battery and battery.
Step three: 3D Printing
The next step is to design the candle body for 3D printing. The wizard uses the Tinkercad program.
The candle has four parts:
The body is a hollow cylinder that will house the electronics.
The upper and lower parts cover the main body from the ends. At the bottom there is a small rectangular hole for the USB port of the Arduino Nano board. In the upper part there are four small holes – three for LEDs, one for the IR receiver diode of the flame sensor.
Flame cover performs diffuser function. This part will be 3D printed in white and has very thin walls.
Step four: assembly
Now you can start assembling the candle. Installs LEDs on the top. Installs a flame sensor. The IR LED should be positioned against the hole. Fixes everything with hot glue and tape.
Mounts electronics according to the diagram. Installs a switch at the bottom.
Now you need to install the diffuser.
Step five: code
Now you need to connect Arduino to your computer and download the code. The code can be downloaded below.
////////////////////////////////////////////////////////Realistic Artificial Candle ////By Aarav Garg - Tech Nuttiez //////////////////////////////////////////////////////////#define flamePin A7 #define ledPin1 A0 #define ledPin2 A2 #define ledPin3 A5 int state = 0; void setup () & # 123; //put your setup code here, to run once & # 58; pinMode (flamePin, INPUT); pinMode (ledPin1, OUTPUT); pinMode (ledPin2, OUTPUT); pinMode (ledPin3, OUTPUT); Serial.begin (9600); state = 0; } void loop () & # 123; //put your main code here, to run repeatedly & # 58; Serial.println (analogRead (flamePin)); if (analogRead (flamePin) & lt; 500) & # 123; state = 1; } if (state == 1) & # 123; analogWrite (ledPin1, random (50) +125); analogWrite (ledPin2, random (50) +115); analogWrite (ledPin3, random (50) +135); delay (random (100)); }}
Everything is ready.
< img class = "aligncenter" alt = "LED candle lighting from a match" src = "https://usamodelkina.ru/uploads/posts/2021-06/1624466459_1-26.jpg"/> add turning off the candle – blowing it out.