I am using a kind of electric lighter in my circuit in order to turn the fire on. enter image description here

And also i have used some sensors that alert in danger by sending a signal to the MCU (ATmega 32) interrupt. The lighter works with 220 V AC in its input so I used a relay to switch it on and off. Also I used emitter common transistor to make the relay controllable from MCU. Right before it I have used an optocoupler to separate the power supply. But when the lighter starts working, the interrupt program begin and this is my problem.

I have used many methods for example i placed small capacitors on Interrupt's pin, used sound insulation cover around MCU, covering the lighter, covering lighter wires, using ferrite bead (on the output of the power supply of MCU), using big capacitors. They helped me to reduce this noise But not enough to solve my problem. What should I do? Maybe the lighter is too powerful!
lighter conncetions

  • \$\begingroup\$ Do you have a circuit? \$\endgroup\$
    – Jason Han
    Aug 5, 2017 at 5:57
  • \$\begingroup\$ I'll draw it now \$\endgroup\$ Aug 5, 2017 at 6:02
  • \$\begingroup\$ Where do MQ2 and MQ5 come from? You want to do the filtering there, not at the MCU pin. \$\endgroup\$ Aug 5, 2017 at 7:24
  • \$\begingroup\$ They are independent module. I just use its TTL answer. \$\endgroup\$ Aug 5, 2017 at 7:44
  • 2
    \$\begingroup\$ Have you measured the noise? If so, please post a screenshot of your measurement. \$\endgroup\$
    – Daniel
    Aug 8, 2017 at 23:34

2 Answers 2


I would try to filter the signals befor U2:A. If you filter it after U2:A such as in the circuit the noise will already have influenced the TTL signal and it can't be differentiated any more if the signal got generated thru noise or the MQ2 / MQ5 modules.

  • \$\begingroup\$ Thank you for your suggestion. I'll surely do it and will inform the result here. \$\endgroup\$ Aug 7, 2017 at 10:55

I checked the signal at the MCU output pin which drives the relay by the oscilloscope. I found that it is not an electrical issue that influences the MCU's interrupts. In my program, I have used an external interrupt (to detect the rising edge of a different signal), and as soon as my ignitor starts to work the interrupt started automatically and sometimes the LCD stopped working and showed weird characters on its screen.

Then I decided to remove those interrupts from my programs and I tried to detect the rising edge simply by checking the input pins at specific times. I tried to use the interrupts as low as possible and I disabled them while working with the ignition system. In this way, I could solve my problem.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.