Switching SIM800L via ATMega328


I am using SIM800L with the AtMega328 on 3.3 volts and Now I am switching with BD139 but it’s not working smoothly in the switching and it’s stuck in code(Code behave wired).
Example When I run LED blink example when delay is not working

More information about your problem. Also Scheme and code

Switching means, Are you trying to switch ON the module by connecting BD139 to PWRKEY?
or are you trying to cut power to SIM800L using this transistor?
As @ALEXIS said, Provide more details.

NO no

I am Explain all Project
I am using ATmega328 on 3.3 Volt using Arduino pro mini bootloader on 8MHz.
Then using Sim800L module which working voltage is 3.6-4.2V and 2A and it continues drain this power.

It sleeps only for 15sec then wake up so I am trying to control power of this module via Atmega328 GPIO pin
For switching the power I am using the BD139.

So switching is working but code behaving wired.
For power source, i am using SAMSUNG-ICR18650 Batteries.

BD139 wont work. What you need is a P channel mosfet or High side load switch which supports 2A continous current or more.

I use IRF520 . The range voltage 0-24. And current 0-5 A. P.S. If you apply a current of more than 1 ampere, you must install a radiator

Can you please share your circuit diagram.

Can you share name of MOSFET because I try lots off , and also please share circuit diagram

But you need 5V logical level signal from arduino.

Hello…in my case the scenario was different for this issue. It’s anything but a capacitor or voltage drop issue, else I would have seen an earthy colored out in the MCUSR. I likewise feel that there is now a top on the Sim800l module. Not a code related issue, when I expel the SIm800l and let the code run it fills in true to form.
I presume a few issues with the follows on the board that is for P2. In any case, they are practically indistinguishable from the ones for P3, just thing I can consider is that VCC for P2 goes under the MOSFET collection of Q3, which could cause a few issues. Psyche you Q3 isn’t utilized for the exchanging procedure by any stretch of the imagination, it is a MOSFET to turn on my ADC.