# Electronic Candle Circuit (555 + LM358) – B2P15

We’re going to now build an electronic candle using a 555 timer and an op-amp.

To give us a candle-like effect, we will be using a flicker LED which has two terminals and can be used as a standard LED.

This is what the schematic looks like. We configure the 555 timer in the bistable mode, meaning it has two stable states – SET and RESET, just like an SR flip-flop. The state of the 555 timer is controlled by the voltages at pins 2 and 6.

We use a voltage divider consisting of an LDR to trigger the timer IC. When we bring a flame close to the LDR or if we shine a bright light on it, it’s resistance will decrease and this will reduce the voltage at pin 2. If this voltage falls below 1/3rd of the supply voltage, then it will cause the output of the timer IC to go HIGH, switching ON the LED.

The voltage at pin 6 is responsible to RESET the timer IC or switch OFF the LED. If the voltage at pin 6 rises above 2/3rd of the supply voltage, then the timer IC will be RESET. The circuit consists of an op-amp, whose output is connected to pin 6. The inputs of the op-amp can be connected to two voltage divider circuits. One consists of a 100 Ohm resistor and thermistor, while the other is made up of a 2.2K resistor and 10K trimpot. The op-amp we are using is the LM358 whose output voltage is the difference between the two input voltages. The output of an op-amp is analog in nature, i.e it gives us the actual difference in the inputs, while the output of a comparator is digital in nature as it gives us a logic HIGH when the positive input is at a greater voltage compared to the voltage at the negative input.

The idea behind the design of the electronic candle is that one could blow air over the thermistor which would change its resistance and this could then be used to trigger the comparator. There are two hurdles that must be overcome to achieve this. Firstly, blowing air over the thermistor is only going to change the resulting voltage divider output by a few hundred millivolts. This means that the other input to the comparator must be matched closely to the ambient output voltage. This can be done by adjusting VR1.

The second concern is that the response of the thermistor will depend on the ambient temperature relative to the temperature of the air being blown. If the air being blown over the thermistor is cooler than the ambient temperature then the resistance of the thermistor will increase as it has a negative temperature coefficient. This will cause an increase in the voltage divider output. On the other hand, if the air being blown over the thermistor is warmer than the ambient temperature, then it will decrease the thermistor resistance and the output of the voltage divider.

Based on this, you can configure the jumpers to send the correct signal to the op-amp inputs in order to generate a positive output when you blow over the thermistor. One way to determine this is by powering ON the circuit and measuring the voltage at the NTC output. You can then blow some air over the thermistor to watch how the voltage changes. In my case, there is an increase in the output voltage and this means that I need to connect the NTC output to the positive input of the comparator. The trimpot output should be connected to the negative of the comparator and it should be adjusted such that the output voltage is about 100mV below that of the NTC. This way, the comparator output would be LOW under normal working conditions and the LED can continue to glow. When you blow some air over the thermistor, it will cause the thermistor voltage to increase and when this voltage rises above the voltage at the negative input of the comparator, it will cause the comparator output to go HIGH and it will RESET the timer IC, switching OFF the LED.

This circuit is a wonderful example of why a software solution is sometimes better than a hardware solution. If we could use a microcontroller then we would be able to detect a sharp rise or fall in the NTC output when air is blown over it. We would then be able to switch OFF the LED and we wouldn’t have to keep adjusting the trimpot when the ambient temperature changes. We will explore microcontrollers and programming in BBox 3.

Here’s the assembled PCB in action. A gaslighter flame is used to trigger the IC and switch ON the LED. Blowing air over the thermistor resets the timer IC. Let’s move on to the next project.

Categories: BBox 2