I'm currently designing a simple circuit to act as a remote firework igniter. I'm using the ATtiny85 to control a MOSFET as a switch which would connect a coil of nichrome wire to the battery terminals and make it really hot to ignite the firework.

The problem is that when I switch the MOSFET and the load is connected, the microcontroller auto resets. I am using the switch connected to pin 3 as an input pull-up, and every time the button is pressed I programmed the ATtiny to turn on and off the MOSFET gate 2 times with a 1 s delay inbetween to make sure the nichrome gets enough time to heat up. The other LEDs are just indicators showing that the ATtiny is on and when the gate of the MOSFET is turned on.

My problem is that when the load is connected the microcontroller auto resets. I think it has something to do with the high current drawn from the battery, but I would like to hear any recommendations as to how I could solve this problem. I was thinking of adding a decoupling capacitor across VCC and GND, but I don't know if this will solve the issue. Any insight as to how I could improve this circuit would be highly aprecciated.

Circuit I built

enter image description here

  • 3
    \$\begingroup\$ If you've been thinking about using a decoupling capacitor, why haven't you tried it yet? In general, you should not operate a microcontroller without a decoupling capacitor. \$\endgroup\$ Dec 25, 2022 at 22:30
  • 2
    \$\begingroup\$ I don't think a decoupling cap will help much. If the voltage from battery drops under the load so much that MCU resets; then the battery simply can't provide enough current to the load. \$\endgroup\$
    – Justme
    Dec 25, 2022 at 22:47
  • 4
    \$\begingroup\$ grab the datasheet for the ATTINY85 and give the VCC and RST pins the recommended treatment. \$\endgroup\$ Dec 25, 2022 at 22:56
  • 1
    \$\begingroup\$ You may be triggering the brown-out detector. See 8.2.3 in the datasheet. \$\endgroup\$
    – Matt S
    Dec 26, 2022 at 2:40
  • 1
    \$\begingroup\$ tried using a bench [PS] […] tried connecting a 10uF cap across Vcc and Gnd Please prefer augmenting the post body over commenting comments - this is not chat. Has the cap been close to the ATtiny? Did doing both simultaneously not help? \$\endgroup\$
    – greybeard
    Dec 26, 2022 at 6:01

1 Answer 1


According to your schematic you basically short circuit your supply voltage when you switch the MOSFet on.

As others noted the supply voltage likely drops enough to send your microcontroller into a brownout condition. Several things probably work against you here:

  • Static voltage drop: the internal resistance of the battery and the battery wires lead to a voltage drop while the load is connected.
  • Transient voltage drop: There are no buffer or decoupling caps. When the switch is turned on the voltage drops immediately on the board and the long wires (inductance) to your battery lead to lagging response. This is likely the bigger factor in this setup and can be enough to reset your controller or get other odd behavior.

An easy solution:


simulate this circuit – Schematic created using CircuitLab

Split the power supply by using a diode. Behind the diode connect a large buffer capacitor (hundreds of uF). To this supply you only connect your controller.

When you turn on the MOSFet, your Microcontroller supply is now buffered and the load can not draw from this buffer. But as long as the load is active, your buffer will not charge up again, so the buffer needs to be large enough. It only has to buffer the MCU and the LEDs. I recommend increasing the series resistors for the LEDs to reduce the loading on your buffer. I prefer this over just adding decoupling caps as it will be more robust. Adding a decoupling capacitor close to the IC is still recommended though.

Additionaly you could add a large buffer capacitor bank on the output of your battery to reduce the load on your battery. But for this a lot more energy has to be stored and you would need a soft start circuit for slow charging to get a net benefit.


Your Answer

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

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